|
@@ -69,7 +69,7 @@ class DeferredXMLRPCResponse:
|
|
return NOT_DONE_YET
|
|
return NOT_DONE_YET
|
|
except RPCError, err:
|
|
except RPCError, err:
|
|
value = xmlrpclib.Fault(err.code, err.text)
|
|
value = xmlrpclib.Fault(err.code, err.text)
|
|
-
|
|
|
|
|
|
+
|
|
body = xmlrpc_marshal(value)
|
|
body = xmlrpc_marshal(value)
|
|
|
|
|
|
self.finished = True
|
|
self.finished = True
|
|
@@ -204,7 +204,7 @@ class SystemNamespaceRPCInterface:
|
|
if methodname == name:
|
|
if methodname == name:
|
|
return methods[methodname]
|
|
return methods[methodname]
|
|
raise RPCError(Faults.SIGNATURE_UNSUPPORTED)
|
|
raise RPCError(Faults.SIGNATURE_UNSUPPORTED)
|
|
-
|
|
|
|
|
|
+
|
|
def methodSignature(self, name):
|
|
def methodSignature(self, name):
|
|
""" Return an array describing the method signature in the
|
|
""" Return an array describing the method signature in the
|
|
form [rtype, ptype, ptype...] where rtype is the return data type
|
|
form [rtype, ptype, ptype...] where rtype is the return data type
|
|
@@ -322,10 +322,10 @@ class supervisor_xmlrpc_handler(xmlrpc_handler):
|
|
|
|
|
|
def match(self, request):
|
|
def match(self, request):
|
|
return request.uri.startswith(self.path)
|
|
return request.uri.startswith(self.path)
|
|
-
|
|
|
|
|
|
+
|
|
def continue_request (self, data, request):
|
|
def continue_request (self, data, request):
|
|
logger = self.supervisord.options.logger
|
|
logger = self.supervisord.options.logger
|
|
-
|
|
|
|
|
|
+
|
|
try:
|
|
try:
|
|
|
|
|
|
params, method = self.loads(data)
|
|
params, method = self.loads(data)
|
|
@@ -335,7 +335,7 @@ class supervisor_xmlrpc_handler(xmlrpc_handler):
|
|
logger.trace('XML-RPC request received with no method name')
|
|
logger.trace('XML-RPC request received with no method name')
|
|
request.error(400)
|
|
request.error(400)
|
|
return
|
|
return
|
|
-
|
|
|
|
|
|
+
|
|
# we allow xml-rpc clients that do not send empty <params>
|
|
# we allow xml-rpc clients that do not send empty <params>
|
|
# when there are no parameters for the method call
|
|
# when there are no parameters for the method call
|
|
if params is None:
|
|
if params is None:
|
|
@@ -449,13 +449,13 @@ class SupervisorTransport(xmlrpclib.Transport):
|
|
"Content-Type" : "text/xml",
|
|
"Content-Type" : "text/xml",
|
|
"Accept": "text/xml"
|
|
"Accept": "text/xml"
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
# basic auth
|
|
# basic auth
|
|
if self.username is not None and self.password is not None:
|
|
if self.username is not None and self.password is not None:
|
|
unencoded = "%s:%s" % (self.username, self.password)
|
|
unencoded = "%s:%s" % (self.username, self.password)
|
|
encoded = base64.encodestring(unencoded).replace('\n', '')
|
|
encoded = base64.encodestring(unencoded).replace('\n', '')
|
|
self.headers["Authorization"] = "Basic %s" % encoded
|
|
self.headers["Authorization"] = "Basic %s" % encoded
|
|
-
|
|
|
|
|
|
+
|
|
self.headers["Content-Length"] = str(len(request_body))
|
|
self.headers["Content-Length"] = str(len(request_body))
|
|
|
|
|
|
self.connection.request('POST', handler, request_body, self.headers)
|
|
self.connection.request('POST', handler, request_body, self.headers)
|
|
@@ -473,7 +473,7 @@ class SupervisorTransport(xmlrpclib.Transport):
|
|
p, u = self.getparser()
|
|
p, u = self.getparser()
|
|
p.feed(data)
|
|
p.feed(data)
|
|
p.close()
|
|
p.close()
|
|
- return u.close()
|
|
|
|
|
|
+ return u.close()
|
|
|
|
|
|
class UnixStreamHTTPConnection(httplib.HTTPConnection):
|
|
class UnixStreamHTTPConnection(httplib.HTTPConnection):
|
|
def connect(self):
|
|
def connect(self):
|
|
@@ -556,7 +556,6 @@ if iterparse is not None:
|
|
"data": lambda x: [v.text for v in x],
|
|
"data": lambda x: [v.text for v in x],
|
|
"struct": lambda x: dict([(k.text or "", v.text) for k, v in x]),
|
|
"struct": lambda x: dict([(k.text or "", v.text) for k, v in x]),
|
|
"base64": lambda x: decodestring(x.text or ""),
|
|
"base64": lambda x: decodestring(x.text or ""),
|
|
- "value": lambda x: x[0].text,
|
|
|
|
"param": lambda x: x[0].text,
|
|
"param": lambda x: x[0].text,
|
|
}
|
|
}
|
|
|
|
|
|
@@ -568,6 +567,13 @@ if iterparse is not None:
|
|
data = unmarshal(elem)
|
|
data = unmarshal(elem)
|
|
elem.clear()
|
|
elem.clear()
|
|
elem.text = data
|
|
elem.text = data
|
|
|
|
+ elif elem.tag == "value":
|
|
|
|
+ try:
|
|
|
|
+ data = elem[0].text
|
|
|
|
+ except IndexError:
|
|
|
|
+ data = elem.text or ""
|
|
|
|
+ elem.clear()
|
|
|
|
+ elem.text = data
|
|
elif elem.tag == "methodName":
|
|
elif elem.tag == "methodName":
|
|
method = elem.text
|
|
method = elem.text
|
|
elif elem.tag == "params":
|
|
elif elem.tag == "params":
|