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.
This commit is contained in:
parent
42059ac6d7
commit
1ad5dbeab6
@ -10,7 +10,7 @@ function check_not_installed()
|
|||||||
{
|
{
|
||||||
c=0
|
c=0
|
||||||
config=$(vtysh -c "show run")
|
config=$(vtysh -c "show run")
|
||||||
for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6');
|
for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6' | uniq);
|
||||||
do
|
do
|
||||||
is_internal_route_map $route_map_name && continue
|
is_internal_route_map $route_map_name && continue
|
||||||
echo "$config" | egrep -q "^route-map $route_map_name permit 20$"
|
echo "$config" | egrep -q "^route-map $route_map_name permit 20$"
|
||||||
@ -26,7 +26,7 @@ function check_installed()
|
|||||||
c=0
|
c=0
|
||||||
e=0
|
e=0
|
||||||
config=$(vtysh -c "show run")
|
config=$(vtysh -c "show run")
|
||||||
for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6');
|
for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6' | uniq);
|
||||||
do
|
do
|
||||||
is_internal_route_map $route_map_name && continue
|
is_internal_route_map $route_map_name && continue
|
||||||
echo "$config" | egrep -q "^route-map $route_map_name permit 20$"
|
echo "$config" | egrep -q "^route-map $route_map_name permit 20$"
|
||||||
@ -38,3 +38,15 @@ function check_installed()
|
|||||||
done
|
done
|
||||||
return $((e-c))
|
return $((e-c))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function find_num_routemap()
|
||||||
|
{
|
||||||
|
c=0
|
||||||
|
config=$(vtysh -c "show run")
|
||||||
|
for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6' | uniq);
|
||||||
|
do
|
||||||
|
is_internal_route_map $route_map_name && continue
|
||||||
|
c=$((c+1))
|
||||||
|
done
|
||||||
|
return $c
|
||||||
|
}
|
||||||
|
@ -3,12 +3,18 @@
|
|||||||
# Load the common functions
|
# Load the common functions
|
||||||
source /usr/bin/TS
|
source /usr/bin/TS
|
||||||
|
|
||||||
|
find_num_routemap
|
||||||
|
routemap_count=$?
|
||||||
check_not_installed
|
check_not_installed
|
||||||
not_installed=$?
|
not_installed=$?
|
||||||
if [[ $not_installed -ne 0 ]];
|
|
||||||
|
if [[ $routemap_count -eq 0 ]];
|
||||||
|
then
|
||||||
|
echo "System Mode: No external neighbors"
|
||||||
|
elif [[ $not_installed -ne 0 ]];
|
||||||
then
|
then
|
||||||
TSA_FILE=$(mktemp)
|
TSA_FILE=$(mktemp)
|
||||||
for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p');
|
for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | uniq);
|
||||||
do
|
do
|
||||||
is_internal_route_map $route_map_name && continue
|
is_internal_route_map $route_map_name && continue
|
||||||
case "$route_map_name" in
|
case "$route_map_name" in
|
||||||
|
@ -3,12 +3,18 @@
|
|||||||
# Load the common functions
|
# Load the common functions
|
||||||
source /usr/bin/TS
|
source /usr/bin/TS
|
||||||
|
|
||||||
|
find_num_routemap
|
||||||
|
routemap_count=$?
|
||||||
check_installed
|
check_installed
|
||||||
installed=$?
|
installed=$?
|
||||||
if [[ $installed -ne 0 ]];
|
|
||||||
|
if [[ $routemap_count -eq 0 ]];
|
||||||
|
then
|
||||||
|
echo "System Mode: No external neighbors"
|
||||||
|
elif [[ $installed -ne 0 ]];
|
||||||
then
|
then
|
||||||
TSB_FILE=$(mktemp)
|
TSB_FILE=$(mktemp)
|
||||||
for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p');
|
for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | uniq);
|
||||||
do
|
do
|
||||||
is_internal_route_map $route_map_name && continue
|
is_internal_route_map $route_map_name && continue
|
||||||
case "$route_map_name" in
|
case "$route_map_name" in
|
||||||
|
@ -3,13 +3,18 @@
|
|||||||
# Load the common functions
|
# Load the common functions
|
||||||
source /usr/bin/TS
|
source /usr/bin/TS
|
||||||
|
|
||||||
|
find_num_routemap
|
||||||
|
routemap_count=$?
|
||||||
check_not_installed
|
check_not_installed
|
||||||
not_installed=$?
|
not_installed=$?
|
||||||
|
|
||||||
check_installed
|
check_installed
|
||||||
installed=$?
|
installed=$?
|
||||||
|
|
||||||
if [[ $installed -eq 0 ]];
|
if [[ $routemap_count -eq 0 ]];
|
||||||
|
then
|
||||||
|
echo "System Mode: No external neighbors"
|
||||||
|
elif [[ $installed -eq 0 ]];
|
||||||
then
|
then
|
||||||
echo "System Mode: Normal"
|
echo "System Mode: Normal"
|
||||||
elif [[ $not_installed -eq 0 ]];
|
elif [[ $not_installed -eq 0 ]];
|
||||||
|
Reference in New Issue
Block a user