From 8b63da7b43ec23a3bb80ad1f54493cd0cc4b4ca6 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 23 Jan 2020 11:47:08 -0800 Subject: [PATCH] Fix ansible-test egg-info directory detection. --- changelogs/fragments/ansible-test-egg-info-version.yml | 2 ++ test/lib/ansible_test/_internal/executor.py | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 changelogs/fragments/ansible-test-egg-info-version.yml diff --git a/changelogs/fragments/ansible-test-egg-info-version.yml b/changelogs/fragments/ansible-test-egg-info-version.yml new file mode 100644 index 00000000000..9c61b6a2776 --- /dev/null +++ b/changelogs/fragments/ansible-test-egg-info-version.yml @@ -0,0 +1,2 @@ +bugfixes: + - ansible-test is now able to find its ``egg-info`` directory when it contains the Ansible version number diff --git a/test/lib/ansible_test/_internal/executor.py b/test/lib/ansible_test/_internal/executor.py index 42d1f917db8..caed48d93c6 100644 --- a/test/lib/ansible_test/_internal/executor.py +++ b/test/lib/ansible_test/_internal/executor.py @@ -292,6 +292,15 @@ def generate_egg_info(args): if args.explain: return + ansible_version = get_ansible_version() + + # inclusion of the version number in the path is optional + # see: https://setuptools.readthedocs.io/en/latest/formats.html#filename-embedded-metadata + egg_info_path = ANSIBLE_LIB_ROOT + '-%s.egg-info' % ansible_version + + if os.path.exists(egg_info_path): + return + egg_info_path = ANSIBLE_LIB_ROOT + '.egg-info' if os.path.exists(egg_info_path):