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 @@ def ensure_online(self): 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 @@ def run(self, **kwargs): 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 diff --git a/teuthology/provision/fog.py b/teuthology/provision/fog.py index 8f32969b6..6194fc8e8 100644 --- a/teuthology/provision/fog.py +++ b/teuthology/provision/fog.py @@ -299,7 +299,7 @@ def _wait_for_ready(self): self.remote.run(args=cmd, timeout=600) break except ( - ConnectionResetError, + ConnectionError, EOFError, ) as e: log.error(f"{e} on {self.shortname}")