mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
powershell - fix for ANSIBLE_KEEP_REMOTE_FILES on older Pythons (#45942)
This commit is contained in:
parent
a7bf505474
commit
ce515a626c
2 changed files with 4 additions and 2 deletions
|
@ -57,7 +57,7 @@ import re
|
|||
import shlex
|
||||
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible.module_utils._text import to_text
|
||||
from ansible.module_utils._text import to_native, to_text
|
||||
from ansible.plugins.shell import ShellBase
|
||||
|
||||
|
||||
|
@ -1605,7 +1605,7 @@ class ShellModule(ShellBase):
|
|||
|
||||
# non-pipelining
|
||||
|
||||
cmd_parts = shlex.split(cmd, posix=False)
|
||||
cmd_parts = shlex.split(to_native(cmd), posix=False)
|
||||
cmd_parts = list(map(to_text, cmd_parts))
|
||||
if shebang and shebang.lower() == '#!powershell':
|
||||
if not self._unquote(cmd_parts[0]).lower().endswith('.ps1'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue