Do not assume users have names
This should be a safe assumption, but hughsaunders ran into a deployment
where a small subset of users (backed by AD) were configured with:
[ldap]
user_name_attribute = sAMAccountName
Where sAMAccountName happens to be an optional attribute in some LDAP
systems, resulting in those users not having "name" attributes available
via Keystone's API.
closes-bug: 1431942
Change-Id: Ic69e571c71fd462c65791800eaaa474917dec2ef
This commit is contained in:
committed by
Hugh Saunders
parent
af64fa9f1f
commit
903e7b3d0d
@@ -461,7 +461,7 @@ class ManageKeystone(object):
|
||||
:param name: ``str`` Name of the user.
|
||||
"""
|
||||
for entry in self.keystone.users.list():
|
||||
if entry.name == name:
|
||||
if getattr(entry, 'name', None) == name:
|
||||
return entry
|
||||
else:
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user