lib.ec.ssh.Exec: Honour username and port

Username and port of an Exec SSH client are not passed to the ssh
executable, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-04-17 18:05:12 +02:00
commit 4a8ccfb0a6

View file

@ -60,4 +60,8 @@ class Exec(Base):
if env:
for key, val in env.items():
opts.extend(['-o', f'SetEnv {key}="{val}"'])
if self.username:
opts.extend(['-l', self.username])
if self.port is not None:
pots.extend(['-p', str(self.port)])
return await run_cmd(['ssh', *opts, self.hostname, join_cmd(cmd)], cmd_input=cmd_input, throw=False)