From da7cc439f7701dc6e42cccbf870e97ab1aae7542 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Mon, 3 Jul 2017 15:00:52 +0100 Subject: [PATCH] Ensure liberasurecode-dev is installable Make sure the liberasurecode-dev is installable when needed, in order to build the venvs for swift. No distinction is done anymore for backports/anything else like UCA. Change-Id: I552b77eeb05469b815592da1dd7fab45124ffe89 --- leap-upgrades/lib/functions.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/leap-upgrades/lib/functions.sh b/leap-upgrades/lib/functions.sh index 7e89b471..8e91894a 100644 --- a/leap-upgrades/lib/functions.sh +++ b/leap-upgrades/lib/functions.sh @@ -262,12 +262,6 @@ function pre_flight { exit 99 fi - # Install liberasurecode-dev which will be used in the venv creation process - if ! grep -n ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep -qw "backports"; then - failure "The trusty backports repo has not been enabled on this host." - exit 99 - fi - if [[ ! -f /opt/leap42/rebootstrap-ansible ]]; then # Don't run this over and over again if the variables above are not set! pushd /opt/leap42 @@ -276,9 +270,6 @@ function pre_flight { chmod +x py_pkgs.py popd - apt-get update > /dev/null - apt-get -y install liberasurecode-dev > /dev/null - # 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. if dpkg --compare-versions "$(pip --version | awk '{print $2}')" "lt" "9.0.1"; then @@ -381,6 +372,18 @@ function run_venv_prep { } function build_venv { + # Building venv requires to be able to install liberasurecode-dev for swift. + # It should be found in backports or UCA. + apt-get update > /dev/null + + # Install liberasurecode-dev which will be used in the venv creation process + if ! apt-cache search liberasurecode-dev | grep liberasurecode-dev; then + failure "Can't install liberasurecode-dev. Enable trusty backports or UCA on this host." + exit 99 + fi + + apt-get -y install liberasurecode-dev > /dev/null + ### The venv build is done using a modern version of the py_pkgs plugin which collects all versions of ### the OpenStack components from a given release. This creates 1 large venv per migratory release. # If the venv archive exists delete it.