summaryrefslogtreecommitdiff
path: root/src/validators/port-range
diff options
context:
space:
mode:
authorsarthurdev <965089+sarthurdev@users.noreply.github.com>2022-01-09 23:37:12 +0100
committersarthurdev <965089+sarthurdev@users.noreply.github.com>2022-01-10 21:18:03 +0100
commitda370b63b266254d9a7a7ae15274a9a70bcf5417 (patch)
treeb1e6cfd25e179db5d6421791e47f46f2f380b98f /src/validators/port-range
parenta5ad98b2307af974dd498a84caec94fa613f7491 (diff)
downloadvyos-1x-da370b63b266254d9a7a7ae15274a9a70bcf5417.tar.gz
vyos-1x-da370b63b266254d9a7a7ae15274a9a70bcf5417.zip
validators: T4148: Add text output when validators fail
Diffstat (limited to 'src/validators/port-range')
-rwxr-xr-xsrc/validators/port-range2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/validators/port-range b/src/validators/port-range
index abf0b09d5..6e68c8733 100755
--- a/src/validators/port-range
+++ b/src/validators/port-range
@@ -9,9 +9,11 @@ if __name__ == '__main__':
if re.search('[0-9]{1,5}-[0-9]{1,5}', port_range):
for tmp in port_range.split('-'):
if int(tmp) not in range(1, 65535):
+ print(f'Error: {port_range} is not a valid port range')
sys.exit(1)
else:
if int(port_range) not in range(1, 65535):
+ print(f'Error: {port_range} is not a valid port')
sys.exit(1)
else:
sys.exit(2)