|
|
@ -2315,7 +2315,7 @@ class AnsibleModule(object):
|
|
|
|
|
|
|
|
|
|
|
|
if isinstance(args, list):
|
|
|
|
if isinstance(args, list):
|
|
|
|
if use_unsafe_shell:
|
|
|
|
if use_unsafe_shell:
|
|
|
|
args = " ".join([pipes.quote(x) for x in args])
|
|
|
|
args = " ".join([shlex_quote(x) for x in args])
|
|
|
|
shell = True
|
|
|
|
shell = True
|
|
|
|
elif isinstance(args, (binary_type, text_type)) and use_unsafe_shell:
|
|
|
|
elif isinstance(args, (binary_type, text_type)) and use_unsafe_shell:
|
|
|
|
shell = True
|
|
|
|
shell = True
|
|
|
@ -2334,7 +2334,8 @@ class AnsibleModule(object):
|
|
|
|
|
|
|
|
|
|
|
|
shell = False
|
|
|
|
shell = False
|
|
|
|
if use_unsafe_shell:
|
|
|
|
if use_unsafe_shell:
|
|
|
|
executable = os.environ.get('SHELL')
|
|
|
|
if executable is None:
|
|
|
|
|
|
|
|
executable = os.environ.get('SHELL')
|
|
|
|
if executable:
|
|
|
|
if executable:
|
|
|
|
args = [executable, '-c', args]
|
|
|
|
args = [executable, '-c', args]
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|