-
Notifications
You must be signed in to change notification settings - Fork 201
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
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this looks very nice.
0187cb3
to
aa0971b
Compare
…ining whitespace)
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! |
…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)
Merged in 5361619 |
Description
This PR contains several improvements wrt. the handling of YAML hint files, as used by the
netplan set
CLI.--origin-hint
is 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/*.yaml
are cleared otherwise.Checklist
make check
successfully.make check-coverage
).