summaryrefslogtreecommitdiff
path: root/python/vyos/template.py
diff options
context:
space:
mode:
authorsarthurdev <965089+sarthurdev@users.noreply.github.com>2024-01-07 09:24:10 +0100
committersarthurdev <965089+sarthurdev@users.noreply.github.com>2024-01-10 00:42:22 +0100
commitdaffee2cbf001dab13799f5b2b69330162491214 (patch)
tree7164b748eb92fb943773761715d4de9f8d91a875 /python/vyos/template.py
parentdff740f3cfb57757146d465d994499c552876359 (diff)
downloadvyos-1x-daffee2cbf001dab13799f5b2b69330162491214.tar.gz
vyos-1x-daffee2cbf001dab13799f5b2b69330162491214.zip
dhcp: T3316: Move options to separate node and extend scopes
Diffstat (limited to 'python/vyos/template.py')
-rw-r--r--python/vyos/template.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/python/vyos/template.py b/python/vyos/template.py
index 29ea0889b..c0c09f690 100644
--- a/python/vyos/template.py
+++ b/python/vyos/template.py
@@ -842,15 +842,22 @@ def kea_shared_network_json(shared_networks):
'authoritative': ('authoritative' in config),
'subnet4': []
}
- options = kea_parse_options(config)
+
+ if 'option' in config:
+ network['option-data'] = kea_parse_options(config['option'])
+
+ if 'bootfile_name' in config['option']:
+ network['boot-file-name'] = config['option']['bootfile_name']
+
+ if 'bootfile_server' in config['option']:
+ network['next-server'] = config['option']['bootfile_server']
if 'subnet' in config:
for subnet, subnet_config in config['subnet'].items():
+ if 'disable' in subnet_config:
+ continue
network['subnet4'].append(kea_parse_subnet(subnet, subnet_config))
- if options:
- network['option-data'] = options
-
out.append(network)
return dumps(out, indent=4)