Skip to content

Commit a3da1d2

Browse files
[config-chassisdb] use cached variables
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
1 parent 1bf2012 commit a3da1d2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

files/image_config/config-chassisdb/config-chassisdb

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
config_chassis_db() {
2828
startdb_file="/etc/sonic/chassisdb.conf"
2929
[ ! -e $startdb_file ] || rm $startdb_file
30-
platform=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)
30+
platform=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`}
3131
# database-chassis services will start when $chassis_config file exists
3232
chassis_config="/usr/share/sonic/device/$platform/chassisdb.conf"
3333
if [ ! -e $chassis_config ]; then
@@ -54,6 +54,9 @@ config_chassis_db() {
5454
fi
5555
}
5656

57+
# read SONiC immutable variables
58+
[ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment
59+
5760
config_chassis_db
5861

5962
exit 0

0 commit comments

Comments
 (0)