2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-02 07:26:04 +00:00

Say what is wrong with an unusable parameter file

A parameter file that is not json, or that holds something other than an
object, reached the update as a raw parser message or as a TypeError from the
handler that unpacked it.
This commit is contained in:
Markus Hilger
2026-08-14 22:31:21 +02:00
parent 264576bddd
commit 9755c8b0a8
@@ -513,7 +513,14 @@ class IpmiHandler:
if self.inputdata.parameterdata:
params = self.inputdata.parameterdata
if params and isinstance(params, str):
params = json.loads(params)
try:
params = json.loads(params)
except ValueError as ve:
raise pygexc.InvalidParameterValue(
'The parameter file is not valid json: {0}'.format(ve))
if params and not isinstance(params, dict):
raise pygexc.InvalidParameterValue(
'The parameter file must hold a json object, see nodefirmware(8)')
return await self.ipmicmd.update_firmware(filename, progress=progress, data=data, bank=bank, otherfields=params)
async def handle_update(self):