Format NetworkManager connection name correctly for VLANs (#4986)

* Format NetworkManager connection name correctly for VLANs

Make sure NetworkManager connections are named correctly for VLANs
as well (<interface-name>.<vlan-id>).

* Avoid extending VLAN configuration name
This commit is contained in:
Stefan Agner 2024-04-02 21:07:39 +02:00 committed by GitHub
parent d26058ac80
commit a9265afd4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,8 +37,8 @@ def get_connection_from_interface(
# Generate/Update ID/name
if not name or not name.startswith("Supervisor"):
name = f"Supervisor {interface.name}"
if interface.type == InterfaceType.VLAN:
name = f"{name}.{interface.vlan.id}"
if interface.type == InterfaceType.VLAN:
name = f"{name}.{interface.vlan.id}"
if interface.type == InterfaceType.ETHERNET:
iftype = "802-3-ethernet"