diff --git a/lib/ansible/utils/__init__.py b/lib/ansible/utils/__init__.py index 4c640946aa..f28eef0b54 100644 --- a/lib/ansible/utils/__init__.py +++ b/lib/ansible/utils/__init__.py @@ -156,7 +156,7 @@ def check_conditional(conditional): try: return eval(conditional.replace("\n", "\\n")) - except SyntaxError as e: + except (NameError, SyntaxError): raise errors.AnsibleError("Could not evaluate the expression: " + conditional) def is_executable(path):