jw.pkg.*.run_xxx(): Return exit status

Most run_xxx() return stdout and stderr. There's no way, really, for
the caller to get hold of the exit code of the spawned executable. It
can pass throw=true, catch, and assume a non-zero exit status. But
that's not semantically clean, since the spawned function can well be
a test function which is expected to return a non-zero status code,
and the caller might be interested in what code that was, exactly.

The clearest way to solve this is to return the exit code as well.
This commit does that.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-03-03 08:34:27 +01:00
commit 565946643b
6 changed files with 25 additions and 25 deletions

View file

@ -97,5 +97,5 @@ class SSHClientCmd(SSHClient): # export
self.__init_askpass()
cmd_arr = ['ssh']
cmd_arr.append(self.hostname)
stdout, stderr = await run_cmd(['ssh', self.hostname, cmd])
stdout, stderr, status = await run_cmd(['ssh', self.hostname, cmd])
return stdout