From 0fb56d6de9f2b1c45f8778ddd4b09cfcbd2e3ebe Mon Sep 17 00:00:00 2001 From: Juliana Motira Date: Mon, 24 Aug 2015 14:39:36 -0300 Subject: [PATCH] Changing Lenovo custom get_leds method Change-Id: I7b57649a40935aa9f525b972c37199b7f3920bb6 --- pyghmi/ipmi/command.py | 3 +-- pyghmi/ipmi/oem/lenovo/handler.py | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) 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: