2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-10-20 06:35:33 +00:00

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.
This commit is contained in:
Markus Hilger
2026-08-18 22:58:48 +02:00
parent 9228ef53de
commit 811d48ed42
2 changed files with 3 additions and 8 deletions
@@ -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'
@@ -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,