From 8643daf1bbb75c0e4a9f3134e9bfbcde5dcf301a Mon Sep 17 00:00:00 2001 From: Jesse Schmidt Date: Fri, 26 Jan 2024 11:53:30 -0800 Subject: [PATCH] fix: SSH Connection refused traceback --- lib/live_cluster/ssh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/live_cluster/ssh.py b/lib/live_cluster/ssh.py index 003328e5..4e1777a6 100644 --- a/lib/live_cluster/ssh.py +++ b/lib/live_cluster/ssh.py @@ -125,7 +125,7 @@ async def create_connection(self, ip) -> SSHConnection: async with SSHConnectionFactory.semaphore_host_dict[ip].semaphore: logger.debug(f"{ip}: Creating connection") return SSHConnection(await asyncssh.connect(ip, options=self.opts)) - except asyncssh.DisconnectError as e: + except (asyncssh.DisconnectError, ConnectionRefusedError) as e: raise SSHConnectionError(e) finally: SSHConnectionFactory.semaphore_host_dict[ip].count -= 1