summaryrefslogtreecommitdiffstats
path: root/lite-xmlrpc.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-10-28 02:45:38 -0600
committerJason Gerard DeRose <jderose@redhat.com>2008-10-28 02:45:38 -0600
commitad60c94b5eadc797eb65de9059d557dbadc8ef71 (patch)
tree4f533f3508eec46b658d48dafd8bc249609dd30f /lite-xmlrpc.py
parent47c736a90b845e3e96d99b06fac19e410d64e76b (diff)
downloadfreeipa-ad60c94b5eadc797eb65de9059d557dbadc8ef71.tar.gz
freeipa-ad60c94b5eadc797eb65de9059d557dbadc8ef71.tar.xz
freeipa-ad60c94b5eadc797eb65de9059d557dbadc8ef71.zip
Cleaned up LoggingSimpleXMLRPCRequestHandler._dispatch() method
Diffstat (limited to 'lite-xmlrpc.py')
-rwxr-xr-xlite-xmlrpc.py33
1 files changed, 13 insertions, 20 deletions
diff --git a/lite-xmlrpc.py b/lite-xmlrpc.py
index 73c7e0287..6fbd76d81 100755
--- a/lite-xmlrpc.py
+++ b/lite-xmlrpc.py
@@ -61,31 +61,24 @@ class LoggingSimpleXMLRPCRequestHandler(SimpleXMLRPCServer.SimpleXMLRPCRequestHa
return (args, kw)
def _dispatch(self, method, params):
- """Dispatches the XML-RPC method.
+ """
+ Dispatches the XML-RPC method.
Methods beginning with an '_' are considered private and will
not be called.
"""
-
+ if method not in funcs:
+ logger.error('no such method %r', method)
+ raise Exception('method "%s" is not supported' % method)
+ func = funcs[method]
krbccache = krbV.default_context().default_ccache().name
-
- func = None
- try:
- try:
- # check to see if a matching function has been registered
- func = funcs[method]
- except KeyError:
- raise Exception('method "%s" is not supported' % method)
- (args, kw) = xmlrpc_unmarshal(*params)
- # FIXME: don't hardcode host and port
- context.conn = conn.IPAConn(api.env.ldaphost, api.env.ldapport, krbccache)
- logger.info("calling %s" % method)
- return func(*args, **kw)
- finally:
- # Clean up any per-request data and connections
-# for k in context.__dict__.keys():
-# del context.__dict__[k]
- pass
+ context.conn = conn.IPAConn(
+ api.env.ldap_host,
+ api.env.ldap_port,
+ krbccache,
+ )
+ logger.info('calling %s', method)
+ return func(*args, **kw)
def _marshaled_dispatch(self, data, dispatch_method = None):
try: