Make sure args in run_command are encoded for shlex.split calls on py2.6

This commit is contained in:
James Cammarata 2014-04-15 13:04:41 -04:00
parent d494a163f9
commit 23c5f4524d

View file

@ -1054,7 +1054,7 @@ class AnsibleModule(object):
elif isinstance(args, basestring) and use_unsafe_shell:
shell = True
elif isinstance(args, basestring):
args = shlex.split(args)
args = shlex.split(args.encode('utf-8'))
else:
msg = "Argument 'args' to run_command must be list or string"
self.fail_json(rc=257, cmd=args, msg=msg)