summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2015-06-22 09:59:33 +0000
committerJan Cholasta <jcholast@redhat.com>2015-07-01 13:05:30 +0000
commitfe2accf77663693628835d7063da7d871b1ad268 (patch)
tree95a5aaf3254edd12e305d2a1548f7c0a80ca72d2
parentf87ba5ee080ebf24d2420d105aa4026e844439db (diff)
downloadfreeipa-fe2accf77663693628835d7063da7d871b1ad268.zip
freeipa-fe2accf77663693628835d7063da7d871b1ad268.tar.gz
freeipa-fe2accf77663693628835d7063da7d871b1ad268.tar.xz
ipalib: Load ipaserver plugins when api.env.in_server is True
https://fedorahosted.org/freeipa/ticket/3090 https://fedorahosted.org/freeipa/ticket/5073 Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
-rwxr-xr-xdaemons/dnssec/ipa-dnskeysyncd1
-rwxr-xr-xinstall/tools/ipa-replica-manage1
-rw-r--r--ipalib/__init__.py2
-rw-r--r--ipalib/plugins/baseuser.py2
-rw-r--r--ipalib/plugins/stageuser.py2
-rw-r--r--ipalib/plugins/user.py2
-rw-r--r--ipapython/dnssec/ldapkeydb.py1
-rw-r--r--ipaserver/dcerpc.py1
-rw-r--r--ipaserver/install/bindinstance.py1
-rw-r--r--ipaserver/install/ipa_server_certinstall.py2
-rw-r--r--ipaserver/install/ipa_server_upgrade.py1
-rw-r--r--ipaserver/install/ldapupdate.py1
-rw-r--r--ipaserver/install/plugins/update_managed_permissions.py1
-rw-r--r--ipaserver/install/server/install.py3
-rw-r--r--ipaserver/rpcserver.py6
-rwxr-xr-xmakeaci1
16 files changed, 8 insertions, 20 deletions
diff --git a/daemons/dnssec/ipa-dnskeysyncd b/daemons/dnssec/ipa-dnskeysyncd
index 7213168..a0fcf8b 100755
--- a/daemons/dnssec/ipa-dnskeysyncd
+++ b/daemons/dnssec/ipa-dnskeysyncd
@@ -17,7 +17,6 @@ from ipapython.dn import DN
from ipapython.ipa_log_manager import root_logger, standard_logging_setup
from ipapython import ipaldap
from ipapython import ipautil
-from ipaserver.plugins.ldap2 import ldap2
from ipaplatform.paths import paths
from ipapython.dnssec.keysyncer import KeySyncer
diff --git a/install/tools/ipa-replica-manage b/install/tools/ipa-replica-manage
index 71eb992..2239eb0 100755
--- a/install/tools/ipa-replica-manage
+++ b/install/tools/ipa-replica-manage
@@ -31,7 +31,6 @@ from ipapython import ipautil
from ipaserver.install import replication, dsinstance, installutils
from ipaserver.install import bindinstance, cainstance, certs
from ipaserver.install import opendnssecinstance, dnskeysyncinstance
-from ipaserver.plugins import ldap2
from ipapython import version, ipaldap
from ipalib import api, errors, util
from ipalib.constants import CACERT
diff --git a/ipalib/__init__.py b/ipalib/__init__.py
index 0b58790..cc14925 100644
--- a/ipalib/__init__.py
+++ b/ipalib/__init__.py
@@ -905,7 +905,7 @@ class API(plugable.API):
def bootstrap(self, parser=None, **overrides):
super(API, self).bootstrap(parser, **overrides)
- if self.env.context in ('server', 'lite'):
+ if self.env.in_server:
self.packages.append('ipaserver')
if self.env.context in ('installer', 'updates'):
self.packages.append('ipaserver/install/plugins')
diff --git a/ipalib/plugins/baseuser.py b/ipalib/plugins/baseuser.py
index d2bc68f..9068ef0 100644
--- a/ipalib/plugins/baseuser.py
+++ b/ipalib/plugins/baseuser.py
@@ -38,8 +38,6 @@ from ipapython.ipavalidate import Email
from ipalib.capabilities import client_has_capability
from ipalib.util import (normalize_sshpubkey, validate_sshpubkey,
convert_sshpubkey_post)
-if api.env.in_server and api.env.context in ['lite', 'server']:
- from ipaserver.plugins.ldap2 import ldap2
__doc__ = _("""
Baseuser
diff --git a/ipalib/plugins/stageuser.py b/ipalib/plugins/stageuser.py
index 7c714f6..01c01ce 100644
--- a/ipalib/plugins/stageuser.py
+++ b/ipalib/plugins/stageuser.py
@@ -42,8 +42,6 @@ from ipapython.ipavalidate import Email
from ipalib.capabilities import client_has_capability
from ipalib.util import (normalize_sshpubkey, validate_sshpubkey,
convert_sshpubkey_post)
-if api.env.in_server and api.env.context in ['lite', 'server']:
- from ipaserver.plugins.ldap2 import ldap2
__doc__ = _("""
Stageusers
diff --git a/ipalib/plugins/user.py b/ipalib/plugins/user.py
index 0b90519..96de65a 100644
--- a/ipalib/plugins/user.py
+++ b/ipalib/plugins/user.py
@@ -44,7 +44,7 @@ from ipapython.ipavalidate import Email
from ipalib.capabilities import client_has_capability
from ipalib.util import (normalize_sshpubkey, validate_sshpubkey,
convert_sshpubkey_post)
-if api.env.in_server and api.env.context in ['lite', 'server']:
+if api.env.in_server:
from ipaserver.plugins.ldap2 import ldap2
__doc__ = _("""
diff --git a/ipapython/dnssec/ldapkeydb.py b/ipapython/dnssec/ldapkeydb.py
index 520b510..23e6b01 100644
--- a/ipapython/dnssec/ldapkeydb.py
+++ b/ipapython/dnssec/ldapkeydb.py
@@ -11,7 +11,6 @@ import ipalib
from ipapython.dn import DN
from ipapython import ipaldap
from ipapython import ipautil
-from ipaserver.plugins.ldap2 import ldap2
from ipaplatform.paths import paths
from abshsm import attrs_name2id, attrs_id2name, bool_attr_names, populate_pkcs11_metadata, AbstractHSM
diff --git a/ipaserver/dcerpc.py b/ipaserver/dcerpc.py
index a1c57d2..ee92664 100644
--- a/ipaserver/dcerpc.py
+++ b/ipaserver/dcerpc.py
@@ -31,7 +31,6 @@ from ipapython import ipautil
from ipapython.ipa_log_manager import *
from ipapython.dn import DN
from ipaserver.install import installutils
-from ipaserver.plugins import ldap2
from ipalib.util import normalize_name
import os, string, struct, copy
diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py
index 77ff342..102a8e5 100644
--- a/ipaserver/install/bindinstance.py
+++ b/ipaserver/install/bindinstance.py
@@ -29,7 +29,6 @@ import ldap
import installutils
import service
-from ipaserver.plugins import ldap2
from ipaserver.install.cainstance import IPA_CA_RECORD
from ipapython import sysrestore, ipautil, ipaldap
from ipapython.ipa_log_manager import *
diff --git a/ipaserver/install/ipa_server_certinstall.py b/ipaserver/install/ipa_server_certinstall.py
index 9e24c4c..2e3e34a 100644
--- a/ipaserver/install/ipa_server_certinstall.py
+++ b/ipaserver/install/ipa_server_certinstall.py
@@ -31,7 +31,7 @@ from ipapython.ipautil import user_input, write_tmp_file
from ipalib import api, errors
from ipalib.constants import CACERT
from ipaserver.install import certs, dsinstance, httpinstance, installutils
-from ipaserver.plugins.ldap2 import ldap2
+
class ServerCertInstall(admintool.AdminTool):
command_name = 'ipa-server-certinstall'
diff --git a/ipaserver/install/ipa_server_upgrade.py b/ipaserver/install/ipa_server_upgrade.py
index 8373b21..d0a839d 100644
--- a/ipaserver/install/ipa_server_upgrade.py
+++ b/ipaserver/install/ipa_server_upgrade.py
@@ -41,7 +41,6 @@ class ServerUpgrade(admintool.AdminTool):
super(ServerUpgrade, self).run()
api.bootstrap(in_server=True, context='updates')
- import ipaserver.plugins.dogtag # ensure profile backend gets loaded
api.finalize()
try:
diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py
index f30659f..848ff1d 100644
--- a/ipaserver/install/ldapupdate.py
+++ b/ipaserver/install/ldapupdate.py
@@ -45,7 +45,6 @@ from ipaplatform import services
from ipapython.dn import DN
from ipapython.ipa_log_manager import *
from ipapython.ipautil import wait_for_open_socket
-from ipaserver.plugins import ldap2
UPDATES_DIR=paths.UPDATES_DIR
diff --git a/ipaserver/install/plugins/update_managed_permissions.py b/ipaserver/install/plugins/update_managed_permissions.py
index 11765fb..a2f289f 100644
--- a/ipaserver/install/plugins/update_managed_permissions.py
+++ b/ipaserver/install/plugins/update_managed_permissions.py
@@ -91,7 +91,6 @@ from ipalib.plugins.permission import permission, permission_del
from ipalib.aci import ACI
from ipalib import Updater
from ipapython import ipautil
-from ipaserver.plugins.ldap2 import ldap2
register = Registry()
diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py
index bde3485..2c5183b 100644
--- a/ipaserver/install/server/install.py
+++ b/ipaserver/install/server/install.py
@@ -592,9 +592,6 @@ def install_check(installer):
api.env.ca_host = host_name
api.bootstrap(**cfg)
- if setup_ca:
- # ensure profile backend is available
- import ipaserver.plugins.dogtag
api.finalize()
if setup_ca:
diff --git a/ipaserver/rpcserver.py b/ipaserver/rpcserver.py
index 5158c42..43ee63e 100644
--- a/ipaserver/rpcserver.py
+++ b/ipaserver/rpcserver.py
@@ -748,7 +748,8 @@ class jsonserver_session(jsonserver, KerberosSession):
def __init__(self):
super(jsonserver_session, self).__init__()
- auth_mgr = AuthManagerKerb(self.__class__.__name__)
+ name = '{0}_{1}'.format(self.__class__.__name__, id(self))
+ auth_mgr = AuthManagerKerb(name)
session_mgr.auth_mgr.register(auth_mgr.name, auth_mgr)
def _on_finalize(self):
@@ -1200,7 +1201,8 @@ class xmlserver_session(xmlserver, KerberosSession):
def __init__(self):
super(xmlserver_session, self).__init__()
- auth_mgr = AuthManagerKerb(self.__class__.__name__)
+ name = '{0}_{1}'.format(self.__class__.__name__, id(self))
+ auth_mgr = AuthManagerKerb(name)
session_mgr.auth_mgr.register(auth_mgr.name, auth_mgr)
def _on_finalize(self):
diff --git a/makeaci b/makeaci
index ab65a99..5c441c0 100755
--- a/makeaci
+++ b/makeaci
@@ -95,6 +95,7 @@ def main(options):
basedn=DN('dc=ipa,dc=example'),
realm='IPA.EXAMPLE',
)
+ from ipaserver.plugins import ldap2
from ipaserver.install.plugins.update_managed_permissions import (
update_managed_permissions)
from ipalib.plugins.permission import permission