mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-23 19:01:26 -07:00
Make sure args in run_command are encoded for shlex.split calls on py2.6
This commit is contained in:
parent
d494a163f9
commit
23c5f4524d
1 changed files with 1 additions and 1 deletions
|
@ -1054,7 +1054,7 @@ class AnsibleModule(object):
|
||||||
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):
|
||||||
args = shlex.split(args)
|
args = shlex.split(args.encode('utf-8'))
|
||||||
else:
|
else:
|
||||||
msg = "Argument 'args' to run_command must be list or string"
|
msg = "Argument 'args' to run_command must be list or string"
|
||||||
self.fail_json(rc=257, cmd=args, msg=msg)
|
self.fail_json(rc=257, cmd=args, msg=msg)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue