From 171b224c1cf1303a608725ec74b545902daa243e Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 4 Jul 2022 20:40:01 +0200 Subject: ntp: T4456: call verify_vrf() before individual interface validation It makes no sense to test against a VRF that might not exist at all. --- src/conf_mode/ntp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/conf_mode/ntp.py') diff --git a/src/conf_mode/ntp.py b/src/conf_mode/ntp.py index 7be150ed2..5490a794d 100755 --- a/src/conf_mode/ntp.py +++ b/src/conf_mode/ntp.py @@ -50,6 +50,8 @@ def verify(ntp): if 'allow_clients' in ntp and 'server' not in ntp: raise ConfigError('NTP server not configured') + verify_vrf(ntp) + if 'interface' in ntp: # If ntpd should listen on a given interface, ensure it exists for interface in ntp['interface']: @@ -63,7 +65,6 @@ def verify(ntp): raise ConfigError(f'NTP runs in VRF "{vrf_name}" - "{interface}" '\ f'does not belong to this VRF!') - verify_vrf(ntp) return None def generate(ntp): -- cgit v1.2.3