[bgpmon] Fix dict_keys
unsubscriptable error (#5859)
Simply looping through `dict_key` object instead of index-subscribing to fix this. Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
This commit is contained in:
parent
9fda295cd0
commit
92704e8a93
@ -68,8 +68,8 @@ class BgpStateGet:
|
|||||||
def update_new_peer_states(self, peer_dict):
|
def update_new_peer_states(self, peer_dict):
|
||||||
peer_l = peer_dict["peers"].keys()
|
peer_l = peer_dict["peers"].keys()
|
||||||
self.new_peer_l.extend(peer_l)
|
self.new_peer_l.extend(peer_l)
|
||||||
for i in range (0, len(peer_l)):
|
for peer in peer_l:
|
||||||
self.new_peer_state[peer_l[i]] = peer_dict["peers"][peer_l[i]]["state"]
|
self.new_peer_state[peer] = peer_dict["peers"][peer]["state"]
|
||||||
|
|
||||||
# Get a new snapshot of BGP neighbors and store them in the "new" location
|
# Get a new snapshot of BGP neighbors and store them in the "new" location
|
||||||
def get_all_neigh_states(self):
|
def get_all_neigh_states(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user