Skip to content

Commit 077a537

Browse files
authored
Log message fix for TSB (sonic-net#11441)
1 parent 52c36cd commit 077a537

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

  • dockers/docker-fpm-frr/base_image_files

dockers/docker-fpm-frr/base_image_files/TS

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`}
77

88
if [[ $1 == "TSA" ]]; then
99
TSA_STATE_UPDATE='{"BGP_DEVICE_GLOBAL":{"STATE":{"tsa_enabled": "true"}}}'
10+
log_msg='System Mode: Normal -> Maintenance'
1011
elif [[ $1 == "TSB" ]]; then
1112
TSA_STATE_UPDATE='{"BGP_DEVICE_GLOBAL":{"STATE":{"tsa_enabled": "false"}}}'
13+
log_msg='System Mode: Maintenance -> Normal'
1214
fi
1315

1416
# Parse the device specific asic conf file, if it exists
@@ -28,8 +30,8 @@ if [[ ($NUM_ASIC -gt 1) ]]; then
2830
echo -e "BGP"$asic" : \c"
2931
if [[ -n "$TSA_STATE_UPDATE" ]]; then
3032
sonic-cfggen -a "$TSA_STATE_UPDATE" -w -n $NAMESPACE_PREFIX$asic
31-
logger -t $1 -p user.info "BGP$asic: System Mode: Normal -> Maintenance"
32-
echo "BGP$asic: System Mode: Normal -> Maintenance"
33+
logger -t $1 -p user.info "BGP$asic: $log_msg"
34+
echo "$log_msg"
3335
else
3436
# If TSC is executed, invoke FRR script to check installed route-maps
3537
docker exec -i bgp$asic /usr/bin/$1
@@ -40,11 +42,10 @@ if [[ ($NUM_ASIC -gt 1) ]]; then
4042
else
4143
if [[ -n "$TSA_STATE_UPDATE" ]]; then
4244
sonic-cfggen -a "$TSA_STATE_UPDATE" -w
43-
logger -t $1 -p user.info "System Mode: Normal -> Maintenance"
44-
echo "System Mode: Normal -> Maintenance"
45+
logger -t $1 -p user.info "$log_msg"
46+
echo "$log_msg"
4547
else
4648
# If TSC is executed, invoke FRR script to check installed route-maps
4749
docker exec -i bgp /usr/bin/$1
4850
fi
4951
fi
50-

0 commit comments

Comments
 (0)