feat: open() waits out sshd's per-source penalty (NetOrk/netork#1800) #51

Merged
christianmanivong merged 2 commits from feat/ssh-penalties-1800 into main 2026-10-31 23:36:46 +00:00
Showing only changes of commit bff275402e - Show all commits
+2 -7
View File
@@ -391,10 +391,7 @@ class LinuxDriver(
"""Open the SSH connection and detect the package manager."""
try:
with self._host_key.netmiko(self.netmiko_optional_args) as netmiko_args_:
# Again after a pause when sshd closes the connection before its
# banner: OpenSSH 9.8+ does that to a source it has just
# penalised (NetOrk/netork#1800).
self._device = retry_refused(
self._device = retry_refused( # waits out sshd's penalty (NetOrk/netork#1800)
lambda: ConnectHandler(
device_type=self.NETMIKO_DEVICE_TYPE,
host=self.hostname,
@@ -406,9 +403,7 @@ class LinuxDriver(
**netmiko_args_,
)
)
except NetmikoAuthenticationException as exc:
raise ConnectionException(str(exc)) from exc
except NetmikoTimeoutException as exc:
except (NetmikoAuthenticationException, NetmikoTimeoutException) as exc:
raise ConnectionException(str(exc)) from exc
self._host_key.observe(self._device.remote_conn_pre.get_transport())