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
This commit is contained in:
akinsley 2014-11-01 00:51:52 -07:00
parent 7cd5b13e34
commit 3e992b5824

View file

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