forked from Mirror/frr
lib: print all errors when validating a config
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This commit is contained in:
parent
81cb39a934
commit
51a2a4b3f4
|
@ -871,9 +871,14 @@ int nb_candidate_update(struct nb_config *candidate)
|
||||||
int nb_candidate_validate_yang(struct nb_config *candidate, bool no_state,
|
int nb_candidate_validate_yang(struct nb_config *candidate, bool no_state,
|
||||||
char *errmsg, size_t errmsg_len)
|
char *errmsg, size_t errmsg_len)
|
||||||
{
|
{
|
||||||
if (lyd_validate_all(&candidate->dnode, ly_native_ctx,
|
uint32_t options = LYD_VALIDATE_MULTI_ERROR;
|
||||||
no_state ? LYD_VALIDATE_NO_STATE
|
|
||||||
: LYD_VALIDATE_PRESENT,
|
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) {
|
NULL) != 0) {
|
||||||
yang_print_errors(ly_native_ctx, errmsg, errmsg_len);
|
yang_print_errors(ly_native_ctx, errmsg, errmsg_len);
|
||||||
return NB_ERR_VALIDATION;
|
return NB_ERR_VALIDATION;
|
||||||
|
|
Loading…
Reference in a new issue