2
0
mirror of https://opendev.org/x/pyghmi synced 2025-07-25 05:31:11 +00:00

Changing Lenovo custom get_leds method

Change-Id: I7b57649a40935aa9f525b972c37199b7f3920bb6
This commit is contained in:
Juliana Motira
2015-08-24 14:39:36 -03:00
parent 6ca968e6bb
commit 0fb56d6de9
2 changed files with 3 additions and 6 deletions

View File

@@ -537,8 +537,7 @@ class Command(object):
This provides a detailed view of the LEDs of the managed system.
"""
self.oem_init()
for leds in self._oem.get_leds():
yield leds
return self._oem.get_leds()
def get_health(self):
"""Summarize health of managed system

View File

@@ -237,16 +237,14 @@ class OEMHandler(generic.OEMHandler):
continue
def get_leds(self):
result_leds = {}
for (name, id_) in leds.items():
try:
rsp = self.ipmicmd.xraw_command(netfn=0x3A, command=0x02,
data=(id_,))
except pygexc.IpmiException:
continue # Ignore LEDs we can't retrieve
result_leds[name] = led_status.get(ord(rsp['data'][0]),
led_status_default)
yield ("leds", result_leds)
status = led_status.get(ord(rsp['data'][0]), led_status_default)
yield (name, {'status': status})
def process_fru(self, fru):
if fru is None: