From 6b0565c76324ef2a86f472b4e02a7223f39aa049 Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Wed, 15 Feb 2023 17:03:28 +0000 Subject: T4971: Accel-ppp verify if client_ip_pool key exists in config If 'client_ip_pool' not exists in config we cannot search it in the dictionary dict_search_recursive(config, 'gateway_address', ['client_ip_pool', 'name']) Add check for Equuleus --- python/vyos/configverify.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'python/vyos') diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py index 47cf218ee..0085ad5e4 100644 --- a/python/vyos/configverify.py +++ b/python/vyos/configverify.py @@ -361,11 +361,12 @@ def verify_accel_ppp_base_service(config): if 'gateway_address' in config: gateway = True else: - if dict_search_recursive(config, 'gateway_address', ['client_ip_pool', 'name']): - for _, v in config['client_ip_pool']['name'].items(): - if 'gateway_address' in v: - gateway = True - break + if 'client_ip_pool' in config: + if dict_search_recursive(config, 'gateway_address', ['client_ip_pool', 'name']): + for _, v in config['client_ip_pool']['name'].items(): + if 'gateway_address' in v: + gateway = True + break if not gateway: raise ConfigError('Server requires gateway-address to be configured!') -- cgit v1.2.3