From fa0715eeac380992cf9cca6d4de1daf42e976189 Mon Sep 17 00:00:00 2001 From: Tobias Henkel Date: Tue, 19 Mar 2019 08:26:02 +0100 Subject: [PATCH] Move ansible installation from pre_command to install phase in tox We currently install ansible during the pre_command phase in tox. This breaks the following use case: tox -e py36 --notest ttrun This is broken now because ttrun doesn't run pre_commands. Instead we already have a pip wrapper that does the nodeenv installation. We can use this to also call zuul-manage-ansible on zuul installation. Change-Id: I680777e5406368d35366602ac37e029db91c8a5c --- tools/pip.sh | 5 +++++ tox.ini | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/pip.sh b/tools/pip.sh index 0b94b1c79c..a8474d77e1 100755 --- a/tools/pip.sh +++ b/tools/pip.sh @@ -38,3 +38,8 @@ then popd fi pip install $* + +# Check if we're installing zuul. If so install the managed ansible as well. +if echo "$*" | grep -vq requirements.txt; then + zuul-manage-ansible -v +fi diff --git a/tox.ini b/tox.ini index b5f75acdd0..671841cd68 100644 --- a/tox.ini +++ b/tox.ini @@ -25,7 +25,6 @@ install_command = pip install {opts} {packages} whitelist_externals = bash deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -commands_pre = zuul-manage-ansible -v commands = stestr run {posargs} stestr slowest @@ -82,7 +81,6 @@ install_command = {[nodeenv]install_command} commands = stestr run --concurrency=1 --test-path ./tests/nodepool {posargs} [testenv:remote] -commands_pre = zuul-manage-ansible -v commands = stestr run --test-path ./tests/remote {posargs} passenv = ZUUL_TEST_ROOT OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_LOG_CAPTURE OS_LOG_DEFAULTS ZUUL_REMOTE_IPV4 ZUUL_SSH_KEY NODEPOOL_ZK_HOST install_command = {[nodeenv]install_command}