mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-12 11:51:10 +00:00
Handle AnsibleUndefinedVariable's raised from lookup plugins like jinja2 UndefinedError's
This commit is contained in:
committed by
James Cammarata
parent
8034231a00
commit
3569a2ffee
@@ -511,7 +511,7 @@ def template_from_string(basedir, data, vars, fail_on_undefined=False):
|
||||
|
||||
res = jinja2.utils.concat(t.root_render_func(t.new_context(_jinja2_vars(basedir, vars, t.globals, fail_on_undefined), shared=True)))
|
||||
return res
|
||||
except jinja2.exceptions.UndefinedError:
|
||||
except (jinja2.exceptions.UndefinedError, errors.AnsibleUndefinedVariable):
|
||||
if fail_on_undefined:
|
||||
raise
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user