Development

This commit is contained in:
Matthew Grotke 2026-06-03 02:24:21 -04:00
parent f04b2b36cc
commit 5a3a18d5b0
7 changed files with 123 additions and 33 deletions

View file

@ -739,8 +739,9 @@ def validate_config(data):
f"pool ({pool_start} - {pool_end})."
)
seen_res_ips = {}
seen_res_macs = {}
seen_res_ips = {}
seen_res_macs = {}
seen_res_hostnames = {}
vlan_name_key = vlan.get("name", "")
for r in [r for r in data.get("dhcp_reservations", []) if r.get("vlan") == vlan_name_key]:
rdesc = r.get("description", "?")
@ -784,6 +785,16 @@ def validate_config(data):
else:
seen_res_macs[rmac] = rdesc
rhost = r.get("hostname", "").strip().lower()
if rhost:
if rhost in seen_res_hostnames:
errors.append(
f"{label}: reservation '{rdesc}' hostname '{rhost}' duplicates "
f"'{seen_res_hostnames[rhost]}'."
)
else:
seen_res_hostnames[rhost] = rdesc
for bl_name in vlan.get("use_blocklists", []):
if bl_name not in blocklists_by_name:
errors.append(f"{label}: use_blocklists references unknown blocklist '{bl_name}'.")