Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse: fix renderer validation for nm-devices (LP: #2091755) #532

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

daniloegea
Copy link
Collaborator

@daniloegea daniloegea commented Dec 16, 2024

When we process a nm-device we check to see if the renderer is NetworkManager. If it's not set to NetworkManager we log a warning message and change the backend.

This verification can be only done after the netdef is processed. Move the verification so it happens after the call to process_mapping().

Fixes LP: #2091755

Reproducer:

network:
  version: 2
  nm-devices:
    NM-db5f0f67-1f4c-4d59-8ab8-3d278389cf87:
      renderer: NetworkManager
      networkmanager:
        uuid: "db5f0f67-1f4c-4d59-8ab8-3d278389cf87"
        name: "myvpnconnection"
        passthrough:
          connection.type: "vpn"
$ netplan --debug get --root-dir /tmp/fakeroot
** (process:70728): DEBUG: 15:57:33.741: starting new processing pass
** (process:70728): DEBUG: 15:57:33.741: netplan: NM-db5f0f67-1f4c-4d59-8ab8-3d278389cf87: handling NetworkManager passthrough device, settings are not fully supported.
** (process:70728): DEBUG: 15:57:33.741: nm-device: NM-db5f0f67-1f4c-4d59-8ab8-3d278389cf87: the renderer for nm-devices must be NetworkManager, it will be used instead of the defined one.
** (process:70728): DEBUG: 15:57:33.741: We have some netdefs, pass them through a final round of validation
** (process:70728): DEBUG: 15:57:33.741: Configuration is valid
network:
  version: 2
  nm-devices:
    NM-db5f0f67-1f4c-4d59-8ab8-3d278389cf87:
      renderer: NetworkManager
      networkmanager:
        uuid: "db5f0f67-1f4c-4d59-8ab8-3d278389cf87"
        name: "myvpnconnection"
        passthrough:
          connection.type: "vpn"

Note that the message the renderer for nm-devices must be NetworkManager, it will be used instead of the defined one is present even though the renderer is explicitly set to NetworkManager.

Description

Checklist

  • Runs make check successfully.
  • Retains 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.

When we process a nm-device we check to see if the renderer is
NetworkManager. If it's not set to NetworkManager we log a warning
message and change the backend.

This verification can be only done after the netdef is processed. Move
the verification so it happens after the call to process_mapping().

Fixes LP: #2091755
Copy link
Collaborator

@slyon slyon left a comment

Choose a reason for hiding this comment

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

lgtm

@daniloegea daniloegea merged commit e765570 into canonical:main Dec 18, 2024
16 checks passed
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