Tags: slyon/netplan
Tags
nm:parse-nm: handle differing ip6-privacy default value (canonical#263) Commit 64e381e (canonical#244) changed netplan's behaviour to always write out the ipv6-privacy value (default to 0=off), in order to comply with what is written in our documentation and how it is implemented in the networkd backend. This is a problem for our NetworkManager integration, as NM's default value is -1=unknown. Netplan only supports values 0=off and 2=on while NM supports -1, 0, 1 and 2. We need to handle unsupported cases (-1 and 1) via passthrough.
cli: Fix failure with "set-name" and "bridges" (canonical#221) The code path when a config has set-name as well as bridges doesn't seem to work at present, failure below. This change seems to fix it. Config: ``` network: version: 2 # renderer: networkd # networkd doesn't handle ethernet well... renderer: NetworkManager ethernets: devnet: renderer: networkd match: name: enx00aa11223344 enx00bb11223344: addresses: [ 10.20.0.1/24 ] renderer: networkd wlan: match: macaddress: 00:99:11:22:33:44 set-name: "wlan0" bridges: # ... and NetworkManager doesn't handle bridges well renderer: networkd br0: addresses: [ "10.9.0.1/16" ] interfaces: [ "devnet" ] ``` Failure: ``` netplan try Traceback (most recent call last): File "/usr/share/netplan/netplan/cli/commands/try_command.py", line 84, in command_try NetplanApply().command_apply(run_generate=True, sync=True, exit_on_error=False) File "/usr/share/netplan/netplan/cli/commands/apply.py", line 191, in command_apply changes = NetplanApply.process_link_changes(devices, config_manager) File "/usr/share/netplan/netplan/cli/commands/apply.py", line 281, in process_link_changes if NetplanApply.is_composite_member(composite_interfaces, phy): File "/usr/share/netplan/netplan/cli/commands/apply.py", line 252, in is_composite_member members = settings.get('interfaces', []) AttributeError: 'str' object has no attribute 'get' ``` COMMITS: * cli: Fix handling "set-name" with composites * tests: add CLI unittests Co-authored-by: Lukas Märdian <slyon@ubuntu.com>
parser: refactor / factor out validation and error reporting Move validation and error reporting to their own files; also rework the validation passes slightly to validate as much as we can of the netplan grammar in parser passes (so we get context info for errors), and leave the backend rules sanity checking only to after the parsing. This way we'll get the error context, unless things are backend-specific rules for which it's just hard to get the info (and not as helpful).
PreviousNext