summaryrefslogtreecommitdiff
path: root/lib/northbound.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2023-11-14 19:57:05 +0100
committerIgor Ryzhov <iryzhov@nfware.com>2023-11-15 14:17:29 +0100
commit51a2a4b3f471eba2f4416865ed19a986a6aca9f3 (patch)
tree823b4da9d5c24c8aa0d0908ed7153388459c3fa1 /lib/northbound.c
parent81cb39a9344aadfb644ee77d8f41929da0e5f82a (diff)
lib: print all errors when validating a config
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib/northbound.c')
-rw-r--r--lib/northbound.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/northbound.c b/lib/northbound.c
index 30489d7dfb..15775f4d3a 100644
--- a/lib/northbound.c
+++ b/lib/northbound.c
@@ -871,9 +871,14 @@ int nb_candidate_update(struct nb_config *candidate)
int nb_candidate_validate_yang(struct nb_config *candidate, bool no_state,
char *errmsg, size_t errmsg_len)
{
- if (lyd_validate_all(&candidate->dnode, ly_native_ctx,
- no_state ? LYD_VALIDATE_NO_STATE
- : LYD_VALIDATE_PRESENT,
+ uint32_t options = LYD_VALIDATE_MULTI_ERROR;
+
+ if (no_state)
+ SET_FLAG(options, LYD_VALIDATE_NO_STATE);
+ else
+ SET_FLAG(options, LYD_VALIDATE_PRESENT);
+
+ if (lyd_validate_all(&candidate->dnode, ly_native_ctx, options,
NULL) != 0) {
yang_print_errors(ly_native_ctx, errmsg, errmsg_len);
return NB_ERR_VALIDATION;