1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

python3: mstpctlutils: .strip() expects bytes and not a string

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
Julien Fortin
2019-12-17 17:08:29 +01:00
parent fefbda193d
commit f508b51eb1

View File

@@ -142,7 +142,7 @@ class mstpctlutil(utilsBase):
return mstpctl_bridgeport_attrs_dict
portname = bridgename # assigning portname to avoid an exception, in the exception handler
try:
mstpctl_bridge_cache = json.loads(output.strip('\n'))
mstpctl_bridge_cache = json.loads(output.strip(b'\n'))
for portname in list(mstpctl_bridge_cache.keys()):
for portid in list(mstpctl_bridge_cache[portname].keys()):
mstpctl_bridgeport_attrs_dict[portname] = {}
@@ -165,7 +165,7 @@ class mstpctlutil(utilsBase):
self.logger.info(str(e))
return mstpctl_bridge_attrs_dict
try:
mstpctl_bridge_cache = json.loads(output.strip('\n'))
mstpctl_bridge_cache = json.loads(output.strip(b'\n'))
for jsonAttr in list(mstpctl_bridge_cache[bridgename].keys()):
mstpctl_bridge_attrs_dict[jsonAttr] = (
str(mstpctl_bridge_cache[bridgename][jsonAttr]))