From 36404cc93457dad035f2742c520f40e0db4b7f76 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 28 Sep 2015 10:57:10 -0400 Subject: [PATCH] Fix attempt to get LED against System X The lenovo oem handler was erroneously unconditionally applying Thinkserver LED queries to system x. Correct by checking for a TSM prior to making the request. Change-Id: I202942743a1040516f80ea5a2655037d19a5c59a --- pyghmi/ipmi/oem/lenovo/handler.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pyghmi/ipmi/oem/lenovo/handler.py b/pyghmi/ipmi/oem/lenovo/handler.py index 1f305726..2e5af093 100755 --- a/pyghmi/ipmi/oem/lenovo/handler.py +++ b/pyghmi/ipmi/oem/lenovo/handler.py @@ -280,14 +280,16 @@ class OEMHandler(generic.OEMHandler): continue def get_leds(self): - 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 - status = led_status.get(ord(rsp['data'][0]), led_status_default) - yield (name, {'status': status}) + if self.has_tsm: + 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 + status = led_status.get(ord(rsp['data'][0]), + led_status_default) + yield (name, {'status': status}) def process_fru(self, fru): if fru is None: