Handle need to rebootstrap before fetch.py (#5389)

* Fix #5387

* Add test for #5387

* remove LE_PYTHON

* Use environment variable to reduce line length
This commit is contained in:
Brad Warren
2018-01-09 15:40:26 -08:00
committed by ohemorange
parent 288c4d956c
commit 887a6bcfce
3 changed files with 38 additions and 14 deletions
+10 -2
View File
@@ -4,6 +4,8 @@ yum update -y > /dev/null
yum install -y centos-release-scl > /dev/null
yum install -y python27 > /dev/null 2> /dev/null
LE_AUTO="certbot/letsencrypt-auto-source/letsencrypt-auto"
# we're going to modify env variables, so do this in a subshell
(
source /opt/rh/python27/enable
@@ -25,7 +27,7 @@ if [ $RESULT -ne 0 ]; then
fi
# bootstrap, but don't install python 3.
certbot/letsencrypt-auto-source/letsencrypt-auto --no-self-upgrade -n > /dev/null 2> /dev/null
"$LE_AUTO" --no-self-upgrade -n > /dev/null 2> /dev/null
# ensure python 3 isn't installed
python3 --version 2> /dev/null
@@ -47,8 +49,14 @@ if [ $RESULT -eq 0 ]; then
exit 1
fi
# Skip self upgrade due to Python 3 not being available.
if ! "$LE_AUTO" 2>&1 | grep -q "WARNING: couldn't find Python"; then
echo "Python upgrade failure warning not printed!"
exit 1
fi
# bootstrap, this time installing python3
certbot/letsencrypt-auto-source/letsencrypt-auto --no-self-upgrade -n > /dev/null 2> /dev/null
"$LE_AUTO" --no-self-upgrade -n > /dev/null 2> /dev/null
# ensure python 3 is installed
python3 --version > /dev/null