Skip to content

Commit 782efb0

Browse files
committed
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
1 parent 53c2f6f commit 782efb0

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tools/install_pip.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,12 @@ get_versions
133133
# results in a nonfunctional system. pip on fedora installs to /usr so pip
134134
# can safely override the system pip for all versions of fedora
135135
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
138142
fi
139143

140144
install_get_pip

0 commit comments

Comments
 (0)