Retry ssh connect when EOFError received

When doing a ssh connect, paramiko transport randomly throws out
EOFError. This should be retried the same as when socket.error and
paramiko.SSHException are captured.

Change-Id: Iaf6dce01278116128dcef8f11585e8d7f6353e1e
Closes-bug: #1487373
This commit is contained in:
Xiangfei Zhu
2015-08-21 16:59:19 +08:00
parent 61b7ffcaf8
commit 7a3e77f98b

View File

@@ -76,7 +76,8 @@ class Client(object):
LOG.info("ssh connection to %s@%s successfuly created",
self.username, self.host)
return ssh
except (socket.error,
except (EOFError,
socket.error,
paramiko.SSHException) as e:
if self._is_timed_out(_start_time):
LOG.exception("Failed to establish authenticated ssh"