From 06a82bf4b646cd077a43841abb5670d9a495b24c Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Thu, 23 Oct 2008 11:00:50 -0400 Subject: Fix ipa command running in server_context=True Make the LDAP host and port environment variables More changes so that commands have a shell return value lite-xmlrpc no longer hardcodes the kerberos credentials cache location --- lite-xmlrpc.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lite-xmlrpc.py') diff --git a/lite-xmlrpc.py b/lite-xmlrpc.py index 88ef1512e..7e9c69a83 100755 --- a/lite-xmlrpc.py +++ b/lite-xmlrpc.py @@ -37,6 +37,7 @@ from ipa_server.servercore import context import ipalib.load_plugins from ipalib.util import xmlrpc_unmarshal import traceback +import krbV PORT=8888 @@ -70,10 +71,7 @@ class LoggingSimpleXMLRPCRequestHandler(SimpleXMLRPCServer.SimpleXMLRPCRequestHa not be called. """ - # this is fine for our test server - # uid = commands.getoutput('/usr/bin/id -u') - uid = "500" - krbccache = "FILE:/tmp/krb5cc_" + uid + krbccache = krbV.default_context().default_ccache().name func = None try: @@ -84,7 +82,7 @@ class LoggingSimpleXMLRPCRequestHandler(SimpleXMLRPCServer.SimpleXMLRPCRequestHa raise Exception('method "%s" is not supported' % method) (args, kw) = xmlrpc_unmarshal(*params) # FIXME: don't hardcode host and port - context.conn = conn.IPAConn("localhost", 389, krbccache) + context.conn = conn.IPAConn(api.env.ldaphost, api.env.ldapport, krbccache) logger.info("calling %s" % method) return func(*args, **kw) finally: -- cgit