Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix VerifyBiosAttributes command on Systems with multiple entries #9234

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that when a user runs this command, they need to use resource_id to specify an exact system in a multi-system scenario? Did get_multi_bios_attributes ever work properly in the first place?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct (that was the case before my change as well):

msg: Issuing a data modification command without specifying the ID of the target System resource when there is more than one System is no longer allowed. Use the `resource_id` option to specify the target System ID.

That threw me off, but because everything in redfish_command uses data_modification=True:

resource_id=resource_id, data_modification=True, strip_etag_quotes=strip_etag_quotes,

it hits the gate:

elif len(self.systems_uris) > 1:
self.module.fail_json(msg=FAIL_MSG % {'resource': 'System'})

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, just checking. I don't think it was ever reasonable in the first place to have a "multi-system" BIOS check; I think it would be very likely there'd be differences. I prefer having this check a specific system.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed - I’m not sure of any system types where you’d have that, but I suppose it’s possible.

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
Loading