timeout = None,
retry = 0,
err_on_timeout = True,
- connect_timeout = 900,
+ connect_timeout = 60,
persistent = True,
hostip = None):
"""
args.extend(('-i', ident_key))
if tty:
args.append('-t')
+ args.append('-t')
if server_key:
# Create a temporary server key file
tmp_known_hosts = _make_server_key_args(
try:
out, err = _communicate(proc, stdin, timeout, err_on_timeout)
if proc.poll():
+ if TRACE:
+ print "COMMAND host %s, command %s, error %s" % (host, " ".join(args), err)
if err.strip().startswith('ssh: ') or err.strip().startswith('mux_client_hello_exchange: '):
# SSH error, can safely retry
continue
continue
break
except RuntimeError,e:
- if retry <= 0:
- raise
if TRACE:
+ print "COMMAND host %s, command %s, error %s" % (host, " ".join(args), err)
print " timedout -> ", e.args
+ if retry <= 0:
+ raise
retry -= 1
if TRACE:
'-o', 'NoHostAuthenticationForLocalhost=yes',
# XXX: Security vulnerability
#'-o', 'StrictHostKeyChecking=no',
- '-o', 'ConnectTimeout=900',
+ '-o', 'ConnectTimeout=60',
'-o', 'ConnectionAttempts=3',
'-o', 'ServerAliveInterval=30',
'-o', 'TCPKeepAlive=yes',
'-o', 'NoHostAuthenticationForLocalhost=yes',
# XXX: Security vulnerability
#'-o', 'StrictHostKeyChecking=no',
- '-o', 'ConnectTimeout=900',
+ '-o', 'ConnectTimeout=60',
'-o', 'ConnectionAttempts=3',
'-o', 'ServerAliveInterval=30',
'-o', 'TCPKeepAlive=yes' ]