mirror of
https://opendev.org/x/pyghmi
synced 2025-08-15 23:50:19 +00:00
Provide reseat command
Some chassis managers implement a reseat function, provide access to this capability with a high level API. Change-Id: Ie7bbedc34236c95e43b790677b9e637cda893e0a
This commit is contained in:
@@ -250,6 +250,18 @@ class Command(object):
|
||||
'persistent': persistent,
|
||||
'uefimode': uefimode}
|
||||
|
||||
def reseat_bay(self, bay):
|
||||
"""Request the reseat of a bay
|
||||
|
||||
Request the enclosure manager to reseat the system in a particular
|
||||
bay.
|
||||
|
||||
:param bay: The bay identifier to reseat
|
||||
:return:
|
||||
"""
|
||||
self.oem_init()
|
||||
self._oem.reseat_bay(bay)
|
||||
|
||||
def set_power(self, powerstate, wait=False):
|
||||
"""Request power state change (helper)
|
||||
|
||||
|
@@ -202,6 +202,10 @@ class OEMHandler(object):
|
||||
raise exc.UnsupportedFunctionality(
|
||||
'Firmware update not supported on this platform')
|
||||
|
||||
def reseat_bay(self, bay):
|
||||
raise exc.UnsupportedFunctionality(
|
||||
'Bay reseat not supported on this platform')
|
||||
|
||||
def get_graphical_console(self):
|
||||
"""Get graphical console launcher"""
|
||||
return ()
|
||||
|
@@ -247,6 +247,11 @@ class OEMHandler(generic.OEMHandler):
|
||||
event['component_type_id'] == 13):
|
||||
event['component'] += ' {0}'.format(evdata[1] & 0b11111)
|
||||
|
||||
def reseat_bay(self, bay):
|
||||
if self.is_fpc:
|
||||
return self.smmhandler.reseat_bay(bay)
|
||||
return super(OEMHandler, self).reseat_bay(bay)
|
||||
|
||||
def get_ntp_enabled(self):
|
||||
if self.has_tsm:
|
||||
ntpres = self.ipmicmd.xraw_command(netfn=0x32, command=0xa7)
|
||||
|
@@ -240,6 +240,10 @@ class SMMClient(object):
|
||||
self.password = ipmicmd.ipmi_session.password
|
||||
self._wc = None
|
||||
|
||||
def reseat_bay(self, bay):
|
||||
self.ipmicmd.xraw_command(netfn=0x32, command=0xa4,
|
||||
data=[int(bay), 2])
|
||||
|
||||
def process_fru(self, fru):
|
||||
# TODO(jjohnson2): can also get EIOM, SMM, and riser data if warranted
|
||||
fru['Serial Number'] = self.ipmicmd.xraw_command(
|
||||
|
Reference in New Issue
Block a user