fix(plus)!: drop set_vlan, delete_vlan and set_interface stubs

The three methods only raised NotImplementedError. napalm-device-types
declares them on SwitchDriver for type checking only, so a driver that
cannot carry them out is meant not to have them; netOrk reads the
capability from the method being callable and offered "Add VLAN" and the
port VLAN editor on Plus switches, which then failed.

BREAKING CHANGE: NetgearPlusDriver has no set_vlan, delete_vlan or
set_interface attribute any more.

Closes #9
This commit is contained in:
Christian Manivong committed 2026-11-01 21:54:12 +01:00
1 parent fa56ed4cfa
commit 6f9914f29e
3 files changed
+25 -25

No files matched your search

+7
View File
@@ -18,6 +18,13 @@ All notable changes to this driver. The format follows
just now". The "Age (min)" column of `show arp` is not parsed until real switch just now". The "Age (min)" column of `show arp` is not parsed until real switch
output confirms its format (NetOrk/netork#1327). output confirms its format (NetOrk/netork#1327).
### Removed
- **Breaking:** the Netgear Plus driver no longer has `set_vlan`, `delete_vlan` and
`set_interface`. They only raised `NotImplementedError`; an application that tells
what a switch can do by whether the method exists offered VLAN and port editing on
Plus switches, and the action then failed. A caller that caught
`NotImplementedError` from them now finds no such attribute.
## [0.6.0] - 2026-10-23 ## [0.6.0] - 2026-10-23
The first release on PyPI, under the new name `napalm-netgear-switches`. The first release on PyPI, under the new name `napalm-netgear-switches`.
-25
View File
@@ -511,24 +511,6 @@ class NetgearPlusDriver(FirmwareOfferMixin, SwitchDriver):
for vid, info in detail.items() for vid, info in detail.items()
} }
def set_vlan(self, vlan_id: int, config: dict) -> None:
"""Create or update a VLAN.
Not supported via HTTP API.
"""
raise NotImplementedError(
"VLAN management is not supported for Netgear Plus switches via HTTP."
)
def delete_vlan(self, vlan_id: int) -> None:
"""Delete a VLAN.
Not supported via HTTP API.
"""
raise NotImplementedError(
"VLAN management is not supported for Netgear Plus switches via HTTP."
)
def get_config( def get_config(
self, self,
retrieve: str = "all", retrieve: str = "all",
@@ -723,13 +705,6 @@ class NetgearPlusDriver(FirmwareOfferMixin, SwitchDriver):
raise ValueError(f"{interface} is not a PoE port on this switch.") raise ValueError(f"{interface} is not a PoE port on this switch.")
self._connector.power_cycle_poe_port(port_number) self._connector.power_cycle_poe_port(port_number)
def set_interface(self, interface: str, config: dict) -> None:
"""Configure an interface.
Not supported via HTTP API.
"""
raise NotImplementedError("set_interface() is not supported for Netgear Plus switches.")
# ── SNMP / Health ────────────────────────────────────────────────────────── # ── SNMP / Health ──────────────────────────────────────────────────────────
def get_snmp_config(self): def get_snmp_config(self):
+18
View File
@@ -0,0 +1,18 @@
"""Netgear Plus only has the methods it can carry out.
An application reads a capability from the method being there: netOrk offers
"Add VLAN" and the port VLAN editor when ``set_vlan`` / ``set_interface`` are
callable (#9). A method that only raises NotImplementedError
made the HTTP-only Plus switches look able to do it.
"""
from __future__ import annotations
import pytest
from napalm_netgear.netgear_plus import NetgearPlusDriver
@pytest.mark.parametrize("method", ["set_vlan", "delete_vlan", "set_interface"])
def test_plus_has_no_vlan_or_port_writes(method):
assert not callable(getattr(NetgearPlusDriver, method, None))