HewlettPackard / python-redfish-utility

Python-based utility for interacting with devices supporting a Redfish Service
Other
86 stars 41 forks source link

Flashing v1 FWPKGs without `PLDMImage` results in KeyError #82

Closed moonrail closed 1 year ago

moonrail commented 1 year ago

Just as with #79:

This time its PLDMImage:

$ ilorest -v flashfwpkg ilo5_210.fwpkg
iLOrest : RESTful Interface Tool version 4.3.0.0
Copyright (c) 2014-2023 Hewlett Packard Enterprise Development LP
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ERROR: 'PLDMImage'
ILOREST return code: 255

Looks like it has been introduced with 4.3.0.0: https://github.com/HewlettPackard/python-redfish-utility/commit/892450faca3ab1d583add7ebe088d43bbe208cbd#diff-ed0f1d562ee67a6761395648311c4cc88c7d59b65cab0bccf04f9aa3600c05acR299

Hint: Using dict.get() will mitigate these reoccuring issues and be backwards compatible from the get go:

if firmwareimage.get('PLDMImage'):
    pldmflag = True
rajeevkallur commented 1 year ago

@moonrail , Thanks, Will be fixed in next release of ilorest

larsux commented 11 months ago

Hi @rajeevkallur, I just test the new Version, but it looks like the issue still exists:

# ilorest -v flashfwpkg ilo5_210.fwpkg
iLORest : RESTful Interface Tool version 4.5.0.0
Copyright (c) 2014-2023 Hewlett Packard Enterprise Development LP
-------
Local login initiated...
Discovering data...Done
ERROR: 'PLDMImage'
iLORest return code: 255

The erroneous line in the code seems untouched: https://github.com/HewlettPackard/python-redfish-utility/blob/33e5056cccfbcb0cad5ba18c0d6781cb75cea09b/src/extensions/iLO_REPOSITORY_COMMANDS/FwpkgCommand.py#L315