fix(dhcp): one refused reservation no longer stops the apply #104

Merged
christianmanivong merged 2 commits from fix/dhcp-reservations-partial-apply into main 2026-11-11 21:12:31 +00:00
2 Commits
Author SHA1 Message Date
christianmanivong 8516f2a1ee refactor(dhcp): one reservation's write in a helper of its own
driver / standard (pull_request) Successful in 17s
driver / lint (pull_request) Successful in 15s
driver / types (pull_request) Successful in 1m6s
driver / test (3.12) (pull_request) Successful in 1m19s
driver / test (3.13) (pull_request) Successful in 1m10s
driver / lowest (pull_request) Successful in 42s
driver / build (pull_request) Successful in 37s
driver / security (pull_request) Successful in 1m9s
CI / driver (pull_request) Successful in 3m0s
driver / publish (pull_request) Skipped
apply_dhcp_reservationset grew to 59 lines with the per-write handling;
the quality ratchet allows no new function that long.

Refs NetOrk/netork#2381
2026-11-11 22:08:50 +01:00
christianmanivong c74173523a fix(dhcp): one refused reservation no longer stops the apply
driver / lint (pull_request) Successful in 18s
driver / standard (pull_request) Failing after 22s
driver / types (pull_request) Successful in 1m22s
driver / test (3.12) (pull_request) Successful in 1m28s
driver / test (3.13) (pull_request) Successful in 1m26s
driver / lowest (pull_request) Successful in 38s
driver / build (pull_request) Successful in 38s
driver / security (pull_request) Successful in 1m11s
CI / driver (pull_request) Failing after 2m57s
driver / publish (pull_request) Skipped
apply_dhcp_reservationset wrote the diff one reservation at a time and
committed only after the last. A write the device refused -- on
OPNsense, an address in a subnet Kea does not manage -- ended the run
before the commit: every later reservation went unwritten, and the
earlier ones stayed saved but inactive. The next diff read those back as
configured, reported no changes and never committed them.

A refused change now gets a "[failed] <mac> -> <ip>: <reason>" line and
the others are still written. Any non-empty diff commits, also one whose
every write was refused, so writes an interrupted earlier run saved take
effect. DhcpApplyError (a RuntimeError, exported) is raised after the
commit with how many of how many changes were refused.

Refs NetOrk/netork#2381
2026-11-11 22:03:52 +01:00