mirror of
https://opendev.org/x/pyghmi
synced 2026-04-04 17:16:26 +00:00
Add blink support to Lenovo "IPMI" support
Hop over to redfish to implement blink support in the identify LED. Change-Id: I9f304c3a135b7b00c6e20167940f86f5f375b5ad
This commit is contained in:
@@ -551,7 +551,7 @@ class Command(object):
|
||||
return {'powerstate': self._get_power_state(
|
||||
bridge_request=bridge_request)}
|
||||
|
||||
def set_identify(self, on=True, duration=None):
|
||||
def set_identify(self, on=True, duration=None, blink=False):
|
||||
"""Request identify light
|
||||
|
||||
Request the identify light to turn off, on for a duration,
|
||||
@@ -563,10 +563,14 @@ class Command(object):
|
||||
"""
|
||||
self.oem_init()
|
||||
try:
|
||||
self._oem.set_identify(on, duration)
|
||||
self._oem.set_identify(on, duration, blink)
|
||||
return
|
||||
except exc.BypassGenericBehavior:
|
||||
return
|
||||
except exc.UnsupportedFunctionality:
|
||||
pass
|
||||
if blink:
|
||||
raise exc.IpmiException('Blink not supported with generic IPMI')
|
||||
if duration is not None:
|
||||
duration = int(duration)
|
||||
if duration > 255:
|
||||
|
||||
@@ -377,7 +377,7 @@ class OEMHandler(object):
|
||||
def list_media(self):
|
||||
raise exc.UnsupportedFunctionality()
|
||||
|
||||
def set_identify(self, on, duration):
|
||||
def set_identify(self, on, duration, blink):
|
||||
"""Provide an OEM override for set_identify
|
||||
|
||||
Some systems may require an override for set identify.
|
||||
|
||||
@@ -671,9 +671,11 @@ class OEMHandler(generic.OEMHandler):
|
||||
led_status_default)
|
||||
yield (name, {'status': status})
|
||||
|
||||
def set_identify(self, on, duration):
|
||||
def set_identify(self, on, duration, blink):
|
||||
if on and not duration and self.is_sd350:
|
||||
self.ipmicmd.xraw_command(netfn=0x3a, command=6, data=(1, 1))
|
||||
elif self.has_xcc:
|
||||
self.immhandler.set_identify(on, duration, blink)
|
||||
else:
|
||||
raise pygexc.UnsupportedFunctionality()
|
||||
|
||||
|
||||
@@ -968,6 +968,14 @@ class XCCClient(IMMClient):
|
||||
fru['manufacturer'] = memi['memory_manufacturer']
|
||||
break
|
||||
|
||||
def set_identify(self, on, duration, blink):
|
||||
if blink:
|
||||
self.grab_redfish_response_with_status(
|
||||
'/redfish/v1/Systems/1',
|
||||
{'IndicatorLED': 'Blinking'},
|
||||
method='PATCH')
|
||||
raise pygexc.BypassGenericBehavior()
|
||||
|
||||
def get_description(self):
|
||||
dsc = self.wc.grab_json_response('/DeviceDescription.json')
|
||||
dsc = dsc[0]
|
||||
|
||||
Reference in New Issue
Block a user