summaryrefslogtreecommitdiff
path: root/src/value_checker.ml
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-10-24 11:04:39 -0500
committerJohn Estabrook <jestabro@vyos.io>2024-10-24 11:04:39 -0500
commit73e0836d9d64c9dbbf53b82d18ab84e525f59ad6 (patch)
treef858ca6fe042a79fbd809aeafe9e33a7ef946cb9 /src/value_checker.ml
parent8bb9e607eb1c7b0a701292a36583c91f4a0cdc7b (diff)
downloadvyos1x-config-73e0836d9d64c9dbbf53b82d18ab84e525f59ad6.tar.gz
vyos1x-config-73e0836d9d64c9dbbf53b82d18ab84e525f59ad6.zip
T6718: validate_path returns unit instead of (path, value)
Splitting of path arg into (path, value), as originally returned by validate_path, is now handled by a utility function. validate_path returns unit on success and raises error with output on failure.
Diffstat (limited to 'src/value_checker.ml')
-rw-r--r--src/value_checker.ml8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/value_checker.ml b/src/value_checker.ml
index 69bfeec..65013d4 100644
--- a/src/value_checker.ml
+++ b/src/value_checker.ml
@@ -52,11 +52,11 @@ let validate_any validators constraints value =
match validate_exists validators constraints value with
| true ->
let () = Buffer.clear buf in
- true, ""
+ None
| false ->
let out = Buffer.contents buf in
let () = Buffer.clear buf in
- false, out
+ Some out
(* If no constraints given, consider it valid.
Otherwise consider it valid if it satisfies all constraints *)
@@ -71,8 +71,8 @@ let validate_all validators constraints value =
match validate_forall validators constraints value with
| true ->
let () = Buffer.clear buf in
- true, ""
+ None
| false ->
let out = Buffer.contents buf in
let () = Buffer.clear buf in
- false, out
+ Some out