Skip to content

Commit

Permalink
[config] Merge with init_cfg.json when load_minigraph (sonic-net#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
taoyl-ms authored Oct 26, 2017
1 parent 67f9f96 commit c67fe24
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c67fe24

Please sign in to comment.