Skip to content

Commit c67fe24

Browse files
authored
[config] Merge with init_cfg.json when load_minigraph (sonic-net#139)
1 parent 67f9f96 commit c67fe24

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

config/main.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,10 @@ def load_minigraph():
165165
config_db.connect()
166166
client = config_db.redis_clients[config_db.CONFIG_DB]
167167
client.flushdb()
168-
command = "{} -m --write-to-db".format(SONIC_CFGGEN_PATH)
168+
if os.path.isfile('/etc/sonic/init_cfg.json'):
169+
command = "{} -m -j /etc/sonic/init_cfg.json --write-to-db".format(SONIC_CFGGEN_PATH)
170+
else:
171+
command = "{} -m --write-to-db".format(SONIC_CFGGEN_PATH)
169172
run_command(command, display_cmd=True)
170173
client.set(config_db.INIT_INDICATOR, True)
171174
command = "{} -m -v \"DEVICE_METADATA['localhost']['hostname']\"".format(SONIC_CFGGEN_PATH)

0 commit comments

Comments
 (0)