[config-topology] use cached variables (#17343)

- Why I did it
Improve  boot performance mostly needed for fast and warmboot

- How I did it
Use cached variable.

- How to verify it
Boot the system. Simply do "systemd-analyze blame" and look at service start time.

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
This commit is contained in:
Stepan Blyshchak 2023-12-07 15:22:44 +02:00 committed by GitHub
parent 000a2ef818
commit 6435df1056
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@
# which could be used for platform specific topology configuration
#
start() {
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`}
#Path to platform topology script
TOPOLOGY_SCRIPT="/usr/share/sonic/device/$PLATFORM/plugins/config-topology.sh"
#if topology script file not present, do nothing and return 0
@ -13,7 +13,7 @@ start() {
}
stop() {
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`}
#Path to platform topology script
TOPOLOGY_SCRIPT="/usr/share/sonic/device/$PLATFORM/plugins/config-topology.sh"
#if topology script file not present, do nothing and return 0