From e8f368d64892cafd96b4489e085bf20331e35ee0 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 14 Aug 2017 10:06:01 -0400 Subject: [PATCH] Implement state feedback on firmware update Provide a means to indicate through string return to show user what the next step should be. Change-Id: Id6b9c2bb6e6a46d6eb653622294ae93e858b8356 --- pyghmi/ipmi/command.py | 2 +- pyghmi/ipmi/oem/lenovo/handler.py | 4 ++-- pyghmi/ipmi/oem/lenovo/imm.py | 1 + pyghmi/ipmi/oem/lenovo/nextscale.py | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pyghmi/ipmi/command.py b/pyghmi/ipmi/command.py index 75a60dbc..db2c5e59 100644 --- a/pyghmi/ipmi/command.py +++ b/pyghmi/ipmi/command.py @@ -1779,7 +1779,7 @@ class Command(object): self.oem_init() if progress is None: progress = lambda x: True - self._oem.update_firmware(file, data, progress) + return self._oem.update_firmware(file, data, progress) def attach_remote_media(self, url, username=None, password=None): """Attach remote media by url diff --git a/pyghmi/ipmi/oem/lenovo/handler.py b/pyghmi/ipmi/oem/lenovo/handler.py index c809dff8..c4fc3abe 100755 --- a/pyghmi/ipmi/oem/lenovo/handler.py +++ b/pyghmi/ipmi/oem/lenovo/handler.py @@ -840,8 +840,8 @@ class OEMHandler(generic.OEMHandler): if self.is_fpc: return self.smmhandler.update_firmware( filename, data=data, progress=progress) - super(OEMHandler, self).update_firmware(filename, data=data, - progress=progress) + return super(OEMHandler, self).update_firmware(filename, data=data, + progress=progress) def detach_remote_media(self): if self.has_imm: diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index 15b98072..60077efa 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -630,3 +630,4 @@ class XCCClient(IMMClient): raise Exception( 'Unknown condition waiting for ' 'firmware update: ' + repr(rsp)) + return 'pending' diff --git a/pyghmi/ipmi/oem/lenovo/nextscale.py b/pyghmi/ipmi/oem/lenovo/nextscale.py index bdfeabb3..956ae86c 100644 --- a/pyghmi/ipmi/oem/lenovo/nextscale.py +++ b/pyghmi/ipmi/oem/lenovo/nextscale.py @@ -314,6 +314,7 @@ class SMMClient(object): progress({'phase': 'apply', 'progress': percent}) complete = percent >= 100.0 + return 'complete' def logout(self): self.wc.request('POST', '/data/logout', None)