Skip to content

Commit

Permalink
Fix VerifyBiosAttributes command on Systems with multiple entries (#9234
Browse files Browse the repository at this point in the history
)

* 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 <[email protected]>

---------

Co-authored-by: Alexei Znamensky <[email protected]>
  • Loading branch information
sseekamp and russoz authored Dec 14, 2024
1 parent 88ea025 commit 34e8e8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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).
6 changes: 3 additions & 3 deletions plugins/module_utils/redfish_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3616,7 +3616,7 @@ def set_session_service(self, sessions_config):

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

Expand All @@ -3625,8 +3625,8 @@ def verify_bios_attributes(self, bios_attributes):

# 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})
Expand Down

0 comments on commit 34e8e8e

Please sign in to comment.