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

pull/7000/head
James Cammarata 11 years ago
parent d494a163f9
commit 23c5f4524d

@ -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…
Cancel
Save