mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-27 05:43:09 +00:00
[PR #6772/93f5a48b backport][stable-6] Redfish: Filter empty account slots from ListUsers (#6793)
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>
(cherry picked from commit 93f5a48b8c)
Co-authored-by: Mike Raineri <mraineri@gmail.com>
This commit is contained in:
@@ -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).
|
||||
@@ -1079,6 +1079,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
|
||||
|
||||
Reference in New Issue
Block a user