]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
orchestra/remote.py: raise if ensure_online() fails
authorKefu Chai <kchai@redhat.com>
Wed, 25 Mar 2020 10:25:11 +0000 (18:25 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 25 Mar 2020 10:25:13 +0000 (18:25 +0800)
to ensure that we fail early if we cannot ensure an online remote.

Signed-off-by: Kefu Chai <kchai@redhat.com>
teuthology/orchestra/remote.py

index 79df250cd84dd39e3be70cb2547eac2dc418813f..96a1c9201f1ecc86c999df9387163ef0bd60d2df 100644 (file)
@@ -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):