Also catch NameErrors which would indicate missing quotes

parent bc709e7b
...@@ -156,7 +156,7 @@ def check_conditional(conditional): ...@@ -156,7 +156,7 @@ def check_conditional(conditional):
try: try:
return eval(conditional.replace("\n", "\\n")) return eval(conditional.replace("\n", "\\n"))
except SyntaxError as e: except (NameError, SyntaxError):
raise errors.AnsibleError("Could not evaluate the expression: " + conditional) raise errors.AnsibleError("Could not evaluate the expression: " + conditional)
def is_executable(path): def is_executable(path):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment