From 00a25705c9bc07719667ae7adf98f39cbd450871 Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Sat, 24 Oct 2020 10:10:02 -0700 Subject: [PATCH] fdbshow and nbrshow use SonicV2Connector with decode_responses=True, and remove all the decode() (#1187) --- scripts/fdbshow | 4 ++-- scripts/nbrshow | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/fdbshow b/scripts/fdbshow index 383a26ae9b72..e51941458386 100755 --- a/scripts/fdbshow +++ b/scripts/fdbshow @@ -40,7 +40,7 @@ class FdbShow(object): def __init__(self): super(FdbShow,self).__init__() - self.db = SonicV2Connector(host="127.0.0.1") + self.db = SonicV2Connector(host="127.0.0.1", decode_responses=True) self.if_name_map, \ self.if_oid_map = port_util.get_interface_oid_map(self.db) self.if_br_oid_map = port_util.get_bridge_port_map(self.db) @@ -64,7 +64,7 @@ class FdbShow(object): oid_pfx = len("oid:0x") for s in fdb_str: - fdb_entry = s.decode() + fdb_entry = s fdb = json.loads(fdb_entry .split(":", 2)[-1]) if not fdb: continue diff --git a/scripts/nbrshow b/scripts/nbrshow index 8d1abe7562bc..1c9eb51554b3 100644 --- a/scripts/nbrshow +++ b/scripts/nbrshow @@ -47,7 +47,7 @@ class NbrBase(object): def __init__(self, cmd): super(NbrBase, self).__init__() - self.db = SonicV2Connector(host="127.0.0.1") + self.db = SonicV2Connector(host="127.0.0.1", decode_responses=True) self.if_name_map, self.if_oid_map = port_util.get_interface_oid_map(self.db) self.if_br_oid_map = port_util.get_bridge_port_map(self.db) self.fetch_fdb_data() @@ -73,7 +73,7 @@ class NbrBase(object): oid_pfx = len("oid:0x") for s in fdb_str: - fdb_entry = s.decode() + fdb_entry = s fdb = json.loads(fdb_entry .split(":", 2)[-1]) if not fdb: continue