When lyd_validate() is used with the LYD_OPT_DATA option, full YANG
validation is performed. As a side-effect to this, default nodes are
created, which is not desirable when displaying operational data
since configuration nodes can also be created. Use LYD_OPT_GET
option to resolve this problem.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
yang_dnode_free(dnode);
return CMD_WARNING;
}
- lyd_validate(&dnode, LYD_OPT_DATA | LYD_OPT_DATA_NO_YANGLIB, ly_ctx);
+ lyd_validate(&dnode, LYD_OPT_GET, ly_ctx);
/* Display the data. */
if (lyd_print_mem(&strp, dnode, format,