diff options
author | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-05-08 19:14:09 +0100 |
---|---|---|
committer | Thomas Mangin <thomas.mangin@exa.net.uk> | 2020-05-08 19:14:09 +0100 |
commit | ff58182904882278a004f4d3d8082ec11adbe1ea (patch) | |
tree | f79a57f98a312897db529c47421c4f2c45a738e1 /src/helpers | |
parent | 3639a5610b590a64d6d56bee81dddd252994cfe5 (diff) | |
parent | 29dee3abb55d0f0c6b91b311f30521b45d7e46b6 (diff) | |
download | vyos-1x-ff58182904882278a004f4d3d8082ec11adbe1ea.tar.gz vyos-1x-ff58182904882278a004f4d3d8082ec11adbe1ea.zip |
Merge branch 'current' of github.com:thomas-mangin/vyos-1x into T2417
Diffstat (limited to 'src/helpers')
-rwxr-xr-x | src/helpers/validate-value.py | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/helpers/validate-value.py b/src/helpers/validate-value.py deleted file mode 100755 index a58ba61d1..000000000 --- a/src/helpers/validate-value.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python3 - -import re -import os -import sys -import argparse - -from vyos.util import call - -parser = argparse.ArgumentParser() -parser.add_argument('--regex', action='append') -parser.add_argument('--exec', action='append') -parser.add_argument('--value', action='store') - -args = parser.parse_args() - -debug = False - -# Multiple arguments work like logical OR - -try: - for r in args.regex: - if re.fullmatch(r, args.value): - sys.exit(0) -except Exception as exn: - if debug: - print(exn) - else: - pass - -try: - for cmd in args.exec: - cmd = "{0} {1}".format(cmd, args.value) - if debug: - print(cmd) - res = call(cmd) - if res == 0: - sys.exit(0) -except Exception as exn: - if debug: - print(exn) - else: - pass - -sys.exit(1) |