1
0
Fork 0
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:
Mike Raineri 2023-06-26 17:29:51 -04:00 committed by GitHub
parent 22efbcc627
commit 93f5a48b8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

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

View file

@ -1163,6 +1163,12 @@ class RedfishUtils(object):
if property in data: if property in data:
user[property] = data[property] 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) users_results.append(user)
result["entries"] = users_results result["entries"] = users_results
return result return result