Skip to content

Commit

Permalink
roles: use correct ssh host and port
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrezina committed Aug 9, 2024
1 parent 5668acf commit 5afdc33
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion sssd_test_framework/roles/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,16 @@ def ssh(self, user: str, password: str, *, shell: Shell | None = None) -> SSHCli
if shell is None:
shell = Bash()

host = self.host.hostname
port = 22

if isinstance(self.host.conn, SSHClient):
host = getattr(self.host.conn, "host", host)
port = getattr(self.host.conn, "port", 22)

return SSHClient(
self.host.hostname,
host=host,
port=port,
user=user,
password=password,
shell=shell,
Expand Down

0 comments on commit 5afdc33

Please sign in to comment.