From c3c4e528507787b42fd8e4eb6e4fd4252fa7e882 Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Wed, 12 May 2021 15:49:40 +0200 Subject: [PATCH] bgpd: display pretty VRF/view name on no such neighbor Display on which VRF/view the neighbor was not found. Useful when selecting "vrf all". Before patch: No such neighbor in this view/vrf After patch: No such neighbor in VRF default Signed-off-by: Louis Scalbert --- bgpd/bgpd.c | 3 ++- .../all_protocol_startup/test_all_protocol_startup.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 6f2f2c9f34..e720f414e7 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -7869,7 +7869,8 @@ struct peer *peer_lookup_in_view(struct vty *vty, struct bgp *bgp, json_no, JSON_C_TO_STRING_PRETTY)); json_object_free(json_no); } else - vty_out(vty, "No such neighbor in this view/vrf\n"); + vty_out(vty, "No such neighbor in %s\n", + bgp->name_pretty); return NULL; } diff --git a/tests/topotests/all_protocol_startup/test_all_protocol_startup.py b/tests/topotests/all_protocol_startup/test_all_protocol_startup.py index 4a07ba38eb..f47dfd8b9d 100644 --- a/tests/topotests/all_protocol_startup/test_all_protocol_startup.py +++ b/tests/topotests/all_protocol_startup/test_all_protocol_startup.py @@ -969,7 +969,7 @@ def test_bgp_summary(): "", expected ) elif "10.0.0.1" in filter: - expected = "No such neighbor in this view/vrf" + expected = "No such neighbor in VRF default" # Strip empty lines actual = actual.lstrip().rstrip() -- 2.39.5