From dd2807ef3cc68135298421d98fc28f1f3f2f60c4 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Wed, 8 Oct 2014 14:44:42 -0500 Subject: [PATCH] Strip newlines off k=v pairs in command/shell argument parsing Fixes ansible/ansible#9272 --- lib/ansible/modules/commands/command.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/ansible/modules/commands/command.py b/lib/ansible/modules/commands/command.py index c1fabd4f9b..c584d6feed 100644 --- a/lib/ansible/modules/commands/command.py +++ b/lib/ansible/modules/commands/command.py @@ -250,12 +250,7 @@ class CommandModule(AnsibleModule): if '=' in x and not quoted: # check to see if this is a special parameter for the command k, v = x.split('=', 1) - v = unquote(v) - # because we're not breaking out quotes in the shlex split - # above, the value of the k=v pair may still be quoted. If - # so, remove them. - if len(v) > 1 and (v.startswith('"') and v.endswith('"') or v.startswith("'") and v.endswith("'")): - v = v[1:-1] + v = unquote(v.strip()) if k in ('creates', 'removes', 'chdir', 'executable', 'NO_LOG'): if k == "chdir": v = os.path.abspath(os.path.expanduser(v))