Commit Graph
73 Commits
Author SHA1 Message Date
Christian Manivong 7bb15f5af3 feat(time-sync): NTP servers and time zone through TimeSyncMixin
driver / test (3.13) (pull_request) Successful in 56s
driver / lowest (pull_request) Successful in 27s
driver / build (pull_request) Successful in 29s
driver / security (pull_request) Successful in 58s
CI / driver (pull_request) Successful in 2m26s
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 53s
driver / test (3.12) (pull_request) Successful in 58s
driver / publish (pull_request) Skipped
netOrk aligns every device's time sources and zone through the driver
(NetOrk/netork#2360); for APs that replaces the UCI commands netOrk
built itself for the AP profile fields (NetOrk/netork#2364).

Both values live in UCI's system config:
- The servers are system.ntp.server. A write replaces the list, enables
  the client, sets use_dhcp=0 so the servers of a DHCP lease are not
  added, and restarts sysntpd: the router ends up with exactly these.
  A disabled client reads as no servers.
- The zone is zonename (the IANA name, in LuCI's spelling with spaces)
  and timezone, the POSIX rule from posix_tz that libc reads as TZ. The
  rule is what counts (NetOrk/netork#1849), so the name is read as the
  zone only where the rule in force is that zone's; a rule alone reads
  as the one zone that has it, or None where several share it. A write
  sets both, reloads /etc/init.d/system and restarts logd, which reads
  the zone at start.

netOrk aligns on every poll, so each step compares first and writes
and restarts nothing when the router already has the values. GMT0 (the
stock rule) counts as UTC's time.

get_ntp_servers now uses the same reading, so it agrees with
get_time_sync; it used to keep only the first server of a list, as uci
prints a list as 'a' 'b' on one line. synchronized is None: BusyBox
ntpd keeps no state to read.

The floor on napalm-device-types is 4.35.0, the first with
TimeSyncMixin.
2026-11-11 15:22:54 +01:00
christianmanivong e7bd0c17f5 Merge pull request 'feat(host-status): get_host_status through HostStatusMixin' (#34) from feat/interrupted-pm-851 into main
driver / lint (push) Successful in 18s
driver / test (3.13) (push) Successful in 57s
driver / lowest (push) Successful in 31s
driver / build (push) Successful in 31s
driver / security (push) Successful in 1m9s
driver / publish (push) Skipped
driver / standard (push) Successful in 17s
driver / types (push) Successful in 1m5s
driver / test (3.12) (push) Successful in 1m16s
CI / driver (push) Successful in 2m26s
2026-11-07 18:58:31 +00:00
Christian Manivong 29872243ba feat(host-status): get_host_status through HostStatusMixin
driver / test (3.13) (pull_request) Successful in 1m11s
driver / test (3.12) (pull_request) Successful in 1m16s
driver / lowest (pull_request) Successful in 30s
driver / build (pull_request) Successful in 34s
driver / security (pull_request) Successful in 1m5s
CI / driver (pull_request) Successful in 2m38s
driver / standard (pull_request) Successful in 19s
driver / lint (pull_request) Successful in 16s
driver / types (pull_request) Successful in 1m16s
driver / publish (pull_request) Skipped
The router's host status, read by napalm-device-types' command over an
SSH exec channel: whether it needs a reboot, how full its filesystems
are, and, with napalm-device-types 4.32, whether apk or opkg was left
halfway.

Refs NetOrk/netork#851
2026-11-07 14:46:00 +01:00
christianmanivong e2eda54fe4 Merge pull request 'feat(scheduled-jobs): scheduled jobs through PosixScheduledJobsMixin (#32)' (#33) from feature/scheduled-jobs into main
driver / lint (push) Successful in 14s
driver / test (3.13) (push) Successful in 54s
driver / lowest (push) Successful in 28s
driver / build (push) Successful in 26s
driver / security (push) Successful in 1m1s
driver / publish (push) Skipped
driver / standard (push) Successful in 14s
driver / types (push) Successful in 55s
driver / test (3.12) (push) Successful in 57s
CI / driver (push) Successful in 2m27s
2026-11-03 08:20:26 +00:00
Christian Manivong af3e10d194 chore(scheduled-jobs): require napalm-device-types 4.27.0
driver / test (3.13) (pull_request) Successful in 51s
driver / lowest (pull_request) Successful in 27s
driver / build (pull_request) Successful in 26s
driver / security (pull_request) Successful in 58s
CI / driver (pull_request) Successful in 2m21s
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 57s
driver / test (3.12) (pull_request) Successful in 1m0s
driver / publish (pull_request) Skipped
4.26.0 went out with the sshd drop-in change; the scheduled-jobs
contract is in 4.27.0.
2026-11-03 08:35:46 +01:00
Christian Manivong eeeb46121f feat(scheduled-jobs): scheduled jobs through PosixScheduledJobsMixin (#32)
driver / test (3.13) (pull_request) Failing after 15s
driver / lowest (pull_request) Failing after 16s
driver / build (pull_request) Successful in 28s
driver / security (pull_request) Failing after 35s
CI / driver (pull_request) Failing after 1m6s
driver / lint (pull_request) Successful in 14s
driver / standard (pull_request) Successful in 16s
driver / types (pull_request) Failing after 26s
driver / test (3.12) (pull_request) Failing after 17s
driver / publish (pull_request) Skipped
get_scheduled_jobs reads every crontab in /etc/crontabs in one round trip
as root, with the time zone from UCI and each crontab's package from opkg;
manage_scheduled_job enables, disables or runs one now; put_ and
delete_scheduled_job write and remove an application's own job as marked
lines in the user's crontab. BusyBox crond has no /etc/crontab, cron.d,
run-parts, anacron or systemd, so none is read.

OpenWrt's BusyBox differs from what the POSIX mixin assumes, so a few
steps are the driver's own:
- crontab -l says only "can't open" for a missing crontab, as for an
  unreadable one: the file is read directly, a missing one is empty, and
  one that cannot be read is never written.
- crontab FILE exits 0 when it could not write: every write is read back.
- cron is enabled and restarted after each write; OpenWrt does not start
  crond while /etc/crontabs is empty.
- crond has no special times: aliases are written as five fields and
  @reboot is refused.
- crond hands the whole command to sh and takes only SHELL and PATH from
  the crontab, so a run now does the same (% is no stdin).
- there is no su and no timeout before 25.x: another user's job runs
  through start-stop-daemon -c, and the run is bounded by timeout only
  where the router has it.

Every write changes only the job's own line, so the reboot failback line
in /etc/crontabs/root stays as it is.

Requires napalm-device-types 4.26.0.

Closes #32
2026-11-03 05:45:56 +01:00
christianmanivong 0380350a4c Merge pull request 'fix(lldp): shared lldpctl parser; raise on failed LLDP and environment reads' (#30) from fix/lldp-keyvalue into main
driver / lint (push) Successful in 17s
driver / test (3.13) (push) Successful in 1m1s
driver / lowest (push) Successful in 33s
driver / build (push) Successful in 45s
driver / security (push) Successful in 1m36s
driver / publish (push) Skipped
driver / standard (push) Successful in 17s
driver / types (push) Successful in 1m19s
driver / test (3.12) (push) Successful in 1m12s
CI / driver (push) Successful in 3m22s
2026-11-02 11:04:12 +00:00
Christian Manivong f9af7abaf6 Merge remote-tracking branch 'origin/main' into fix/lldp-keyvalue
driver / test (3.13) (pull_request) Successful in 56s
driver / lowest (pull_request) Successful in 25s
driver / build (pull_request) Successful in 28s
driver / security (pull_request) Successful in 59s
CI / driver (pull_request) Successful in 2m24s
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 12s
driver / types (pull_request) Successful in 1m0s
driver / test (3.12) (pull_request) Successful in 1m0s
driver / publish (pull_request) Skipped
2026-11-02 11:06:07 +01:00
christianmanivong f81d2cd89f Merge pull request 'fix(packages): decide install/uninstall success by exit status (#28)' (#29) from fix/bugs-2026-11-02 into main
driver / lint (push) Failing after 7s
driver / test (3.13) (push) Successful in 1m14s
driver / lowest (push) Failing after 5s
driver / build (push) Successful in 41s
driver / security (push) Successful in 1m23s
driver / publish (push) Skipped
driver / standard (push) Successful in 18s
driver / types (push) Successful in 1m25s
driver / test (3.12) (push) Successful in 1m22s
CI / driver (push) Failing after 3m8s
2026-11-02 08:40:47 +00:00
Christian Manivong 071beeb68a fix(lldp): report the neighbour's chassis MAC
driver / test (3.13) (pull_request) Failing after 15s
driver / test (3.12) (pull_request) Failing after 17s
driver / lowest (pull_request) Failing after 18s
driver / build (pull_request) Successful in 35s
driver / security (pull_request) Failing after 40s
CI / driver (pull_request) Failing after 1m41s
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 28s
driver / types (pull_request) Failing after 30s
driver / publish (pull_request) Skipped
lldpd tells the chassis MAC, but get_lldp_neighbors reported only name
and port, so netOrk, which matches a neighbour by MAC first, could match
OpenWrt's neighbours by name only. napalm-device-types' lldp_neighbors
projection now carries mac (lower case) when the chassis id is a MAC
address, as napalm-linux reports it.

Closes #31
2026-11-02 08:51:27 +01:00
Christian Manivong aafb5636a9 fix(getters): raise on a failed LLDP or environment read
driver / test (3.13) (pull_request) Failing after 15s
driver / lowest (pull_request) Failing after 6s
driver / build (pull_request) Successful in 33s
driver / security (pull_request) Failing after 38s
CI / driver (pull_request) Failing after 1m36s
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 21s
driver / types (pull_request) Failing after 6s
driver / test (3.12) (pull_request) Failing after 17s
driver / publish (pull_request) Skipped
lldpctl's error text has no "=", so a missing lldpctl or a stopped
lldpd read as a device without neighbours. lldpctl now runs as
napalm-device-types' LLDPCTL_KEYVALUE_COMMAND, which brings its exit
status and message back, and the shared parser raises on a failure.

get_environment swallowed an unreadable /proc/stat or /proc/meminfo
and reported 0 % CPU and 0 bytes of memory, a plausible value instead
of a failure. Both now raise ValueError; 0 % stays for counters that
did not move between the two reads.

Closes #27
2026-11-02 08:47:15 +01:00
Christian Manivong 231def768e fix(lldp): keep dotted interface names and read every id type
The local interface was the second dotted part of the key, so the
neighbours of eth0.1 landed under eth0 with every field missed. The
remote port was read from port.ifname or port.id.value, and lldpd
prints a port given by MAC or local id as port.mac / port.local, never
as id.value, so that port came back empty.

lldpd's output now goes through napalm-device-types'
parse_lldpctl_keyvalue and its two NAPALM projections, which keep the
interface name up to the neighbour's first field and read the ids under
whatever type lldpd prints. The detail gains the system description and
capabilities on the way. The module is under strict mypy now; the floor
on napalm-device-types rises to 4.24.0.

Closes #26
2026-11-02 08:45:51 +01:00
Christian Manivong 58ee774250 fix(packages): decide install/uninstall success by exit status
driver / test (3.12) (pull_request) Successful in 1m8s
driver / test (3.13) (pull_request) Successful in 59s
driver / lowest (pull_request) Successful in 28s
driver / build (pull_request) Successful in 31s
driver / security (pull_request) Successful in 1m21s
CI / driver (pull_request) Successful in 3m14s
driver / standard (pull_request) Successful in 26s
driver / lint (pull_request) Successful in 19s
driver / types (pull_request) Successful in 1m11s
driver / publish (pull_request) Skipped
install_package and uninstall_package searched the output for keywords.
opkg's dependency failure ("Collected errors:") contains none of them and
read as success; a successful install naming a "failed" file read as a
failure. Append the exit-status marker and let the status alone decide.

Closes #28
2026-11-02 08:34:29 +01:00
christianmanivong d04a969eb1 Merge pull request 'feat(lldp): configure_lldp_agent sets up lldpd on the given interfaces' (#25) from feat/lldp-agent-setup into main
driver / lint (push) Successful in 16s
driver / test (3.13) (push) Successful in 55s
driver / lowest (push) Successful in 54s
driver / build (push) Successful in 46s
driver / security (push) Successful in 1m24s
driver / publish (push) Skipped
driver / standard (push) Successful in 19s
driver / types (push) Successful in 58s
driver / test (3.12) (push) Successful in 1m3s
CI / driver (push) Successful in 2m40s
2026-11-02 00:08:09 +00:00
Christian Manivong 6802e4d7df chore(deps): floor napalm-device-types at 4.23.0
driver / lowest (pull_request) Successful in 27s
driver / test (3.13) (pull_request) Successful in 55s
driver / build (pull_request) Successful in 25s
driver / security (pull_request) Successful in 59s
CI / driver (pull_request) Successful in 2m36s
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 59s
driver / test (3.12) (pull_request) Successful in 1m5s
driver / publish (pull_request) Skipped
4.23.0 is on PyPI with everything this branch uses; the git pre-install
in CI is no longer needed.
2026-11-02 00:31:50 +01:00
Christian Manivong 1e988c87f4 Merge remote-tracking branch 'origin/main' into feat/lldp-agent-setup 2026-11-02 00:31:35 +01:00
christianmanivong 004c3e9322 Merge pull request 'fix: six open bugs (#19, #3, #11, #10, #9, #8)' (#24) from fix/bugs-2026-11 into main
driver / lint (push) Successful in 18s
driver / test (3.13) (push) Successful in 1m3s
driver / lowest (push) Successful in 28s
driver / build (push) Successful in 28s
driver / security (push) Successful in 1m6s
driver / publish (push) Skipped
driver / standard (push) Successful in 20s
driver / types (push) Successful in 1m14s
driver / test (3.12) (push) Successful in 1m15s
CI / driver (push) Successful in 2m46s
2026-11-01 22:00:02 +00:00
Christian Manivong 5cce38b2bb feat(lldp): configure_lldp_agent sets up lldpd on the given interfaces
driver / test (3.13) (pull_request) Failing after 49s
driver / lowest (pull_request) Failing after 25s
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Successful in 1m1s
CI / driver (pull_request) Failing after 2m28s
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 12s
driver / types (pull_request) Failing after 1m1s
driver / test (3.12) (pull_request) Failing after 59s
driver / publish (pull_request) Skipped
The LLDP getters started lldpd and rewrote its interface list on every
poll; with read-only getters that setup needs an action. The driver
mixes in napalm-device-types' LldpAgentMixin and writes the step the
template leaves to it: lldpd.config.interface in UCI. A VLAN device is
written as the device under it, as the old helper did, since lldpd
sends on the L2 device. Which interfaces is the caller's choice.

Refs #8
2026-11-01 22:13:56 +01:00
Christian Manivong 783a4ee0cb fix(lldp): read neighbours without starting or reconfiguring lldpd
driver / test (3.13) (pull_request) Successful in 53s
driver / lowest (pull_request) Successful in 24s
driver / build (pull_request) Successful in 30s
driver / security (pull_request) Successful in 56s
CI / driver (pull_request) Successful in 2m19s
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 59s
driver / test (3.12) (pull_request) Successful in 1m0s
driver / publish (pull_request) Skipped
get_lldp_neighbors, which a poll calls every time, enabled and started a
stopped lldpd and rewrote lldpd's interface list with uci, restarting
the daemon. A getter must not change the device. Both LLDP getters now
only run lldpctl; installing and starting lldpd are ensure_package and
manage_service.

Closes #8
2026-11-01 21:48:31 +01:00
Christian Manivong 5e71f0b471 fix(lldp): keep every neighbour on a port
The keyvalue output was grouped by local interface only, so with several
neighbours on one port their keys overwrote each other and one mixed
entry came back. A neighbour now ends where the next one opens (alias,
then via, as lldpd prints it); a key repeated inside one neighbour, such
as one mgmt-ip per address, does not start a new one.

Closes #9
2026-11-01 21:47:34 +01:00
Christian Manivong 097d9b9581 fix(environment): CPU usage from two reads a second apart
get_environment promised two samples one second apart but read
/proc/stat once, so the figure was the average since boot: a box at
100 % for the last minute showed its lifetime average. It now reads the
cpu line twice, a second apart, and uses the difference.

Closes #10
2026-11-01 21:45:24 +01:00
Christian Manivong c211ba0d9e fix(updates): only the exit status decides apply_updates
apply_updates ran apk/opkg upgrade and returned success whatever
happened, so a failed upgrade was reported as done. The command now
prints its exit status after the marker get_available_updates already
uses; a non-zero or missing status is a failure, named in "error".

Closes #11
2026-11-01 21:44:26 +01:00
Christian Manivong 16e0fa9d5e fix(services): only the exit status decides manage_service
manage_service returned success for every action, so a failed start or
a missing init script showed up as done. The command now prints its
exit status after a marker, and only that status decides.

Closes #3
2026-11-01 21:43:56 +01:00
Christian Manivong 45f5b65427 fix(driver): leave the caller's optional_args unchanged
__init__ popped "port" out of the dict it was handed, so the caller's
own optional_args lost its port. The driver now works on a copy.

Closes #19
2026-11-01 21:43:09 +01:00
christianmanivong d78a55dd1a Merge pull request 'fix: an unknown ARP age is -1.0, not 0.0' (#23) from fix/arp-unknown-age into main
driver / lint (push) Successful in 14s
driver / lowest (push) Successful in 32s
driver / test (3.13) (push) Successful in 1m21s
driver / build (push) Successful in 31s
driver / security (push) Successful in 1m13s
driver / publish (push) Skipped
driver / standard (push) Successful in 22s
driver / test (3.12) (push) Successful in 1m15s
driver / types (push) Successful in 1m17s
CI / driver (push) Successful in 3m5s
2026-10-30 09:20:24 +00:00
Christian Manivong b0270d3430 fix: an unknown ARP age is -1.0, not 0.0
driver / test (3.13) (pull_request) Successful in 1m2s
driver / lowest (pull_request) Successful in 31s
driver / build (pull_request) Successful in 33s
driver / security (pull_request) Successful in 1m7s
CI / driver (pull_request) Successful in 2m28s
driver / lint (pull_request) Successful in 17s
driver / standard (pull_request) Successful in 19s
driver / types (pull_request) Successful in 1m5s
driver / test (3.12) (pull_request) Successful in 1m8s
driver / publish (pull_request) Skipped
Neither ip neigh nor /proc/net/arp has an age, 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
christianmanivong b1a2950d9d Merge pull request 'chore: Python 3.12 is the floor (NAPALM/driver-standard#6)' (#22) from chore/python-312-floor into main
driver / lint (push) Successful in 12s
driver / lowest (push) Successful in 24s
driver / test (3.13) (push) Successful in 54s
driver / build (push) Successful in 26s
driver / security (push) Successful in 1m2s
driver / publish (push) Skipped
driver / standard (push) Successful in 15s
driver / types (push) Successful in 55s
driver / test (3.12) (push) Successful in 57s
CI / driver (push) Successful in 2m26s
2026-10-27 10:33:09 +00:00
Christian Manivong 14ab92b80b fix: the floor on napalm is 5.1 (NAPALM/driver-standard#6)
driver / test (3.12) (pull_request) Successful in 59s
driver / test (3.13) (pull_request) Successful in 51s
driver / lowest (pull_request) Successful in 24s
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Successful in 1m5s
CI / driver (pull_request) Successful in 2m34s
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 1m0s
driver / publish (pull_request) Skipped
napalm 5.0 and older import pkg_resources, which a Python 3.12 venv no
longer has, so the lowest job failed on them.
2026-10-27 10:49:29 +01:00
Christian Manivong 20d2670759 chore: Python 3.12 is the floor (NAPALM/driver-standard#6)
driver / test (3.12) (pull_request) Successful in 1m3s
driver / lowest (pull_request) Failing after 24s
driver / test (3.13) (pull_request) Successful in 51s
driver / build (pull_request) Successful in 25s
driver / security (pull_request) Successful in 1m1s
CI / driver (pull_request) Failing after 2m32s
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 1m9s
driver / publish (pull_request) Skipped
netOrk runs every driver in its own containers on Python 3.12, so 3.10
and 3.11 are no longer supported or tested. requires-python, mypy and
ruff move to 3.12, along with what ruff's pyupgrade rules then rewrite.
2026-10-27 10:18:58 +01:00
christianmanivong 7ae94a27e2 Merge pull request 'chore: adopt the NAPALM driver standard' (#21) from chore/driver-standard into main
driver / lint (push) Successful in 14s
driver / test (3.11) (push) Successful in 1m4s
driver / lowest (push) Successful in 30s
driver / test (3.13) (push) Successful in 58s
driver / build (push) Successful in 29s
driver / security (push) Successful in 1m14s
driver / publish (push) Successful in 28s
driver / standard (push) Successful in 19s
driver / types (push) Successful in 1m6s
driver / test (3.10) (push) Successful in 1m5s
driver / test (3.12) (push) Successful in 1m8s
CI / driver (push) Successful in 3m37s
v0.7.0
2026-10-23 11:52:51 +00:00
Christian Manivong d576357f9c chore(release): 0.7.0
driver / test (3.10) (pull_request) Successful in 45s
driver / test (3.11) (pull_request) Successful in 45s
driver / test (3.13) (pull_request) Successful in 38s
driver / lowest (pull_request) Successful in 21s
driver / security (pull_request) Successful in 53s
driver / build (pull_request) Successful in 21s
CI / driver (pull_request) Successful in 5m35s
driver / standard (pull_request) Successful in 14s
driver / lint (pull_request) Successful in 10s
driver / types (pull_request) Successful in 43s
driver / test (3.12) (pull_request) Successful in 44s
driver / publish (pull_request) Skipped
2026-10-23 11:37:05 +02:00
Christian Manivong 51bcfc5724 fix(deps): a floor on netaddr the lowest versions can import
driver / test (3.10) (pull_request) Successful in 58s
driver / test (3.11) (pull_request) Successful in 56s
driver / test (3.12) (pull_request) Successful in 59s
driver / test (3.13) (pull_request) Successful in 48s
driver / lowest (pull_request) Successful in 32s
driver / security (pull_request) Successful in 1m1s
driver / build (pull_request) Successful in 32s
CI / driver (pull_request) Successful in 6m55s
driver / standard (pull_request) Successful in 14s
driver / lint (pull_request) Successful in 11s
driver / types (pull_request) Successful in 43s
driver / publish (pull_request) Skipped
Unfloored, the CI lowest job installs netaddr 0.3.1, which has no
IPAddress, and every test module fails to import. 0.7.19 has it; 194 tests
pass at the lowest declared versions.
2026-10-23 09:05:22 +02:00
Christian Manivong 6d884898c7 chore: adopt the NAPALM driver standard
driver / test (3.10) (pull_request) Successful in 1m9s
driver / test (3.11) (pull_request) Successful in 59s
driver / test (3.13) (pull_request) Successful in 55s
driver / lowest (pull_request) Failing after 25s
driver / security (pull_request) Successful in 1m0s
driver / build (pull_request) Successful in 26s
CI / driver (pull_request) Failing after 7m18s
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 19s
driver / types (pull_request) Successful in 1m0s
driver / test (3.12) (pull_request) Successful in 46s
driver / publish (pull_request) Skipped
- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
  of NAPALM/driver-standard; .github/ is gone.
- requires-python >=3.10 (napalm-device-types needs it), napalm-device-types
  >=4.21.1, LICENSE file, py.typed, SPDX license string, a dev extra with
  floors, links to git.netork.io (README included), CHANGELOG.md.
- mypy strict for the package; exempt for now, with 130 errors between
  them: napalm_openwrt.config_mixin, .interfaces_mixin, .lldp_mixin,
  .openwrt, .packages_mixin, .routing_mixin, .system_mixin, .vlan_mixin and
  .wireless_mixin. They are recorded in the quality baseline with the long
  and complex functions and the one unannotated public method.
- Coverage floor 65 % (measured 65.03 %).
2026-10-23 08:35:03 +02:00
Christian Manivong 8b8905f0c7 fix: what bandit and the remaining lint rules found
- Long lines are wrapped: the get_environment awk command is split into
  adjacent string literals, the rollback message and the system mixin's
  docstring are wrapped; the command and the text are unchanged.
- The two except Exception: pass (the snmpd community in get_snmp_config,
  the network VLANs in get_ssids) now log at debug level (B110), so a
  swallowed failure leaves a trace.
- tests: raise ... from exc, unused loop variable.
2026-10-23 08:33:29 +02:00
Christian Manivong a212bc8715 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:32:47 +02:00
christianmanivong 7f2ae6ac58 Merge pull request 'fix(ssh): verify the host key netOrk expects, report the one seen (NetOrk/netork#1167)' (#18) from fix/ssh-host-key-tofu-1167 into master
CI / test (3.10) (push) Successful in 32s
CI / test (3.11) (push) Successful in 30s
CI / test (3.12) (push) Successful in 39s
2026-10-18 19:23:41 +00:00
Christian Manivong cb14f1f00f fix(ssh): verify the host key netOrk expects, report the one seen (NetOrk/netork#1167)
CI / test (3.10) (push) Successful in 34s
CI / test (3.11) (push) Successful in 40s
CI / test (3.12) (push) Successful in 34s
CI / test (3.10) (pull_request) Successful in 36s
CI / test (3.12) (pull_request) Successful in 27s
CI / test (3.11) (pull_request) Successful in 29s
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:40 +02:00
christianmanivong fddb5c6772 Merge pull request 'feat: reboot_host (0.5.0)' (#17) from feat/reboot-host into master
CI / test (3.10) (push) Successful in 25s
CI / test (3.11) (push) Successful in 23s
CI / test (3.12) (push) Successful in 26s
2026-10-18 12:48:20 +00:00
Christian Manivong d89bb38688 feat: reboot_host (0.5.0)
CI / test (3.10) (push) Successful in 26s
CI / test (3.11) (push) Successful in 23s
CI / test (3.12) (push) Successful in 26s
CI / test (3.10) (pull_request) Successful in 25s
CI / test (3.12) (pull_request) Successful in 25s
CI / test (3.11) (pull_request) Successful in 24s
HostRebootMixin's reboot_host over the command channel: reboot detached
and two seconds late, so the answer comes back before the session goes
down, and a refusal is raised instead of being mistaken for the dropped
session. netOrk sent /sbin/reboot through the private _send_command and
could not tell the two apart (netOrk #1113). A login other than root is
refused before anything runs.
2026-10-18 14:45:44 +02:00
christianmanivong 5169d2438f Merge pull request 'feat: a public command channel; no warnings of its own (0.4.0)' (#16) from feat/command-channel into master
CI / test (3.10) (push) Successful in 26s
CI / test (3.11) (push) Successful in 23s
CI / test (3.12) (push) Successful in 25s
2026-10-18 12:10:50 +00:00
Christian Manivong 595496549b feat: a public command channel; no warnings of its own (0.4.0)
CI / test (3.10) (push) Successful in 25s
CI / test (3.11) (push) Successful in 24s
CI / test (3.12) (push) Successful in 25s
CI / test (3.10) (pull_request) Successful in 25s
CI / test (3.12) (pull_request) Successful in 25s
CI / test (3.11) (pull_request) Successful in 24s
run_command and open_stream (napalm-device-types CommandChannelMixin,
which AccessPointDriver carries) run on an SSH exec channel next to
netmiko's shell: stdin, stderr apart, a real exit code. netOrk sent UCI
scripts and the wifi channel through the private _send_command, typing
a file in base64 chunks or printf lines; with stdin it writes it with
cat, and base64 is needed for nothing (netOrk #1113). OpenWrt has no
sudo, so a privileged command from a login other than root is refused
before it runs.

get_device_warnings goes with it: no_base64 was its last code.
2026-10-18 14:08:09 +02:00
christianmanivong 100a6d36c5 Merge pull request 'feat: name only a missing base64; lldpd, auc and updates are facts (0.3.0)' (#15) from feat/facts-not-warnings into master
CI / test (3.10) (push) Successful in 26s
CI / test (3.11) (push) Successful in 24s
CI / test (3.12) (push) Successful in 25s
2026-10-17 08:34:56 +00:00
Christian Manivong 34d80bd994 feat: name only a missing base64; lldpd, auc and updates are facts (0.3.0)
CI / test (3.10) (push) Successful in 26s
CI / test (3.11) (push) Successful in 23s
CI / test (3.12) (push) Successful in 26s
CI / test (3.10) (pull_request) Successful in 24s
CI / test (3.12) (pull_request) Successful in 25s
CI / test (3.11) (pull_request) Successful in 22s
get_device_warnings no longer names lldpd_not_installed,
updates_available or update_notifications_disabled. The packages and
get_available_updates are the facts; netOrk derives the warnings with the
same reach (netOrk #1111). The old update read swallowed failures,
get_available_updates raises them.

no_base64 stays: BusyBox may provide base64 as an applet, so no package
tells the caller whether it is there.
2026-10-17 09:37:43 +02:00
christianmanivong 9f43b8c797 Merge pull request 'feat!: fix templates with the caller's values replace run_device_action (0.2.0)' (#14) from feat/fix-templates into master
CI / test (3.10) (push) Successful in 29s
CI / test (3.11) (push) Successful in 26s
CI / test (3.12) (push) Successful in 25s
2026-10-17 06:48:19 +00:00
Christian Manivong 968d6583ba feat!: fix templates with the caller's values replace run_device_action (0.2.0)
CI / test (3.10) (push) Successful in 26s
CI / test (3.11) (push) Successful in 24s
CI / test (3.12) (push) Successful in 26s
CI / test (3.10) (pull_request) Successful in 25s
CI / test (3.12) (pull_request) Successful in 25s
CI / test (3.11) (pull_request) Successful in 23s
fix_snmp set no community at all and opened the management zone's
udp/161 to every source, with a rule named after an application; a
second fix_snmp in the system mixin was shadowed and never ran (#5).
install_lldpd, install_auc and install_coreutils_base64 were actions of
their own.

The driver implements napalm-device-types 4.13's templates instead:
- configure_snmp_agent(settings): snmpd installed when missing;
  community, contact and location in UCI with one com2sec (com2sec6)
  per allowed source; the zone-resolving firewall step of the old fix,
  now limited to the sources (src_ip) and named Allow-SNMP; snmpd
  enabled, restarted and listening;
- get_management_peer() from SSH_CONNECTION;
- ensure_package(name) from the base package, over install_package.
A community, contact or location that would break UCI is refused.

BREAKING CHANGE: run_device_action is removed. Requires
napalm-device-types 4.13.

Closes #5. Part of #13.
2026-10-17 08:33:25 +02:00
christianmanivong d569a289ba Merge pull request 'ci: run the tests and build the package on every push and pull request' (#7) from ci/workflow into master
CI / test (3.10) (push) Successful in 26s
CI / test (3.11) (push) Successful in 24s
CI / test (3.12) (push) Successful in 27s
2026-10-07 06:30:50 +00:00
Christian Manivong 56bb999830 ci: run the tests and build the package on every push and pull request
CI / test (3.10) (push) Successful in 26s
CI / test (3.11) (push) Successful in 24s
CI / test (3.12) (push) Successful in 26s
CI / test (3.10) (pull_request) Successful in 26s
CI / test (3.12) (pull_request) Successful in 29s
CI / test (3.11) (pull_request) Successful in 28s
The same job as napalm-fritzbox and napalm-opnsense: Python 3.10, 3.11 and
3.12, pytest, then wheel and sdist. napalm-device-types comes from
git.netork.io first, because PyPI has an unrelated package of that name.
2026-10-07 07:52:44 +02:00
christianmanivong 4885f028be Merge pull request 'feat: report what listens, and which procd service it is' (#6) from feat/listening-sockets into master 2026-10-07 05:21:32 +00:00
Christian Manivong 96f94770cd feat: report what listens, and which procd service it is
Mixes in napalm-device-types' ListeningSocketsMixin (2.5.0): without ss
the shared command reads busybox netstat, and each process's cgroup names
its procd service. The driver only carries the command across.

Over an SSH exec channel of its own, not the interactive shell: busybox
ash cuts a typed line at 512 characters, the command is longer, and the
cut line left the shell waiting for a closing quote. OpenWrt logs in as
root; a login other than root cannot become root, so its reading says it
is not attributed.

Checked against a real OpenWrt 25.12.2 access point. For netOrk#673.
2026-10-07 07:20:27 +02:00
christianmanivong 75f46913b4 Merge pull request 'fix: never report "nothing pending" when the package index is gone, and load it on request' (#4) from feat/update-reader-raises into master 2026-10-05 22:20:10 +00:00