Compare commits

...
4 Commits
Author SHA1 Message Date
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
3 changed files with 21 additions and 6 deletions
+4 -1
View File
@@ -13,7 +13,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] python-version: ["3.10", "3.11", "3.12"]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -25,6 +25,9 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
# napalm-device-types lives in git.netork.io/NAPALM, not on PyPI: without this
# pip looks there, finds an unrelated 0.1.0 and the job dies before any test.
pip install "napalm-device-types @ git+https://git.netork.io/NAPALM/napalm-device-types.git"
pip install -e ".[dev]" pip install -e ".[dev]"
- name: Run tests - name: Run tests
+15 -2
View File
@@ -522,6 +522,19 @@ class TPLinkJetstreamDriver(ConfigLifecycleMixin, SwitchDriver):
return interfaces_ip return interfaces_ip
@staticmethod
def _strip_event_log(config: str) -> str:
"""Remove timestamped event-log lines from config output.
TP-Link Jetstream embeds system event log entries in ``show running-config``
output as lines like ``#2026-06-29 14:58:50,[Link]/5/Gi1/0/4 changed state``.
These lines are volatile and cause false-positive config-change events in
the config-backup feature. Strip them to keep the diff meaningful.
"""
import re
return re.sub(r"^#\d{4}-\d{2}-\d{2} .*\n?", "", config, flags=re.MULTILINE)
def get_config( def get_config(
self, self,
retrieve: str = "all", retrieve: str = "all",
@@ -537,10 +550,10 @@ class TPLinkJetstreamDriver(ConfigLifecycleMixin, SwitchDriver):
configs = {"running": "", "startup": "", "candidate": ""} configs = {"running": "", "startup": "", "candidate": ""}
if retrieve in ("all", "running"): if retrieve in ("all", "running"):
configs["running"] = self._send_command("show running-config") configs["running"] = self._strip_event_log(self._send_command("show running-config"))
if retrieve in ("all", "startup"): if retrieve in ("all", "startup"):
configs["startup"] = self._send_command("show startup-config") configs["startup"] = self._strip_event_log(self._send_command("show startup-config"))
if sanitized: if sanitized:
configs = napalm_helpers.sanitize_configs(configs, C.CISCO_SANITIZE_FILTERS) configs = napalm_helpers.sanitize_configs(configs, C.CISCO_SANITIZE_FILTERS)
+2 -3
View File
@@ -8,7 +8,7 @@ version = "0.1.2"
description = "NAPALM driver for TP-Link Jetstream managed switches" description = "NAPALM driver for TP-Link Jetstream managed switches"
readme = "README.md" readme = "README.md"
license = { text = "Apache-2.0" } license = { text = "Apache-2.0" }
requires-python = ">=3.8" requires-python = ">=3.10"
authors = [ authors = [
{ name = "Christian Manivong" }, { name = "Christian Manivong" },
] ]
@@ -16,8 +16,6 @@ classifiers = [
"Topic :: Utilities", "Topic :: Utilities",
"License :: OSI Approved :: Apache Software License", "License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.12",
@@ -28,6 +26,7 @@ dependencies = [
"napalm>=4.0.0", "napalm>=4.0.0",
"napalm_device_types>=0.2.0", "napalm_device_types>=0.2.0",
"netmiko>=4.0.0", "netmiko>=4.0.0",
"paramiko>=5.0.0", # CVE-2026-44405
"netaddr", "netaddr",
] ]