lib.util.run_cmd(): Remove parameter interactive

run_cmd() is a thin layer over the public ExecContext API, which
falls back to using a Local instance if not other ExecContext is
specified explicitly. Both the default Local context as the
subsequent call to run() should have the same idea about
interactivity, so allowing to specify it in two parameters
("interactive" and "cmd_input") is a bad idea. Remove "interactive".

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-04-17 18:11:43 +02:00
commit 910f10b194
2 changed files with 3 additions and 4 deletions

View file

@ -41,6 +41,4 @@ class Exec(Base):
async def _run_ssh(self, cmd: list[str], cmd_input: bytes|None, *args, **kwargs) -> Result:
self.__init_askpass()
if cmd_input is None:
cmd_input = InputMode.Interactive if self.interactive else InputMode.NonInteractive
return await run_cmd(['ssh', self.hostname, join_cmd(cmd)], cmd_input=cmd_input, interactive=self.interactive, throw=False)
return await run_cmd(['ssh', self.hostname, join_cmd(cmd)], cmd_input=cmd_input, throw=False)