From 53450e29f12a1c1e01c40e79ecdea1be3514b1bf Mon Sep 17 00:00:00 2001 From: Sahdev Zala Date: Wed, 20 Mar 2013 16:47:42 -0500 Subject: [PATCH] Enable emulation for domains Fixes bug #1157727 Change-Id: I3760469b8000cfc5fb461bb9ede5d0e140413dd7 --- keystone/common/config.py | 2 ++ keystone/identity/backends/ldap/core.py | 3 ++- tests/_ldap_livetest.py | 2 +- tests/backend_liveldap.conf | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/keystone/common/config.py b/keystone/common/config.py index e60385ccd0..68514d01c8 100644 --- a/keystone/common/config.py +++ b/keystone/common/config.py @@ -344,6 +344,8 @@ def configure(): register_bool('domain_allow_create', group='ldap', default=True) register_bool('domain_allow_update', group='ldap', default=True) register_bool('domain_allow_delete', group='ldap', default=True) + register_bool('domain_enabled_emulation', group='ldap', default=False) + register_str('domain_enabled_emulation_dn', group='ldap', default=None) # pam register_str('url', group='pam', default=None) diff --git a/keystone/identity/backends/ldap/core.py b/keystone/identity/backends/ldap/core.py index 1160ac6d28..7fae049780 100644 --- a/keystone/identity/backends/ldap/core.py +++ b/keystone/identity/backends/ldap/core.py @@ -928,7 +928,8 @@ class GroupApi(common_ldap.BaseLdap, ApiShimMixin): return users -class DomainApi(common_ldap.BaseLdap, ApiShimMixin): +class DomainApi(common_ldap.EnabledEmuMixIn, common_ldap.BaseLdap, + ApiShimMixin): DEFAULT_OU = 'ou=Domains' DEFAULT_STRUCTURAL_CLASSES = [] DEFAULT_OBJECTCLASS = 'groupOfNames' diff --git a/tests/_ldap_livetest.py b/tests/_ldap_livetest.py index d6a7a63d74..f35e0e8b11 100644 --- a/tests/_ldap_livetest.py +++ b/tests/_ldap_livetest.py @@ -69,7 +69,7 @@ class LiveLDAPIdentity(test_backend_ldap.LDAPIdentity): 'ou': 'Projects'}) create_object(CONF.ldap.domain_tree_dn, {'objectclass': 'organizationalUnit', - 'ou': 'Domain'}) + 'ou': 'Domains'}) create_object(CONF.ldap.group_tree_dn, {'objectclass': 'organizationalUnit', 'ou': 'UserGroups'}) diff --git a/tests/backend_liveldap.conf b/tests/backend_liveldap.conf index cdaaa608ce..abcd441d1e 100644 --- a/tests/backend_liveldap.conf +++ b/tests/backend_liveldap.conf @@ -10,6 +10,7 @@ domain_tree_dn = ou=Domains,dc=openstack,dc=org user_tree_dn = ou=Users,dc=openstack,dc=org tenant_enabled_emulation = True user_enabled_emulation = True +domain_enabled_emulation = True user_mail_attribute = mail use_dumb_member = True