summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Lane <rlane@wikimedia.org>2011-01-24 19:07:12 +0000
committerRyan Lane <rlane@wikimedia.org>2011-01-24 19:07:12 +0000
commit70d97f5ca927dbf26e2d2590e54acce036b6179e (patch)
tree55fea38ff3a40d4db6a2de62f5f8f86da096388d
parent2e6a5713d86b487c0b26a72b111531781745aeb2 (diff)
Changes __dn_to_uid to return the uid attribute from the user's object.
-rw-r--r--nova/auth/ldapdriver.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/nova/auth/ldapdriver.py b/nova/auth/ldapdriver.py
index a6915ce03..db7b345d6 100644
--- a/nova/auth/ldapdriver.py
+++ b/nova/auth/ldapdriver.py
@@ -585,11 +585,11 @@ class LdapDriver(object):
else:
return None
- @staticmethod
- def __dn_to_uid(dn):
+ def __dn_to_uid(self,dn):
"""Convert user dn to uid"""
- return dn.split(',')[0].split('=')[1]
-
+ query = '(objectclass=novaUser)'
+ user = self.__find_object(dn,query)
+ return user[FLAGS.ldap_user_id_attribute][0]
class FakeLdapDriver(LdapDriver):
"""Fake Ldap Auth driver"""