From 782efb0f8a0b6c64e5b6a317ff5bf905e51da850 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Mon, 11 May 2020 18:28:32 -0700 Subject: [PATCH] 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 --- tools/install_pip.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/install_pip.sh b/tools/install_pip.sh index dcd546629f..5eb538ce84 100755 --- a/tools/install_pip.sh +++ b/tools/install_pip.sh @@ -133,8 +133,12 @@ get_versions # results in a nonfunctional system. pip on fedora installs to /usr so pip # can safely override the system pip for all versions of fedora if ! is_fedora && ! is_suse; then - uninstall_package python-pip - uninstall_package python3-pip + if is_package_installed python-pip ; then + uninstall_package python-pip + fi + if is_package_installed python3-pip ; then + uninstall_package python3-pip + fi fi install_get_pip