Skip to content

Commit

Permalink
Fix as per review comment.
Browse files Browse the repository at this point in the history
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
  • Loading branch information
SuvarnaMeenakshi committed Sep 8, 2020
1 parent ade4e38 commit 99f3b76
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions src/sonic_ax_impl/mibs/vendor/cisco/bgp4.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,25 @@ def update_data(self):
neigh_str = neigh_key.decode()
neigh_str = neigh_str.split('|')[1]
neigh_info = self.db_conn[db_index].get_all(mibs.STATE_DB, neigh_key, blocking=False)
if neigh_info is None:
continue
state = neigh_info[b'state'].decode()
ip = ipaddress.ip_address(neigh_str)
if type(ip) is ipaddress.IPv4Address:
oid_head = (1, 4)
else:
oid_head = (2, 16)
oid_ip = tuple(i for i in ip.packed)

if state.isdigit():
status = 6
elif state in STATE_CODE:
status = STATE_CODE[state]
else:
continue

oid = oid_head + oid_ip
self.session_status_list.append(oid)
self.session_status_map[oid] = status
if neigh_info is not None:
state = neigh_info[b'state'].decode()
ip = ipaddress.ip_address(neigh_str)
if type(ip) is ipaddress.IPv4Address:
oid_head = (1, 4)
else:
oid_head = (2, 16)
oid_ip = tuple(i for i in ip.packed)

if state.isdigit():
status = 6
elif state in STATE_CODE:
status = STATE_CODE[state]
else:
continue

oid = oid_head + oid_ip
self.session_status_list.append(oid)
self.session_status_map[oid] = status

self.session_status_list.sort()

Expand Down

0 comments on commit 99f3b76

Please sign in to comment.