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

cli:apply: initialize self.state (LP: #1949104) #243

Merged
merged 2 commits into from
Nov 4, 2021

Conversation

slyon
Copy link
Collaborator

@slyon slyon commented Nov 3, 2021

Description

The self.state attribute needs to be available even if NetplanApply() is not executed via the command line (and thus the run() method is not executed).

Fixes a regression in #231

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#1949104

The attribute needs to be available even if NetplanApply() is not executed via
the commandline (and thus the run() method is not executed).
@slyon slyon changed the title cli:apply: initialize self.state cli:apply: initialize self.state (LP: #1949104) Nov 3, 2021
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, but it'd be even nicer with a test that triggers the fixed bug :)

@slyon
Copy link
Collaborator Author

slyon commented Nov 4, 2021

I agree. netplan try modifies the running system, so we cannot easily wrap this into an unit test. But I've created two new integration tests that execute netplan try and accept and reject the configuration accordingly, checking for the correct output.

@schopin-pro schopin-pro merged commit a6e8366 into main Nov 4, 2021
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.

2 participants