2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-14 19:57:47 +00:00

Explicitly check RDOC list after add

On a broderline case, a file can be accepted for upload,
but denied on add, but not denied at add time, but after.
Retrieve the list after the fact to pick up on this situation.

Change-Id: I90656d70d7f0006a08c04d6f0686d65afaa65c2b
This commit is contained in:
Jarrod Johnson 2018-02-23 11:35:59 -05:00
parent 05b973dff0
commit 6c116dc7d7

View File

@ -1044,6 +1044,10 @@ class XCCClient(IMMClient):
addfile)
if rsp['return'] != 0:
raise Exception('Unrecognized return: ' + repr(rsp))
rsp = self.wc.grab_json_response('/api/providers/rp_rdoc_getfiles')
if 'items' not in rsp or len(rsp['items']) == 0:
raise Exception(
'Image upload was not accepted, it may be too large')
rsp = self.wc.grab_json_response('/api/providers/rp_rdoc_mountall',
{})
if rsp['return'] != 0: