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,