Rejoin args list into a string for run_command when using an unsafe shell

This allows the use of an args list with leading environment variables,
which otherwise would fail due to the way Popen works.
release1.5.3
James Cammarata 12 years ago
parent 48a1c156ee
commit c96c3c483c

@ -1008,7 +1008,9 @@ class AnsibleModule(object):
shell = False shell = False
if isinstance(args, list): if isinstance(args, list):
pass if use_unsafe_shell:
args = " ".join([pipes.quote(x) for x in args])
shell = True
elif isinstance(args, basestring) and use_unsafe_shell: elif isinstance(args, basestring) and use_unsafe_shell:
shell = True shell = True
elif isinstance(args, basestring): elif isinstance(args, basestring):

Loading…
Cancel
Save