2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-27 19:37:44 +00:00

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
This commit is contained in:
Jarrod Johnson 2019-12-11 10:00:50 -05:00
parent a1cea91038
commit 14cefc6502

View File

@ -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