diff options
author | Rob Crittenden <rcritten@redhat.com> | 2008-10-14 17:46:36 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2008-10-14 21:28:06 -0400 |
commit | 1c3f81852cb8337e2305f968be5bd8165997d27e (patch) | |
tree | d46ece432b9912982ca909613857351dd28f8b13 /test_server | |
parent | ff88652a405c7fd9236a9b1d80dd8955a9ca056d (diff) | |
download | freeipa.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-x | test_server | 18 |
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) |