From 1da4b4372f6a04bb185ae0cddc65ef1ca6103eaa Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 25 Mar 2020 18:25:11 +0800 Subject: [PATCH] orchestra/remote.py: raise if ensure_online() fails to ensure that we fail early if we cannot ensure an online remote. Signed-off-by: Kefu Chai --- teuthology/orchestra/remote.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/teuthology/orchestra/remote.py b/teuthology/orchestra/remote.py index 79df250cd..96a1c9201 100644 --- a/teuthology/orchestra/remote.py +++ b/teuthology/orchestra/remote.py @@ -168,8 +168,11 @@ class Remote(object): return self.ssh.get_transport().is_active() def ensure_online(self): + if self.is_online: + return + self.connect() if not self.is_online: - return self.connect() + raise Exception('unable to connect') @property def system_type(self): -- 2.47.3