diff --git a/files/image_config/config-chassisdb/config-chassisdb b/files/image_config/config-chassisdb/config-chassisdb index 3bdcf0a0fb..f64443b274 100755 --- a/files/image_config/config-chassisdb/config-chassisdb +++ b/files/image_config/config-chassisdb/config-chassisdb @@ -27,7 +27,7 @@ config_chassis_db() { startdb_file="/etc/sonic/chassisdb.conf" [ ! -e $startdb_file ] || rm $startdb_file - platform=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) + platform=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`} # database-chassis services will start when $chassis_config file exists chassis_config="/usr/share/sonic/device/$platform/chassisdb.conf" if [ ! -e $chassis_config ]; then @@ -54,6 +54,9 @@ config_chassis_db() { fi } +# read SONiC immutable variables +[ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment + config_chassis_db exit 0