diff --git a/napalm_linux/linux.py b/napalm_linux/linux.py index c219a97..800ff01 100644 --- a/napalm_linux/linux.py +++ b/napalm_linux/linux.py @@ -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())