From ffdc6be5141c62f82a73e4c21ed42522f48a032a Mon Sep 17 00:00:00 2001 From: Erica Portnoy Date: Wed, 12 Aug 2020 18:49:26 -0700 Subject: [PATCH] move setting up venv back out of script so it's not run with sudo --- tests/letstest/scripts/bootstrap_os_packages.sh | 3 --- tests/letstest/scripts/test_apache2.sh | 10 +++++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/letstest/scripts/bootstrap_os_packages.sh b/tests/letstest/scripts/bootstrap_os_packages.sh index 20691a670..d123c5def 100755 --- a/tests/letstest/scripts/bootstrap_os_packages.sh +++ b/tests/letstest/scripts/bootstrap_os_packages.sh @@ -192,6 +192,3 @@ elif [ -f /etc/redhat-release ]; then fi Bootstrap - -cd $1 # REPO_ROOT -$2 # Call the venv setup script here so we don't have to activate Python36SCL in the parent diff --git a/tests/letstest/scripts/test_apache2.sh b/tests/letstest/scripts/test_apache2.sh index c14d7d1b2..6b065b099 100755 --- a/tests/letstest/scripts/test_apache2.sh +++ b/tests/letstest/scripts/test_apache2.sh @@ -40,11 +40,19 @@ fi cd letsencrypt echo "Bootstrapping dependencies..." -sudo tests/letstest/scripts/bootstrap_os_packages.sh . "tools/venv3.py -e acme[dev] -e certbot[dev,docs] -e certbot-apache" +sudo tests/letstest/scripts/bootstrap_os_packages.sh if [ $? -ne 0 ] ; then exit 1 fi +if command -v python && [ $(python -V 2>&1 | cut -d" " -f 2 | cut -d. -f1,2 | sed 's/\.//') -eq 26 ]; then + # RHEL/CentOS 6 will need a special treatment, so we need to detect that environment + # Enable the SCL Python 3.6 installed by letsencrypt-auto bootstrap + PATH="/opt/rh/rh-python36/root/usr/bin:$PATH" +fi + +tools/venv3.py -e acme[dev] -e certbot[dev,docs] -e certbot-apache + sudo "venv3/bin/certbot" -v --debug --text --agree-tos \ --renew-by-default --redirect --register-unsafely-without-email \ --domain $PUBLIC_HOSTNAME --server $BOULDER_URL