Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to ensure the entire value is quoted #1608

Merged
merged 1 commit into from
Nov 13, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/ansible/playbook/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def compile_when_to_only_if(self, expression):
if tokens[0] in [ 'set', 'unset' ]:
if len(tokens) != 2:
raise errors.AnsibleError("usage: when: <set|unset> <$variableName>")
return "is_%s('%s')" % (tokens[0], tokens[1])
return "is_%s('''%s''')" % (tokens[0], tokens[1])

# when_integer / when_float / when_string
elif tokens[0] in [ 'integer', 'float', 'string' ]:
Expand All @@ -223,7 +223,7 @@ def compile_when_to_only_if(self, expression):
for (i,t) in enumerate(tokens[1:]):
if t.find("$") != -1:
# final variable substitution will happen in Runner code
tcopy[i] = "%s('%s')" % (cast, t)
tcopy[i] = "%s('''%s''')" % (cast, t)
else:
tcopy[i] = t
return " ".join(tcopy)
Expand Down