From 793a3d3f7664ed27016fb024b9db407dfd664d4d Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Fri, 12 Apr 2013 13:29:10 -0400 Subject: [PATCH] More 1.2 templating development; for legacy when_string constructs don't quote the 'in' operator --- lib/ansible/utils/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/ansible/utils/__init__.py b/lib/ansible/utils/__init__.py index 762217c9fe7..28e1ea34e74 100644 --- a/lib/ansible/utils/__init__.py +++ b/lib/ansible/utils/__init__.py @@ -155,7 +155,6 @@ def check_conditional(conditional): if not isinstance(conditional, basestring): return conditional - try: conditional = conditional.replace("\n", "\\n") result = safe_eval(conditional) @@ -606,7 +605,7 @@ def compile_when_to_only_if(expression): # casting is really not needed #tcopy[i] = "%s('''%s''')" % (cast, t) t2 = t.strip() - if (t2[0].isalpha() or t2[0] == '$') and cast == 'str': + if (t2[0].isalpha() or t2[0] == '$') and cast == 'str' and t2 != 'in': tcopy[i] = "'%s'" % (t) else: tcopy[i] = t