mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
More 1.2 templating development; for legacy when_string constructs don't quote the 'in' operator
This commit is contained in:
parent
85099be48f
commit
793a3d3f76
1 changed files with 1 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue