summaryrefslogtreecommitdiffstats
path: root/keystone/assignment
diff options
context:
space:
mode:
authorElena Ezhova <eezhova@mirantis.com>2013-04-16 17:34:40 +0400
committerAdam Young <ayoung@redhat.com>2013-08-05 14:19:15 -0400
commit1289bbf12e8cf6e7792df0de44a3bc9bf6e9c505 (patch)
tree6ca35d7ec7f277ad6daedab37ac10a842bfc7275 /keystone/assignment
parented1f9676d9e59022ecd9cd05e50b970d1b2930c8 (diff)
downloadkeystone-1289bbf12e8cf6e7792df0de44a3bc9bf6e9c505.tar.gz
keystone-1289bbf12e8cf6e7792df0de44a3bc9bf6e9c505.tar.xz
keystone-1289bbf12e8cf6e7792df0de44a3bc9bf6e9c505.zip
Abstract out attribute_mapping filling in LDAP driver.
bp refactor-ldap-driver Change-Id: I4b3bb2900b54f046b05d68f15fb6e35b324ca9f7
Diffstat (limited to 'keystone/assignment')
-rw-r--r--keystone/assignment/backends/ldap.py19
1 files changed, 5 insertions, 14 deletions
diff --git a/keystone/assignment/backends/ldap.py b/keystone/assignment/backends/ldap.py
index 9b273e40..34cd9c2f 100644
--- a/keystone/assignment/backends/ldap.py
+++ b/keystone/assignment/backends/ldap.py
@@ -267,20 +267,14 @@ class ProjectApi(common_ldap.EnabledEmuMixIn, common_ldap.BaseLdap):
NotFound = exception.ProjectNotFound
notfound_arg = 'project_id' # NOTE(yorik-sar): while options_name = tenant
options_name = 'tenant'
- attribute_mapping = {'name': 'ou',
- 'description': 'description',
- 'tenantId': 'cn',
- 'enabled': 'enabled',
- 'domain_id': 'domain_id'}
+ attribute_options_names = {'name': 'name',
+ 'description': 'desc',
+ 'enabled': 'enabled',
+ 'domain_id': 'domain_id'}
model = models.Project
def __init__(self, conf):
super(ProjectApi, self).__init__(conf)
- self.attribute_mapping['name'] = conf.ldap.tenant_name_attribute
- self.attribute_mapping['description'] = conf.ldap.tenant_desc_attribute
- self.attribute_mapping['enabled'] = conf.ldap.tenant_enabled_attribute
- self.attribute_mapping['domain_id'] = (
- conf.ldap.tenant_domain_id_attribute)
self.member_attribute = (getattr(conf.ldap, 'tenant_member_attribute')
or self.DEFAULT_MEMBER_ATTRIBUTE)
self.attribute_ignore = (getattr(conf.ldap, 'tenant_attribute_ignore')
@@ -384,14 +378,11 @@ class RoleApi(common_ldap.BaseLdap):
DEFAULT_ATTRIBUTE_IGNORE = []
NotFound = exception.RoleNotFound
options_name = 'role'
- attribute_mapping = {'name': 'ou',
- #'serviceId': 'service_id',
- }
+ attribute_options_names = {'name': 'name'}
model = models.Role
def __init__(self, conf):
super(RoleApi, self).__init__(conf)
- self.attribute_mapping['name'] = conf.ldap.role_name_attribute
self.member_attribute = (getattr(conf.ldap, 'role_member_attribute')
or self.DEFAULT_MEMBER_ATTRIBUTE)
self.attribute_ignore = (getattr(conf.ldap, 'role_attribute_ignore')