Commit 7347e54b by fdavis

change error message on check_conditional when variable does not exist

parent 23f2a7fc
...@@ -143,7 +143,10 @@ def check_conditional(conditional): ...@@ -143,7 +143,10 @@ def check_conditional(conditional):
def is_unset(var): def is_unset(var):
return var.startswith("$") return var.startswith("$")
return eval(conditional.replace("\n", "\\n")) try:
return eval(conditional.replace("\n", "\\n"))
except SyntaxError as e:
raise errors.AnsibleError("Could not evaluate the expression: " + conditional)
def is_executable(path): def is_executable(path):
'''is the given path executable?''' '''is the given path executable?'''
......
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