From: Kyr Shatskyy Date: Mon, 4 Feb 2019 12:31:03 +0000 (+0100) Subject: orchestra: fix no connection after reboot X-Git-Tag: 1.1.0~251^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d74edaca44bf054fa2e72c828e22c8be453e771b;p=teuthology.git orchestra: fix no connection after reboot 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 --- diff --git a/teuthology/orchestra/remote.py b/teuthology/orchestra/remote.py index 85b47a8a2..5f1285da1 100644 --- a/teuthology/orchestra/remote.py +++ b/teuthology/orchestra/remote.py @@ -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