#21: unread or failed reads are no longer reported as empty
Netgear Plus no longer overrides the NAPALM getters its web interface cannot do: get_mac_address_table, get_lldp_neighbors, get_lldp_neighbors_detail, get_config, get_users, get_snmp_information, get_ntp_servers, get_ntp_peers, get_ntp_stats. They fall through to NAPALM's stub, which raises NotImplementedError and lets an application see that the driver does not override it. They returned empty values without asking the switch. get_arp_table still returns [] (L2 only).
Breaking: Netgear Plus no longer has get_spanning_tree, get_port_channels, get_dot1x_ports and get_mac_acl. They returned {} without asking the switch. napalm-device-types only declares them, so an application tells capability by the method being there, as with the VLAN writes in #9.
Netgear Plus get_vlans_detail (and get_vlans through it) raises when vlan.cgi cannot be read: ConnectionException when the request fails, RuntimeError for a non-200 answer or an empty page. The fetch moves into _fetch_vlan_page (get_vlans_detail 67→58 lines, complexity under the limit).
Breaking: Netgear Plus get_vlans keys are int, as in NAPALM. get_vlans_detail keeps its string keys.
Smart get_snmp_config raises when show snmp fails instead of returning None ("no SNMP").
## What
**#21: unread or failed reads are no longer reported as empty**
- Netgear Plus no longer overrides the NAPALM getters its web interface cannot do: `get_mac_address_table`, `get_lldp_neighbors`, `get_lldp_neighbors_detail`, `get_config`, `get_users`, `get_snmp_information`, `get_ntp_servers`, `get_ntp_peers`, `get_ntp_stats`. They fall through to NAPALM's stub, which raises `NotImplementedError` and lets an application see that the driver does not override it. They returned empty values without asking the switch. `get_arp_table` still returns `[]` (L2 only).
- **Breaking:** Netgear Plus no longer has `get_spanning_tree`, `get_port_channels`, `get_dot1x_ports` and `get_mac_acl`. They returned `{}` without asking the switch. napalm-device-types only declares them, so an application tells capability by the method being there, as with the VLAN writes in #9.
- Netgear Plus `get_vlans_detail` (and `get_vlans` through it) raises when `vlan.cgi` cannot be read: `ConnectionException` when the request fails, `RuntimeError` for a non-200 answer or an empty page. The fetch moves into `_fetch_vlan_page` (`get_vlans_detail` 67→58 lines, complexity under the limit).
- **Breaking:** Netgear Plus `get_vlans` keys are `int`, as in NAPALM. `get_vlans_detail` keeps its string keys.
- Smart `get_snmp_config` raises when `show snmp` fails instead of returning `None` ("no SNMP").
- README getter table updated to match.
**#22: README requirements**
The table lists every dependency with the floor `pyproject.toml` declares: NAPALM 5.1 (was 4.0), plus paramiko and netaddr.
## Why
A caller could not tell "not supported" or "could not read" from "read, none".
## Tests
Fixtures only (no device). `tests/unit/test_reads_not_empty.py`:
- each Plus NAPALM getter is NAPALM's own stub and raises;
- the four switch-role getters are absent;
- ARP stays `[]`;
- `vlan.cgi` is parsed from a page in the layout the parser documents (no recording exists), and `get_vlans` gives int keys;
- a failed fetch, `None`, HTTP 500 and an empty page raise;
- Smart `get_snmp_config` raises with `show snmp` failing.
19 of them failed before the change.
pytest 131 passed, ruff format/check clean, mypy clean, `napalm-standard check` passes, `napalm-standard ratchet` within the baseline (tightened: `get_vlans_detail` gone from complexity, 58 lines; Smart `get_snmp_config` complexity 16→15; `netgear_smart.py` 2067→2063 lines).
Closes #21
Closes #22
The requirements table named NAPALM 4.0 where pyproject.toml requires
5.1, and left out paramiko and netaddr. It now lists every dependency
with the floor pyproject.toml declares.
Closes#22
Netgear Plus answered reads its web interface cannot do (MAC table,
LLDP, config, users, SNMP, NTP) with empty values without asking the
switch; those now fall through to NAPALM's NotImplementedError, and the
switch-role getters that only returned {} (spanning tree, port channels,
802.1X, MAC ACL) are gone, as device-types reads capability from the
method being there. get_vlans_detail raises when vlan.cgi cannot be
read, get_vlans keys VLANs by int, and Smart get_snmp_config raises when
show snmp fails instead of reading as "no SNMP".
Closes#21
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
#21: unread or failed reads are no longer reported as empty
get_mac_address_table,get_lldp_neighbors,get_lldp_neighbors_detail,get_config,get_users,get_snmp_information,get_ntp_servers,get_ntp_peers,get_ntp_stats. They fall through to NAPALM's stub, which raisesNotImplementedErrorand lets an application see that the driver does not override it. They returned empty values without asking the switch.get_arp_tablestill returns[](L2 only).get_spanning_tree,get_port_channels,get_dot1x_portsandget_mac_acl. They returned{}without asking the switch. napalm-device-types only declares them, so an application tells capability by the method being there, as with the VLAN writes in #9.get_vlans_detail(andget_vlansthrough it) raises whenvlan.cgicannot be read:ConnectionExceptionwhen the request fails,RuntimeErrorfor a non-200 answer or an empty page. The fetch moves into_fetch_vlan_page(get_vlans_detail67→58 lines, complexity under the limit).get_vlanskeys areint, as in NAPALM.get_vlans_detailkeeps its string keys.get_snmp_configraises whenshow snmpfails instead of returningNone("no SNMP").#22: README requirements
The table lists every dependency with the floor
pyproject.tomldeclares: NAPALM 5.1 (was 4.0), plus paramiko and netaddr.Why
A caller could not tell "not supported" or "could not read" from "read, none".
Tests
Fixtures only (no device).
tests/unit/test_reads_not_empty.py:[];vlan.cgiis parsed from a page in the layout the parser documents (no recording exists), andget_vlansgives int keys;None, HTTP 500 and an empty page raise;get_snmp_configraises withshow snmpfailing.19 of them failed before the change.
pytest 131 passed, ruff format/check clean, mypy clean,
napalm-standard checkpasses,napalm-standard ratchetwithin the baseline (tightened:get_vlans_detailgone from complexity, 58 lines; Smartget_snmp_configcomplexity 16→15;netgear_smart.py2067→2063 lines).Closes #21
Closes #22
Netgear Plus answered reads its web interface cannot do (MAC table, LLDP, config, users, SNMP, NTP) with empty values without asking the switch; those now fall through to NAPALM's NotImplementedError, and the switch-role getters that only returned {} (spanning tree, port channels, 802.1X, MAC ACL) are gone, as device-types reads capability from the method being there. get_vlans_detail raises when vlan.cgi cannot be read, get_vlans keys VLANs by int, and Smart get_snmp_config raises when show snmp fails instead of reading as "no SNMP". Closes #21