mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-09 01:44:03 -07:00
re-enable non-pipelined mode for Powershell (#25012)
* fixes #23986 * fixes 3rd-party Windows connection plugins that don't support pipelining (eg awsrun)
This commit is contained in:
parent
b41c42cf0d
commit
36ad934156
7 changed files with 128 additions and 121 deletions
|
@ -335,17 +335,17 @@ class Connection(ConnectionBase):
|
|||
|
||||
def exec_command(self, cmd, in_data=None, sudoable=True):
|
||||
super(Connection, self).exec_command(cmd, in_data=in_data, sudoable=sudoable)
|
||||
cmd_parts = self._shell._encode_script(exec_wrapper, as_list=True, strict_mode=False, preserve_rc=False)
|
||||
cmd_parts = self._shell._encode_script(cmd, as_list=True, strict_mode=False, preserve_rc=False)
|
||||
|
||||
# TODO: display something meaningful here
|
||||
display.vvv("EXEC (via pipeline wrapper)")
|
||||
|
||||
if not in_data:
|
||||
payload = self._create_raw_wrapper_payload(cmd)
|
||||
else:
|
||||
payload = in_data
|
||||
stdin_iterator = None
|
||||
|
||||
result = self._winrm_exec(cmd_parts[0], cmd_parts[1:], from_exec=True, stdin_iterator=self._wrapper_payload_stream(payload))
|
||||
if in_data:
|
||||
stdin_iterator = self._wrapper_payload_stream(in_data)
|
||||
|
||||
result = self._winrm_exec(cmd_parts[0], cmd_parts[1:], from_exec=True, stdin_iterator=stdin_iterator)
|
||||
|
||||
result.std_out = to_bytes(result.std_out)
|
||||
result.std_err = to_bytes(result.std_err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue