mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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.
This commit is contained in:
parent
b93b99871b
commit
4273cb2d8e
1 changed files with 3 additions and 1 deletions
|
@ -1009,7 +1009,9 @@ class AnsibleModule(object):
|
|||
|
||||
shell = False
|
||||
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:
|
||||
shell = True
|
||||
elif isinstance(args, basestring):
|
||||
|
|
Loading…
Reference in a new issue