Skip to content

Commit f0b106d

Browse files
committed
fix: handle NoValidConnectionsError properly in SSHCE
1 parent d000937 commit f0b106d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/DIRAC/Resources/Computing/SSHComputingElement.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868

6969
from fabric import Connection
7070
from invoke.exceptions import CommandTimedOut
71-
from paramiko.ssh_exception import SSHException
71+
from paramiko.ssh_exception import NoValidConnectionsError, SSHException
7272

7373
import DIRAC
7474
from DIRAC import S_ERROR, S_OK
@@ -123,6 +123,8 @@ def _run(self, connection: Connection, command: str):
123123
return S_ERROR(
124124
errno.ETIME, f"[{connection.host}] The command timed out. Consider increasing the timeout: {e}"
125125
)
126+
except NoValidConnectionsError as e:
127+
return S_ERROR(f"[{connection.host}] Unable to connect: {str(e)}")
126128
except SSHException as e:
127129
return S_ERROR(f"[{connection.host}] SSH error occurred: {str(e)}")
128130

0 commit comments

Comments
 (0)