From dd1dfdb7d5bc57c22fa27156528e1880a9892179 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 29 Aug 2018 09:07:00 -0400 Subject: [PATCH] Fix bay number from IMM property in nextscale chassis The property is ASCII representation of decimal number that would result from erroneously evaluating BCD as normal. Compensate by working back to the hexadecimal representation and presenting that as a number. Change-Id: I47ae2fe484c2eaaa4c103eae81c56f9561ac316c --- pyghmi/ipmi/oem/lenovo/imm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index 23755f8a..6fcda973 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -533,7 +533,8 @@ class IMMClient(object): hwmap = {} enclosureuuid = self.get_property('/v2/ibmc/smm/chassis/uuid') if enclosureuuid: - bay = self.get_property('/v2/cmm/sp/7') + bay = hex(int(self.get_property('/v2/cmm/sp/7'))).replace( + '0x', '') serial = self.get_property('/v2/ibmc/smm/chassis/sn') model = self.get_property('/v2/ibmc/smm/chassis/mtm') hwmap['Enclosure'] = {