From bafc7fed2a76689bf8aa514f598573588a5ed641 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Fri, 10 Apr 2026 15:30:48 +0200 Subject: [PATCH] lib.ec.ssh.Exec: Honour self.interactive The Exec SSHClient ignores the "interactive" argument passed to its constructor, fix that. Signed-off-by: Jan Lindemann --- src/python/jw/pkg/lib/ec/ssh/Exec.py | 2 +- src/python/jw/pkg/lib/util.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/python/jw/pkg/lib/ec/ssh/Exec.py b/src/python/jw/pkg/lib/ec/ssh/Exec.py index b1267800..3872ac37 100644 --- a/src/python/jw/pkg/lib/ec/ssh/Exec.py +++ b/src/python/jw/pkg/lib/ec/ssh/Exec.py @@ -40,5 +40,5 @@ class Exec(Base): async def _run_ssh(self, cmd: list[str], cmd_input: str|None, *args, **kwargs) -> Result: self.__init_askpass() - return await run_cmd(['ssh', self.hostname, join_cmd(cmd)], cmd_input=cmd_input) + return await run_cmd(['ssh', self.hostname, join_cmd(cmd)], cmd_input=cmd_input, interactive=self.interactive) diff --git a/src/python/jw/pkg/lib/util.py b/src/python/jw/pkg/lib/util.py index de242812..b13c20b8 100644 --- a/src/python/jw/pkg/lib/util.py +++ b/src/python/jw/pkg/lib/util.py @@ -32,12 +32,12 @@ def pretty_cmd(cmd: list[str], wd=None): return ret # See ExecContext.run() for what this function does -async def run_cmd(*args, ec: ExecContext|None=None, verbose: bool|None=None, **kwargs) -> Result: +async def run_cmd(*args, ec: ExecContext|None=None, verbose: bool|None=None, interactive: bool=False, **kwargs) -> Result: if verbose is None: verbose = False if ec is None else ec.verbose_default if ec is None: from .ec.Local import Local - ec = Local(verbose_default=verbose) + ec = Local(verbose_default=verbose, interactive=interactive) return await ec.run(verbose=verbose, *args, **kwargs) async def run_curl(args: list[str], parse_json: bool=False, wd=None, throw=None, verbose=None, cmd_input=None, ec: ExecContext|None=None, decode=False) -> dict|str: # export