From 14cefc650287ce3ad47bdd987e2ff51923a423fc Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 11 Dec 2019 10:00:50 -0500 Subject: [PATCH] Fix Python3 SMM setting Under Python3, indexing a bytes gets a number instead of a str, adjust to bytearray which is number in both 2 and 3. Change-Id: I249729c2287bb58dd764a627c298c74e5ebb50cc --- pyghmi/ipmi/oem/lenovo/imm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index ad11bf23..cab1e62d 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -840,9 +840,9 @@ class XCCClient(IMMClient): 'possible': ['Enable', 'Disable'], 'help': 'Enables or disables the network of the D2 enclosure manager.', } - if enclosureinfo['data'][0] == '\x02': + if bytearray(enclosureinfo['data'])[0] == 2: settings['smm']['value'] = 'Disable' - elif enclosureinfo['data'][0] == '\x01': + elif bytearray(enclosureinfo['data'])[0] == 1: settings['smm']['value'] = 'Enable' else: settings['smm']['value'] = None