ia64/xen-unstable

changeset 12075:52bf7bbb0f36

[XEND] Make logging an optional parameter for the XMLRPCServer

Signed-off-by: Alastair Tse <atse@xensource.com>
author Alastair Tse <atse@xensource.com>
date Thu Oct 05 17:29:19 2006 +0100 (2006-10-05)
parents ccfc8e4148b2
children 5fe8e9ebcf5c
files tools/python/xen/util/xmlrpclib2.py
line diff
     1.1 --- a/tools/python/xen/util/xmlrpclib2.py	Thu Oct 05 17:29:19 2006 +0100
     1.2 +++ b/tools/python/xen/util/xmlrpclib2.py	Thu Oct 05 17:29:19 2006 +0100
     1.3 @@ -25,7 +25,6 @@ import types
     1.4  import fcntl
     1.5  
     1.6  from httplib import HTTPConnection, HTTP
     1.7 -from xmlrpclib import Transport
     1.8  from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
     1.9  import SocketServer
    1.10  import xmlrpclib, socket, os, stat
    1.11 @@ -81,10 +80,11 @@ class HTTPUnixConnection(HTTPConnection)
    1.12  class HTTPUnix(HTTP):
    1.13      _connection_class = HTTPUnixConnection
    1.14  
    1.15 -class UnixTransport(Transport):
    1.16 +class UnixTransport(xmlrpclib.Transport):
    1.17      def request(self, host, handler, request_body, verbose=0):
    1.18          self.__handler = handler
    1.19 -        return Transport.request(self, host, '/RPC2', request_body, verbose)
    1.20 +        return xmlrpclib.Transport.request(self, host, '/RPC2',
    1.21 +                                           request_body, verbose)
    1.22      def make_connection(self, host):
    1.23          return HTTPUnix(self.__handler)
    1.24  
    1.25 @@ -134,7 +134,7 @@ class TCPXMLRPCServer(SocketServer.Threa
    1.26      allow_reuse_address = True
    1.27  
    1.28      def __init__(self, addr, requestHandler=XMLRPCRequestHandler,
    1.29 -                 logRequests=1):
    1.30 +                 logRequests = 1):
    1.31          SimpleXMLRPCServer.__init__(self, addr, requestHandler, logRequests)
    1.32  
    1.33          flags = fcntl.fcntl(self.fileno(), fcntl.F_GETFD)
    1.34 @@ -201,7 +201,7 @@ class UnixXMLRPCRequestHandler(XMLRPCReq
    1.35  class UnixXMLRPCServer(TCPXMLRPCServer):
    1.36      address_family = socket.AF_UNIX
    1.37  
    1.38 -    def __init__(self, addr, logRequests):
    1.39 +    def __init__(self, addr, logRequests = 1):
    1.40          parent = os.path.dirname(addr)
    1.41          if os.path.exists(parent):
    1.42              os.chown(parent, os.geteuid(), os.getegid())