From 249ea5dda245e8703fabb55e0a3c85f500dc35e4 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 5 Jun 2015 13:55:30 -0400 Subject: [PATCH] Handle unknown entity ids Vendors can do other entitiy ids. Have a catch all that provides the raw value in case there is no better lookup for the number. Change-Id: I66a226e1b38f6b31b95bfe58e044875decae09a8 --- pyghmi/ipmi/sdr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyghmi/ipmi/sdr.py b/pyghmi/ipmi/sdr.py index bbbd06f2..d067bd35 100644 --- a/pyghmi/ipmi/sdr.py +++ b/pyghmi/ipmi/sdr.py @@ -318,7 +318,8 @@ class SDREntry(object): # this function handles the common aspects of compact and full # offsets from spec, minus 6 self.sensor_number = entry[2] - self.entity = ipmiconst.entity_ids[entry[3]] + self.entity = ipmiconst.entity_ids.get( + entry[3], 'Unknown entity {0}'.format(entry[3])) self.sensor_type_number = entry[7] try: self.sensor_type = ipmiconst.sensor_type_codes[entry[7]]