summaryrefslogtreecommitdiff
path: root/tests/topotests/bgp-auth/test_bgp_auth.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/topotests/bgp-auth/test_bgp_auth.py')
-rw-r--r--tests/topotests/bgp-auth/test_bgp_auth.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/topotests/bgp-auth/test_bgp_auth.py b/tests/topotests/bgp-auth/test_bgp_auth.py
index 521ca332d0..b2cdef1c93 100644
--- a/tests/topotests/bgp-auth/test_bgp_auth.py
+++ b/tests/topotests/bgp-auth/test_bgp_auth.py
@@ -357,9 +357,10 @@ def check_neigh_state(router, peer, state, vrf=""):
"show bgp vrf {} neighbors {} json".format(vrf, peer)
)
neigh_output_json = json.loads(neigh_output)
- if neigh_output_json[peer]["bgpState"] == state:
- matched = True
- break
+ if peer in neigh_output_json.keys():
+ if neigh_output_json[peer]["bgpState"] == state:
+ matched = True
+ break
count += 1
sleep(1)