From 35d138a0d6642536d63926b74260c0ebb8aee441 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Fri, 13 Sep 2013 13:52:58 -0500 Subject: [PATCH] When checking conditionals, don't dereference when the variable contains dashes Fixes #4104 --- lib/ansible/utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/utils/__init__.py b/lib/ansible/utils/__init__.py index b4b8b24ed3..fd97f8a142 100644 --- a/lib/ansible/utils/__init__.py +++ b/lib/ansible/utils/__init__.py @@ -164,7 +164,7 @@ def check_conditional(conditional, basedir, inject, fail_on_undefined=False, jin if conditional.startswith("jinja2_compare"): conditional = conditional.replace("jinja2_compare ","") # allow variable names - if conditional in inject: + 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) # a Jinja2 evaluation that results in something Python can eval!