summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fontein <felix@fontein.de>2020-06-17 05:19:01 +0200
committerGitHub <noreply@github.com>2020-06-16 20:19:01 -0700
commit4744f3102315223e95deafeef1a2c6963489dccc (patch)
tree300e49f14f4a020270f14cb2cd9be9efba230e5d
parent153de5ee4916dfcbe2d1957af7c099dc019c2a91 (diff)
downloadansible-4744f3102315223e95deafeef1a2c6963489dccc.tar.gz
Fix ansible-test egg-info directory detection. (#69403)
(cherry picked from commit 8b63da7b43ec23a3bb80ad1f54493cd0cc4b4ca6) Co-authored-by: Matt Clay <matt@mystile.com>
-rw-r--r--changelogs/fragments/ansible-test-egg-info-version.yml2
-rw-r--r--test/lib/ansible_test/_internal/executor.py9
2 files changed, 11 insertions, 0 deletions
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 0000000000..9c61b6a277
--- /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 f9bc00e9a5..aaa7e2cd9d 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):