Commit 76bbbfd6 authored by Avery Pennarun's avatar Avery Pennarun

Catch the exception thrown when ssh can't connect.

Easiest test: give it an invalid hostname.

Reported by Chetan Kunte.
parent 6e336c09
...@@ -100,7 +100,13 @@ def _main(listener, fw, use_server, remotename, python, seed_hosts, auto_nets): ...@@ -100,7 +100,13 @@ def _main(listener, fw, use_server, remotename, python, seed_hosts, auto_nets):
else: else:
helpers.logprefix = 'client: ' helpers.logprefix = 'client: '
debug1('connecting to server...\n') debug1('connecting to server...\n')
(serverproc, serversock) = ssh.connect(remotename, python) try:
(serverproc, serversock) = ssh.connect(remotename, python)
except socket.error, e:
if e.errno == errno.EPIPE:
raise Fatal("failed to establish ssh session")
else:
raise
mux = Mux(serversock, serversock) mux = Mux(serversock, serversock)
handlers.append(mux) handlers.append(mux)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment