summaryrefslogtreecommitdiffstats
path: root/lite-xmlrpc.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2008-10-23 11:00:50 -0400
committerRob Crittenden <rcritten@redhat.com>2008-10-23 11:00:50 -0400
commit06a82bf4b646cd077a43841abb5670d9a495b24c (patch)
tree3b205e58546590c402fea858db3ad4bea6e28ec1 /lite-xmlrpc.py
parentf8e8ac85036ad4100664de7b853c2bb58677088d (diff)
downloadfreeipa-06a82bf4b646cd077a43841abb5670d9a495b24c.tar.gz
freeipa-06a82bf4b646cd077a43841abb5670d9a495b24c.tar.xz
freeipa-06a82bf4b646cd077a43841abb5670d9a495b24c.zip
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
Diffstat (limited to 'lite-xmlrpc.py')
-rwxr-xr-xlite-xmlrpc.py8
1 files changed, 3 insertions, 5 deletions
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: