diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2009-01-22 15:41:54 -0700 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-02-03 15:29:01 -0500 |
commit | 24b6cb89d443384cb432f01265c45bc18d9cf2fc (patch) | |
tree | 50aa6e4b2ce4863d018644026c34085347263c74 /ipaserver/rpcserver.py | |
parent | 9f48612a56b6e760aa06a9af2071f1b50f413f27 (diff) | |
download | freeipa-24b6cb89d443384cb432f01265c45bc18d9cf2fc.tar.gz freeipa-24b6cb89d443384cb432f01265c45bc18d9cf2fc.tar.xz freeipa-24b6cb89d443384cb432f01265c45bc18d9cf2fc.zip |
Further migration toward new xmlrcp code; fixed problem with unicode Fault.faultString; fixed problem where ServerProxy method was not called correctly
Diffstat (limited to 'ipaserver/rpcserver.py')
-rw-r--r-- | ipaserver/rpcserver.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ipaserver/rpcserver.py b/ipaserver/rpcserver.py index 225173675..f5fb3c623 100644 --- a/ipaserver/rpcserver.py +++ b/ipaserver/rpcserver.py @@ -27,6 +27,7 @@ from xmlrpclib import Fault from ipalib import Backend from ipalib.errors2 import PublicError, InternalError, CommandError from ipalib.rpc import xml_dumps, xml_loads +from ipalib.util import make_repr def params_2_args_options(params): @@ -47,21 +48,26 @@ class xmlserver(Backend): self.debug('Received RPC call to %r', method) if method not in self.Command: raise CommandError(name=method) + self.info('params = %r', params) (args, options) = params_2_args_options(params) + self.info('args = %r', args) + self.info('options = %r', options) + self.debug(make_repr(method, *args, **options)) result = self.Command[method](*args, **options) return (result,) # Must wrap XML-RPC response in a tuple singleton - def execute(self, data, ccache=None, client_version=None, - client_ip=None, languages=None): + def execute(self, data): """ Execute the XML-RPC request in contained in ``data``. """ try: (params, method) = xml_loads(data) response = self.dispatch(method, params) + print 'okay' except Exception, e: if not isinstance(e, PublicError): e = InternalError() assert isinstance(e, PublicError) + self.debug('Returning %r exception', e.__class__.__name__) response = Fault(e.errno, e.strerror) - return dumps(response) + return xml_dumps(response, methodresponse=True) |