From 3baed35ccc4b1d015f9746de3226f9956e78b75c Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 16 Oct 2017 10:13:18 -0500 Subject: [PATCH] Work around non-standard envdir locations ironic-inspector overrides the envdir location for their releasenotes environment which causes us to not be able to find their virtualenv. For now, skip processing it. As a follow up, we can run 'tox --showconfig' and pull out the envdir from the section for [textenv:{envlist}] - but that'll take a little more time to get right. Change-Id: I28a9a073da04a5657b902ca13aff4984d80a3683 --- .../library/tox_install_sibling_packages.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/roles/tox-siblings/library/tox_install_sibling_packages.py b/roles/tox-siblings/library/tox_install_sibling_packages.py index 8edbfe35a..5fbdad5d5 100644 --- a/roles/tox-siblings/library/tox_install_sibling_packages.py +++ b/roles/tox-siblings/library/tox_install_sibling_packages.py @@ -112,13 +112,17 @@ def main(): module.exit_json( changed=False, msg="No name in setup.cfg, skipping siblings") - tox_python = '{project_dir}/.tox/{envlist}/bin/python'.format( + envdir = '{project_dir}/.tox/{envlist}'.format( project_dir=project_dir, envlist=envlist) + if not os.path.exists(envdir): + module.exit_json( + changed=False, msg="envdir does not exist, skipping siblings") + + tox_python = '{envdir}/bin/python'.format(envdir=envdir) # Write a log file into the .tox dir so that it'll get picked up # Name it with envlist as a prefix so that fetch-tox-output will properly # get it in a multi-env scenario - log_dir = '{project_dir}/.tox/{envlist}/log'.format( - project_dir=project_dir, envlist=envlist) + log_dir = '{envdir}/log'.format(envdir=envdir) log_file = '{log_dir}/{envlist}-siblings.txt'.format( log_dir=log_dir, envlist=envlist)