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
slyon
left a comment
There was a problem hiding this comment.
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 setcommand, where we parse the YAML tree to do some syntactical merging of the trees without looking too much into the semanticsconfigmanager.py+sriov.pywhere 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 infoto easily generate well-formed YAML data from a Python dict.This PR removes the
migrateandinfouse 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 checksuccessfully.make check-coverage).