From d6ecdfd00ad23f9d8cab340d64a1e53c22e7e4c4 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Thu, 12 May 2016 14:10:23 -0700 Subject: [PATCH] Blacklist __pycache__ directories --- ansible_testing/modules.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ansible_testing/modules.py b/ansible_testing/modules.py index 4833569e323..7f222e20ec3 100644 --- a/ansible_testing/modules.py +++ b/ansible_testing/modules.py @@ -563,6 +563,8 @@ class ModuleValidator(Validator): class PythonPackageValidator(Validator): + BLACKLIST_FILES = frozenset(('__pycache__',)) + def __init__(self, path): super(PythonPackageValidator, self).__init__() @@ -580,6 +582,9 @@ class PythonPackageValidator(Validator): def validate(self): super(PythonPackageValidator, self).validate() + if self.basename in self.BLACKLIST_FILES: + return + init_file = os.path.join(self.path, '__init__.py') if not os.path.exists(init_file): self.errors.append('Ansible module subdirectories must contain an '