2
0
mirror of https://opendev.org/x/pyghmi synced 2025-04-13 16:57:46 +00:00

Restore support for old XCC update API

Oldest XCCs return different data to unsupported APIs, so
modify to support three variants, no return, return 2, and
the latest that require support for the return code.

Change-Id: I8d04cfffa42ff9b70bd4a19e32b353c0c7be5544
This commit is contained in:
Jarrod Johnson 2018-12-14 08:07:30 -05:00
parent db7f1490f5
commit ebf33d40bf

View File

@ -1444,7 +1444,7 @@ class XCCClient(IMMClient):
rsp = self.wc.grab_json_response(
'/api/providers/fwupdate',
json.dumps({'UPD_WebVerifyUploadFileStatus': 1}))
if rsp['return'] == 2:
if not rsp or rsp['return'] == 2:
# The XCC firmware predates the FileStatus api
break
if rsp['return'] != 0: