mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Redfish: Filter empty account slots from ListUsers (#6772)
* Redfish: Filter empty account slots from ListUsers Signed-off-by: Mike Raineri <michael.raineri@dell.com> * Update 6771-redfish-filter-empty-account-slots.yml * Update changelogs/fragments/6771-redfish-filter-empty-account-slots.yml Co-authored-by: Felix Fontein <felix@fontein.de> --------- Signed-off-by: Mike Raineri <michael.raineri@dell.com> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
22efbcc627
commit
93f5a48b8c
2 changed files with 8 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- redfish_info - fix ``ListUsers`` to not show empty account slots (https://github.com/ansible-collections/community.general/issues/6771, https://github.com/ansible-collections/community.general/pull/6772).
|
|
@ -1163,6 +1163,12 @@ class RedfishUtils(object):
|
|||
if property in data:
|
||||
user[property] = data[property]
|
||||
|
||||
# Filter out empty account slots
|
||||
# An empty account slot can be detected if the username is an empty
|
||||
# string and if the account is disabled
|
||||
if user.get('UserName', '') == '' and not user.get('Enabled', False):
|
||||
continue
|
||||
|
||||
users_results.append(user)
|
||||
result["entries"] = users_results
|
||||
return result
|
||||
|
|
Loading…
Reference in a new issue