From b2ef82a685f5390b4e8a88127ecd33a3161ec7cd Mon Sep 17 00:00:00 2001 From: Penghui Cui Date: Mon, 25 Oct 2021 15:56:52 +0800 Subject: [PATCH] Use str as key instead of float to avoid computing problems Change-Id: I9084e627e1923b27ceb3c5566306782f5ee45280 --- pyghmi/ipmi/oem/lookup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyghmi/ipmi/oem/lookup.py b/pyghmi/ipmi/oem/lookup.py index db1b9cf3..24740c51 100755 --- a/pyghmi/ipmi/oem/lookup.py +++ b/pyghmi/ipmi/oem/lookup.py @@ -37,8 +37,7 @@ def get_oem_handler(oemid, ipmicmd, *args): # first try to find with composite key manufacturer_id.product_id, # if found return directly # then try to find with manufacturer_id - item = float('.'.join([str(oemid['manufacturer_id']), - str(oemid['product_id'])])) + item = '{}.{}'.format(oemid['manufacturer_id'], oemid['product_id']) if item in oemmap: return (oemmap[item].OEMHandler(oemid, ipmicmd, *args), True) return (oemmap[oemid['manufacturer_id']].OEMHandler(oemid,