]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add debug output for reconnect() failures
authorZack Cerza <zack@cerza.org>
Fri, 21 Feb 2014 16:18:41 +0000 (10:18 -0600)
committerZack Cerza <zack@cerza.org>
Fri, 21 Feb 2014 16:18:41 +0000 (10:18 -0600)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/orchestra/remote.py

index 7d353c36416bff5e0f1ef95a3af1f1dedf4e0bf8..79dbc2d413b03384965a66f27a7c2b328bd6f183 100644 (file)
@@ -29,17 +29,14 @@ class Remote(object):
     # for unit tests to hook into
     _runner = staticmethod(run.run)
 
-    def __init__(self, name, ssh=None, shortname=None, console=None, host_key=None,
-                 keep_alive=True):
+    def __init__(self, name, ssh=None, shortname=None, console=None,
+                 host_key=None, keep_alive=True):
         self.name = name
         self._shortname = shortname
         self.host_key = host_key
         self.keep_alive = keep_alive
         self.console = console
-        if ssh is None:
-            ssh = self.connect()
-        else:
-            self.ssh = ssh
+        self.ssh = ssh or self.connect()
 
     def connect(self):
         self.ssh = connection.connect(user_at_host=self.name,
@@ -56,7 +53,8 @@ class Remote(object):
         try:
             self.ssh = self.connect()
             return self.is_online
-        except Exception:
+        except Exception as e:
+            log.debug(e)
             return False
 
     @property