From: Zack Cerza Date: Wed, 7 May 2014 17:36:06 +0000 (-0500) Subject: Add Remote.ensure_online() X-Git-Tag: 1.1.0~1474 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d0f7a47bf93fefa8ab088176d2d3699d80550c7f;p=teuthology.git Add Remote.ensure_online() 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 --- diff --git a/teuthology/orchestra/remote.py b/teuthology/orchestra/remote.py index cc3d8af8..8a983b64 100644 --- a/teuthology/orchestra/remote.py +++ b/teuthology/orchestra/remote.py @@ -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): """