Browse code

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

Sampath Priyankara authored on 2017/08/03 16:12:40
Showing 1 changed files
... ...
@@ -346,6 +346,9 @@ function pip_install {
346 346
 }
347 347
 
348 348
 function pip_uninstall {
349
+    # Skip uninstall if offline
350
+    [[ "${OFFLINE}" = "True" ]] && return
351
+
349 352
     local name=$1
350 353
     if [[ -n ${PIP_VIRTUAL_ENV:=} && -d ${PIP_VIRTUAL_ENV} ]]; then
351 354
         local cmd_pip=$PIP_VIRTUAL_ENV/bin/pip