mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 07:01:22 -07:00
Merge pull request #1772 from fdavis/devel
change error message on check_conditional when variable does not exist
This commit is contained in:
commit
ad2ab6a5dd
1 changed files with 4 additions and 1 deletions
|
@ -143,7 +143,10 @@ def check_conditional(conditional):
|
||||||
def is_unset(var):
|
def is_unset(var):
|
||||||
return var.startswith("$")
|
return var.startswith("$")
|
||||||
|
|
||||||
|
try:
|
||||||
return eval(conditional.replace("\n", "\\n"))
|
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?'''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue