Commit Graph
14 Commits
Author SHA1 Message Date
Christian Manivong 9df131db78 fix(snmp): read get_snmp_information's community from the Name column
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 16s
driver / test (3.12) (pull_request) Successful in 1m5s
driver / types (pull_request) Successful in 1m12s
driver / test (3.13) (pull_request) Successful in 1m4s
driver / lowest (pull_request) Successful in 30s
driver / build (pull_request) Successful in 33s
driver / security (pull_request) Successful in 1m13s
CI / driver (pull_request) Successful in 2m55s
driver / publish (pull_request) Skipped
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
2026-11-02 08:40:54 +01:00
Christian Manivong 8e7be0e47e fix(snmp): read the community from the Name column
driver / standard (pull_request) Successful in 14s
driver / lint (pull_request) Successful in 12s
driver / types (pull_request) Successful in 59s
driver / test (3.12) (pull_request) Successful in 58s
driver / test (3.13) (pull_request) Successful in 50s
driver / lowest (pull_request) Successful in 24s
driver / build (pull_request) Successful in 26s
driver / security (pull_request) Successful in 1m2s
CI / driver (pull_request) Successful in 2m26s
driver / publish (pull_request) Skipped
The switch's community table starts with an Index column, and
get_snmp_config took a row's first word, so it reported the community
as "1". The name now comes from the column headed Name, found in the
header line above the dashes; the tests read the recorded table.

Found while recording fixtures for #3.
2026-11-01 22:19:33 +01:00
Christian Manivong 34f00f9f3a fix(snmp): report no community instead of inventing "public"
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 56s
driver / test (3.12) (pull_request) Successful in 57s
driver / test (3.13) (pull_request) Successful in 51s
driver / lowest (pull_request) Successful in 25s
driver / build (pull_request) Successful in 26s
driver / security (pull_request) Successful in 1m2s
CI / driver (pull_request) Successful in 2m28s
driver / publish (pull_request) Skipped
get_snmp_config started from community "public" and returned it with
running=True when no row of the community table parsed. Without a listed
community it now reports the agent as not running, as it already did for
"no community entry exists".

The issue's other two points were already fixed on main: the management
VLAN is matched exactly since c2f0f7c (_management_vlan, with the
caller's listen address), and the floor on napalm-device-types is 4.21.1
with no requirements.txt since 4e171bf.

Closes #3
2026-11-01 21:52:55 +01:00
Christian Manivong f515859472 fix(ping): list replies only, not timed-out requests
Each "Request timed out" line went into results with the timeout as its
RTT. NAPALM's results hold replies, and a sweep treats a non-empty
results list as a live host, so dead hosts showed up in LAN scans.

Closes #2
2026-11-01 21:52:30 +01:00
christianmanivong 086dd8e3ed Merge pull request 'fix: an unknown ARP age is -1.0, not 0.0' (#11) from fix/arp-unknown-age into main
driver / standard (push) Successful in 17s
driver / lint (push) Successful in 13s
driver / types (push) Successful in 1m1s
driver / test (3.12) (push) Successful in 1m3s
driver / lowest (push) Failing after 6s
driver / test (3.13) (push) Successful in 58s
driver / build (push) Failing after 8s
driver / security (push) Successful in 1m6s
CI / driver (push) Failing after 2m39s
driver / publish (push) Skipped
2026-10-30 09:20:28 +00:00
Christian Manivong d14c11e991 fix(ssh): keep the key exchange off DH group16
driver / lint (pull_request) Successful in 14s
driver / standard (pull_request) Successful in 19s
driver / types (pull_request) Successful in 1m9s
driver / test (3.13) (pull_request) Successful in 58s
driver / test (3.12) (pull_request) Successful in 1m7s
driver / lowest (pull_request) Successful in 28s
driver / build (pull_request) Successful in 33s
driver / security (pull_request) Successful in 1m8s
CI / driver (pull_request) Successful in 2m25s
driver / publish (pull_request) Skipped
The switch offers diffie-hellman-group14-sha256 and group16-sha512 only,
and paramiko picks group16. On an SG2210P with firmware 5.30 that 4096-bit
exchange takes 9 to 16 seconds, against netmiko's 10-second conn_timeout:
paramiko then tries to log in on a transport whose key exchange has not
finished and fails with "No existing session", so every other poll failed
and netOrk flapped the switch between online and offline. group14 takes
1.5 seconds.

group16 is now disabled by default; a disabled_algorithms passed in
optional_args still wins. The netmiko arguments move into _ssh.py, so
tplink_jetstream.py keeps its recorded length.
2026-10-30 09:17:48 +01:00
Christian Manivong 3f1bb159d5 fix: an unknown ARP age is -1.0, not 0.0
driver / standard (pull_request) Successful in 19s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 1m7s
driver / test (3.12) (pull_request) Successful in 1m3s
driver / test (3.13) (pull_request) Successful in 1m2s
driver / lowest (pull_request) Successful in 27s
driver / build (pull_request) Successful in 34s
driver / security (pull_request) Successful in 1m15s
CI / driver (pull_request) Successful in 2m51s
driver / publish (pull_request) Skipped
show arp has no age column, so get_arp_table reports ARP_AGE_UNKNOWN
instead of 0.0 ("confirmed just now").

NetOrk/netork#1327
2026-10-30 08:37:08 +01:00
Christian Manivong 4e171bff30 chore: adopt the NAPALM driver standard
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 15s
driver / types (pull_request) Successful in 55s
driver / test (3.10) (pull_request) Successful in 1m6s
driver / test (3.11) (pull_request) Successful in 59s
driver / test (3.12) (pull_request) Successful in 47s
driver / test (3.13) (pull_request) Successful in 44s
driver / lowest (pull_request) Successful in 24s
driver / security (pull_request) Successful in 52s
driver / build (pull_request) Successful in 29s
CI / driver (pull_request) Successful in 6m47s
driver / publish (pull_request) Skipped
- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
  of NAPALM/driver-standard. .github/ goes with publish.yml and tests.yml:
  PyPI Trusted Publishing never worked from Gitea.
- requirements.txt goes: it only repeated the pyproject dependencies, with
  an older napalm-device-types floor and without paramiko.
- LICENSE file (the README already pointed to it), CHANGELOG, py.typed,
  SPDX license string, links to git.netork.io (README included);
  napalm-device-types >=4.21.1, a dev extra with floors.
- netaddr gets a true floor (>=0.7.10): unbounded, the lowest job
  installed a version without IPAddress, which napalm imports.
- mypy strict for the package; napalm_tplink_jetstream.tplink_jetstream is
  exempt for now (96 errors), recorded in the quality baseline with its
  long functions and the 2000-line module. Coverage floor 36 % (measured
  36.71 %).
2026-10-23 08:48:12 +02:00
Christian Manivong bef2f23ab2 fix: what bandit and the remaining lint rules found
- set_interface: the except Exception: pass around reading the old
  untagged VLANs now logs at debug level (B110), with a module logger.
- nosec for the empty password field of get_users (B105, now a named
  constant); a false positive.
- Two docstrings quoting tabular device output keep their lines (noqa
  E501); a long docstring and an error message are shortened or split;
  the unused duplex column is named _duplex.
- tests: a get_facts test named SHOW_INTERFACE, which does not exist; it
  is SHOW_INTERFACE_STATUS. raise ... from exc.
2026-10-23 08:46:36 +02:00
Christian Manivong e53a4b4cc6 style: ruff format and the lint rules of the driver standard
Mechanical: ruff format, and ruff check --fix with the rule set every NAPALM
driver uses (E, F, I, UP, B at line length 100, Python 3.10). What ruff
cannot fix comes in the next commit.
2026-10-23 08:45:32 +02:00
Christian Manivong e4f57d3c3a fix(ssh): verify the host key netOrk expects, report the one seen (NetOrk/netork#1167)
Tests / Test (Python 3.10) (pull_request) Successful in 28s
Tests / Test (Python 3.11) (pull_request) Successful in 56s
Tests / Test (Python 3.12) (pull_request) Successful in 34s
The driver accepted any SSH host key. It now verifies through
napalm-device-types' HostKeyCheck (>= 4.19.0): with a known key in
optional_args["ssh_host_keys"] any other key is refused before login, and
every key seen is reported to optional_args["ssh_host_key_observer"].
Without either argument it connects as before (first use).
2026-10-18 21:23:42 +02:00
Christian Manivong c2f0f7c20a feat!: configure_snmp_agent with the caller's values replaces fix_snmp (0.3.0)
Tests / Test (Python 3.10) (pull_request) Successful in 17s
Tests / Test (Python 3.11) (pull_request) Successful in 17s
Tests / Test (Python 3.12) (pull_request) Successful in 21s
fix_snmp hard-coded community "public" and found the management VLAN
for the source interface with a substring match, so 10.0.0.1 matched
10.0.0.10 and a DNS name never matched (#3).

The driver implements napalm-device-types 4.13's configure_snmp_agent
steps: the caller's community (read-only, viewDefault), the source
interface set to the VLAN whose address is exactly the listen address
or the management address, configuration saved, and the community
checked in show snmp community. Contact and location are reported as
not set; there is no verified CLI for them on this switch. A value
that would break the CLI is refused.

The requirements now name napalm-device-types 4.13 in both files.

BREAKING CHANGE: run_device_action is removed.

Part of #3 and #4.
2026-10-17 08:36:52 +02:00
Christian Manivong b01d70aa3c feat: declare the SNMP health OIDs instead of collecting them (0.2.0)
Tests / Test (Python 3.10) (pull_request) Successful in 22s
Tests / Test (Python 3.11) (pull_request) Successful in 21s
Tests / Test (Python 3.12) (pull_request) Successful in 24s
The driver no longer collects over SNMP. SNMP_HEALTH_PROFILE states
where the switch publishes uptime (TimeTicks), CPU and memory (tables
with one row per stack unit, first row as before); the application
polls and computes (napalm-device-types docs/STRUCTURE.md).

Interface counters now come from the 64-bit ifXTable where the switch
has it, as the application reads them for every device.
2026-10-16 12:02:32 +02:00
Christian Manivong 6a04796dd7 Inital commit 2026-05-09 19:05:49 +02:00