Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[updategraph] enhance update graph handling #3549

Merged
merged 1 commit into from
Oct 2, 2019
Merged

Conversation

yxieca
Copy link
Contributor

@yxieca yxieca commented Oct 2, 2019

- What I did

  • after reloading minigraph, write latest version string in the DB.
  • if old config_db.json file exists, use it and migrate to latest version.
  • only reload minigraph when config_db.json doesn't exist and minigraph
    exists.

Signed-off-by: Ying Xie ying.xie@microsoft.com

- How to verify it
sonic upgrade

- after reloading minigraph, write latest version string in the DB.
- if old config_db.json file exists, use it and migrate to latest version.
- only reload minigraph when config_db.json doesn't exist and minigraph
  exists.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
echo "Use config_db.json from old system..."
sonic-cfggen -j /etc/sonic/config_db.json --write-to-db

if [[ -x /usr/bin/db_migrator.py ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noting the use of double square brackets here but single brackets elsewhere. I think we need to decide on one to use moving forward.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. this file has fixed use of [] and [[ ]]. We need to unify the usage. I think [[ ]] is safer for some reason I don't remember now. But it could be just a myth :-)

@yxieca
Copy link
Contributor Author

yxieca commented Oct 2, 2019

retest vs please

@yxieca yxieca merged commit cd85e21 into sonic-net:master Oct 2, 2019
@yxieca yxieca deleted the graph branch October 2, 2019 20:58
yxieca added a commit that referenced this pull request Oct 2, 2019
- after reloading minigraph, write latest version string in the DB.
- if old config_db.json file exists, use it and migrate to latest version.
- only reload minigraph when config_db.json doesn't exist and minigraph
  exists.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants