diff --git a/pyghmi/ipmi/oem/lenovo/handler.py b/pyghmi/ipmi/oem/lenovo/handler.py index 1020060d..d053c31f 100755 --- a/pyghmi/ipmi/oem/lenovo/handler.py +++ b/pyghmi/ipmi/oem/lenovo/handler.py @@ -366,6 +366,7 @@ class OEMHandler(generic.OEMHandler): self.oemid['product_id']) tsma_ids = ((19046, 32, 1287),) + @property def has_tsma(self): currid = (self.oemid['manufacturer_id'], self.oemid['device_id'], diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index 2978821f..6bd3034c 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -1647,10 +1647,14 @@ class XCCClient(IMMClient): if rsp.get('return', -1) != 0: errmsg = repr(rsp) if rsp else self.wc.lastjsonerror raise Exception('Unrecognized return: ' + errmsg) - 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') + ready = False + while not ready: + ipmisession.Session.pause(3) + 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') + ready = rsp['items'][0]['size'] != 0 self._refresh_token() rsp = self.wc.grab_json_response('/api/providers/rp_rdoc_mountall', {}) diff --git a/pyghmi/redfish/oem/lenovo/xcc.py b/pyghmi/redfish/oem/lenovo/xcc.py index 9b08a6bf..cd0c57d9 100644 --- a/pyghmi/redfish/oem/lenovo/xcc.py +++ b/pyghmi/redfish/oem/lenovo/xcc.py @@ -520,10 +520,14 @@ class OEMHandler(generic.OEMHandler): if rsp.get('return', -1) != 0: errmsg = repr(rsp) if rsp else self.wc.lastjsonerror raise Exception('Unrecognized return: ' + errmsg) - 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') + ready = False + while not ready: + time.sleep(3) + 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') + ready = rsp['items'][0]['size'] != 0 self._refresh_token() rsp = self.wc.grab_json_response('/api/providers/rp_rdoc_mountall', {})