From 48ce4b7d70b7e3695af090e4c4bdb5d7436e54f7 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Tue, 30 Jun 2015 14:17:26 -0500 Subject: [PATCH] Don't trace if we check a non python module for just docs --- ansible_testing/modules.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ansible_testing/modules.py b/ansible_testing/modules.py index 56eaefc5800..b7e060dddc2 100644 --- a/ansible_testing/modules.py +++ b/ansible_testing/modules.py @@ -120,10 +120,13 @@ class ModuleValidator(Validator): return False def _just_docs(self): - for child in self.ast.body: - if not isinstance(child, ast.Assign): - return False - return True + try: + for child in self.ast.body: + if not isinstance(child, ast.Assign): + return False + return True + except AttributeError: + return False def _is_bottom_import_blacklisted(self): return self.object_name in self.BOTTOM_IMPORTS_BLACKLIST