mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
only set executable from shell if not set already
This commit is contained in:
parent
55135c0825
commit
e506b5da14
1 changed files with 3 additions and 2 deletions
|
@ -2315,7 +2315,7 @@ class AnsibleModule(object):
|
|||
|
||||
if isinstance(args, list):
|
||||
if use_unsafe_shell:
|
||||
args = " ".join([pipes.quote(x) for x in args])
|
||||
args = " ".join([shlex_quote(x) for x in args])
|
||||
shell = True
|
||||
elif isinstance(args, (binary_type, text_type)) and use_unsafe_shell:
|
||||
shell = True
|
||||
|
@ -2334,7 +2334,8 @@ class AnsibleModule(object):
|
|||
|
||||
shell = False
|
||||
if use_unsafe_shell:
|
||||
executable = os.environ.get('SHELL')
|
||||
if executable is None:
|
||||
executable = os.environ.get('SHELL')
|
||||
if executable:
|
||||
args = [executable, '-c', args]
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue