mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
username doesn't necessarily need to be in slot 0
check for existence in whole array instead
This commit is contained in:
parent
8a12fbbce8
commit
6e510935c6
@ -227,7 +227,7 @@ def groups(username, **kwargs):
|
||||
else:
|
||||
return False
|
||||
for _, entry in search_results:
|
||||
if entry['memberUid'][0] == username:
|
||||
if username in entry['memberUid']:
|
||||
group_list.append(entry['cn'][0])
|
||||
log.debug('User {0} is a member of groups: {1}'.format(username, group_list))
|
||||
return group_list
|
||||
|
Loading…
Reference in New Issue
Block a user