Fixes project and role checking when a user's naming attribute is not uid.

This commit is contained in:
Ryan Lane
2011-01-25 19:17:01 +00:00
committed by Tarmac

View File

@@ -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):