get_snmp_information() reads each community from the community table's Name column and its access from the Type column.
New pure parser parse_snmp_community_access() in napalm_tplink_jetstream/parsers.py: community name → "rw" when its Type says write, "ro" otherwise. It shares the header/dashes table reading with parse_snmp_communities() (from #13), which keeps its behaviour.
get_snmp_information() uses it instead of its own row splitting. The "SNMP disabled" check is unchanged.
Why
The switch's table starts with an Index column. The getter took the first word of each row as the community, so the switch's public was reported as 1, and read the access from the second word (the name), so every community came out read-only.
Tests
Fixtures only (no device): tests/unit/test_snmp_information.py against the recorded jetstream-show-snmp-server-community.txt, plus that recording with a read-write row and with a read-only community named writers added in the same layout, and parser edge cases (no rows, no Name column, no Type column, unknown output). The getter tests failed before the change ({'1': ...} instead of {'public': ...}).
pytest 64 passed, ruff format/check clean, mypy clean, napalm-standard ratchet within the baseline (tplink_jetstream.py 2013→1999 lines), napalm-standard check passes.
## What
`get_snmp_information()` reads each community from the community table's `Name` column and its access from the `Type` column.
- New pure parser `parse_snmp_community_access()` in `napalm_tplink_jetstream/parsers.py`: community name → `"rw"` when its `Type` says write, `"ro"` otherwise. It shares the header/dashes table reading with `parse_snmp_communities()` (from #13), which keeps its behaviour.
- `get_snmp_information()` uses it instead of its own row splitting. The "SNMP disabled" check is unchanged.
## Why
The switch's table starts with an `Index` column. The getter took the first word of each row as the community, so the switch's `public` was reported as `1`, and read the access from the second word (the name), so every community came out read-only.
## Tests
Fixtures only (no device): `tests/unit/test_snmp_information.py` against the recorded `jetstream-show-snmp-server-community.txt`, plus that recording with a `read-write` row and with a read-only community named `writers` added in the same layout, and parser edge cases (no rows, no `Name` column, no `Type` column, unknown output). The getter tests failed before the change (`{'1': ...}` instead of `{'public': ...}`).
pytest 64 passed, ruff format/check clean, mypy clean, `napalm-standard ratchet` within the baseline (`tplink_jetstream.py` 2013→1999 lines), `napalm-standard check` passes.
Closes #14
The switch's community table starts with an Index column. The getter
took the first word of each row as the community, so "public" was
reported as "1", and read the access from the second word, the name,
so every community came out read-only. It now uses the header-based
community table parser: the name from Name, the access from Type.
Closes#14
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
get_snmp_information()reads each community from the community table'sNamecolumn and its access from theTypecolumn.parse_snmp_community_access()innapalm_tplink_jetstream/parsers.py: community name →"rw"when itsTypesays write,"ro"otherwise. It shares the header/dashes table reading withparse_snmp_communities()(from #13), which keeps its behaviour.get_snmp_information()uses it instead of its own row splitting. The "SNMP disabled" check is unchanged.Why
The switch's table starts with an
Indexcolumn. The getter took the first word of each row as the community, so the switch'spublicwas reported as1, and read the access from the second word (the name), so every community came out read-only.Tests
Fixtures only (no device):
tests/unit/test_snmp_information.pyagainst the recordedjetstream-show-snmp-server-community.txt, plus that recording with aread-writerow and with a read-only community namedwritersadded in the same layout, and parser edge cases (no rows, noNamecolumn, noTypecolumn, unknown output). The getter tests failed before the change ({'1': ...}instead of{'public': ...}).pytest 64 passed, ruff format/check clean, mypy clean,
napalm-standard ratchetwithin the baseline (tplink_jetstream.py2013→1999 lines),napalm-standard checkpasses.Closes #14