fix(dhcp): raise when the Kea reservation search fails

create_dhcp_reservation searched for an existing reservation so a retry
updates it, but a failed search was logged at debug level and the add
went ahead: a write based on a read that did not happen. Raise a
RuntimeError naming searchReservation before anything is written.

Closes #40
This commit is contained in:
Christian Manivong committed 2026-11-02 08:37:06 +01:00
1 parent 901df1b523
commit 0f730a4b9d
3 files changed
+39 -6

No files matched your search

+5
View File
@@ -43,6 +43,11 @@ All notable changes to this driver. The format follows
Dnsmasq ran: a transient API error made the firewall look as if it had no DNS
records. `sync_dns_zone()` raises that API error instead of "No active DNS
service (Unbound or Dnsmasq) detected" (#39).
- `create_dhcp_reservation()` raises `RuntimeError` naming `searchReservation` when
the search for an existing reservation fails, and writes nothing. It used to add
the reservation anyway: a retry then failed with "Kea rejected DHCP reservation"
instead of the real error, or left two reservations for one address, which Kea
refuses to load (#40).
## [0.5.0] - 2026-10-23