Migrate to new source tree layoute

This commit is contained in:
Rob Crittenden 2008-09-30 00:48:53 -04:00 committed by Jason Gerard DeRose
parent b965e558b5
commit 77e6c99f9d
6 changed files with 50 additions and 18 deletions

View File

@ -18,12 +18,9 @@
#
import krbV
import threading
import ldap
import ldap.dn
from ipalib import ipaldap
context = threading.local()
import ipaldap
class IPAConn:
def __init__(self, host, port, krbccache, debug=None):

29
ipa_server/context.py Normal file
View File

@ -0,0 +1,29 @@
# Authors: Rob Crittenden <rcritten@redhat.com>
#
# Copyright (C) 2008 Red Hat
# see file 'COPYING' for use and warranty information
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; version 2 only
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# This should only be imported once. Importing again will cause the
# a new instance to be created in the same thread
# To use:
# from ipa_server.context import context
# context.foo = "bar"
import threading
context = threading.local()

View File

@ -21,8 +21,8 @@ import sys
sys.path.insert(0, ".")
sys.path.insert(0, "..")
import ldap
from ipalib.conn import context
from ipalib import ipautil
from ipa_server.context import context
import ipautil
# temporary
import krbV

View File

@ -1,7 +1,16 @@
#!/usr/bin/python
import xmlrpclib
def user_find(uid):
try:
args=uid
result = server.user_find(args)
print "returned %s" % result
except xmlrpclib.Fault, e:
print e.faultString
# main
server = xmlrpclib.ServerProxy("http://localhost:8888/")
print server.system.listMethods()
@ -15,9 +24,5 @@ try:
except xmlrpclib.Fault, e:
print e.faultString
try:
args="admin"
result = server.user_find(args)
print "returned %s" % result
except xmlrpclib.Fault, e:
print e.faultString
user_find("admin")
user_find("notfound")

View File

@ -9,8 +9,9 @@ import xmlrpclib
import re
import threading
import commands
from ipalib import api, conn
from ipalib.conn import context
from ipalib import api
import conn
from ipa_server.servercore import context
import ipalib.load_plugins
import traceback
@ -66,8 +67,9 @@ class LoggingSimpleXMLRPCRequestHandler(SimpleXMLRPCServer.SimpleXMLRPCRequestHa
return func(*params)
finally:
# Clean up any per-request data and connections
for k in context.__dict__.keys():
del context.__dict__[k]
# for k in context.__dict__.keys():
# del context.__dict__[k]
pass
def _marshaled_dispatch(self, data, dispatch_method = None):
try:

View File

@ -21,12 +21,11 @@
Some example plugins.
"""
from ipalib import frontend
from ipalib import crud
from ipalib.frontend import Param
from ipalib import api
from ipalib import servercore
from ipa_server import servercore
import ldap
class user(frontend.Object):