From cc57e33be8762c0e3c3e2ae6234e4e458dc3fd3d Mon Sep 17 00:00:00 2001 From: Panos Date: Wed, 9 Dec 2020 23:07:31 +0000 Subject: [PATCH] Set default port for proxy client target --- pssh/clients/native/single.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pssh/clients/native/single.py b/pssh/clients/native/single.py index 9d85bdb2..1a6a099b 100644 --- a/pssh/clients/native/single.py +++ b/pssh/clients/native/single.py @@ -109,7 +109,7 @@ def __init__(self, host, self._keepalive_greenlet = None self._proxy_client = None self.host = host - self.port = port + self.port = port if port is not None else 22 if proxy_host is not None: _port = port if proxy_port is None else proxy_port _pkey = pkey if proxy_pkey is None else proxy_pkey @@ -140,6 +140,7 @@ def _connect_proxy(self, proxy_host, proxy_port, proxy_pkey, forward_ssh_agent=False, keepalive_seconds=60, identity_auth=True): + assert isinstance(self.port, int) try: self._proxy_client = SSHClient( proxy_host, port=proxy_port, pkey=proxy_pkey,