Browse code

Fix pip distro package removal for focal

Ubuntu Focal doesn't have python-pip, only python3-pip. Trying to
uninstall a package that apt doesn't know about (installed or
uninstalled) results in a nonzero exit code so devstack fails. This
patch makes the package removal safer for both python2 and python3 cases
by checking first if the package exists.

Change-Id: I3b1118888cb0617ffb99b72c7e9a32308033783e

Colleen Murphy authored on 2020/05/12 10:28:32
Showing 1 changed files
... ...
@@ -133,8 +133,12 @@ get_versions
133 133
 # results in a nonfunctional system. pip on fedora installs to /usr so pip
134 134
 # can safely override the system pip for all versions of fedora
135 135
 if ! is_fedora  && ! is_suse; then
136
-    uninstall_package python-pip
137
-    uninstall_package python3-pip
136
+    if is_package_installed python-pip ; then
137
+        uninstall_package python-pip
138
+    fi
139
+    if is_package_installed python3-pip ; then
140
+        uninstall_package python3-pip
141
+    fi
138 142
 fi
139 143
 
140 144
 install_get_pip