Skip to content

Commit

Permalink
[chassis]: removed dependency for bgp and swss for chassis supervisor (
Browse files Browse the repository at this point in the history
…sonic-net#15734)

Fixes sonic-net#15667 and sonic-net#13293

Work item tracking
Microsoft ADO 24472854:

How I did it
On chassis supervisor bgp feature is disabled in hostcfgd. The dependency between swss and bgp causes the bgp containers to start even though the feature is disabled.

How to verify it
Tests on chassis supervisor and LC
  • Loading branch information
arlakshm authored Aug 7, 2023
1 parent d9393b0 commit 4681703
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions files/scripts/swss.sh
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,16 @@ function check_macsec()
fi
}

function check_add_bgp_dependency()
{
if ! is_chassis_supervisor; then
if [ "$DEV" ]; then
DEPENDENT="${DEPENDENT} bgp@${DEV}"
else
DEPENDENT="${DEPENDENT} bgp"
fi
fi
}
function check_ports_present()
{
PORT_CONFIG_INI=/usr/share/sonic/device/$PLATFORM/$HWSKU/$DEV/port_config.ini
Expand Down Expand Up @@ -353,19 +363,17 @@ fi
if [ "$DEV" ]; then
NET_NS="$NAMESPACE_PREFIX$DEV" #name of the network namespace
SONIC_DB_CLI="sonic-db-cli -n $NET_NS"
DEPENDENT+=" bgp@${DEV}"
else
NET_NS=""
SONIC_DB_CLI="sonic-db-cli"
DEPENDENT+=" bgp"
fi

PLATFORM=`$SONIC_DB_CLI CONFIG_DB hget 'DEVICE_METADATA|localhost' platform`
HWSKU=`$SONIC_DB_CLI CONFIG_DB hget 'DEVICE_METADATA|localhost' hwsku`

check_peer_gbsyncd
check_macsec

check_add_bgp_dependency
check_ports_present
PORTS_PRESENT=$?

Expand Down

0 comments on commit 4681703

Please sign in to comment.