mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-03 07:00:20 -07:00
Also catch NameErrors which would indicate missing quotes
This commit is contained in:
parent
bc709e7b67
commit
70d5dad726
1 changed files with 1 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue