Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fdbshow and nbrshow use SonicV2Connector with decode_responses=True, and remove all the decode() #1187

Merged
merged 1 commit into from
Oct 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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