summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/vyos/kea.py2
-rwxr-xr-xpython/vyos/template.py12
2 files changed, 10 insertions, 4 deletions
diff --git a/python/vyos/kea.py b/python/vyos/kea.py
index 323fded5d..a8b38d999 100644
--- a/python/vyos/kea.py
+++ b/python/vyos/kea.py
@@ -158,7 +158,7 @@ def kea_parse_options(config):
def kea_parse_subnet(subnet, config):
- out = {'subnet': subnet, 'id': int(config['subnet_id']), 'user-context': {}}
+ out = {'subnet': subnet, 'id': int(config['subnet_id']), 'user-context': {'enable-ping-check': False}}
if 'option' in config:
out['option-data'] = kea_parse_options(config['option'])
diff --git a/python/vyos/template.py b/python/vyos/template.py
index 44278e963..128471f42 100755
--- a/python/vyos/template.py
+++ b/python/vyos/template.py
@@ -1015,7 +1015,7 @@ def kea_shared_network_json(shared_networks):
'name': name,
'authoritative': ('authoritative' in config),
'subnet4': [],
- 'user-context': {}
+ 'user-context': {'enable-ping-check': False}
}
if 'dynamic_dns_update' in config:
@@ -1030,15 +1030,21 @@ def kea_shared_network_json(shared_networks):
if 'bootfile_server' in config['option']:
network['next-server'] = config['option']['bootfile_server']
- if 'ping_check' in config:
- network['user-context']['enable-ping-check'] = True
+ subnet_ping_check = False
if 'subnet' in config:
for subnet, subnet_config in config['subnet'].items():
if 'disable' in subnet_config:
continue
+
+ if 'ping_check' in subnet_config:
+ subnet_ping_check = True
+
network['subnet4'].append(kea_parse_subnet(subnet, subnet_config))
+ if 'ping_check' in config or subnet_ping_check:
+ network['user-context']['enable-ping-check'] = True
+
out.append(network)
return dumps(out, indent=4)