Fixed bug I introduced in KerbTransport; started work on lite-xmlrpc.py to add client address to context

This commit is contained in:
Jason Gerard DeRose 2009-01-28 18:16:04 -07:00 committed by Rob Crittenden
parent 83045f0ac8
commit 77e782e2cb
2 changed files with 16 additions and 5 deletions

View File

@ -198,7 +198,7 @@ class KerbTransport(SafeTransport):
else:
raise e
extra_headers += [
extra_headers = [
('Authorization', 'negotiate %s' % kerberos.authGSSClientResponse(vc))
]
@ -240,7 +240,7 @@ class xmlclient(Connectible):
raise ValueError(
'%s.forward(): %r not in api.Command' % (self.name, name)
)
self.info('Forwarding %r to %r', name, self.env.xmlrpc_uri)
self.info('Forwarding %r to server %r', name, self.env.xmlrpc_uri)
command = getattr(self.conn, name)
params = args + (kw,)
try:

View File

@ -24,7 +24,7 @@ In-tree XML-RPC server using SimpleXMLRPCServer.
"""
import sys
from SimpleXMLRPCServer import SimpleXMLRPCServer
from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
import krbV
from ipalib import api
@ -54,14 +54,25 @@ class Server(SimpleXMLRPCServer):
ccache=krbV.default_context().default_ccache().name
return api.Backend.xmlserver.marshaled_dispatch(data, ccache)
except Exception, e:
api.log.exception('Error caught by lite-xmlrpc.py...')
api.log.exception('lite-xmlrpc: caught error in _marshaled_dispatch()')
raise e
class RequestHandler(SimpleXMLRPCRequestHandler):
def do_POST(self):
try:
client = '%r %r' % self.client_address
except Exception, e:
api.log.exception('lite-xmlrpc: caught error in do_POST()')
raise e
return SimpleXMLRPCRequestHandler.do_POST(self)
api.bootstrap_with_global_options(context='server')
api.finalize()
kw = dict(logRequests=False)
kw = dict(requestHandler=RequestHandler, logRequests=False)
if sys.version_info[:2] != (2, 4):
kw.update(dict(encoding='UTF-8', allow_none=True))
server = Server(('', api.env.lite_xmlrpc_port), **kw)