Skip to content

Commit

Permalink
Redfish: Updated message handling for update operations to skip messa…
Browse files Browse the repository at this point in the history
…ge objects with missing MessageId properties (#7471)

* Redfish: Updated message handling for update operations to skip message objects with missing MessageId properties

Signed-off-by: Mike Raineri <[email protected]>

* Update 7465-redfish-firmware-update-message-id-hardening.yml

---------

Signed-off-by: Mike Raineri <[email protected]>
  • Loading branch information
mraineri authored Nov 6, 2023
1 parent 07a47c0 commit ab0b85d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- redfish_command - fix usage of message parsing in ``SimpleUpdate`` and ``MultipartHTTPPushUpdate`` commands to treat the lack of a ``MessageId`` as no message (https://github.com/ansible-collections/community.general/issues/7465, https://github.com/ansible-collections/community.general/pull/7471).
5 changes: 4 additions & 1 deletion plugins/module_utils/redfish_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1658,7 +1658,10 @@ def _operation_results(self, response, data, handle=None):

# Scan the messages to see if next steps are needed
for message in operation_results['messages']:
message_id = message['MessageId']
message_id = message.get('MessageId')
if message_id is None:
# While this is invalid, treat the lack of a MessageId as "no message"
continue

if message_id.startswith('Update.1.') and message_id.endswith('.OperationTransitionedToJob'):
# Operation rerouted to a job; update the status and handle
Expand Down

0 comments on commit ab0b85d

Please sign in to comment.