Skip to content

networkd: reload/reconfigure#200

Merged
slyon merged 6 commits intomasterfrom
slyon/networkctl-restart
Mar 23, 2021
Merged

networkd: reload/reconfigure#200
slyon merged 6 commits intomasterfrom
slyon/networkctl-restart

Conversation

@slyon
Copy link
Contributor

@slyon slyon commented Mar 16, 2021

Description

Replace the calls of systemctl stop/start systemd-networkd.service with networkctl reload && networkctl reconfigure ... during the execution of netplan apply. The devices to be reconfigured are currently all interfaces managed by systemd-networkd, as read from networkctl. This makes the whole restart/apply process quicker and avoids network interruptions for netplan's networkd backend.

The reload & reconfigure commands are available as of systemd v244.

In addition to the Apply-CLI changes, corresponding methods in utils.py are updated/refactored and the unit-test coverage is being improved.

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.

@codecov-io
Copy link

codecov-io commented Mar 16, 2021

Codecov Report

Merging #200 (4632259) into master (abad253) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #200      +/-   ##
==========================================
+ Coverage   98.98%   99.00%   +0.01%     
==========================================
  Files          54       54              
  Lines        8215     8316     +101     
==========================================
+ Hits         8132     8233     +101     
  Misses         83       83              
Impacted Files Coverage Δ
netplan/cli/commands/apply.py 100.00% <100.00%> (ø)
netplan/cli/utils.py 100.00% <100.00%> (ø)
tests/test_utils.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 abad253...4632259. Read the comment docs.

@slyon slyon force-pushed the slyon/networkctl-restart branch from 208d50b to 2b4f035 Compare March 16, 2021 12:36
@slyon slyon marked this pull request as ready for review March 19, 2021 11:02
@slyon slyon requested a review from sil2100 March 19, 2021 11:19
Copy link
Contributor

@sil2100 sil2100 left a comment

Choose a reason for hiding this comment

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

Ok, this looks smooth. Thanks! (just one inline enhancement proposed)

make use of list.extend() instead of individual list.append()s

Co-authored-by: Łukasz Zemczak <[email protected]>
@slyon slyon merged commit 3ec52c4 into master Mar 23, 2021
@slyon slyon deleted the slyon/networkctl-restart branch March 23, 2021 13:22
@slyon slyon changed the title networkd: restart/reconfigure networkd: reload/reconfigure Aug 5, 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.

3 participants