mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-01 16:23:10 +00:00
change error message on check_conditional when variable does not exist
This commit is contained in:
@@ -143,7 +143,10 @@ def check_conditional(conditional):
|
||||
def is_unset(var):
|
||||
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):
|
||||
'''is the given path executable?'''
|
||||
|
||||
Reference in New Issue
Block a user