diff --git a/letsencrypt-auto-source/letsencrypt-auto b/letsencrypt-auto-source/letsencrypt-auto index 335b3debb..157d3a95a 100755 --- a/letsencrypt-auto-source/letsencrypt-auto +++ b/letsencrypt-auto-source/letsencrypt-auto @@ -529,11 +529,11 @@ BootstrapRpmPython3Legacy() { exit 1 fi + BootstrapRpmCommonBase "${python_pkgs}" + # Try now to enable SCL rh-python36 for systems that are not yet bootstrapped # NB: function EnablePython36SCL has been defined along with BootstrapRpmPython3Legacy in certbot-auto EnablePython36SCL - - BootstrapRpmCommonBase "${python_pkgs}" } # If new packages are installed by BootstrapRpmPython3 below, this version @@ -821,7 +821,9 @@ elif [ -f /etc/redhat-release ]; then if ! python3.6 --version > /dev/null 2> /dev/null; then # Do nothing if SCL Python 3.6 is not installed if [ -f /opt/rh/rh-python36/enable ]; then - source /opt/rh/rh-python36/enable + set +e + . scl_source enable rh-python36 + set -e fi fi } diff --git a/letsencrypt-auto-source/letsencrypt-auto.template b/letsencrypt-auto-source/letsencrypt-auto.template index c72811d65..92235b05e 100755 --- a/letsencrypt-auto-source/letsencrypt-auto.template +++ b/letsencrypt-auto-source/letsencrypt-auto.template @@ -356,7 +356,9 @@ elif [ -f /etc/redhat-release ]; then if ! python3.6 --version > /dev/null 2> /dev/null; then # Do nothing if SCL Python 3.6 is not installed if [ -f /opt/rh/rh-python36/enable ]; then - source /opt/rh/rh-python36/enable + set +e + . scl_source enable rh-python36 + set -e fi fi } diff --git a/letsencrypt-auto-source/pieces/bootstrappers/rpm_python3_legacy.sh b/letsencrypt-auto-source/pieces/bootstrappers/rpm_python3_legacy.sh index c5ec43f07..b3034f5e2 100644 --- a/letsencrypt-auto-source/pieces/bootstrappers/rpm_python3_legacy.sh +++ b/letsencrypt-auto-source/pieces/bootstrappers/rpm_python3_legacy.sh @@ -39,9 +39,9 @@ BootstrapRpmPython3Legacy() { exit 1 fi + BootstrapRpmCommonBase "${python_pkgs}" + # Try now to enable SCL rh-python36 for systems that are not yet bootstrapped # NB: function EnablePython36SCL has been defined along with BootstrapRpmPython3Legacy in certbot-auto EnablePython36SCL - - BootstrapRpmCommonBase "${python_pkgs}" } diff --git a/letsencrypt-auto-source/tests/centos6_tests.sh b/letsencrypt-auto-source/tests/centos6_tests.sh index 14aeb8f8d..a70fb627a 100644 --- a/letsencrypt-auto-source/tests/centos6_tests.sh +++ b/letsencrypt-auto-source/tests/centos6_tests.sh @@ -9,7 +9,7 @@ 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 +. scl_source enable python27 # ensure python 3 isn't installed python3 --version > /dev/null 2> /dev/null @@ -55,9 +55,6 @@ if ! "$LE_AUTO" 2>&1 | grep -q "WARNING: couldn't find Python"; then exit 1 fi -# Enable SCL rh-python36 -source /opt/rh/rh-python36/enable - # bootstrap from the old letsencrypt-auto, this time installing python3.4 "$LE_AUTO_PY_34" --no-self-upgrade -n > /dev/null 2> /dev/null @@ -74,6 +71,9 @@ echo "PASSED: Successfully upgraded to Python3.4 using letsencrypt-auto < 0.37.0 # now bootstrap from current letsencrypt-auto, that will install python3.6 from SCL "$LE_AUTO" --no-self-upgrade -n > /dev/null 2> /dev/null +# enable SCL rh-python36 +. scl_source enable rh-python36 + # ensure python 3.6 is installed python3.6 --version > /dev/null 2> /dev/null RESULT=$?