mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 17:23:36 +02:00
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:
parent
3574c0f1bf
commit
4a8ccfb0a6
1 changed files with 4 additions and 0 deletions
|
|
@ -60,4 +60,8 @@ class Exec(Base):
|
||||||
if env:
|
if env:
|
||||||
for key, val in env.items():
|
for key, val in env.items():
|
||||||
opts.extend(['-o', f'SetEnv {key}="{val}"'])
|
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)
|
return await run_cmd(['ssh', *opts, self.hostname, join_cmd(cmd)], cmd_input=cmd_input, throw=False)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue