From c67fe24e54385d2fb379d88c33ccf448240d7a78 Mon Sep 17 00:00:00 2001 From: Taoyu Li Date: Thu, 26 Oct 2017 13:01:46 -0700 Subject: [PATCH] [config] Merge with init_cfg.json when load_minigraph (#139) --- config/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/main.py b/config/main.py index ce0b0232d383..ed2f1312982a 100644 --- a/config/main.py +++ b/config/main.py @@ -165,7 +165,10 @@ def load_minigraph(): config_db.connect() client = config_db.redis_clients[config_db.CONFIG_DB] client.flushdb() - command = "{} -m --write-to-db".format(SONIC_CFGGEN_PATH) + if os.path.isfile('/etc/sonic/init_cfg.json'): + command = "{} -m -j /etc/sonic/init_cfg.json --write-to-db".format(SONIC_CFGGEN_PATH) + else: + command = "{} -m --write-to-db".format(SONIC_CFGGEN_PATH) run_command(command, display_cmd=True) client.set(config_db.INIT_INDICATOR, True) command = "{} -m -v \"DEVICE_METADATA['localhost']['hostname']\"".format(SONIC_CFGGEN_PATH)