From e37ba8dd2984a94c67bcf1ac68fff7b40a050c3a Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Tue, 22 Dec 2015 10:55:26 -0600 Subject: [PATCH] Fix bottom import check weirdness --- ansible_testing/modules.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ansible_testing/modules.py b/ansible_testing/modules.py index 928ad176d3a..102b2034157 100644 --- a/ansible_testing/modules.py +++ b/ansible_testing/modules.py @@ -101,6 +101,7 @@ class ModuleValidator(Validator): 'ansible.module_utils.facts', 'ansible.module_utils.splitter', 'ansible.module_utils.known_hosts', + 'ansible.module_utils.rax', )) BOTTOM_IMPORTS_BLACKLIST = frozenset(( 'command.py', @@ -217,11 +218,8 @@ class ModuleValidator(Validator): if child.module in self.BOTTOM_IMPORTS: if (child.lineno < main - 10 and not self._is_bottom_import_blacklisted()): - self.errors.append('%s import not near main()' % - child.module) - else: - self.warnings.append('%s import not near main()' % - child.module) + self.errors.append('%s import not near call to ' + 'main()' % child.module) linenos.append(child.lineno)