summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2020-06-17 14:58:33 -0700
committerMatt Clay <matt@mystile.com>2020-06-17 16:24:21 -0700
commit6514ae6c05549f7048bfa9e17a04dddc34966e08 (patch)
tree9d07de7f85cee20975de3eaeea887bcbd929ab37
parenta0c02d4c9d315693a240913d923139b7e20884d2 (diff)
downloadansible-6514ae6c05549f7048bfa9e17a04dddc34966e08.tar.gz
Revert "Fix ansible-test module_utils import analysis. (#69406)"
This reverts commit b8808efd264aebad1ef73da3898b085d32bb2136.
-rw-r--r--changelogs/fragments/ansible-test-change-detection-fix.yml2
-rw-r--r--test/lib/ansible_test/_internal/import_analysis.py4
2 files changed, 2 insertions, 4 deletions
diff --git a/changelogs/fragments/ansible-test-change-detection-fix.yml b/changelogs/fragments/ansible-test-change-detection-fix.yml
deleted file mode 100644
index 3917afec3d..0000000000
--- a/changelogs/fragments/ansible-test-change-detection-fix.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-bugfixes:
- - ansible-test now ignores empty ``*.py`` files when analyzing module_utils imports for change detection
diff --git a/test/lib/ansible_test/_internal/import_analysis.py b/test/lib/ansible_test/_internal/import_analysis.py
index c7fc00bdbb..fd52173861 100644
--- a/test/lib/ansible_test/_internal/import_analysis.py
+++ b/test/lib/ansible_test/_internal/import_analysis.py
@@ -144,10 +144,10 @@ def enumerate_module_utils():
for path in data_context().content.walk_files(data_context().content.module_utils_path):
ext = os.path.splitext(path)[1]
- if ext != '.py':
+ if path == os.path.join(data_context().content.module_utils_path, '__init__.py'):
continue
- if os.path.getsize(path) == 0:
+ if ext != '.py':
continue
module_utils.append(get_python_module_utils_name(path))