From 34fe33163bd9c577a685c744a03414c78606d655 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 11:13:41 +0100 Subject: [PATCH] [PR #9234/34e8e8e5 backport][stable-9] Fix VerifyBiosAttributes command on Systems with multiple entries (#9248) Fix VerifyBiosAttributes command on Systems with multiple entries (#9234) * Fix verify_bios_attributes command * Add changelog fragment * Update changelogs/fragments/9234-fix-verify-bios-attributes-multi-system.yml Improve fragment Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --------- Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> (cherry picked from commit 34e8e8e5d18ab339556c922c28967d77faa0084c) Co-authored-by: Scott Seekamp --- .../9234-fix-verify-bios-attributes-multi-system.yml | 2 ++ plugins/module_utils/redfish_utils.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/9234-fix-verify-bios-attributes-multi-system.yml diff --git a/changelogs/fragments/9234-fix-verify-bios-attributes-multi-system.yml b/changelogs/fragments/9234-fix-verify-bios-attributes-multi-system.yml new file mode 100644 index 0000000000..95bafed8d8 --- /dev/null +++ b/changelogs/fragments/9234-fix-verify-bios-attributes-multi-system.yml @@ -0,0 +1,2 @@ +bugfixes: + - redfish_utils module utils - Fix ``VerifyBiosAttributes`` command on multi system resource nodes (https://github.com/ansible-collections/community.general/pull/9234). diff --git a/plugins/module_utils/redfish_utils.py b/plugins/module_utils/redfish_utils.py index 895ef15387..1836bfc7b7 100644 --- a/plugins/module_utils/redfish_utils.py +++ b/plugins/module_utils/redfish_utils.py @@ -3588,7 +3588,7 @@ class RedfishUtils(object): def verify_bios_attributes(self, bios_attributes): # This method verifies BIOS attributes against the provided input - server_bios = self.get_multi_bios_attributes() + server_bios = self.get_bios_attributes(self.systems_uri) if server_bios["ret"] is False: return server_bios @@ -3597,8 +3597,8 @@ class RedfishUtils(object): # Verify bios_attributes with BIOS settings available in the server for key, value in bios_attributes.items(): - if key in server_bios["entries"][0][1]: - if server_bios["entries"][0][1][key] != value: + if key in server_bios["entries"]: + if server_bios["entries"][key] != value: bios_dict.update({key: value}) else: wrong_param.update({key: value})