Skip to content

Commit

Permalink
Make sure db_migrator is run after all config are loaded during (soni…
Browse files Browse the repository at this point in the history
…c-net#926)

load_minigraph. The behaviour got changed as part of multi-npu change
so make it correct again.
  • Loading branch information
abdosi authored May 30, 2020
1 parent 811a4c6 commit aae4f85
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,14 +908,19 @@ def load_minigraph(no_service_restart):
run_command('{} pfcwd start_default'.format(ns_cmd_prefix), display_cmd=True)
run_command("{} config qos reload".format(ns_cmd_prefix), display_cmd=True)

# Write latest db version string into db
db_migrator='/usr/bin/db_migrator.py'
if os.path.isfile(db_migrator) and os.access(db_migrator, os.X_OK):
run_command(db_migrator + ' -o set_version' + cfggen_namespace_option)

if os.path.isfile('/etc/sonic/acl.json'):
run_command("acl-loader update full /etc/sonic/acl.json", display_cmd=True)


# Write latest db version string into db
db_migrator='/usr/bin/db_migrator.py'
if os.path.isfile(db_migrator) and os.access(db_migrator, os.X_OK):
for namespace in namespace_list:
if namespace is DEFAULT_NAMESPACE:
cfggen_namespace_option = " "
else:
cfggen_namespace_option = " -n {}".format(namespace)
run_command(db_migrator + ' -o set_version' + cfggen_namespace_option)

# We first run "systemctl reset-failed" to remove the "failed"
# status from all services before we attempt to restart them
if not no_service_restart:
Expand Down

0 comments on commit aae4f85

Please sign in to comment.