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

Handle possible scenario where conditional might be an integer (whoa!) down the error path. Super rare but fixes #4483.

This commit is contained in:
Michael DeHaan 2013-10-13 09:19:41 -04:00
parent a956c2019f
commit c90a82fd52

View file

@ -175,7 +175,7 @@ def check_conditional(conditional, basedir, inject, fail_on_undefined=False, jin
if conditional in inject and str(inject[conditional]).find('-') == -1:
conditional = inject[conditional]
conditional = template.template(basedir, conditional, inject, fail_on_undefined=fail_on_undefined)
original = conditional.replace("jinja2_compare ","")
original = str(conditional).replace("jinja2_compare ","")
# a Jinja2 evaluation that results in something Python can eval!
presented = "{%% if %s %%} True {%% else %%} False {%% endif %%}" % conditional
conditional = template.template(basedir, presented, inject)