fix: is_alive port, DNS override read failure, Kea reservation MAC (#15, #14, #26) #38

Merged
christianmanivong merged 3 commits from fix/bugs-2026-11 into main 2026-11-01 22:00:11 +00:00
Owner

Three bug fixes, one commit each.

  • fix(connection): is_alive probes the host and port of base_url (scheme default when no port) (#15).
  • fix(dns): a failed host-override read raises before sync_dns_zone writes anything, instead of re-adding every override; get_dns_entries() raises too (netOrk's poll already treats that as "unknown", #1458) (#14).
  • fix(dhcp): Kea reservations are matched on address and MAC. Create raises RuntimeError when another MAC holds the address and writes nothing; delete removes only the given MAC's reservation and lease and reports another host's MAC in the new key reservation_other_mac (#26). Note: netOrk's VM provisioning will now fail a job whose address is reserved for another MAC.

Already fixed on main, no code touched: #24/#25 (bb0810d, age -1.0), #2 (960aaef), #1 (1f29d9d).

Tested: fixtures only. pytest 480 passed, ruff, mypy, napalm-standard check/ratchet green (baseline only shrank).

Closes #15
Closes #14
Closes #26

Three bug fixes, one commit each. - `fix(connection)`: `is_alive` probes the host and port of `base_url` (scheme default when no port) (#15). - `fix(dns)`: a failed host-override read raises before `sync_dns_zone` writes anything, instead of re-adding every override; `get_dns_entries()` raises too (netOrk's poll already treats that as "unknown", #1458) (#14). - `fix(dhcp)`: Kea reservations are matched on address **and** MAC. Create raises `RuntimeError` when another MAC holds the address and writes nothing; delete removes only the given MAC's reservation and lease and reports another host's MAC in the new key `reservation_other_mac` (#26). Note: netOrk's VM provisioning will now fail a job whose address is reserved for another MAC. Already fixed on main, no code touched: #24/#25 (bb0810d, age `-1.0`), #2 (960aaef), #1 (1f29d9d). Tested: fixtures only. pytest 480 passed, ruff, mypy, `napalm-standard check`/`ratchet` green (baseline only shrank). Closes #15 Closes #14 Closes #26
christianmanivong added 3 commits 2026-11-01 20:54:39 +00:00
is_alive always opened port 443 on the hostname, so a firewall whose API
is reached through base_url on another port (https://fw:8443) read as
dead. The probe now takes host and port from base_url, falling back to
the scheme's default port.

Closes #15
The Unbound and Dnsmasq override reads logged any error and returned an
empty list. sync_dns_zone took that for "no overrides": it deleted
nothing and added every record again, so a transient API error left
each record twice on the firewall. The reads now raise, which stops the
sync before it writes and lets get_dns_entries callers tell a failed
read from an empty one.

Closes #14
fix(dhcp): match Kea reservations on address and MAC
driver / standard (pull_request) Successful in 15s
driver / lint (pull_request) Successful in 12s
driver / types (pull_request) Successful in 56s
driver / test (3.12) (pull_request) Successful in 1m16s
driver / test (3.13) (pull_request) Successful in 1m4s
driver / lowest (pull_request) Successful in 29s
driver / build (pull_request) Successful in 30s
driver / security (pull_request) Successful in 1m2s
CI / driver (pull_request) Successful in 2m45s
driver / publish (pull_request) Skipped
ea0a52717e
create_dhcp_reservation and delete_dhcp_reservation_and_lease looked a
reservation up by its address alone. A reservation another MAC held for
the address, made by hand or left from an earlier host, was overwritten
on create and removed on delete, together with that host's lease.

Create now raises instead of taking it over, and delete leaves another
MAC's reservation and lease in place and names that MAC in the new
reservation_other_mac field. The matching lives in kea_reservations, a
module under strict typing.

Closes #26
christianmanivong merged commit 91a17b54a8 into main 2026-11-01 22:00:11 +00:00
christianmanivong deleted branch fix/bugs-2026-11 2026-11-01 22:00:11 +00:00
Sign in to join this conversation.