diff options
author | Daniil Baturin <daniil@vyos.io> | 2024-02-15 15:09:07 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-15 15:09:07 +0000 |
commit | 2bc62337b3a1474bba3e1027292ca8d0e443b297 (patch) | |
tree | 32c69c3091590069626446611174c3f61d00b7d1 /python/vyos | |
parent | 71497e76c9cf0724581505f50e8b78b6e1c47316 (diff) | |
parent | ac6a16f6c5ad7700789759e1ec093236c2e182a2 (diff) | |
download | vyos-1x-2bc62337b3a1474bba3e1027292ca8d0e443b297.tar.gz vyos-1x-2bc62337b3a1474bba3e1027292ca8d0e443b297.zip |
Merge pull request #3004 from aapostoliuk/T6029-circinus
T6029: Rewritten Accel-PPP services to an identical feature set
Diffstat (limited to 'python/vyos')
-rw-r--r-- | python/vyos/accel_ppp_util.py | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/python/vyos/accel_ppp_util.py b/python/vyos/accel_ppp_util.py index bd0c46a19..845b2f5f0 100644 --- a/python/vyos/accel_ppp_util.py +++ b/python/vyos/accel_ppp_util.py @@ -106,7 +106,26 @@ def get_pools_in_order(data: dict) -> list: return pools -def verify_accel_ppp_base_service(config, local_users=True): +def verify_accel_ppp_name_servers(config): + if "name_server_ipv4" in config: + if len(config["name_server_ipv4"]) > 2: + raise ConfigError( + "Not more then two IPv4 DNS name-servers " "can be configured" + ) + if "name_server_ipv6" in config: + if len(config["name_server_ipv6"]) > 3: + raise ConfigError( + "Not more then three IPv6 DNS name-servers " "can be configured" + ) + + +def verify_accel_ppp_wins_servers(config): + if 'wins_server' in config and len(config['wins_server']) > 2: + raise ConfigError( + 'Not more then two WINS name-servers can be configured') + + +def verify_accel_ppp_authentication(config, local_users=True): """ Common helper function which must be used by all Accel-PPP services based on get_config_dict() @@ -148,17 +167,6 @@ def verify_accel_ppp_base_service(config, local_users=True): if not dict_search('authentication.radius.dynamic_author.key', config): raise ConfigError('DAE/CoA server key required!') - if "name_server_ipv4" in config: - if len(config["name_server_ipv4"]) > 2: - raise ConfigError( - "Not more then two IPv4 DNS name-servers " "can be configured" - ) - - if "name_server_ipv6" in config: - if len(config["name_server_ipv6"]) > 3: - raise ConfigError( - "Not more then three IPv6 DNS name-servers " "can be configured" - ) |