get/set: ignore empty YAML hints and delete files on "set network=null" (LP: #1946957)#246
Closed
get/set: ignore empty YAML hints and delete files on "set network=null" (LP: #1946957)#246
Conversation
Codecov Report
@@ Coverage Diff @@
## main #246 +/- ##
=======================================
Coverage 99.09% 99.09%
=======================================
Files 58 58
Lines 9913 9963 +50
=======================================
+ Hits 9823 9873 +50
Misses 90 90
Continue to review full report at Codecov.
|
0a07037 to
0187cb3
Compare
mvo5
approved these changes
Nov 25, 2021
Contributor
mvo5
left a comment
There was a problem hiding this comment.
Thank you, this looks very nice.
0187cb3 to
aa0971b
Compare
…ining whitespace)
Contributor
Author
|
Thanks for the review, Michael! I've added another fix + test-case today. Once we can confirm this passes the original snapd tests, we're good for merging! |
slyon
added a commit
that referenced
this pull request
Nov 29, 2021
…l" (LP: #1946957) (#246) This PR contains several improvements wrt. the handling of YAML hint files, as used by the netplan set CLI. If a --origin-hint is specified, that already exists as an empty file, that file is ignored. If netplan set network=null [--origin-hint FILE] is executed, a special handler makes sure that either the specified origin hint file is remove, or all files in etc/netplan/*.yaml are cleared otherwise. COMMITS: * test:get-set: detect unexpected output in CLI * cli:set: ignore empty hint files * cli:set: special case for 'network=null' to clear YAML files * cli:set: improve logging * cli:set: do not crash if we try to unset something that does not exist (LP: #1946957) * cli:set: fix another case of writing an empty origin-hint file (containing whitespace)
Contributor
Author
|
Merged in 5361619 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR contains several improvements wrt. the handling of YAML hint files, as used by the
netplan setCLI.--origin-hintis specified, that already exists as an empty file, that file is ignored.netplan set network=null [--origin-hint FILE]is executed, a special handler makes sure that either the specified origin hint file is remove, or all files inetc/netplan/*.yamlare cleared otherwise.Checklist
make checksuccessfully.make check-coverage).