]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
orchestra: fix no connection after reboot 1280/head
authorKyr Shatskyy <kyrylo.shatskyy@suse.com>
Mon, 4 Feb 2019 12:31:03 +0000 (13:31 +0100)
committerKyr Shatskyy <kyrylo.shatskyy@gmail.com>
Tue, 16 Apr 2019 16:54:02 +0000 (18:54 +0200)
This resolves the issue when remote lost connection
if the command was a reboot of the host and there was
only one unsuccessful try to reconnect and as a result
was loosing transport and got stuck with message like:

WARNING:tasks.deepsea.orch:No connection established yet..

Signed-off-by: Kyr <kyrylo.shatskyy@suse.com>
teuthology/orchestra/remote.py

index 85b47a8a21d5a47353e84ce96c83885ea2f36aa7..5f1285da13cdfaecb74dad8d6f692dcf7c008c5b 100644 (file)
@@ -198,14 +198,10 @@ class Remote(object):
 
         TODO refactor to move run.run here?
         """
-        if self.ssh is None:
-            self.reconnect(timeout=5)
-        if self.ssh:
-            # There is a chance that the ssh(paramiko) instance
-            # is populated but has no transport yet.
-            if self.ssh.get_transport():
-                if not self.ssh.get_transport().is_active():
-                    self.reconnect(timeout=5)
+        if not self.ssh or \
+           not self.ssh.get_transport() or \
+           not self.ssh.get_transport().is_active():
+            self.reconnect()
         r = self._runner(client=self.ssh, name=self.shortname, **kwargs)
         r.remote = self
         return r