diff --git a/pyghmi/ipmi/oem/lenovo/handler.py b/pyghmi/ipmi/oem/lenovo/handler.py index 840b2fb6..dece2a72 100755 --- a/pyghmi/ipmi/oem/lenovo/handler.py +++ b/pyghmi/ipmi/oem/lenovo/handler.py @@ -284,6 +284,8 @@ class OEMHandler(generic.OEMHandler): def reseat_bay(self, bay): if self.is_fpc: return self.smmhandler.reseat_bay(bay) + elif self.has_xcc and bay == -1: + return self.immhandler.reseat() return super(OEMHandler, self).reseat_bay(bay) def get_ntp_enabled(self): diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index 18be585e..b4b11f11 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -860,6 +860,13 @@ class XCCClient(IMMClient): super(XCCClient, self).__init__(ipmicmd) self.adp_referer = None + def reseat(self): + rsp = self.wc.grab_json_response_with_status( + '/api/providers/virt_reseat', '{}') + if rsp[1] != 200 or rsp[0].get('return', 1) != 0: + raise pygexc.UnsupportedFunctionality( + 'This platform does not support AC reseat.') + def get_description(self): dsc = self.wc.grab_json_response('/DeviceDescription.json') dsc = dsc[0]