From 9ff145e3b262ed081ad13097a0282601b5c12648 Mon Sep 17 00:00:00 2001 From: git-harry Date: Thu, 13 Jul 2017 09:38:13 +0100 Subject: [PATCH] Ensure PIP requirements are always met This change is necessary to ensure that all the required PIP packages are installed. Without this change the code assumes that if the version of `pip` in okay then all the required packages are already installed. Change-Id: I16a4eaf24e346411a7f0890d69939f666ecc6be3 --- leap-upgrades/lib/functions.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/leap-upgrades/lib/functions.sh b/leap-upgrades/lib/functions.sh index 8e91894a..97803398 100644 --- a/leap-upgrades/lib/functions.sh +++ b/leap-upgrades/lib/functions.sh @@ -270,15 +270,16 @@ function pre_flight { chmod +x py_pkgs.py popd - # Upgrade pip if it's needed. This will re-install pip using the constraints and then - # re-install all of the remaining requirements as needed. + # Upgrade pip if it's needed. This will re-install pip using the constraints if dpkg --compare-versions "$(pip --version | awk '{print $2}')" "lt" "9.0.1"; then wget https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py -O /opt/get-pip.py rm -rf /usr/local/lib/python2.7/dist-packages/{setuptools,wheel,pip,distutils,packaging}* python /opt/get-pip.py --constraint "${SYSTEM_PATH}/lib/upgrade-requirements.txt" --force-reinstall --upgrade --isolated - pip install --requirement "${SYSTEM_PATH}/lib/upgrade-requirements.txt" --upgrade --isolated fi + # Ensure all of the required packages are installed + pip install --requirement "${SYSTEM_PATH}/lib/upgrade-requirements.txt" --upgrade --isolated + if [[ -d "/opt/ansible-runtime" ]]; then rm -rf "/opt/ansible-runtime" fi