Skip to content

Commit

Permalink
Log message fix for TSB (#11441)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjchadaga authored and yxieca committed Jul 28, 2022
1 parent e00cd53 commit 4bc1192
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions dockers/docker-fpm-frr/base_image_files/TS
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`}

if [[ $1 == "TSA" ]]; then
TSA_STATE_UPDATE='{"BGP_DEVICE_GLOBAL":{"STATE":{"tsa_enabled": "true"}}}'
log_msg='System Mode: Normal -> Maintenance'
elif [[ $1 == "TSB" ]]; then
TSA_STATE_UPDATE='{"BGP_DEVICE_GLOBAL":{"STATE":{"tsa_enabled": "false"}}}'
log_msg='System Mode: Maintenance -> Normal'
fi

# Parse the device specific asic conf file, if it exists
Expand All @@ -28,8 +30,8 @@ if [[ ($NUM_ASIC -gt 1) ]]; then
echo -e "BGP"$asic" : \c"
if [[ -n "$TSA_STATE_UPDATE" ]]; then
sonic-cfggen -a "$TSA_STATE_UPDATE" -w -n $NAMESPACE_PREFIX$asic
logger -t $1 -p user.info "BGP$asic: System Mode: Normal -> Maintenance"
echo "BGP$asic: System Mode: Normal -> Maintenance"
logger -t $1 -p user.info "BGP$asic: $log_msg"
echo "$log_msg"
else
# If TSC is executed, invoke FRR script to check installed route-maps
docker exec -i bgp$asic /usr/bin/$1
Expand All @@ -40,11 +42,10 @@ if [[ ($NUM_ASIC -gt 1) ]]; then
else
if [[ -n "$TSA_STATE_UPDATE" ]]; then
sonic-cfggen -a "$TSA_STATE_UPDATE" -w
logger -t $1 -p user.info "System Mode: Normal -> Maintenance"
echo "System Mode: Normal -> Maintenance"
logger -t $1 -p user.info "$log_msg"
echo "$log_msg"
else
# If TSC is executed, invoke FRR script to check installed route-maps
docker exec -i bgp /usr/bin/$1
fi
fi

0 comments on commit 4bc1192

Please sign in to comment.