Development
This commit is contained in:
parent
705c69abc4
commit
470cc39356
5 changed files with 244 additions and 245 deletions
|
|
@ -741,7 +741,8 @@ def validate_config(data):
|
|||
|
||||
seen_res_ips = {}
|
||||
seen_res_macs = {}
|
||||
for r in vlan.get("reservations", []):
|
||||
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", "?")
|
||||
rmac = r.get("mac", "").lower().strip()
|
||||
|
||||
|
|
@ -876,10 +877,11 @@ def validate_config(data):
|
|||
|
||||
# RADIUS requires multiple VLANs ================================
|
||||
non_wg_vlans = [v for v in data.get("vlans", []) if not is_wg(v)]
|
||||
non_wg_names = {v.get("name") for v in non_wg_vlans}
|
||||
has_radius_clients = any(
|
||||
r.get("radius_client")
|
||||
for v in non_wg_vlans
|
||||
for r in v.get("reservations", [])
|
||||
for r in data.get("dhcp_reservations", [])
|
||||
if r.get("vlan") in non_wg_names
|
||||
)
|
||||
if has_radius_clients and len(non_wg_vlans) < 2:
|
||||
errors.append(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue