summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorsarthurdev <965089+sarthurdev@users.noreply.github.com>2023-10-05 13:47:38 +0200
committersarthurdev <965089+sarthurdev@users.noreply.github.com>2023-12-08 00:29:40 +0100
commit2787e7915c1225f05f1e07c62f7c4d1ac9dca5ac (patch)
tree9f0724328d94ef3b2a938e203c44fb82f2c81a63 /python
parent4484a7398482caffdd5e0a74f73f46b162785bf3 (diff)
downloadvyos-1x-2787e7915c1225f05f1e07c62f7c4d1ac9dca5ac.tar.gz
vyos-1x-2787e7915c1225f05f1e07c62f7c4d1ac9dca5ac.zip
dhcp: T3316: Add time-zone node for options 100 and 101
Diffstat (limited to 'python')
-rw-r--r--python/vyos/kea.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/python/vyos/kea.py b/python/vyos/kea.py
index fa2948233..cb341e0f2 100644
--- a/python/vyos/kea.py
+++ b/python/vyos/kea.py
@@ -83,6 +83,13 @@ def kea_parse_options(config):
options.append({'name': 'rfc3442-static-route', 'data': ", ".join(routes if not default_route else routes + [default_route])})
options.append({'name': 'windows-static-route', 'data': ", ".join(routes)})
+ if 'time_zone' in config:
+ with open("/usr/share/zoneinfo/" + config['time_zone'], "rb") as f:
+ tz_string = f.read().split(b"\n")[-2].decode("utf-8")
+
+ options.append({'name': 'pcode', 'data': tz_string})
+ options.append({'name': 'tcode', 'data': config['time_zone']})
+
return options
def kea_parse_subnet(subnet, config):