Setting keepalive option before opening session

Setting the keepalive option before opening up the paramiko session
in order to avoid the slim chance that the connection is stalled
in the short time between opening the session and setting up the
keepalive. I described the issue I am solving at
https://groups.google.com/forum/#!topic/ansible-project/rkwvz3vyvLk
pull/9462/head
akinsley 10 years ago
parent 7cd5b13e34
commit 3e992b5824

@ -194,8 +194,8 @@ class Connection(object):
try: try:
chan = self.ssh.get_transport().open_session()
self.ssh.get_transport().set_keepalive(5) self.ssh.get_transport().set_keepalive(5)
chan = self.ssh.get_transport().open_session()
except Exception, e: except Exception, e:

Loading…
Cancel
Save