From 5afdc33e895cb9e41d3b2b14266a927ae331edf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20B=C5=99ezina?= Date: Fri, 9 Aug 2024 12:31:13 +0200 Subject: [PATCH] roles: use correct ssh host and port --- sssd_test_framework/roles/base.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sssd_test_framework/roles/base.py b/sssd_test_framework/roles/base.py index d17b2b0..ac777eb 100644 --- a/sssd_test_framework/roles/base.py +++ b/sssd_test_framework/roles/base.py @@ -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,