getters report unsupported or failed reads as empty (Plus MAC/LLDP/config/…, Plus VLAN fetch, Smart get_snmp_config) #21

Closed
opened 2026-11-02 08:12:45 +00:00 by christianmanivong · 0 comments
Owner

What happens

Several getters answer "nothing there" for a read that did not happen or failed, against the driver standard ("a failed read raises"; a read the device cannot do is NotImplementedError):

  • netgear_plus, reads the HTTP interface cannot do: get_mac_address_table (napalm_netgear/netgear_plus.py:399, docstring "Not available via the HTTP web interface … Returns an empty list."), the LLDP getters (~415-429), get_config (~514-526), get_users, get_snmp_information, NTP, spanning tree, port channels, dot1x and MAC ACL (~574-639) return empty values without asking the switch. A caller cannot tell "not supported" from "read, none" — netOrk treats an empty MAC table or LLDP answer as the device's state. (get_arp_table returning [] is fine: the switches are L2 only.)
  • netgear_plus get_vlans_detail (~443-450): a failed fetch of vlan.cgi returns {}:
    except Exception:
        return {}
    
    and a non-200 answer or empty body likewise. get_vlans also returns the VLAN ids as strings where NAPALM's get_vlans uses int keys.
  • netgear_smart get_snmp_config (napalm_netgear/netgear_smart.py ~1850-1853): show snmp failing returns None, the same as "no SNMP".

Expected

Unsupported reads raise NotImplementedError (netOrk's capability check then skips them); a failed request raises; get_vlans keys are int. Test-first per getter.

Priority: P3 — empty MAC/LLDP/VLAN state stored for Plus switches after a transient error or for reads that never happened.

Found during the bug sweep of 2026-11-02 (#19).

## What happens Several getters answer "nothing there" for a read that did not happen or failed, against the driver standard ("a failed read raises"; a read the device cannot do is `NotImplementedError`): - **netgear_plus, reads the HTTP interface cannot do:** `get_mac_address_table` (`napalm_netgear/netgear_plus.py:399`, docstring "Not available via the HTTP web interface … Returns an empty list."), the LLDP getters (~415-429), `get_config` (~514-526), `get_users`, `get_snmp_information`, NTP, spanning tree, port channels, dot1x and MAC ACL (~574-639) return empty values without asking the switch. A caller cannot tell "not supported" from "read, none" — netOrk treats an empty MAC table or LLDP answer as the device's state. (`get_arp_table` returning `[]` is fine: the switches are L2 only.) - **netgear_plus `get_vlans_detail`** (~443-450): a failed fetch of `vlan.cgi` returns `{}`: ```python except Exception: return {} ``` and a non-200 answer or empty body likewise. `get_vlans` also returns the VLAN ids as strings where NAPALM's `get_vlans` uses `int` keys. - **netgear_smart `get_snmp_config`** (`napalm_netgear/netgear_smart.py` ~1850-1853): `show snmp` failing returns `None`, the same as "no SNMP". ## Expected Unsupported reads raise `NotImplementedError` (netOrk's capability check then skips them); a failed request raises; `get_vlans` keys are `int`. Test-first per getter. Priority: P3 — empty MAC/LLDP/VLAN state stored for Plus switches after a transient error or for reads that never happened. Found during the bug sweep of 2026-11-02 (#19).
christianmanivong added the
prio
P3
bug
labels 2026-11-02 08:12:45 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-netgear#21