diff options
author | Elena Ezhova <eezhova@mirantis.com> | 2013-04-16 17:34:40 +0400 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2013-08-05 14:19:15 -0400 |
commit | 1289bbf12e8cf6e7792df0de44a3bc9bf6e9c505 (patch) | |
tree | 6ca35d7ec7f277ad6daedab37ac10a842bfc7275 /keystone/common/ldap/core.py | |
parent | ed1f9676d9e59022ecd9cd05e50b970d1b2930c8 (diff) | |
download | keystone-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/common/ldap/core.py')
-rw-r--r-- | keystone/common/ldap/core.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/keystone/common/ldap/core.py b/keystone/common/ldap/core.py index 7a2dfee7..71423064 100644 --- a/keystone/common/ldap/core.py +++ b/keystone/common/ldap/core.py @@ -114,7 +114,7 @@ class BaseLdap(object): notfound_arg = None options_name = None model = None - attribute_mapping = {} + attribute_options_names = {} attribute_ignore = [] tree_dn = None @@ -129,6 +129,7 @@ class BaseLdap(object): self.tls_cacertfile = conf.ldap.tls_cacertfile self.tls_cacertdir = conf.ldap.tls_cacertdir self.tls_req_cert = parse_tls_cert(conf.ldap.tls_req_cert) + self.attribute_mapping = {} if self.options_name is not None: self.suffix = conf.ldap.suffix @@ -145,6 +146,10 @@ class BaseLdap(object): self.object_class = (getattr(conf.ldap, objclass) or self.DEFAULT_OBJECTCLASS) + for k, v in self.attribute_options_names.iteritems(): + v = '%s_%s_attribute' % (self.options_name, v) + self.attribute_mapping[k] = getattr(conf.ldap, v) + attr_mapping_opt = ('%s_additional_attribute_mapping' % self.options_name) attr_mapping = (getattr(conf.ldap, attr_mapping_opt) |