From cfceabaf783f0a9980279b93f1353e3ea58b666e Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 24 Feb 2021 13:31:33 -0500 Subject: [PATCH] Fix error on long apply phase Some firmware takes a long time to apply. Add token refresh to avoid the session going bad during apply phase. Change-Id: I9b40cb608adc235d49865a94bf4aef98ca0ac1bc --- pyghmi/ipmi/oem/lenovo/imm.py | 1 + pyghmi/redfish/oem/lenovo/xcc.py | 1 + 2 files changed, 2 insertions(+) diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index 66be7b89..57414097 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -1928,6 +1928,7 @@ class XCCClient(IMMClient): raise Exception('Unexpected result starting update: %s' % errmsg) complete = False while not complete: + self._refresh_token() ipmisession.Session.pause(3) rsp = self.wc.grab_json_response( '/api/dataset/imm_firmware_progress') diff --git a/pyghmi/redfish/oem/lenovo/xcc.py b/pyghmi/redfish/oem/lenovo/xcc.py index d43795d9..6408d630 100644 --- a/pyghmi/redfish/oem/lenovo/xcc.py +++ b/pyghmi/redfish/oem/lenovo/xcc.py @@ -876,6 +876,7 @@ class OEMHandler(generic.OEMHandler): raise Exception('Unexpected result starting update: %s' % errmsg) complete = False while not complete: + self._refresh_token() time.sleep(3) rsp = self.wc.grab_json_response( '/api/dataset/imm_firmware_progress')