fix interactive ssh and tests

Signed-off-by: a.lipay <a.lipay@yadro.com>
This commit is contained in:
a.lipay 2022-11-09 18:24:32 +03:00 committed by Alipayy
parent 8016ad4b86
commit cbfcbb559c
2 changed files with 9 additions and 6 deletions

View file

@ -142,7 +142,9 @@ class SSHShell(Shell):
@log_command
def _exec_interactive(self, command: str, options: CommandOptions) -> CommandResult:
stdin, stdout, stderr = self._connection.exec_command(command, timeout=options.timeout)
stdin, stdout, stderr = self._connection.exec_command(
command, timeout=options.timeout, get_pty=True
)
for interactive_input in options.interactive_inputs:
input = interactive_input.input
if not input.endswith("\n"):