Skip to content

Commit

Permalink
Handle possible scenario where conditional might be an integer (whoa!…
Browse files Browse the repository at this point in the history
…) down the error path. Super rare but fixes ansible#4483.
  • Loading branch information
mpdehaan committed Oct 13, 2013
1 parent a956c20 commit c90a82f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ansible/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c90a82f

Please sign in to comment.