summaryrefslogtreecommitdiff
path: root/python/vyos/configverify.py
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2023-02-15 15:46:18 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2023-02-15 15:46:18 +0000
commit21e3a0b0258f690b10a9144f1c28962d642578f7 (patch)
tree02050b4706106f06d99e41ac0292c110d61acb1d /python/vyos/configverify.py
parente0e550ad1187e10bcd730675c11714a075abc4a0 (diff)
downloadvyos-1x-21e3a0b0258f690b10a9144f1c28962d642578f7.tar.gz
vyos-1x-21e3a0b0258f690b10a9144f1c28962d642578f7.zip
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
Diffstat (limited to 'python/vyos/configverify.py')
-rw-r--r--python/vyos/configverify.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py
index 30bdd2d47..fcc8cc733 100644
--- a/python/vyos/configverify.py
+++ b/python/vyos/configverify.py
@@ -420,11 +420,12 @@ def verify_accel_ppp_base_service(config, local_users=True):
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!')