Skip to content

Commit 1ad5dbe

Browse files
authored
Fixes for errors seen in staging devices (#7171)
With the latest 201911 image, the following error was seen on staging devices with TSB command ( for both single asic, multi asic ). Though this err message doesn't affect the TSB functionality, it is good to fix. admin@STG01-0101-0102-01T1:~$ TSB BGP0 : % Could not find route-map entry TO_TIER0_V4 20 line 1: Failure to communicate[13] to zebra, line: no route-map TO_TIER0_V4 permit 20 % Could not find route-map entry TO_TIER0_V4 30 line 2: Failure to communicate[13] to zebra, line: no route-map TO_TIER0_V4 deny 30 In addition, in this PR I am fixing the message displayed to user when there are no BGP neighbors configured on that BGP instance. In multi-asic device there could be case where there are no BGP neighbors configured on a particular ASIC.
1 parent 42059ac commit 1ad5dbe

File tree

4 files changed

+36
-7
lines changed

4 files changed

+36
-7
lines changed

dockers/docker-fpm-frr/TS

+14-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function check_not_installed()
1010
{
1111
c=0
1212
config=$(vtysh -c "show run")
13-
for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6');
13+
for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6' | uniq);
1414
do
1515
is_internal_route_map $route_map_name && continue
1616
echo "$config" | egrep -q "^route-map $route_map_name permit 20$"
@@ -26,7 +26,7 @@ function check_installed()
2626
c=0
2727
e=0
2828
config=$(vtysh -c "show run")
29-
for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6');
29+
for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6' | uniq);
3030
do
3131
is_internal_route_map $route_map_name && continue
3232
echo "$config" | egrep -q "^route-map $route_map_name permit 20$"
@@ -38,3 +38,15 @@ function check_installed()
3838
done
3939
return $((e-c))
4040
}
41+
42+
function find_num_routemap()
43+
{
44+
c=0
45+
config=$(vtysh -c "show run")
46+
for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6' | uniq);
47+
do
48+
is_internal_route_map $route_map_name && continue
49+
c=$((c+1))
50+
done
51+
return $c
52+
}

dockers/docker-fpm-frr/TSA

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@
33
# Load the common functions
44
source /usr/bin/TS
55

6+
find_num_routemap
7+
routemap_count=$?
68
check_not_installed
79
not_installed=$?
8-
if [[ $not_installed -ne 0 ]];
10+
11+
if [[ $routemap_count -eq 0 ]];
12+
then
13+
echo "System Mode: No external neighbors"
14+
elif [[ $not_installed -ne 0 ]];
915
then
1016
TSA_FILE=$(mktemp)
11-
for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p');
17+
for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | uniq);
1218
do
1319
is_internal_route_map $route_map_name && continue
1420
case "$route_map_name" in

dockers/docker-fpm-frr/TSB

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@
33
# Load the common functions
44
source /usr/bin/TS
55

6+
find_num_routemap
7+
routemap_count=$?
68
check_installed
79
installed=$?
8-
if [[ $installed -ne 0 ]];
10+
11+
if [[ $routemap_count -eq 0 ]];
12+
then
13+
echo "System Mode: No external neighbors"
14+
elif [[ $installed -ne 0 ]];
915
then
1016
TSB_FILE=$(mktemp)
11-
for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p');
17+
for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | uniq);
1218
do
1319
is_internal_route_map $route_map_name && continue
1420
case "$route_map_name" in

dockers/docker-fpm-frr/TSC

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@
33
# Load the common functions
44
source /usr/bin/TS
55

6+
find_num_routemap
7+
routemap_count=$?
68
check_not_installed
79
not_installed=$?
810

911
check_installed
1012
installed=$?
1113

12-
if [[ $installed -eq 0 ]];
14+
if [[ $routemap_count -eq 0 ]];
15+
then
16+
echo "System Mode: No external neighbors"
17+
elif [[ $installed -eq 0 ]];
1318
then
1419
echo "System Mode: Normal"
1520
elif [[ $not_installed -eq 0 ]];

0 commit comments

Comments
 (0)