From a41145f0179c3f18234d613e41f6c5de9dcf006f Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Wed, 16 May 2018 03:23:20 +0200 Subject: T643: correct support for regex validators. --- scripts/build-command-templates | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/build-command-templates b/scripts/build-command-templates index 415104e65..9f51c00cd 100755 --- a/scripts/build-command-templates +++ b/scripts/build-command-templates @@ -142,13 +142,13 @@ def get_properties(p): if v_argument is None: v_argument = "" - validators.append("{0} {1} \\\'$VAR(@)\\\'".format(v_name, v_argument)) + validators.append("{0} {1}".format(v_name, v_argument)) regex_args = " ".join(map(lambda s: "--regex \\\'{0}\\\'".format(s), regexes)) validator_args = " ".join(map(lambda s: "--exec \\\"{0}\\\"".format(s), validators)) validator_script = '${vyos_libexecdir}/validate-value.py' - validator_string = "exec \"{0} {1} {2}\"; \"{3}\"".format(validator_script, regex_args, validator_args, error_msg) + validator_string = "exec \"{0} {1} {2} --value \\\'$VAR(@)\\\'\"; \"{3}\"".format(validator_script, regex_args, validator_args, error_msg) props["constraint"] = validator_string except Exception as exn: -- cgit v1.2.3