From 70d5dad72611871beb97f27ec4c02d88848eaae8 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Thu, 7 Feb 2013 11:56:29 +0100 Subject: [PATCH] Also catch NameErrors which would indicate missing quotes --- lib/ansible/utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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):