From ec73d0f3ff41aa8d0df08f47209cb976b61f3d43 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 14 Aug 2023 22:39:24 +0800 Subject: [PATCH] [chassis]: removed dependency for bgp and swss for chassis supervisor (#15734) (#16135) Fixes #15667 and #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 Co-authored-by: Arvindsrinivasan Lakshmi Narasimhan <55814491+arlakshm@users.noreply.github.com> --- files/scripts/swss.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/files/scripts/swss.sh b/files/scripts/swss.sh index c0c9b1952b..2974104e66 100755 --- a/files/scripts/swss.sh +++ b/files/scripts/swss.sh @@ -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 @@ -353,11 +363,9 @@ 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` @@ -365,7 +373,7 @@ 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=$?