Skip to content

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

Merged
schopin-pro merged 2 commits intomainfrom
slyon/netplan-try-state-regression
Nov 4, 2021
Merged

cli:apply: initialize self.state (LP: #1949104)#243
schopin-pro merged 2 commits intomainfrom
slyon/netplan-try-state-regression

Conversation

@slyon
Copy link
Contributor

@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
@slyon slyon requested a review from schopin-pro November 3, 2021 15:30
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 slyon requested a review from schopin-pro November 4, 2021 08:43
@slyon
Copy link
Contributor 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