Skip to content

Commit 925634b

Browse files
committed
Change ssh client super init: provide resolved port number
1 parent 8711de1 commit 925634b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

exec_helpers/_ssh_client_base.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,6 @@ def __init__(
236236
.. versionchanged:: 6.0.0 keepalive exposed to constructor
237237
.. versionchanged:: 6.0.0 private_keys is deprecated
238238
"""
239-
super(SSHClientBase, self).__init__(
240-
logger=logging.getLogger(self.__class__.__name__).getChild(f"({host}:{port})")
241-
)
242-
243239
if private_keys is not None:
244240
warnings.warn(
245241
"private_keys setting without SSHAuth object is deprecated and will be removed at short time.",
@@ -259,6 +255,11 @@ def __init__(
259255
self.__hostname: str = config.hostname
260256
self.__port: int = port if port is not None else config.port if config.port is not None else 22
261257

258+
# Init super with host and real port
259+
super(SSHClientBase, self).__init__(
260+
logger=logging.getLogger(self.__class__.__name__).getChild(f"({host}:{self.__port})")
261+
)
262+
262263
# Store initial auth mapping
263264
self.__auth_mapping = ssh_auth.SSHAuthMapping(ssh_auth_map)
264265
# We are already resolved hostname

0 commit comments

Comments
 (0)