From 2787e7915c1225f05f1e07c62f7c4d1ac9dca5ac Mon Sep 17 00:00:00 2001 From: sarthurdev <965089+sarthurdev@users.noreply.github.com> Date: Thu, 5 Oct 2023 13:47:38 +0200 Subject: dhcp: T3316: Add time-zone node for options 100 and 101 --- python/vyos/kea.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'python') 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): -- cgit v1.2.3