Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.9] Fix ansible-test module_utils import analysis. #69406

Merged
merged 1 commit into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/ansible-test-change-detection-fix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- ansible-test now ignores empty ``*.py`` files when analyzing module_utils imports for change detection
4 changes: 2 additions & 2 deletions test/lib/ansible_test/_internal/import_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 path == os.path.join(data_context().content.module_utils_path, '__init__.py'):
if ext != '.py':
continue

if ext != '.py':
if os.path.getsize(path) == 0:
continue

module_utils.append(get_python_module_utils_name(path))
Expand Down