Commit Graph
31 Commits
Author SHA1 Message Date
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
christianmanivong 8b94818269 Merge pull request 'fix(ssh): verify the host key netOrk expects, report the one seen (NetOrk/netork#1167)' (#7) from fix/ssh-host-key-tofu-1167 into main
Tests / Test (Python 3.10) (push) Successful in 30s
Tests / Test (Python 3.11) (push) Successful in 46s
Tests / Test (Python 3.12) (push) Successful in 30s
2026-10-18 19:23:43 +00: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
christianmanivong 03300b7954 Merge pull request 'feat!: configure_snmp_agent with the caller's values replaces fix_snmp (0.3.0)' (#6) from feat/snmp-agent-template into main
Tests / Test (Python 3.10) (push) Successful in 17s
Tests / Test (Python 3.11) (push) Successful in 17s
Tests / Test (Python 3.12) (push) Successful in 21s
2026-10-17 06:48:20 +00: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
christianmanivong f4d553b7df Merge pull request 'feat: declare the SNMP health OIDs instead of collecting them (0.2.0)' (#5) from feat/snmp-health-profile into main
Tests / Test (Python 3.10) (push) Successful in 22s
Tests / Test (Python 3.11) (push) Successful in 21s
Tests / Test (Python 3.12) (push) Successful in 25s
2026-10-16 23:06:59 +00: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
christianmanivong e8c8515984 Merge pull request 'ci: install napalm-device-types from git, so the tests run at all' (#1) from fix/ci-device-types-from-git into main
Tests / Test (Python 3.10) (push) Successful in 1m13s
Tests / Test (Python 3.11) (push) Successful in 17s
Tests / Test (Python 3.12) (push) Successful in 22s
2026-10-03 23:23:38 +00:00
Christian Manivong 786f05faac ci: install napalm-device-types from git, so the tests run at all
Tests / Test (Python 3.10) (pull_request) Successful in 17s
Tests / Test (Python 3.11) (pull_request) Successful in 16s
Tests / Test (Python 3.12) (pull_request) Successful in 21s
Every CI run died at "pip install -e .[dev]": pyproject.toml asks for
napalm_device_types, which lives in git.netork.io/NAPALM rather than on PyPI,
and pip found only an unrelated 0.1.0 there. Not one test had run in CI.

The workflow now installs napalm-device-types from git first. The matrix
drops 3.8/3.9 and requires-python says >=3.10, because napalm-device-types
itself needs 3.10 -- the package never installed on anything older.

Replayed in a fresh venv: napalm-device-types 2.0.0 from git, then the
package with its dev extras, tests green.
2026-10-04 00:43:46 +02:00
Christian Manivong a772b0f967 fix(deps): pin paramiko>=5.0.0 (CVE-2026-44405)
Tests / Test (Python 3.10) (push) Failing after 5s
Tests / Test (Python 3.11) (push) Failing after 6s
Tests / Test (Python 3.12) (push) Failing after 6s
Tests / Test (Python 3.8) (push) Failing after 5s
Tests / Test (Python 3.9) (push) Failing after 6s
2026-07-02 12:22:55 +02:00
Christian Manivong 33ef6f86fa fix(get_config): strip timestamped event-log lines from running-config
Tests / Test (Python 3.10) (push) Failing after 6s
Tests / Test (Python 3.11) (push) Failing after 6s
Tests / Test (Python 3.12) (push) Failing after 5s
Tests / Test (Python 3.8) (push) Failing after 6s
Tests / Test (Python 3.9) (push) Failing after 5s
TP-Link embeds system event log entries (link up/down, etc.) in
show running-config output. These change every event and cause false-
positive config-change detections. Strip lines matching #YYYY-MM-DD.
2026-06-30 01:29:56 +02:00
Christian Manivong dccd18da65 fix: falsche OUI-Prefixes entfernen (gegen IEEE verifiziert)
Tests / Test (Python 3.10) (push) Failing after 5s
Tests / Test (Python 3.11) (push) Failing after 5s
Tests / Test (Python 3.12) (push) Failing after 6s
Tests / Test (Python 3.8) (push) Failing after 12s
Tests / Test (Python 3.9) (push) Failing after 6s
2026-06-24 17:06:45 +02:00
Christian ManivongandClaude Sonnet 4.6 3718658294 feat: OUI_PREFIXES für MAC/ARP-Fingerprinting
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 15:41:45 +02:00
Christian ManivongandClaude Sonnet 4.6 b03f3073d5 feat: Fingerprint-Attribute für Discovery-Scoring
Ergänzt DRIVER_NAME, HTTP_FINGERPRINT, SNMP_FINGERPRINT, SSH_FINGERPRINT,
PORT_SPECS und SNMP_OBJECT_ID_PREFIX gemäß docs/DISCOVERY_FINGERPRINTING.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 14:47:08 +02:00
Christian ManivongandClaude Sonnet 4.6 114aaa90f8 fix: set_interface access VLAN uses correct TP-Link CLI commands
- Replace 'switchport general pvid {vlan}' (invalid) with 'switchport pvid {vlan}'
- For access mode: read current untagged VLAN memberships before entering
  config mode, then issue 'no switchport general allowed vlan {old_vid}'
  for each to avoid leaving the port with two untagged VLANs
- Add native_vlan support for trunk mode via 'switchport pvid {native_vlan}'
- Remove invalid 'switchport mode access/general' commands (not supported
  on this switch family)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 21:31:16 +02:00
Christian ManivongandClaude Sonnet 4.6 85215ce150 feat: add PoE config and LAG/trunk membership support
get_poe_status()/set_poe() implement PoE port config via the JetStream
CLI's 'power inline' interface sub-commands. get_interfaces() now enriches
LagN entries and their member ports with trunk_group/lag_members/lag_mode
by parsing 'show link-aggregation summary'. New set_lag_members() adds/
removes members via channel-group/no channel-group.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-12 14:48:29 +02:00
Christian Manivong c53b21ad65 feat: interface enable/description config + fix SNMP auto-fix and detection
- set_interface(): support enabled (shutdown/no shutdown) and description
- get_snmp_config(): detect "no community entry exists" as not-configured
  instead of reporting running=True with no community
- _action_fix_snmp(): use config-mode prompt for in-config commands
  (previously timed out waiting for the exec prompt) and return its result
2026-06-10 02:06:43 +02:00
Christian ManivongandClaude Sonnet 4.6 2a9ddac02d feat: add get_health_metrics() via TP-Link proprietary OIDs
SNMP health metrics using TP-Link enterprise MIB (OID 11863) for
uptime, per-unit CPU utilization, and per-unit memory utilization.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 00:43:38 +02:00
Christian ManivongandClaude Sonnet 4.6 cbe73cab64 feat: SNMP support — get_snmp_config(), fix_snmp action, get_device_warnings()
get_snmp_config() reads 'show snmp community', fix_snmp detects management VLAN
from 'show ip interface' and configures source-interface + community with correct
JetStream CLI syntax. get_device_warnings() added (was missing, caused AttributeError).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 13:09:45 +02:00
Christian Manivong 1874622543 feat: add VLAN/interface write methods and SG3210 support (v0.1.2)
- Implement `delete_vlan()`: removes VLAN from switch, automatically
  moves untagged (PVID) ports to VLAN 1 before deletion to satisfy
  TP-Link's constraint
- Implement `set_vlan()`: creates or updates a VLAN with optional name
- Implement `set_interface()`: configures trunk/access mode and VLAN
  membership on a switch interface
- Add `_to_cli_interface()` helper to expand abbreviated port names
  (e.g. Gi1/0/1 → gigabitEthernet 1/0/1)
- Import `InterfaceConfigDict` and `VlanConfigDict` from
  `napalm_device_types.models`
- Bump `napalm_device_types` dependency to >=0.2.0
- Add TL-SG3210 to tested-device table in README
- Bump version to 0.1.2
2026-05-29 08:53:13 +02:00
Christian Manivong ec70aad7ca Bump version to 0.1.1 2026-05-12 23:09:16 +02:00
Christian Manivong 7b01d73147 Fixed VLAN membership detection for multiline result 2026-05-12 22:53:25 +02:00
Christian Manivong 25bb0c36f2 Added napalm_device_types to pyproject 2026-05-11 22:15:01 +02:00
Christian Manivong 763bb7f5e9 Fixed typo in requirement.txt 2026-05-11 22:11:57 +02:00
Christian Manivong 7494b15b26 Added required napalm_device_types 2026-05-11 22:06:55 +02:00
Christian Manivong e8245f955c GitHub Actions to publish on pypi 2026-05-11 22:00:40 +02:00
Christian Manivong e9f9e291d5 Add usage of device type abstraction layer 2026-05-11 21:56:46 +02:00
Christian Manivong 5a3508d79e docs: add tested devices section (TL-SG2210P) 2026-05-09 19:16:20 +02:00
Christian Manivong 6a04796dd7 Inital commit 2026-05-09 19:05:49 +02:00