summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nova/auth/ldapdriver.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/nova/auth/ldapdriver.py b/nova/auth/ldapdriver.py
index 342fa40ac..e652f1caa 100644
--- a/nova/auth/ldapdriver.py
+++ b/nova/auth/ldapdriver.py
@@ -585,10 +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):