Skip to content

Commit

Permalink
Merge pull request SUSE#183 from SUSE/fix-no-connection
Browse files Browse the repository at this point in the history
orchestra: fix no connection after reboot
  • Loading branch information
kshtsk authored Feb 5, 2019
2 parents d1eb4a9 + f11bdd0 commit ab7fa3c
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions teuthology/orchestra/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,10 @@ def run(self, **kwargs):
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
Expand Down

0 comments on commit ab7fa3c

Please sign in to comment.