2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-14 11:48:33 +00:00

Handle firmware upload error 413

If software attempts to upload a file
larger than the XCC supports.  Report
a more understandable condition in
such a case.

Change-Id: I8b5a80c0be8fbca141bdce34d5da39095217b30b
This commit is contained in:
Jarrod Johnson 2019-02-26 16:07:17 -05:00
parent 7a195ddc2e
commit a1364d55a0

View File

@ -1455,6 +1455,8 @@ class XCCClient(IMMClient):
progress({'phase': 'upload',
'progress': 100.0 * rsp['received'] / rsp['size']})
elif rsp['state'] != 'done':
if rsp.get('status', None) == 413:
raise Exception('File is larger than supported')
raise Exception('Unexpected result:' + repr(rsp))
uploadstate = rsp['state']
self._refresh_token()