summaryrefslogtreecommitdiffstats
path: root/test_server
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2008-10-14 17:46:36 -0400
committerRob Crittenden <rcritten@redhat.com>2008-10-14 21:28:06 -0400
commit1c3f81852cb8337e2305f968be5bd8165997d27e (patch)
treed46ece432b9912982ca909613857351dd28f8b13 /test_server
parentff88652a405c7fd9236a9b1d80dd8955a9ca056d (diff)
downloadfreeipa.git-1c3f81852cb8337e2305f968be5bd8165997d27e.tar.gz
freeipa.git-1c3f81852cb8337e2305f968be5bd8165997d27e.tar.xz
freeipa.git-1c3f81852cb8337e2305f968be5bd8165997d27e.zip
Move some functionality from user-add to the backend ldap create function
Diffstat (limited to 'test_server')
-rwxr-xr-xtest_server18
1 files changed, 13 insertions, 5 deletions
diff --git a/test_server b/test_server
index d26fd596..d58d00af 100755
--- a/test_server
+++ b/test_server
@@ -8,6 +8,7 @@ import re
import threading
import commands
from ipalib import api
+from ipalib import config
from ipa_server import conn
from ipa_server.servercore import context
import ipalib.load_plugins
@@ -46,19 +47,21 @@ class LoggingSimpleXMLRPCRequestHandler(SimpleXMLRPCServer.SimpleXMLRPCRequestHa
"""
# this is fine for our test server
- uid = commands.getoutput('/usr/bin/id -u')
+ # uid = commands.getoutput('/usr/bin/id -u')
+ uid = "500"
krbccache = "FILE:/tmp/krb5cc_" + uid
func = None
try:
- # FIXME: don't hardcode host and port
- context.conn = conn.IPAConn("localhost", 389, krbccache)
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("localhost", 389, krbccache)
+ logger.info("calling %s" % method)
return func(*args, **kw)
finally:
# Clean up any per-request data and connections
@@ -140,9 +143,14 @@ XMLRPCServer = StoppableXMLRPCServer(("",PORT), LoggingSimpleXMLRPCRequestHandle
XMLRPCServer.register_introspection_functions()
-# Get and register all the methods
-api.env.server_context = True
api.finalize()
+
+# Initialize our environment
+env_dict = config.read_config()
+env_dict['server_context'] = True
+api.env.update(config.generate_env(env_dict))
+
+# Get and register all the methods
for cmd in api.Command:
logger.info("registering %s" % cmd)
XMLRPCServer.register_function(api.Command[cmd], cmd)