~slyon/netplan/+git/ubuntu:slyon/0101

Last commit made on 2020-12-09
Get this branch:
git clone -b slyon/0101 https://git.launchpad.net/~slyon/netplan/+git/ubuntu
Only Lukas Märdian can upload to this branch. If you are Lukas Märdian please log in for upload directions.

Branch merges

Branch information

Name:
slyon/0101
Repository:
lp:~slyon/netplan/+git/ubuntu

Recent commits

957cd6b... by Lukas Märdian

Changelog: keep it UNRELEASED for now

abedd11... by Lukas Märdian

Merge tag '0.101' into slyon/0101

3456d40... by Lukas Märdian

Update changelog and symbols

e445b87... by Lukas Märdian

Fix rename of matched interfaces at runtime (LP: #1904662) (#174)

Renaming of network interfaces was not working when running netplan apply and interfaces would only be renamed after a reboot via udev. There is some udev-rename logic inside cli/commands/apply.py, which doesn't seem to be working, though.

This seems to be related to systemd-udevd's NamePolicy=keep default, which is set explicitly as of systemd v240 [0][1] and prevents renaming of interfaces via udev, if the name was set once (i.e. during boot). Even before v240 this has be the (implicit) default, so I'm not sure if this rename logic has ever worked...

I reworked/refactored the renaming of interfaces in apply.py to make use of iproute2 ip link set eth_OLD set name eth_NEW command instead and also added an integration test.

In order to rename interfaces via iproute2, they need to be DOWN, therefore the new code is bringing all to-be-renamed interfaces - which are not defined to be critical - down during apply and renames them accordingly.

Also, there was another issue with the detection of physical interfaces, where the system's current network interface names (from netifaces.interfaces()) have been compared to config_manager.py's physical_interfaces list, which are not (always) actual interface names (but netplan IDs), especially for netplan definitions with a match condition. So I added another util to lookup/match the actual interface name for a given match: condition.

[0] https://www.freedesktop.org/software/systemd/man/systemd.net-naming-scheme.html
[1] https://github.com/systemd/systemd/blob/e62a7fea757f259eb330da5b6d3ab4ede46400a2/NEWS#L25

Commits:
* WIP: rename down interfaces on apply
* cli: improve rename of interfaces at runtime, during 'netplan apply'
* cli: fix linter
* WIP: refactor interface rename code
udevadm test-builtin net_setup_link seems to be only running once (at
boot time) and _not_ rename interfaces during 'netplan apply'
* cli: keep udev link changes like WakeOnLan=
* cli:utils: some cleanup
* cli: big cleanup + unit-tests
* tests: set-name on apply integration test
* cli: update comment about NamePolicy=keep rename

fad12c1... by Iaroslav Akimov <email address hidden>

Fix is_ovs_interface method in cli/ovs.py (LP: #1904633) (LP: #1905156) (#172)

This is a fix for 1904633 netplan crashes while loading incorrect config.

Co-authored-by: Lukas Märdian <email address hidden>

51644a6... by Lukas Märdian

Prepare 0.101 release

40aef1b... by Lukas Märdian

Documentation for get/set CLI and DBus Config/Try/Cancel/Apply/Get/Set (#173)

Add man pages for netplan get/set CLI and Config/Try/Cancel/Apply/Get/Set DBus methods.
This PR also adds a dbus-config feature flag, to indicate the availability of the DBus configuration management.

6eafac5... by Lukas Märdian

DBus Config Management (try-improvement) (#170)

This implements the io.netplan.Netplan /io/netplan/Netplan io.netplan.Netplan Config method, which creates new /io/netplan/Netplan/config/<ID> objects, providing the following methods:

    io.netplan.Netplan.Config Get
    io.netplan.Netplan.Config Set
    io.netplan.Netplan.Config Try
    io.netplan.Netplan.Config Apply
    io.netplan.Netplan.Config Cancel
    And also the io.netplan.Netplan.Config Changed signal.

Each new config object will copy the current global netplan state (from /etc/netplan) to /tmp/netplan-config-<ID> then Get/Set can be called on that temp directory. On Apply/Try it will backup the current global config to /tmp/netplan-config-BACKUP and copy over the current config state to /etc/netplan. On revert the data from /tmp/netplan-config-BACKUP will be restored.

0275cc0... by Lukas Märdian

test:integration: add link-local tests

link-local handling needs to be properly implemented in the
NetworkManager backend.

5b9ee56... by Lukas Märdian

Implement DBus try-commit handling (#134)

Implement the Try(uint32 timeoutInSeconds) and Cancel() command inside netplan-dbus and adopt the Apply() command according to spec. "Try(...)" calls netplan try, keeping stdin open. The "Apply()" command uses the SIGUSR1 signal, to send a confirmation to the netplan try process to confirm/commit the settings. The "Cancel()" command uses the SIGINT signal, to send a rejection to the netplan try child process.
The child process is being monitored, using events on the sd-event mainloop.

Commits:
* dbus: initial draft for try-commit handling
* dbus: improve try tests
* dbus: make linter happy
* cli:try: accept config on USR1 signal
* Revert changes to netplan/terminal.py
* Revert "Revert changes to netplan/terminal.py"
* dbus: use SIGINT/SIGUSR1 to cancel/confirm TRY
* dbus:try: check child status via waitpid/WNOHANG
* tests:dbus: adopt try test case
* terminal: make coverage happy
* dbus: integrate with sd-event mainloop
* dbus: avoid global *bus variable
* dbus: avoid global vars, use signal handlers, pass userdata
* dbus: cleanup
* dbus: move Confirm() into Apply(), as defined by the spec
* dbus: cleanup
* tests: try to improve codecov coverage
* Revert "tests: try to improve codecov coverage"
* dbus: cleanup sd_event
* dbus: remove unneeded safeguards for easier testability