From b73fdae28d34785fb56f69bb4ddbf91fcc2a5180 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Wed, 12 Dec 2018 11:57:42 +0530 Subject: [PATCH] Review comment Signed-off-by: Abhijeet Kasurde --- lib/ansible/executor/module_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/executor/module_common.py b/lib/ansible/executor/module_common.py index 3243c15a9b5741..bae447c7dfc68d 100644 --- a/lib/ansible/executor/module_common.py +++ b/lib/ansible/executor/module_common.py @@ -464,7 +464,7 @@ def recursive_finder(name, data, py_module_names, py_module_cache, zf): # Parse the module and find the imports of ansible.module_utils try: tree = ast.parse(data) - except Exception as e: + except (SyntaxError, IndentationError) as e: raise AnsibleError("Unable to import %s due to %s" % (name, e.msg)) finder = ModuleDepFinder() finder.visit(tree)