summaryrefslogtreecommitdiff
path: root/src/conf_mode/service_ntp.py
diff options
context:
space:
mode:
authorLucas Christian <lucas@lucasec.com>2024-08-08 23:39:00 -0700
committerChristian Breunig <christian@breunig.cc>2024-09-21 08:51:28 +0200
commita5a6e57b3f7ba7d76bffcfb8dcb086d79f51202a (patch)
treea5c399d95be3f3846aff2b541e0a96f552cbb60f /src/conf_mode/service_ntp.py
parentbf5805c52b7133ec76edeebac33f3c30b56b169f (diff)
downloadvyos-1x-a5a6e57b3f7ba7d76bffcfb8dcb086d79f51202a.tar.gz
vyos-1x-a5a6e57b3f7ba7d76bffcfb8dcb086d79f51202a.zip
T6630: ntp: add chrony "ntp over ptp" transport
Diffstat (limited to 'src/conf_mode/service_ntp.py')
-rwxr-xr-xsrc/conf_mode/service_ntp.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/conf_mode/service_ntp.py b/src/conf_mode/service_ntp.py
index 83880fd72..f7dbc3776 100755
--- a/src/conf_mode/service_ntp.py
+++ b/src/conf_mode/service_ntp.py
@@ -87,6 +87,15 @@ def verify(ntp):
if ipv6_addresses > 1:
raise ConfigError(f'NTP Only admits one ipv6 value for listen-address parameter ')
+ if 'server' in ntp:
+ for host, server in ntp['server'].items():
+ if 'ptp_transport' in server:
+ if 'ptp_transport' not in ntp:
+ raise ConfigError('ptp-transport must be enabled on the service '\
+ f'before it can be used with server {host}')
+ else:
+ break
+
return None
def generate(ntp):