From a30ce47845039140ecd6def60917207a020c03ea Mon Sep 17 00:00:00 2001 From: Marc Gariepy Date: Thu, 14 Feb 2019 10:32:45 -0500 Subject: [PATCH] Use runtime venv to determine OSA version With the introduction of c44fbcbbe3b6d88e9393503e92ac670f9e811148, setuptools is used to determine the current OSA version. However, currently it relies on setuptools being present on the host. This is an unnecessary dependency given that we have setuptools in the runtime venv. Rather than add more dependencies on the host, we now use the runtime venv to check for the version of OSA. Change-Id: I5bf11906c87d308567af483263e753ab4f9e2815 --- scripts/bootstrap-ansible.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/bootstrap-ansible.sh b/scripts/bootstrap-ansible.sh index 1dd0bf6ccf..07a805b63d 100755 --- a/scripts/bootstrap-ansible.sh +++ b/scripts/bootstrap-ansible.sh @@ -110,9 +110,6 @@ fi 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])))')" -# Get current code version (this runs at the root of OSA clone) -CURRENT_OSA_VERSION=$(cd ${OSA_CLONE_DIR}; ${PYTHON_EXEC_PATH} setup.py --version) - # Use https when Python with native SNI support is available UPPER_CONSTRAINTS_PROTO=$([ "$PYTHON_VERSION" == $(echo -e "$PYTHON_VERSION\n2.7.9" | sort -V | tail -1) ] && echo "https" || echo "http") @@ -142,6 +139,9 @@ PIP_OPTS+=" --constraint ${UPPER_CONSTRAINTS_FILE}" # Upgrade pip setuptools and wheel to the appropriate version ${PIP_COMMAND} install --isolated ${PIP_OPTS} --upgrade pip setuptools wheel +# Get current code version (this runs at the root of OSA clone) +CURRENT_OSA_VERSION=$(cd ${OSA_CLONE_DIR}; /opt/ansible-runtime/bin/python setup.py --version) + # Install ansible and the other required packages ${PIP_COMMAND} install --isolated ${PIP_OPTS} -r requirements.txt ${ANSIBLE_PACKAGE}