Skip to content

Commit 0bf336a

Browse files
authored
[syncd_init_common.sh] Use template file to retrieve vars (sonic-net#683)
1 parent 4d21a26 commit 0bf336a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

syncd/scripts/syncd_init_common.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ ENABLE_SAITHRIFT=0
1111
PLATFORM_DIR=/usr/share/sonic/platform
1212
HWSKU_DIR=/usr/share/sonic/hwsku
1313

14-
SONIC_ASIC_TYPE=$(sonic-cfggen -y /etc/sonic/sonic_version.yml -v asic_type)
14+
VARS_FILE=/usr/share/sonic/templates/swss_vars.j2
15+
# Retrieve vars from sonic-cfggen
16+
SYNCD_VARS=$(sonic-cfggen -d -y /etc/sonic/sonic_version.yml -t $VARS_FILE) || exit 1
17+
SONIC_ASIC_TYPE=$(echo $SYNCD_VARS | jq -r '.asic_type')
1518

1619
if [ -x $CMD_DSSERVE ]; then
1720
CMD=$CMD_DSSERVE
@@ -28,7 +31,7 @@ CMD_ARGS+=" -u"
2831
CMD_ARGS+=" -l"
2932

3033
# Set synchronous mode if it is enabled in CONFIG_DB
31-
SYNC_MODE=$(sonic-cfggen -d -v DEVICE_METADATA.localhost.synchronous_mode)
34+
SYNC_MODE=$(echo $SYNCD_VARS | jq -r '.synchronous_mode')
3235
if [ "$SYNC_MODE" == "enable" ]; then
3336
CMD_ARGS+=" -s"
3437
fi

0 commit comments

Comments
 (0)