diff --git a/changelogs/fragments/7465-redfish-firmware-update-message-id-hardening.yml b/changelogs/fragments/7465-redfish-firmware-update-message-id-hardening.yml new file mode 100644 index 0000000000..01a98c2225 --- /dev/null +++ b/changelogs/fragments/7465-redfish-firmware-update-message-id-hardening.yml @@ -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). diff --git a/plugins/module_utils/redfish_utils.py b/plugins/module_utils/redfish_utils.py index 6c470c7da3..cea1fd1034 100644 --- a/plugins/module_utils/redfish_utils.py +++ b/plugins/module_utils/redfish_utils.py @@ -1658,7 +1658,10 @@ class RedfishUtils(object): # 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