1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Handle AnsibleUndefinedVariable's raised from lookup plugins like jinja2 UndefinedError's

This commit is contained in:
Alek Storm 2013-07-29 14:33:32 -07:00 committed by James Cammarata
parent 8034231a00
commit 3569a2ffee

View file

@ -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))) res = jinja2.utils.concat(t.root_render_func(t.new_context(_jinja2_vars(basedir, vars, t.globals, fail_on_undefined), shared=True)))
return res return res
except jinja2.exceptions.UndefinedError: except (jinja2.exceptions.UndefinedError, errors.AnsibleUndefinedVariable):
if fail_on_undefined: if fail_on_undefined:
raise raise
else: else: