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

keyfile: do not try to write out unvalidated YAML (LP: #1952967) #247

Merged
merged 10 commits into from
Jan 6, 2022

Conversation

slyon
Copy link
Collaborator

@slyon slyon commented Dec 3, 2021

Description

netplan's keyfile parser can handle certain device types and settings from NM's keyfile format. But we should try to avoid writing out partial YAML where some (essential) fields are missing, as they cannot (yet) be properly parsed.

We need to check that during testing and ideally also at runtime, in order to fall back to the full passthrough mode, using the generic nm-devices type.

FR-1898

Checklist

  • Runs make check successfully.
  • Retains 100% code coverage (make check-coverage).
  • New/changed keys in YAML format are documented.
  • (Optional) Adds example YAML for new feature.
  • (Optional) Closes an open bug in Launchpad. LP#1952967

@codecov-commenter
Copy link

codecov-commenter commented Dec 9, 2021

Codecov Report

Merging #247 (008fdd2) into main (64e381e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #247   +/-   ##
=======================================
  Coverage   99.10%   99.10%           
=======================================
  Files          58       58           
  Lines       10038    10052   +14     
=======================================
+ Hits         9948     9962   +14     
  Misses         90       90           
Impacted Files Coverage Δ
src/abi_compat.c 100.00% <100.00%> (ø)
src/parse-nm.c 100.00% <100.00%> (ø)
tests/parser/base.py 100.00% <100.00%> (ø)
tests/parser/test_keyfile.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64e381e...008fdd2. Read the comment docs.

@slyon slyon marked this pull request as ready for review December 9, 2021 13:05
@slyon slyon force-pushed the slyon/lp1952967-nmtui-tunnels branch from 7cbab24 to 008fdd2 Compare December 10, 2021 14:15
@slyon slyon changed the title keyfile: do not try to write out unvalidated YAML keyfile: do not try to write out unvalidated YAML (LP: #1952967) Dec 10, 2021
@slyon slyon force-pushed the slyon/lp1952967-nmtui-tunnels branch from 008fdd2 to ad389f1 Compare December 16, 2021 11:44
@slyon slyon requested a review from schopin-pro January 5, 2022 10:31
Copy link
Contributor

@schopin-pro schopin-pro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, although I wouldn't have expected this many different changes from the PR description. But then, who am I to talk 😉

There's only a small nitpick, but you can disregard it and merge if you feel like it.

tests/parser/base.py Outdated Show resolved Hide resolved
tests/parser/base.py Show resolved Hide resolved
Co-authored-by: Simon Chopin <simon.chopin@canonical.com>
@slyon slyon merged commit e0a07bc into main Jan 6, 2022
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