From 6c116dc7d7a0e2b4a075ff74abe1fdb9e611151d Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 23 Feb 2018 11:35:59 -0500 Subject: [PATCH] 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 --- pyghmi/ipmi/oem/lenovo/imm.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index dacea248..0daf70eb 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -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: