Merge "Use "type" to take place of "which" and update the output"

This commit is contained in:
Jenkins 2016-09-16 09:24:48 +00:00 committed by Gerrit Code Review
commit 2cf3f65bc9
1 changed files with 8 additions and 4 deletions

View File

@ -12,10 +12,14 @@ unset LANGUAGE
LC_ALL=C
export LC_ALL
for i in curl nova neutron openstack; do
if [[ ! $(which $i) ]]; then
echo "$i not installed. Please install $i before proceeding"
exit 1
fi
if [[ ! $(type $i 2>/dev/null) ]]; then
if [ "$i" == 'curl' ]; then
echo "$i not installed. Please install $i before proceeding"
else
echo "python-${i}client not installed. Please install python-${i}client before proceeding"
fi
exit
fi
done
# Move to top level directory
REAL_PATH=$(python -c "import os,sys;print os.path.realpath('$0')")