From b939b038795f9f521c1ab8e6a6de2553ae0905fb Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Fri, 6 Jul 2018 10:25:30 +0200 Subject: [PATCH] Ensure python2 is used in the ansible venv This ensures all the commands are running with a python2 environment, until we are ready for python3. Change-Id: I5f51e76a23015a08d4e05a4e9082e227a3e62743 --- scripts/bootstrap-ansible.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/bootstrap-ansible.sh b/scripts/bootstrap-ansible.sh index 4a11cb9c3b..c22f53c84c 100755 --- a/scripts/bootstrap-ansible.sh +++ b/scripts/bootstrap-ansible.sh @@ -109,8 +109,9 @@ elif [ -n "$HTTP_PROXY" ]; then PIP_OPTS+="--proxy $HTTP_PROXY" fi -# Figure out the version of python is being used -PYTHON_EXEC_PATH="${PYTHON_EXEC_PATH:-$(which python3 || which python2 || which python)}" +# Force using python2. When python3 and python2 dual stack is supported uncomment the following: +#PYTHON_EXEC_PATH="${PYTHON_EXEC_PATH:-$(which python3 || which python2 || which python)}" +PYTHON_EXEC_PATH="${PYTHON_EXEC_PATH:-$(which python2 || which python)}" PYTHON_VERSION="$($PYTHON_EXEC_PATH -c 'import sys; print(".".join(map(str, sys.version_info[:3])))')" # Use https when Python with native SNI support is available