Commit dd36d829 authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix luxi serialization in ganeti-masterd



Currently, lib/luxi.py used lib/serializer.py for encoding/decoding
messages, but the master daemon uses directly the simplejson module.
This is wrong as any non-trivial change to serializer.py will break the
master daemon.

The patch changes masterd to use exactly the same functions as luxi.py
for encoding/decoding of messages.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 99036060
......@@ -36,7 +36,6 @@ import collections
import Queue
import random
import signal
import simplejson
import logging
from cStringIO import StringIO
......@@ -55,6 +54,7 @@ from ganeti import ssconf
from ganeti import workerpool
from ganeti import rpc
from ganeti import bootstrap
from ganeti import serializer
CLIENT_REQUEST_WORKERS = 16
......@@ -152,7 +152,7 @@ class ClientRqHandler(SocketServer.BaseRequestHandler):
logging.debug("client closed connection")
break
request = simplejson.loads(msg)
request = serializer.LoadJson(msg)
logging.debug("request: %s", request)
if not isinstance(request, dict):
logging.error("wrong request received: %s", msg)
......@@ -181,7 +181,7 @@ class ClientRqHandler(SocketServer.BaseRequestHandler):
luxi.KEY_RESULT: result,
}
logging.debug("response: %s", response)
self.send_message(simplejson.dumps(response))
self.send_message(serializer.DumpJson(response))
def read_message(self):
while not self._msgs:
......
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