From 7b1f1fa56f7ff7de14de7c5bc38753ceec565c0a Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 13 Jun 2020 23:02:17 +0200 Subject: ntp: T2321: remove superfluous verify() step on network addresses Only IP prefixes are allowed to be added by the CLI thus we can drop the same check inside the Python script to validate the prefix. --- src/conf_mode/ntp.py | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src') diff --git a/src/conf_mode/ntp.py b/src/conf_mode/ntp.py index 951ebeec0..05bc962c2 100755 --- a/src/conf_mode/ntp.py +++ b/src/conf_mode/ntp.py @@ -91,14 +91,6 @@ def verify(ntp): if len(ntp['allowed_networks']) and not len(ntp['servers']): raise ConfigError('NTP server not configured') - for n in ntp['allowed_networks']: - try: - addr = ip_network( n['network'] ) - break - except ValueError: - raise ConfigError('{network} does not appear to be a valid IPv4 or IPv6 network, ' - 'check host bits!'.format(**n)) - return None def generate(ntp): -- cgit v1.2.3