Skip to content
Snippets Groups Projects
Commit 082c5adb authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Fix error message when masterd is not listening

Reported by Iustin.

Reviewed-by: iustinp
parent 6683bba2
No related branches found
No related tags found
No related merge requests found
...@@ -539,7 +539,7 @@ def FormatError(err): ...@@ -539,7 +539,7 @@ def FormatError(err):
obuf.write("Unhandled Ganeti error: %s" % msg) obuf.write("Unhandled Ganeti error: %s" % msg)
elif isinstance(err, luxi.NoMasterError): elif isinstance(err, luxi.NoMasterError):
obuf.write("Cannot communicate with the master daemon.\nIs it running" obuf.write("Cannot communicate with the master daemon.\nIs it running"
" and listening on '%s'?" % err.args[0]) " and listening for connections?")
elif isinstance(err, luxi.TimeoutError): elif isinstance(err, luxi.TimeoutError):
obuf.write("Timeout while talking to the master daemon. Error:\n" obuf.write("Timeout while talking to the master daemon. Error:\n"
"%s" % msg) "%s" % msg)
......
...@@ -154,7 +154,7 @@ class Transport: ...@@ -154,7 +154,7 @@ class Transport:
except socket.timeout, err: except socket.timeout, err:
raise TimeoutError("Connect timed out: %s" % str(err)) raise TimeoutError("Connect timed out: %s" % str(err))
except socket.error, err: except socket.error, err:
if err.args[0] == errno.ENOENT: if err.args[0] in (errno.ENOENT, errno.ECONNREFUSED):
raise NoMasterError((address,)) raise NoMasterError((address,))
raise raise
self.socket.settimeout(self._rwtimeout) self.socket.settimeout(self._rwtimeout)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment