From 3e8489c5f2e19cecf554be035554023fbcb59cce Mon Sep 17 00:00:00 2001 From: Logan V Date: Fri, 28 Jul 2017 10:15:04 -0500 Subject: [PATCH] Allow PYTHON_EXEC_PATH in bootstrap-ansible Accept PYTHON_EXEC_PATH via environment if defined instead of forcing python version discovery. Also adds the python-apt package to ensure both py2 and py3 versions of the module are available in case python2 is used. Change-Id: Ifb9cd3c82c7a2caffa8b3c18b8eabac95996e42c --- scripts/bootstrap-ansible.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/bootstrap-ansible.sh b/scripts/bootstrap-ansible.sh index ae4f2e5bf1..f142c18a34 100755 --- a/scripts/bootstrap-ansible.sh +++ b/scripts/bootstrap-ansible.sh @@ -72,7 +72,7 @@ case ${DISTRO_ID} in python-minimal python-dev \ python3 python3-dev \ libssl-dev libffi-dev \ - python3-apt + python-apt python3-apt ;; esac @@ -85,7 +85,7 @@ elif [ -n "$HTTP_PROXY" ]; then fi # Figure out the version of python is being used -PYTHON_EXEC_PATH="$(which python3 || which python2 || which python)" +PYTHON_EXEC_PATH="${PYTHON_EXEC_PATH:-$(which python3 || 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