]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
remote: Raise ConnectionError when appropriate
authorZack Cerza <zack@redhat.com>
Thu, 27 Jul 2023 17:41:11 +0000 (11:41 -0600)
committerZack Cerza <zack@redhat.com>
Thu, 27 Jul 2023 17:41:11 +0000 (11:41 -0600)
Instead of just Exception.

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/orchestra/remote.py

index 11456e0a30fe5f002b1af120d3d89a447643583a..0392acf87e6f1c095f0e3940c017e411fd99a5d6 100644 (file)
@@ -490,7 +490,7 @@ class Remote(RemoteShell):
             return
         self.connect()
         if not self.is_online:
-            raise Exception('unable to connect')
+            raise ConnectionError(f'Failed to connect to {self.shortname}')
 
     @property
     def system_type(self):
@@ -518,7 +518,7 @@ class Remote(RemoteShell):
            not self.ssh.get_transport() or \
            not self.ssh.get_transport().is_active():
             if not self.reconnect():
-                raise Exception(f'Cannot connect to remote host {self.shortname}')
+                raise ConnectionError(f'Failed to reconnect to {self.shortname}')
         r = self._runner(client=self.ssh, name=self.shortname, **kwargs)
         r.remote = self
         return r