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

[config] Enhance the Sonic CLI command "config save" #998

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CharlieChenEC
Copy link

  • Enhance the Sonic CLI command "config save" to roll back the existing
    config file when an error occurs during the operation.

Signed-off-by: Charlie Chen charlie_chen@edge-core.com

- What I did
Enhance the Sonic CLI command "config save" to roll back the existing config file when an error occurs during the operation.

- How I did it
Redirect the output of 'SONIC_CFGGEN' to a temp file. Rename/replace the destination config file by the temp file when
'SONIC_CFGGEN' returns zero.

- How to verify it
Stop 'database.service' and execute 'config save -y config_db.json'. The content of the existing file "config_db.json" will not be changed when "config save -y" returns error.

- Previous command output (if the output of a command-line utility has changed)

- New command output (if the output of a command-line utility has changed)

* Enhance the Sonic CLI command "config save" to roll back the existing
  config file when an error occurs during the operation.

Signed-off-by: Charlie Chen <charlie_chen@edge-core.com>
@prsunny
Copy link
Contributor

prsunny commented Jul 21, 2020

@CharlieChenEC , is there any other case other than database service issue where you could potentially observe this failure?

@CharlieChenEC
Copy link
Author

So far I only observe the failure when database service is not ready.

@jleveque
Copy link
Contributor

Retest this please

1 similar comment
@CharlieChenEC
Copy link
Author

Retest this please

@CharlieChenEC
Copy link
Author

@prsunny Could you help review this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants