From 52e32ed8d881b901fe2b6ec268c93b8199f35868 Mon Sep 17 00:00:00 2001 From: Bernard Cafarelli Date: Thu, 18 Aug 2016 17:23:00 +0200 Subject: [PATCH] DIB: relax check on pip executable On a devstack, pip can be installed system-wide but not coming from system packages. So instead of checking python-pip package installation, we only check that "which pip" succeeds Change-Id: If8a1b7b4b7336cab0bef755b90924e03f1497b82 --- diskimage-create/diskimage-create.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/diskimage-create/diskimage-create.sh b/diskimage-create/diskimage-create.sh index 98d30c92c6..0eda5f261c 100755 --- a/diskimage-create/diskimage-create.sh +++ b/diskimage-create/diskimage-create.sh @@ -254,7 +254,7 @@ if [ "$platform" = 'NAME="Ubuntu"' ]; then fi elif [ "$platform" = 'NAME=Fedora' ]; then - PKG_LIST="qemu kpartx git python-pip" + PKG_LIST="qemu kpartx git" for pkg in $PKG_LIST; do if ! yum list installed $pkg &> /dev/null; then echo "Required package " $pkg " is not installed. Exiting." @@ -263,7 +263,7 @@ elif [ "$platform" = 'NAME=Fedora' ]; then done else # centos or rhel - PKG_LIST="qemu-kvm qemu-img kpartx git python-pip" + PKG_LIST="qemu-kvm qemu-img kpartx git" for pkg in $PKG_LIST; do if ! yum list installed $pkg &> /dev/null; then echo "Required package " $pkg " is not installed. Exiting." @@ -282,6 +282,13 @@ else fi fi +# pip may not be installed from package managers +# only check that we find an executable +if ! which pip &> /dev/null; then + echo "Required executable pip not found. Exiting." + exit 1 +fi + # "pip freeze" does not show argparse, even if it is explicitly installed, # because it is part of the standard python library in 2.7. # See https://github.com/pypa/pip/issues/1570