push_ssid_config, set_radio_channels and set_vlan_name run as checked uci steps (#35): a refused step raises naming itself and reverts what was staged. set_radio_channels replaces the undeclared push_radio_channel. apply_ap_config takes napalm-device-types' ApConfigDict and the parts the caller found different and writes them as one detached script: the builder netOrk had in _uci_builders.py, moved here. It answers which parts it wrote and which it could not, whether the AP restarts, and the script with every passphrase masked. A passphrase part now writes the key. get_dhcp_leases reads dnsmasq's lease file. Needs napalm-device-types 4.54.0; CI pre-installs it from its branch until it is on PyPI.
14 KiB
14 KiB
Changelog
All notable changes to napalm-openwrt. The format follows Keep a Changelog, versions follow Semantic Versioning. Versions up to 0.6.0 were not recorded here; their history is the git log.
[Unreleased]
Added
- napalm-device-types' declared AP writes (NetOrk/netork#695), so an application no longer
sends UCI itself:
push_ssid_config(ssid, config)writes the SSID settings it is given (encryption, key, hidden, enabled, disassoc_low_ack, max_inactivity) to every wifi-iface carrying the SSID and reloads wifi, each step checked (#35). An SSID no wifi-iface carries raises.set_radio_channels({radio: channel})sets every radio's channel (0isauto) in one commit with one full wifi restart.set_vlan_name(vlan_id, name)names the VLAN'sbridge-vlansections; False where none carries it.apply_ap_config(config, parts)writes the parts of an access point's desired configuration that differ, as one script run detached on the AP: radios, remote syslog, LuCI, dropbear, thebr-apbridge and its VLANs, spanning tree, and each SSID's VLAN, bands, presence, encryption, key, flags, limits, MAC filter and 802.11r. It answers which parts it wrote, which it could not (skipped: unknown, or a keyed mode without its key), whether the AP restarts (a new bridge), and the script with every passphrase masked.wireless/<ssid>/passphrasenow writes the key, where netOrk's own builder wrote nothing for it.
get_dhcp_leases()(DhcpLeasesMixin): dnsmasq's DHCPv4 leases from its lease file;[]where dnsmasq never ran, a raise where the file cannot be read.
Changed
- Needs napalm-device-types 4.54.0 or later.
Removed
push_radio_channel(radio, channel), which no contract declared:set_radio_channelsreplaces it. A breaking change before 1.0.0.
[0.10.0] - 2026-11-28
Added
get_radio_status()says whether each radio runs (NetOrk/netork#31):up,pendingandsetup_failedfrom netifd (ubus call network.wireless status, itsretry_setup_failedfor the last), beside the configuration it read before. A key netifd does not answer with a boolean is left out, and all three are left out where the call fails. On 2026-07-16 every radio of the fleet sat in a restart loop with its configuration sayingenabled; this is the state that showed it.
[0.9.0] - 2026-11-26
Added
- An active-only Zabbix agent closes the port netOrk opened for it on an earlier passive run
(
_revoke_zabbix_agent_sources, napalm-device-typesZabbixAgentMixin, NetOrk/netork#2693): the firewall step deletes the rule netOrk wrote -- the named sectionallow_zabbix_agentorallow_zabbix_agent_from_<zone>-- from the configuration and reloads the firewall where one runs. A rule written in LuCI has an anonymouscfgXXXXkey and stays; the rules for the port left in place are named.
[0.8.0] - 2026-11-17
Changed
- Needs napalm-device-types 4.41.0 or later (
FirmwareUpgradeMixin). - The SNMP agent's firewall step writes its rule through
_allow_in_management_zone, which the Zabbix agent's step shares; the rule it writes is the same. get_available_updates()raises napalm-device-types'PackageIndexMissingwhen the package index is not in RAM (after a reboot), for apk and opkg alike, instead of a bareRuntimeError: a caller can load the index instead of reporting a failed read (NetOrk/netork#2527).- A time sync write no longer sets
use_dhcp=0, as the first time sync commit (#36) did; a router that commit wrote keepsuse_dhcp=0until it is set back.
Added
- Firmware (napalm-device-types
FirmwareOfferMixin,FirmwareUpgradeMixin, NetOrk/netork#2615):get_firmware_offer()names the newest release of the device's own release line that the attended sysupgrade server builds for its target (from/json/v1/overview.jsonof the server the device is set to, fetched by the caller at most once a day per server), whether owut can install it (installable, from 24.10 on) and the newest later line (latest_major_version).start_firmware_upgrade(version)runsowut upgrade --version-to <version>detached from the session;get_update_progress()follows its log until owut hands the image to sysupgrade, which keeps the configuration and restarts the device. A sysupgrade brings every installed package in the new image, which empties the overlay that package upgrades fill. - Zabbix agent (napalm-device-types
ZabbixAgentMixin, NetOrk/netork#2571):configure_zabbix_agent(settings)installs the feed'szabbix-agentdafter loading the package index, writes the caller's values into/etc/zabbix_agentd.conf, enables it in UCI, opens tcp/listen_portfor the allowed sources where a firewall runs (an access point often runs none), enables and restarts it. - Time sync (napalm-device-types
TimeSyncMixin, NetOrk/netork#2364):get_time_sync()reads the router's NTP servers and its zone fromuci -q show system;configure_time_sync()writes both. The servers replacesystem.ntp.serverand enable the client;sysntpdrestarts.use_dhcpstays as the router has it: the servers of a DHCP lease (option 42) count (NetOrk/netork#2380).dhcp_ntp_serversnames them -- what sysntpd adds whileuse_dhcpis on, each interface'sdata.ntpserverinubus call network.interface dump(only thedhcp_interfacelist's where it names any), read in the same round trip; None where netifd gives no answer. The zone is written as its name (zonename, in LuCI's spelling) and its POSIX rule (timezone, from napalm-device-types'posix_tz), then/etc/init.d/system reloadand a restart of logd apply it -- the rule, not the name, is what libc reads (NetOrk/netork#1849). A value the router already has is not written again and nothing restarts. The zone reads by its name only where the rule in force is that zone's: a router whose rule differs from itszonename, or that has a rule only, reads as the one zone with that rule, or as no zone where several share it.synchronizedis None: BusyBox ntpd keeps no state to read. get_host_status()(napalm-device-typesHostStatusMixin), over an SSH exec channel: whether the router needs a reboot, how full its filesystems are, and -- with napalm-device-types 4.32 or newer -- whether apk (OpenWrt 25.12) or opkg (before) was left halfway, and which of the two it read (NetOrk/netork#851).- Scheduled jobs (NetOrk/netork#1933, #32), through napalm-device-types'
PosixScheduledJobsMixin:get_scheduled_jobs()reads every crontab in/etc/crontabs-- BusyBox crond has no/etc/crontab,cron.d, run-parts, anacron or systemd -- with the time zone from UCI and each crontab's package fromopkg;manage_scheduled_job()enables, disables or runs one now;put_scheduled_job()anddelete_scheduled_job()write and remove an application's own job as marked lines in the user's crontab. Every write changes only the job's own line, is read back (BusyBoxcrontabexits 0 when it could not write) and leaves cron enabled and restarted. A run is the command as BusyBox crond runs it (%is no stdin), bounded bytimeoutwhere the router has it (OpenWrt 25.x); another user's job runs throughstart-stop-daemon -c, as OpenWrt's BusyBox has nosu.@dailyand the other aliases are written as five fields;@rebootis refused, as OpenWrt's crond has no special times. configure_lldp_agent(interfaces)(napalm-device-typesLldpAgentMixin): installs lldpd where it is missing, writes the interfaces given as lldpd's interface list in UCI, enables lldpd at boot and restarts it. A VLAN device (br-ap.10) is written as the device under it (br-ap). It is the action for the setup the LLDP getters used to do on every poll (#8). Needs napalm-device-types withLldpAgentMixin.
Changed
get_ntp_servers()andget_ntp_peers()read over an SSH exec channel, with the same reading asget_time_sync(), and name no servers while the NTP client is disabled (system.ntp.enabled='0'): sysntpd then starts no ntpd.- The floor on napalm-device-types is 4.35.0, the first release with
TimeSyncMixin(it was 4.26.0 forPosixScheduledJobsMixin, and 4.24.0 for the sharedlldpctlparser before that). - Python 3.12 is the floor (
requires-python = ">=3.12"): netOrk runs every driver on 3.12, so 3.10 and 3.11 are no longer tested (NAPALM/driver-standard#6). - The floor on napalm is 5.1: older releases import
pkg_resources, which a Python 3.12 venv no longer has. get_lldp_neighbors()andget_lldp_neighbors_detail()only read. They no longer enable and start a stopped lldpd, and no longer rewrite lldpd's interface list and restart it, which could happen on every poll. A device whose lldpd is stopped now reports no neighbours until lldpd is started, for example withmanage_service("lldpd", "enable")andmanage_service("lldpd", "start")(#8).
Fixed
set_hostname()hands the name toucias one shell word (theuci()helper ofuci_steps, #43, NetOrk/netork#2456). It stood between single quotes of its own, so a name with a single quote ended them and the rest ran as root (x';reboot;').- A replace
commit_config()androllback()import their config through amktempfile made under umask 077, written, imported and removed in one command (#45, NetOrk/netork#2446). They wrote it as root to a fixed name in /tmp (/tmp/napalm_candidate.uci,/tmp/napalm_rollback.uci) and imported it with a second command, so a local account could place or swap the file and have its own config committed. push_mac_acl()raisesValueErrorfor a mode other than"off","whitelist"and"blacklist", before anything is sent. An unknown mode was written as a deny list (#39).push_mac_acl()andpush_radio_channel()raise when the router refuses a step (CommandErrorException, naming theucicommand or the wifi restart and what the router said). They used to return normally after a refuseduci set,add_list,commitorwifi reload, so an ACL that never landed looked applied. Each step runs on an SSH exec channel of its own and as root, with its exit status checked; a refused change reverts what was staged, so nothing of it is committed by a later write, and wifi is not restarted for it.push_mac_acl()raises when no wifi-iface carries the SSID, where it did nothing, and deletesmacfilter/maclistonly where a section has them instead of hiding every delete's status behind|| true(#35).get_ntp_servers()names every server of thesystem.ntp.serverlist; it kept only the first, as uci prints a list as'a' 'b' 'c'on one line.get_lldp_neighbors()andget_lldp_neighbors_detail()keep an interface name with a dot whole: the neighbours of a VLAN interface such aseth0.1used to come back undereth0with every field empty (#26). A neighbour that names its port by MAC address or a local id is reported with that port instead of an empty one, and a chassis named by a local id or an address with that id. The detail now also carries the neighbour's system description and capabilities, which were always empty. lldpd's output is parsed by napalm-device-types' shared parser.get_lldp_neighbors()reports a neighbour's chassis MAC asmac(lower case) when the neighbour names its chassis by one, as napalm-linux does, so netOrk can match the neighbour by MAC rather than by name only (#31).get_lldp_neighbors()andget_lldp_neighbors_detail()raise when lldpctl fails (not installed, lldpd not running or unreachable), with lldpctl's message; they used to return no neighbours, the same answer as a device without any (#27). An empty result now means lldpctl ran and listed none.get_environment()raises when/proc/stator/proc/meminfocannot be read or parsed, instead of reporting 0 % CPU and 0 bytes of memory.get_arp_table()reports an unknown age as-1.0(napalm-device-types'ARP_AGE_UNKNOWN) instead of0.0, which means "confirmed just now": neitherip neighnor/proc/net/arphas an age (NetOrk/netork#1327).- The driver no longer removes
portfrom theoptional_argsdict it is given: the caller's dict stays as it was (#19). manage_service()reports a failed action or a missing init script as failed: only the init script's exit status decides, where any action used to come back as a success (#3).apply_updates()reports a failed upgrade as failed, with the package manager's exit status inerror; it used to report every upgrade as done (#11).get_environment()reports the CPU usage of the last second, from two reads of/proc/statone second apart; it used to report the average since boot, so a box busy for the last minute could show a low figure (#10).get_lldp_neighbors()andget_lldp_neighbors_detail()report every neighbour on a port (a phone with a PC behind it, a switch without LLDP of its own); only the last one came back, mixed with fields of the others (#9).install_package()anduninstall_package()report a failed install or removal as failed: only the package manager's exit status decides. They used to search the output for words like "error:", so an opkg dependency failure ("Collected errors:", "Cannot install package …") came back as a success, and a successful install of a package whose name contains "failed" as a failure (#28).
[0.7.0] - 2026-10-23
The first release on PyPI.
Changed
- The driver follows the NAPALM driver standard
(https://git.netork.io/NAPALM/driver-standard): CI on Gitea runs ruff, mypy, the
tests on Python 3.10–3.13 and at the lowest declared versions, bandit, pip-audit and
a build check, and a release tag publishes to PyPI. The package now ships
py.typedand a LICENSE file. Python 3.8 and 3.9 are no longer supported; napalm-device-types never ran on them. - napalm-device-types 4.21.1 or newer is required.
- Exceptions the driver deliberately ignores (the snmpd community in
get_snmp_config(), the network VLANs inget_ssids()) are now logged at debug level. - The project links point at git.netork.io instead of GitHub.