From 7f1852aa0acf3a0edcaf4f3f220aabdcf575824d Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 22 Jan 2021 12:39:39 -0500 Subject: [PATCH] Fix py3 bytes mismatch for fromstring Input comes in as bytes, we need to use bytes to match. Change-Id: I73730940569cd2647458ea9ed9401a9488bd9078 --- pyghmi/ipmi/oem/lenovo/config.py | 2 +- pyghmi/ipmi/oem/lenovo/nextscale.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyghmi/ipmi/oem/lenovo/config.py b/pyghmi/ipmi/oem/lenovo/config.py index 2a9844a1..a7b20dbb 100644 --- a/pyghmi/ipmi/oem/lenovo/config.py +++ b/pyghmi/ipmi/oem/lenovo/config.py @@ -45,7 +45,7 @@ SIZE_COMMAND = [0x06] def fromstring(inputdata): - if '!entity' in inputdata: + if b'!entity' in inputdata.lower(): raise Exception('Unsupported XML') return etree.fromstring(inputdata) diff --git a/pyghmi/ipmi/oem/lenovo/nextscale.py b/pyghmi/ipmi/oem/lenovo/nextscale.py index 9b4e47e4..020e24ec 100644 --- a/pyghmi/ipmi/oem/lenovo/nextscale.py +++ b/pyghmi/ipmi/oem/lenovo/nextscale.py @@ -38,7 +38,7 @@ except NameError: def fromstring(inputdata): - if '!entity' in inputdata.lower(): + if b'!entity' in inputdata.lower(): raise Exception('!ENTITY not supported in this interface') return rfromstring(inputdata)