Skip to content

Commit

Permalink
Use runtime venv to determine OSA version
Browse files Browse the repository at this point in the history
With the introduction of c44fbcb,
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
  • Loading branch information
mgariepy authored and Jesse Pretorius (odyssey4me) committed Feb 15, 2019
1 parent c99e545 commit a30ce47
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/bootstrap-ansible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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}

Expand Down

0 comments on commit a30ce47

Please sign in to comment.