Make install_puppet.sh more robust against failure
I hit an issue with a system with curl *and* wget installed. The curl download failed, leaving a corrupt get-pip.py and thus the wget download started (which then saved to get-pip.py.1). The script then tried to run the corrupt version. Although re-running is uncommon unless you're manually deploying the scripts, best to also check for the file first or these commands both re-download to get-pip.py.X Change-Id: I6b70b4b7bb3d963ba70d71388c701951932e9adb
This commit is contained in:
parent
3ac244a68f
commit
ed5a97290f
@ -19,7 +19,22 @@
|
||||
# Install pip using get-pip
|
||||
PIP_GET_PIP_URL=https://bootstrap.pypa.io/get-pip.py
|
||||
|
||||
curl -O $PIP_GET_PIP_URL || wget $PIP_GET_PIP_URL
|
||||
ret=1
|
||||
if [ -f ./get-pip.py ]; then
|
||||
ret=0
|
||||
elif type curl >/dev/null 2>&1; then
|
||||
curl -O $PIP_GET_PIP_URL
|
||||
ret=$?
|
||||
elif type wget >/dev/null 2>&1; then
|
||||
wget $PIP_GET_PIP_URL
|
||||
ret=$?
|
||||
fi
|
||||
|
||||
if [ $ret -ne 0 ]; then
|
||||
echo "Failed to get get-pip.py"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
python get-pip.py
|
||||
|
||||
# Install puppet version 2.7.x from puppetlabs.
|
||||
|
Loading…
x
Reference in New Issue
Block a user