From 87d2396d225533aefd8d52bb5fa574ea57dbb987 Mon Sep 17 00:00:00 2001 From: Sampath Priyankara Date: Thu, 3 Aug 2017 16:12:40 +0900 Subject: [PATCH] Don't uninstall pip packages if OFFLINE=True lib/nova does a pip re-install of libvirt-python to rebuild the python library incase the underlying libvirt version changed during package installs. In offline mode, the underlying version of libvirt can't have changed; so we have the situation that we've removed the libvirt python bindings but can't reinstall them (because we're offline). This fixes that particular situation, but skipping uninstalls in offline mode seems generically OK. Change-Id: I2b75d45d94d82f87d996c7570c125d46f5f99f6a Closes-Bug: #1708369 --- inc/python | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inc/python b/inc/python index f388f48e91..5e7f742d48 100644 --- a/inc/python +++ b/inc/python @@ -346,6 +346,9 @@ function pip_install { } function pip_uninstall { + # Skip uninstall if offline + [[ "${OFFLINE}" = "True" ]] && return + local name=$1 if [[ -n ${PIP_VIRTUAL_ENV:=} && -d ${PIP_VIRTUAL_ENV} ]]; then local cmd_pip=$PIP_VIRTUAL_ENV/bin/pip