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