From: Zack Cerza Date: Thu, 27 Jul 2023 17:41:11 +0000 (-0600) Subject: remote: Raise ConnectionError when appropriate X-Git-Tag: 1.2.0~85^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a496b72f4e1dd44ca5989161451aa0e98490a1f7;p=teuthology.git remote: Raise ConnectionError when appropriate Instead of just Exception. Signed-off-by: Zack Cerza --- diff --git a/teuthology/orchestra/remote.py b/teuthology/orchestra/remote.py index 11456e0a3..0392acf87 100644 --- a/teuthology/orchestra/remote.py +++ b/teuthology/orchestra/remote.py @@ -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