forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLI command to load config in Yang format (sonic-net#1781)
#### What I did To support loading configuration data in yang schema, the `config load` command is enchanced with the below options - `-t` `--file-format` to specify the file-format. The config file can be `yang` or `config_db` format - `-r` to restart the services. Currently this option is supported for yang file format only. - #### How I did it Add the above mentioned cli options. Add Unit tests #### How to verify it Verify the command on VS. ``` admin@vlab-01:~$ sudo config load -y -c yang -r /etc/sonic/yang_cfg.json Disabling container monitoring ... Stopping SONiC target ... Running command: /usr/local/bin/sonic-cfggen -H -Y /etc/sonic/yang_cfg.json -j /etc/sonic/init_cfg.json --write-to-db Restarting SONiC target ... Enabling container monitoring ... Reloading Monit configuration ... Reinitializing monit daemon Please note setting loaded from minigraph will be lost after system reboot.To preserve setting, run `config save`. admin@vlab-01:~$ sudo config load -y -c yang /etc/sonic/yang_cfg.json Running command: /usr/local/bin/sonic-cfggen -H -Y /etc/sonic/yang_cfg.json -j /etc/sonic/init_cfg.json --write-to-db Please note setting loaded from minigraph will be lost after system reboot.To preserve setting, run `config save`. admin@vlab-01:~$ sudo config load Load config in config_db format from the default config file(s) ? [y/N]: y Running command: /usr/local/bin/sonic-cfggen -j /etc/sonic/config_db.json --write-to-db admin@vlab-01:~$ sudo config load -y Running command: /usr/local/bin/sonic-cfggen -j /etc/sonic/config_db.json --write-to-db ```
- Loading branch information
Showing
3 changed files
with
159 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters