lib.ec.ssh.Exec._run_ssh(): run_cmd(throw=False)

_run_ssh() of ssh.Exec doesn't pass throw=False to run_cmd(), which
makes it throw exceptions, and effectively strips the caller of any
chance to get hold of stdout and stderr. Pass throw=False and let
run() decide according the the caller-provided throw parameter
whether or not a problem should propagate up as exception or return
value.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-04-11 11:45:38 +02:00
commit d680d6c5ed

View file

@ -40,5 +40,5 @@ class Exec(Base):
async def _run_ssh(self, cmd: list[str], cmd_input: str|None, *args, **kwargs) -> Result: async def _run_ssh(self, cmd: list[str], cmd_input: str|None, *args, **kwargs) -> Result:
self.__init_askpass() self.__init_askpass()
return await run_cmd(['ssh', self.hostname, join_cmd(cmd)], cmd_input=cmd_input, interactive=self.interactive) return await run_cmd(['ssh', self.hostname, join_cmd(cmd)], cmd_input=cmd_input, interactive=self.interactive, throw=False)