netplan:slyon/nm-4

Last commit made on 2021-01-28
Get this branch:
git clone -b slyon/nm-4 https://git.launchpad.net/netplan

Branch merges

Branch information

Name:
slyon/nm-4
Repository:
lp:netplan

Recent commits

7d34713... by Lukas Märdian

serialize: cleanup formatting

42f5400... by Lukas Märdian

serialize: enable testing

6c37643... by Lukas Märdian

parse: passthrough & backend_settings for ND/AP

ba21fd3... by Lukas Märdian

serialize: add new module to export YALM

2afecba... by Lukas Märdian

parse:networkd: enable WIFI_MODE_OTHER

3089b1e... by Lukas Märdian

NM: refactor keyfile generator, by using GLib's keyfile writer instead of custom writer (#184)

This is the 3rd in a series of pull requests to enable the implementation of a YAML/netplan backend for NetworkManager.

In this PR netplan's current keyfile generation code (in nm.c) is refactored to make use of GLib's keyfile writer, instead of using a custom, home grown approach. This way the keyfile settings can easily be read, written and overwritten (e.g. by the keyfile passthrough/fallback settings in #183) and it should be more robust overall.

While on it: Clean up the usage of keyfile alias for ethernet, wifi and wifi-security, which NetworkManager writes by default since a long time.

Commits:
* nm: refactoring to use GKeyFile writer, instead of home grown
* nm: uses alias for 'ethernet', 'wifi' and 'wifi-security'
NetworkManager writes the alias for 'ethernet' (802-3-ethernet), 'wifi' (802-11-wireless) and 'wifi-security' (802-11-wireless-security) settings by default since a long time, we should do so as well. Especially we should not mix and match.
see:
https://bugzilla.gnome.org/show_bug.cgi?id=696940 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/c36200a225aefb2a3919618e75682646899b82c0
nm_keyfile_plugin_kf_set* from nm-keyfile-utils.c (libnm-core)

1ab7541... by Lukas Märdian

Implement netplan_generate and netplan_delete_connection APIs (#182)

This is 2nd in a series of pull request implementing the functionality in libnetplan to provide a NetworkManager YAML backend. It builds upon #181

* It improves the netplan set CLI a bit, to delete a file, if only network: {version: 2} is left.
* It implements a netplan_generate function, which will call netplan generate in the background by spawning another process.
  * At some point the generate binary should be refactored, to call functions of libnetplan instead, so we could use this same (refactored) functionality inside the library directly
  * But for now this is as good as it gets...
* It implements a netplan_delete_connection function, which will delete a connection from the YAML structure of a file (or potentially the whole file, if it is empty afterwards), by utilizing the netplan set network.TYPE.IFNAME=NULL functionality by spawning another process.
  * At some point we should get rid of this Python/C split of the YAML parsers, to have all the functionality available inside the C library.
  * But for now this is as good as it gets, without duplicating any logic...

11bcbd5... by Lukas Märdian

Prepare for NetworkManager YAML backend functionality (#181)

This is the first in a series of pull request to be prepared for setting up the functionality for a NetworkManager YAML/netplan backend, to be merged into slyon/networkmanager-yaml-backend before it will collectively be merged into master.

This PR refactors some of the YAML processing logic into libnetplan (from the generate binary), keeps track of the filename (absolute path) of the YAML file for each NetplanNetDefinition and implements a first additional library function netplan_get_id_from_nm_filename, which will output the NetplanNetDefinition ID given a path to a netplan generated .nmconnection keyfile in /run/NetworkManager/system-connections/.

The netplan ID is not stored inside NM's data structures, therefore we need a way to gain netplan's identifier for any given connection profile.

Commits:
* parse:generate: refactor process_yaml_hierarchy
* parse: track filename of netdefs
* parse: add netplan_get_id_from_filename library function
* parse: fix typo
* generate: some stylistic cleanup
* util: move netplan_get_id_from_nm_filename from parse.c

bdc2b1d... by Lucas Mlsna <email address hidden>

Clarified `dhcp-identifier` option (#186)

Added information about the other accepted scalar duid which can be specified or is assumed if the option is omitted entirely.

1413f0e... by Lukas Märdian

tests:integration: adopt for racy systemd MAC assignment