From b6776ce2eede695b2e4693018d4bd8bacf0d985b Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 9 Sep 2024 07:44:00 -0400 Subject: [PATCH] Rework get description to enable it to work fer XCC3 Change-Id: I3c1fdb74bd68571e81963037bc339bff8228ccea --- pyghmi/redfish/command.py | 2 +- pyghmi/redfish/oem/generic.py | 2 +- pyghmi/redfish/oem/lenovo/xcc.py | 2 +- pyghmi/redfish/oem/lenovo/xcc3.py | 6 ++++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pyghmi/redfish/command.py b/pyghmi/redfish/command.py index 4b39660d..4f197c1c 100644 --- a/pyghmi/redfish/command.py +++ b/pyghmi/redfish/command.py @@ -1078,7 +1078,7 @@ class Command(object): return self._oem def get_description(self): - return self.oem.get_description() + return self.oem.get_description(self) def get_event_log(self, clear=False): bmcinfo = self._do_web_request(self._bmcurl) diff --git a/pyghmi/redfish/oem/generic.py b/pyghmi/redfish/oem/generic.py index ac2993dd..70812cd0 100644 --- a/pyghmi/redfish/oem/generic.py +++ b/pyghmi/redfish/oem/generic.py @@ -519,7 +519,7 @@ class OEMHandler(object): def detach_remote_media(self): return None - def get_description(self): + def get_description(self, fishclient): return {} def get_firmware_inventory(self, components, fishclient): diff --git a/pyghmi/redfish/oem/lenovo/xcc.py b/pyghmi/redfish/oem/lenovo/xcc.py index dcf40073..584c44f7 100644 --- a/pyghmi/redfish/oem/lenovo/xcc.py +++ b/pyghmi/redfish/oem/lenovo/xcc.py @@ -579,7 +579,7 @@ class OEMHandler(generic.OEMHandler): summary['badreadings'] = fallbackdata return summary - def get_description(self): + def get_description(self, fishclient): description = self._do_web_request('/DeviceDescription.json') if description: description = description[0] diff --git a/pyghmi/redfish/oem/lenovo/xcc3.py b/pyghmi/redfish/oem/lenovo/xcc3.py index 8d760750..197451ed 100644 --- a/pyghmi/redfish/oem/lenovo/xcc3.py +++ b/pyghmi/redfish/oem/lenovo/xcc3.py @@ -4,6 +4,12 @@ import pyghmi.exceptions as pygexc class OEMHandler(generic.OEMHandler): + def get_description(self, fishclient): + bmcstgs = fishclient._do_web_request('/redfish/v1/Managers/1/Oem/Lenovo/BMCSettings') + heightu = bmcstgs.get('Attributes', {}).get('ServerConfigHeightU') + return {'height': heightu} + + def get_system_configuration(self, hideadvanced=True, fishclient=None): stgs = self._getsyscfg(fishclient)[0] outstgs = {}