fix(sdn): restore the virtual interface prefixes for set_vlan

b1ba991 removed _VIRTUAL_IFACE_PREFIXES while _is_physical_uplink still
read it. The AttributeError was swallowed by _find_switch_uplink, so
set_vlan never found an uplink on any node. Restore the constant and
cover both helpers with tests.

Closes #37
This commit is contained in:
Christian Manivong committed 2026-11-01 21:43:09 +01:00
1 parent cb29a42c31
commit d142db73e5
3 files changed
+71

No files matched your search

+11
View File
@@ -33,6 +33,17 @@ _JsonDict = dict[str, Any]
class ProxmoxSDNMixin:
"""Mixin providing SDN, VLAN and network-instance NAPALM methods."""
#: Name prefixes of Proxmox-internal and runtime virtual interfaces, never a switch uplink.
_VIRTUAL_IFACE_PREFIXES: tuple[str, ...] = (
"fwpr", # Proxmox firewall proxy veth
"fwln", # Proxmox firewall link veth
"tap", # VM tap devices
"veth", # generic veth pairs (containers)
"virbr", # libvirt bridges
"docker", # Docker virtual interfaces
"lxcbr", # LXC bridges
)
def _get_sdn_zones(self) -> list[_JsonDict]:
try:
return self._api.cluster.sdn.zones.get() or [] # type: ignore[union-attr]