[database] save configuration after DB migration (#3143)

- Make sure that migrated DB contents persisted for next boot
- Make sure that db saved after warm reboot.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
This commit is contained in:
Ying Xie 2019-07-15 20:21:02 -07:00 committed by GitHub
parent 33a1b26a11
commit b5a4527cb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,6 +89,11 @@ function postStartAction()
if [[ -x /usr/bin/db_migrator.py ]]; then
# Migrate the DB to the latest schema version if needed
/usr/bin/db_migrator.py -o migrate
# Save in memory config_db to config_db.json for 2 reasons:
# 1. Persist the DB migration result.
# 2. Save in memory DB after warm reboot.
/usr/bin/config save -y
fi
{%- elif docker_container_name == "swss" %}
docker exec swss rm -f /ready # remove cruft