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
This commit is contained in:
Monty Taylor 2017-10-16 10:13:18 -05:00
parent 337835ad20
commit 3baed35ccc
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594

View File

@ -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)