dhcp: apply_dhcp_subnetset stops at the first refused write and leaves earlier writes uncommitted #113

Closed
opened 2026-11-12 18:14:28 +00:00 by christianmanivong · 0 comments
Owner

Priority: P3 (important, not urgent).

Found while fixing #106 (PR #112). apply_dhcp_subnetset (napalm_device_types/dhcp.py) calls apply_dhcp_subnet for every add and update and commits only at the end. One refused write raises out of the generator before commit_dhcp_subnets(): the subnets written before it stay saved but inactive, and because the device then reports them as configured, the next diff is empty and nothing ever commits them.

This is the hazard apply_dhcp_reservationset was fixed for in 4.35.1 (#104): a [failed] line per refused write, the others written, any non-empty diff committed, then DhcpApplyError. The subnet apply should behave the same way.

Priority: P3 (important, not urgent). Found while fixing #106 (PR #112). `apply_dhcp_subnetset` (`napalm_device_types/dhcp.py`) calls `apply_dhcp_subnet` for every add and update and commits only at the end. One refused write raises out of the generator before `commit_dhcp_subnets()`: the subnets written before it stay saved but inactive, and because the device then reports them as configured, the next diff is empty and nothing ever commits them. This is the hazard `apply_dhcp_reservationset` was fixed for in 4.35.1 (#104): a `[failed]` line per refused write, the others written, any non-empty diff committed, then `DhcpApplyError`. The subnet apply should behave the same way.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: NAPALM/napalm-device-types#113