2
0
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:
Jarrod Johnson
2017-10-25 09:24:35 -04:00
parent 30195bd316
commit 3d4cdb4bad
4 changed files with 25 additions and 0 deletions

View File

@@ -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)

View File

@@ -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 ()

View File

@@ -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)

View File

@@ -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(