bgpd: Change warning message when BGP community-list is not found

Before:

```
donatas-laptop# show bgp ipv4 unicast community-list testas
% testas is not a valid community-list name
donatas-laptop# con
donatas-laptop(config)# bgp community-list standard testas permit internet
donatas-laptop(config)# do show bgp ipv4 unicast community-list testas
donatas-laptop(config)#
```

`is not a valid community-list name` is a misleading warning message.

Doing the same for filter-list, access-list, prefix-list, route-map.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2022-08-16 09:28:21 +03:00
parent 261e70c66a
commit 606d49a4ca

View File

@ -12464,8 +12464,7 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
list = community_list_lookup(bgp_clist, clist_number_or_name, 0, list = community_list_lookup(bgp_clist, clist_number_or_name, 0,
COMMUNITY_LIST_MASTER); COMMUNITY_LIST_MASTER);
if (list == NULL) { if (list == NULL) {
vty_out(vty, vty_out(vty, "%% %s community-list not found\n",
"%% %s is not a valid community-list name\n",
clist_number_or_name); clist_number_or_name);
return CMD_WARNING; return CMD_WARNING;
} }
@ -12483,8 +12482,7 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
as_list = as_list_lookup(filter); as_list = as_list_lookup(filter);
if (as_list == NULL) { if (as_list == NULL) {
vty_out(vty, vty_out(vty, "%% %s AS-path access-list not found\n",
"%% %s is not a valid AS-path access-list name\n",
filter); filter);
return CMD_WARNING; return CMD_WARNING;
} }
@ -12499,7 +12497,7 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
plist = prefix_list_lookup(afi, prefix_list_str); plist = prefix_list_lookup(afi, prefix_list_str);
if (plist == NULL) { if (plist == NULL) {
vty_out(vty, "%% %s is not a valid prefix-list name\n", vty_out(vty, "%% %s prefix-list not found\n",
prefix_list_str); prefix_list_str);
return CMD_WARNING; return CMD_WARNING;
} }
@ -12514,7 +12512,7 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
alist = access_list_lookup(afi, access_list_str); alist = access_list_lookup(afi, access_list_str);
if (!alist) { if (!alist) {
vty_out(vty, "%% %s is not a valid access-list name\n", vty_out(vty, "%% %s access-list not found\n",
access_list_str); access_list_str);
return CMD_WARNING; return CMD_WARNING;
} }
@ -12529,8 +12527,7 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
rmap = route_map_lookup_by_name(rmap_str); rmap = route_map_lookup_by_name(rmap_str);
if (!rmap) { if (!rmap) {
vty_out(vty, "%% %s is not a valid route-map name\n", vty_out(vty, "%% %s route-map not found\n", rmap_str);
rmap_str);
return CMD_WARNING; return CMD_WARNING;
} }