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 <