From 6514ae6c05549f7048bfa9e17a04dddc34966e08 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 17 Jun 2020 14:58:33 -0700 Subject: Revert "Fix ansible-test module_utils import analysis. (#69406)" This reverts commit b8808efd264aebad1ef73da3898b085d32bb2136. --- changelogs/fragments/ansible-test-change-detection-fix.yml | 2 -- test/lib/ansible_test/_internal/import_analysis.py | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) delete mode 100644 changelogs/fragments/ansible-test-change-detection-fix.yml 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)) -- cgit v1.2.1