mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Make run_command() work when we get byte str with non-ascii characters (instead of unicode type like we were expecting)
Fix and test. Fixes #10536
This commit is contained in:
@@ -1457,7 +1457,12 @@ class AnsibleModule(object):
|
||||
# in reporting later, which strips out things like
|
||||
# passwords from the args list
|
||||
if isinstance(args, basestring):
|
||||
to_clean_args = shlex.split(args.encode('utf-8'))
|
||||
if isinstance(args, unicode):
|
||||
b_args = args.encode('utf-8')
|
||||
else:
|
||||
b_args = args
|
||||
to_clean_args = shlex.split(b_args)
|
||||
del b_args
|
||||
else:
|
||||
to_clean_args = args
|
||||
|
||||
|
||||
Reference in New Issue
Block a user