mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Force all args to strings for 'command' (fixes #43732)
This commit is contained in:
parent
9a8bae5b67
commit
9f9e936d3c
1 changed files with 6 additions and 0 deletions
|
@ -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…
Reference in a new issue