From e912cd15a933e660043a0c55d38158ebeee627b9 Mon Sep 17 00:00:00 2001 From: Tobias Henkel Date: Sat, 25 May 2019 08:35:21 +0200 Subject: [PATCH] Fix test-logs.sh utility for multi-ansible Since the multi-ansible work the test-logs.sh script is broken and needs to be fixed to use the managed ansible. Change-Id: I271f45d9f096a05949900ba1dd2bf8321c459815 --- tools/test-logs.sh | 39 +++++++++++++++++++++++++-------------- tox.ini | 1 - 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/tools/test-logs.sh b/tools/test-logs.sh index 429bac5e8c..2df7eb69a6 100755 --- a/tools/test-logs.sh +++ b/tools/test-logs.sh @@ -22,19 +22,23 @@ if [[ ! -d "${ZUUL_DIR}/.tox/venv" ]]; then tox -e venv --notest popd fi + +ANSIBLE_VERSION="2.7" +ANSIBLE_ROOT="${ZUUL_DIR}/.tox/venv/lib/zuul/ansible/${ANSIBLE_VERSION}" +ARA_DIR=$(dirname $("${ANSIBLE_ROOT}/bin/python3" -c 'import ara; print(ara.__file__)')) + # Source tox environment source ${ZUUL_DIR}/.tox/venv/bin/activate -# Install ARA if it's not installed (not in requirements.txt by default) -python -c "import ara" &> /dev/null -if [ $? -eq 1 ]; then - echo "ARA isn't installed... Installing it." - pip install ara -fi -ARA_DIR=$(dirname $(python3 -c 'import ara; print(ara.__file__)')) - WORK_DIR=$(mktemp -d /tmp/zuul_logs_XXXX) +# Copy zuul ansible modules into workdir +ZUUL_ANSIBLE="${WORK_DIR}/zuul-ansible" +mkdir -p "${ZUUL_ANSIBLE}/zuul" +cp -Lr "${ZUUL_DIR}/zuul/ansible/${ANSIBLE_VERSION}" "${ZUUL_ANSIBLE}/zuul/ansible" +touch "${ZUUL_ANSIBLE}/zuul/ansible/__init__.py" +touch "${ZUUL_ANSIBLE}/zuul/__init__.py" + if [ -z $1 ] ; then INVENTORY=$WORK_DIR/hosts.yaml cat >$INVENTORY <