diff --git a/pyghmi/ipmi/command.py b/pyghmi/ipmi/command.py index 5562524e..568b9a04 100644 --- a/pyghmi/ipmi/command.py +++ b/pyghmi/ipmi/command.py @@ -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 diff --git a/pyghmi/ipmi/oem/lenovo/handler.py b/pyghmi/ipmi/oem/lenovo/handler.py index 44233ab7..708f3c2d 100755 --- a/pyghmi/ipmi/oem/lenovo/handler.py +++ b/pyghmi/ipmi/oem/lenovo/handler.py @@ -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: