Commit c3d7f69b authored by Guido Trotter's avatar Guido Trotter
Browse files

ganeti-noded: Fix handling of QuitGanetiException

- s/GanetiQuitException/QuitGanetiException/
- Look for the arguments in err.args, not err itself

Reviewed-by: iustinp
parent 9f9c8ee2
......@@ -80,13 +80,13 @@ class ServerObject(BaseHTTPServer.BaseHTTPRequestHandler):
except errors.QuitGanetiException, err:
global _EXIT_GANETI_NODED
_EXIT_GANETI_NODED = True
if isinstance(err, tuple) and len(err) == 2:
if err[0]:
if isinstance(err.args, tuple) and len(err.args) == 2:
if err.args[0]:
self.send_error(500, "Error: %s" % str(err[1]))
else:
payload = simplejson.dumps(err[1])
payload = simplejson.dumps(err.args[1])
else:
self.log_message('GanetiQuitException Usage Error')
self.log_message('QuitGanetiException Usage Error')
self.send_error(500, "Error: %s" % str(err))
except Exception, err:
self.send_error(500, "Error: %s" % str(err))
......
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