From d56b4c05726d4f4fb4fb5128a9223df1963fbdb7 Mon Sep 17 00:00:00 2001 From: Nicolas Fort Date: Fri, 8 Mar 2024 15:09:58 +0000 Subject: T6110: dhcp: add error check when fail-over is enabled on a subnet, but range is not defined. --- src/conf_mode/dhcp_server.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/conf_mode/dhcp_server.py b/src/conf_mode/dhcp_server.py index ff0f5ecc5..b5d4a3ade 100755 --- a/src/conf_mode/dhcp_server.py +++ b/src/conf_mode/dhcp_server.py @@ -174,8 +174,11 @@ def verify(dhcp): # DHCP failover needs at least one subnet that uses it if 'enable_failover' in subnet_config: if 'failover' not in dhcp: - raise ConfigError(f'Can not enable failover for "{subnet}" in "{network}".\n' \ + raise ConfigError(f'Cannot enable failover for "{subnet}" in "{network}".\n' \ 'Failover is not configured globally!') + if 'range' not in subnet_config: + raise ConfigError(f'Cannot enable failover for "{subnet}" in "{network}".\n' \ + f'Range is not configured for "{subnet}"') failover_ok = True # Check if DHCP address range is inside configured subnet declaration -- cgit v1.2.3