Skip to content

Commit

Permalink
fdbshow and nbrshow use SonicV2Connector with decode_responses=True, …
Browse files Browse the repository at this point in the history
…and remove all the decode() (sonic-net#1187)
  • Loading branch information
qiluo-msft authored Oct 24, 2020
1 parent 0c3a97f commit 00a2570
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/fdbshow
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions scripts/nbrshow
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down

0 comments on commit 00a2570

Please sign in to comment.