1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

[PR #7471/ab0b85d7 backport][stable-7] Redfish: Updated message handling for update operations to skip message objects with missing MessageId properties (#7491)

Redfish: Updated message handling for update operations to skip message 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 <michael.raineri@dell.com>

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

---------

Signed-off-by: Mike Raineri <michael.raineri@dell.com>
(cherry picked from commit ab0b85d7d2)

Co-authored-by: Mike Raineri <mraineri@gmail.com>
This commit is contained in:
patchback[bot] 2023-11-06 06:25:12 +01:00 committed by GitHub
parent f0c5dd9cbc
commit ebf8d9cde1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -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).

View file

@ -1658,7 +1658,10 @@ class RedfishUtils(object):
# Scan the messages to see if next steps are needed # Scan the messages to see if next steps are needed
for message in operation_results['messages']: 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'): if message_id.startswith('Update.1.') and message_id.endswith('.OperationTransitionedToJob'):
# Operation rerouted to a job; update the status and handle # Operation rerouted to a job; update the status and handle