Force all args to strings for 'command' (fixes #43732)

pull/41174/merge
Andrew Gaffney 6 years ago committed by Toshio Kuratomi
parent 9a8bae5b67
commit 9f9e936d3c

@ -133,6 +133,8 @@ import os
import shlex
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils._text import to_native
from ansible.module_utils.common.collections import is_iterable
def check_command(module, commandline):
@ -215,6 +217,10 @@ def main():
args = args or argv
# All args must be strings
if is_iterable(args, include_strings=False):
args = [to_native(arg, errors='surrogate_or_strict', nonstring='simplerepr') for arg in args]
if chdir:
chdir = os.path.abspath(chdir)
os.chdir(chdir)

Loading…
Cancel
Save