From 811d48ed4252417cedc75389a118cfa71783a1a9 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Tue, 18 Aug 2026 22:58:48 +0200 Subject: [PATCH] Ask only MegaRAC for the parameters part it insists on Generic added an UpdateParameters part to every multipart firmware push, because the specification has one carried. Only the AMI firmware was seen to insist on it, so name it in that handler and let generic send what the caller passed. --- confluent_server/aiohmi/redfish/oem/ami/megarac.py | 3 +++ confluent_server/aiohmi/redfish/oem/generic.py | 8 -------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/confluent_server/aiohmi/redfish/oem/ami/megarac.py b/confluent_server/aiohmi/redfish/oem/ami/megarac.py index 4a640296..1c458a49 100644 --- a/confluent_server/aiohmi/redfish/oem/ami/megarac.py +++ b/confluent_server/aiohmi/redfish/oem/ami/megarac.py @@ -160,6 +160,9 @@ class OEMHandler(generic.OEMHandler): oemparams.get('ImageType', None), filename) oemparams['ImageType'] = imagetype otherfields['OemParameters'] = oemparams + # This firmware rejects a multipart push carrying the image alone. + # Empty Targets means "whatever this image is for". + otherfields.setdefault('UpdateParameters', {'Targets': []}) # Updating the bmc takes the bmc away mid flight, which is expected # rather than a failure to watch the update self._updateresetsbmc = imagetype == 'BMC' diff --git a/confluent_server/aiohmi/redfish/oem/generic.py b/confluent_server/aiohmi/redfish/oem/generic.py index 279c30d1..cca612a2 100644 --- a/confluent_server/aiohmi/redfish/oem/generic.py +++ b/confluent_server/aiohmi/redfish/oem/generic.py @@ -1548,14 +1548,6 @@ class OEMHandler(object): async def update_firmware(self, filename, data=None, progress=None, bank=None, otherfields=()): # disable cache to make sure we trigger the token renewal logic if needed usd, upurl, ismultipart = await self.retrieve_firmware_upload_url() - if ismultipart: - # A multipart push has to carry an UpdateParameters part beside the - # image, and implementations are entitled to reject the request - # when it is missing. Targets empty means "whatever this image is - # for", and OperationApplyTime is left out because it is optional - # and some implementations refuse the ones they do not implement. - otherfields = dict(otherfields) if otherfields else {} - otherfields.setdefault('UpdateParameters', {'Targets': []}) try: uploadthread = await webclient.make_uploader( self.webclient, upurl, filename, data, formname='UpdateFile', formwrap=ismultipart,