Revert "ssh: add interactive flag"

This reverts commit c5db14dea8.
This commit is contained in:
Jörg Thalheim
2024-03-26 13:13:35 +01:00
parent 7b8a49bf6c
commit 80abeef994

View File

@@ -270,22 +270,15 @@ class Host:
cwd: None | str | Path = None,
check: bool = True,
timeout: float = math.inf,
interactive: bool = False,
) -> subprocess.CompletedProcess[str]:
with ExitStack() as stack:
read_std_fd, write_std_fd = (None, None)
read_err_fd, write_err_fd = (None, None)
if not interactive and (stdout is None or stderr is None):
if stdout is None or stderr is None:
read_std_fd, write_std_fd = stack.enter_context(_pipe())
read_err_fd, write_err_fd = stack.enter_context(_pipe())
if interactive:
stdout_read = None
stderr_read = None
stdout_write: IO[str] | None = sys.stdout
stderr_write: IO[str] | None = sys.stderr
else:
if stdout is None:
stdout_read = None
stdout_write = write_std_fd
@@ -326,9 +319,6 @@ class Host:
stderr_write.close()
start = time.time()
if interactive:
stdout_data, stderr_data = "", ""
else:
stdout_data, stderr_data = self._prefix_output(
displayed_cmd,
read_std_fd,
@@ -366,7 +356,6 @@ class Host:
cwd: None | str | Path = None,
check: bool = True,
timeout: float = math.inf,
interactive: bool = False,
) -> subprocess.CompletedProcess[str]:
"""
Command to run locally for the host
@@ -398,7 +387,6 @@ class Host:
cwd=cwd,
check=check,
timeout=timeout,
interactive=interactive,
)
def run(
@@ -411,7 +399,6 @@ class Host:
cwd: None | str | Path = None,
check: bool = True,
timeout: float = math.inf,
interactive: bool = False,
verbose_ssh: bool = False,
tty: bool = False,
) -> subprocess.CompletedProcess[str]:
@@ -471,7 +458,6 @@ class Host:
cwd=cwd,
check=check,
timeout=timeout,
interactive=interactive,
)
def ssh_cmd(
@@ -638,7 +624,6 @@ class HostGroup:
cwd: None | str | Path = None,
check: bool = True,
timeout: float = math.inf,
interactive: bool = False,
verbose_ssh: bool = False,
tty: bool = False,
) -> Results:
@@ -658,7 +643,6 @@ class HostGroup:
cwd=cwd,
check=check,
timeout=timeout,
interactive=interactive,
verbose_ssh=verbose_ssh,
tty=tty,
),