From 6f37744ad45a5f4cd585fa7c981833a9ebe5e437 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 3 Nov 2022 17:40:12 +0100 Subject: xml: T4795: superseed allowed-vlan validator by numeric range validator Reduce CPU time when spawning the python interpreter. Same can be done by the numeric validator. --- interface-definitions/interfaces-bridge.xml.in | 2 +- src/validators/allowed-vlan | 19 ------------------- 2 files changed, 1 insertion(+), 20 deletions(-) delete mode 100755 src/validators/allowed-vlan diff --git a/interface-definitions/interfaces-bridge.xml.in b/interface-definitions/interfaces-bridge.xml.in index 1e11cd4c6..d633077d9 100644 --- a/interface-definitions/interfaces-bridge.xml.in +++ b/interface-definitions/interfaces-bridge.xml.in @@ -151,7 +151,7 @@ VLAN id range allowed on this interface (use '-' as delimiter) - + not a valid VLAN ID value or range diff --git a/src/validators/allowed-vlan b/src/validators/allowed-vlan deleted file mode 100755 index 11389390b..000000000 --- a/src/validators/allowed-vlan +++ /dev/null @@ -1,19 +0,0 @@ -#! /usr/bin/python3 - -import sys -import re - -if __name__ == '__main__': - if len(sys.argv)>1: - allowed_vlan = sys.argv[1] - if re.search('[0-9]{1,4}-[0-9]{1,4}', allowed_vlan): - for tmp in allowed_vlan.split('-'): - if int(tmp) not in range(1, 4095): - sys.exit(1) - else: - if int(allowed_vlan) not in range(1, 4095): - sys.exit(1) - else: - sys.exit(2) - - sys.exit(0) -- cgit v1.2.3