diff --git a/pyghmi/ipmi/oem/lenovo/handler.py b/pyghmi/ipmi/oem/lenovo/handler.py index 56392b99..436c3d74 100755 --- a/pyghmi/ipmi/oem/lenovo/handler.py +++ b/pyghmi/ipmi/oem/lenovo/handler.py @@ -38,6 +38,7 @@ from pyghmi.ipmi.oem.lenovo import psu from pyghmi.ipmi.oem.lenovo import raid_controller from pyghmi.ipmi.oem.lenovo import raid_drive from pyghmi.redfish.oem.lenovo import tsma +import pyghmi.redfish.command as redfishcmd import pyghmi.util.webclient as wc @@ -161,10 +162,11 @@ class OEMHandler(generic.OEMHandler): conn = wc.SecureHTTPConnection(ipmicmd.bmc, 443, verifycallback=self.ipmicmd.certverify) #sysinfo, sysurl, webclient, cache=None): - self.tsmahandler = tsma.TsmHandler(None, None, conn) + self.tsmahandler = tsma.TsmHandler(None, None, conn, fish=redfishcmd) self.tsmahandler.set_credentials( ipmicmd.ipmi_session.userid.decode('utf-8'), ipmicmd.ipmi_session.password.decode('utf-8')) + self.tsmahandler.init_redfish() @property def _megarac_eth_index(self): @@ -976,6 +978,8 @@ class OEMHandler(generic.OEMHandler): def get_system_configuration(self, hideadvanced): if self.has_imm or self.has_xcc: return self.immhandler.get_system_configuration(hideadvanced) + if self.has_tsma: + return self.tsmahandler.get_uefi_configuration(hideadvanced) return super(OEMHandler, self).get_system_configuration(hideadvanced) def set_system_configuration(self, changeset): diff --git a/pyghmi/redfish/oem/lenovo/tsma.py b/pyghmi/redfish/oem/lenovo/tsma.py index dd98aefc..e3603ab7 100644 --- a/pyghmi/redfish/oem/lenovo/tsma.py +++ b/pyghmi/redfish/oem/lenovo/tsma.py @@ -67,7 +67,7 @@ def read_hpm(filename): class TsmHandler(generic.OEMHandler): - def __init__(self, sysinfo, sysurl, webclient, cache=None): + def __init__(self, sysinfo, sysurl, webclient, cache=None, fish=None): if cache is None: cache = {} self._wc = None @@ -75,10 +75,18 @@ class TsmHandler(generic.OEMHandler): self.password = None self._wc = None self.csrftok = None + self.fish = fish super(TsmHandler, self).__init__(sysinfo, sysurl, webclient, cache) self.tsm = webclient.thehost self._certverify = webclient._certverify + def get_uefi_configuration(self, hideadvanced=True): + return self.fishclient.get_system_configuration(hideadvanced) + + def init_redfish(self): + self.fishclient = self.fish.Command(self.tsm, self.username, self.password, + verifycallback=self._certverify) + def get_firmware_inventory(self, components, raisebypass=True): wc = self.wc fwinf = wc.grab_json_response('/api/DeviceVersion')