Fix problem with ARA execution for tox envs not named 'functional'

The ARA prep currently hard codes the tox environment name to
find pip/python in the tox env called 'functional', which does
not universally work.

This patch removes the strict path for pip/python as the script
only runs once the python venv has been activated and therefore
the correct binary path is used.

Change-Id: Ibd8957a85092a48089a6d9d336f27ccab36f009c
This commit is contained in:
Jesse Pretorius 2017-02-20 13:25:54 -05:00
parent fc54dd4bc3
commit df9f5bc212

View File

@ -69,13 +69,13 @@ function setup_ara {
if [[ -e /usr/zuul-env/bin/zuul-cloner && "${ZUUL_PROJECT}" == "openstack/ara" ]]; then
/usr/zuul-env/bin/zuul-cloner --workspace /tmp --cache-dir /opt/git \
git://git.openstack.org openstack/ara
${WORKING_DIR}/.tox/functional/bin/pip install /tmp/openstack/ara
pip install /tmp/openstack/ara
else
${WORKING_DIR}/.tox/functional/bin/pip install ara
pip install ara
fi
# Dynamically figure out the location of ARA (ex: py2 vs py3)
ara_location=$(${WORKING_DIR}/.tox/functional/bin/python -c "import os,ara; print(os.path.dirname(ara.__file__))")
ara_location=$(python -c "import os,ara; print(os.path.dirname(ara.__file__))")
echo "Linking ${ANSIBLE_PLUGIN_DIR}/callback/ara to ${ara_location}/plugins/callbacks/"
mkdir -p "${ANSIBLE_PLUGIN_DIR}/callback/ara"