mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Support late evaluation, suppress warnings on SyntaxError (#17462)
See #14304 comments (https://github.com/ansible/ansible/pull/14304#issuecomment-245453209) for more information.
This commit is contained in:
parent
eefe359d6b
commit
d52a9cee46
1 changed files with 1 additions and 2 deletions
|
@ -137,9 +137,8 @@ def safe_eval(expr, locals={}, include_exceptions=False):
|
|||
else:
|
||||
return result
|
||||
except SyntaxError as e:
|
||||
display.warning('SyntaxError in safe_eval() on expr: %s (%s)' % (expr, e))
|
||||
# special handling for syntax errors, we just return
|
||||
# the expression string back as-is
|
||||
# the expression string back as-is to support late evaluation
|
||||
if include_exceptions:
|
||||
return (expr, None)
|
||||
return expr
|
||||
|
|
Loading…
Reference in a new issue