diff options
author | Daniil Baturin <daniil@vyos.io> | 2024-03-14 17:10:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-14 17:10:03 +0100 |
commit | c2e66922c93b60d12f1f30bded3cd6d4bae7e117 (patch) | |
tree | d61fae3a2d873fa11fd940e2f5eb8a884aaf9957 /src/conf_mode | |
parent | 1ba302d55b86d63880fe2f55286fe82003f8a31f (diff) | |
parent | d56b4c05726d4f4fb4fb5128a9223df1963fbdb7 (diff) | |
download | vyos-1x-c2e66922c93b60d12f1f30bded3cd6d4bae7e117.tar.gz vyos-1x-c2e66922c93b60d12f1f30bded3cd6d4bae7e117.zip |
Merge pull request #3111 from nicolas-fort/T6110
T6110: dhcp: add error check when fail-over is enabled on a subnet, but range is not defined.
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/dhcp_server.py | 5 |
1 files changed, 4 insertions, 1 deletions
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 |