]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Add Remote.ensure_online()
authorZack Cerza <zack@cerza.org>
Wed, 7 May 2014 17:36:06 +0000 (12:36 -0500)
committerZack Cerza <zack@cerza.org>
Sat, 10 May 2014 14:10:22 +0000 (09:10 -0500)
If the connection is alive, do nothing. If not, reconnect. Allow any
exceptions to bubble up to the caller. This is intended to fix unhelpful
'Bad File Descriptor' errors we were seeing when VMs go down.

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

index cc3d8af84e5f2b1b4b87c2bd0c806a64cb190f29..8a983b643e8371eb26b42d07732c777f934ef157 100644 (file)
@@ -84,6 +84,10 @@ class Remote(object):
             return False
         return self.ssh.get_transport().is_active()
 
+    def ensure_online(self):
+        if not self.is_online:
+            return self.connect()
+
     @property
     def system_type(self):
         """