From 7d0bfd32ff1eb19782b9619b3eb33cfe246c0395 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 9 Sep 2022 13:22:27 -0400 Subject: [PATCH] Add reset to defaults to tsma Change-Id: I43834f8126e8e6f7e3bdb219dc299d6d597cfd64 --- pyghmi/ipmi/oem/lenovo/handler.py | 2 ++ pyghmi/redfish/oem/lenovo/tsma.py | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/pyghmi/ipmi/oem/lenovo/handler.py b/pyghmi/ipmi/oem/lenovo/handler.py index 1a20e5b2..dc5a025d 100755 --- a/pyghmi/ipmi/oem/lenovo/handler.py +++ b/pyghmi/ipmi/oem/lenovo/handler.py @@ -1233,6 +1233,8 @@ class OEMHandler(generic.OEMHandler): return self.immhandler.clear_bmc_configuration() elif self.is_fpc: return self.smmhandler.clear_bmc_configuration() + elif self.has_tsma: + return self.tsmahandler.clear_bmc_configuration() return super(OEMHandler, self).clear_system_configuration() def clear_system_configuration(self): diff --git a/pyghmi/redfish/oem/lenovo/tsma.py b/pyghmi/redfish/oem/lenovo/tsma.py index e607a2cb..b82dd1c5 100644 --- a/pyghmi/redfish/oem/lenovo/tsma.py +++ b/pyghmi/redfish/oem/lenovo/tsma.py @@ -114,6 +114,27 @@ class TsmHandler(generic.OEMHandler): self.tsm = webclient.thehost self._certverify = webclient._certverify + def clear_bmc_configuration(self): + wc = self.wc + rsp, status = wc.grab_json_response_with_status( + '/api/maintenance/restore_defaults', + {"id": 1, + "sdr": 0, + "fru": 1, + "sel": 1, + "ipmi": 1, + "network": 1, + "ntp": 1, + "snmp": 1, + "ssh": 1, + "kvm": 1, + "authentication": 1, + "syslog": 0, + "web": 1, + "extlog": 0, + "redfish": 1}, + method='PUT') + def get_bmc_configuration(self): wc = self.wc rsp, status = wc.grab_json_response_with_status(