Skip to content

Commit 801b76a

Browse files
authored
Set default port for proxy client target (#250)
1 parent ff6498f commit 801b76a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pssh/clients/native/single.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def __init__(self, host,
109109
self._keepalive_greenlet = None
110110
self._proxy_client = None
111111
self.host = host
112-
self.port = port
112+
self.port = port if port is not None else 22
113113
if proxy_host is not None:
114114
_port = port if proxy_port is None else proxy_port
115115
_pkey = pkey if proxy_pkey is None else proxy_pkey
@@ -140,6 +140,7 @@ def _connect_proxy(self, proxy_host, proxy_port, proxy_pkey,
140140
forward_ssh_agent=False,
141141
keepalive_seconds=60,
142142
identity_auth=True):
143+
assert isinstance(self.port, int)
143144
try:
144145
self._proxy_client = SSHClient(
145146
proxy_host, port=proxy_port, pkey=proxy_pkey,

0 commit comments

Comments
 (0)