-
Notifications
You must be signed in to change notification settings - Fork 196
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
Consolidate the YAML parsing into libnetplan: low-hanging fruits (FR-702) #241
Conversation
7bd588d
to
800082a
Compare
Codecov Report
@@ Coverage Diff @@
## main #241 +/- ##
=======================================
Coverage 99.10% 99.10%
=======================================
Files 58 58
Lines 10052 10055 +3
=======================================
+ Hits 9962 9965 +3
Misses 90 90
Continue to review full report at Codecov.
|
00259c7
to
2ae70d1
Compare
I've reworked the code to use file descriptors where it made sense instead of giving out file names, and the code coverage should reach 100% (with some error paths excluded as really hard to trigger in the tests). I also added some documentation for the non-trivial new APIs. Now all that remains (besides merging #233) is the reviewability issue. |
9dd8933
to
169547d
Compare
169547d
to
dbff824
Compare
6670f1a
to
3287c5d
Compare
This PR has just undergone a drastic diet to get things moving, and is now just the low hanging fruits, the main course will come in subsequents PRs. As such, I'm removing the draft status and move it up to review. |
3287c5d
to
52b5f3c
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.
This is a very nice PR description! Thank you, LGTM.
I left a tiny nitpick inline, feel free to merge regardless.
The data is simple enough that it's reasonable to format it by hand rather than relying on an external dependency.
Co-authored-by: Lukas Märdian <slyon@ubuntu.com> Co-authored-by: Lukas Märdian <slyon@ubuntu.com>
ea39e09
to
7c8729f
Compare
Description
Until now, we parsed the YAML configuration at different places in the program:
netplan set
command, where we parse the YAML tree to do some syntactical merging of the trees without looking too much into the semanticsconfigmanager.py
+sriov.py
where we have some business logic to be able to configure the SRIOV backend on the fly.netplan migrate
, which isn't supposed to be used in normal circumstancesAdditionally, we use PyYAML in
netplan info
to easily generate well-formed YAML data from a Python dict.This PR removes the
migrate
andinfo
use cases, the other cases will have their own PRs in order to keep review complexity somewhat manageable.Why?
There are a couple of advantages to this new approach:
Checklist
make check
successfully.make check-coverage
).