From 1a4bc045deac52e5c0b66d151dbbce8cc3675497 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Fri, 2 Nov 2018 22:16:55 -0200 Subject: lib, tests: major rework in the operational-data callbacks The northbound infrastructure for operational data was subpar compared to the infrastructure for configuration data. This commit addresses most of the existing problems, making it possible to write operational-data callbacks for more complex YANG models. Summary of the changes: * Add support for nested YANG lists. * Add support for leaf-lists. * Add support for leafs of type "empty". * Introduce the "show yang operational-data XPATH" command, and write an unit test for it. The main purpose of this command is to make it easier to test the operational-data northbound callbacks. * Introduce the nb_oper_data_iterate() function, that can be used to iterate over operational data. Make the CLI and sysrepo use this function. * Since ConfD has a very peculiar API, it can't reuse the nb_oper_data_iterate() like the other northbound clients. In this case, adapt the existing ConfD callbacks to support the new features (and make some performance improvements in the process). Signed-off-by: Renato Westphal --- lib/lib_errors.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/lib_errors.c') diff --git a/lib/lib_errors.c b/lib/lib_errors.c index 71d1ec6e58..b1ed7d2f6b 100644 --- a/lib/lib_errors.c +++ b/lib/lib_errors.c @@ -134,6 +134,12 @@ static struct log_ref ferr_lib_warn[] = { .description = "The northbound subsystem failed to edit a candidate configuration", .suggestion = "This is a bug; please report it" }, + { + .code = EC_LIB_NB_OPERATIONAL_DATA, + .title = "Failure to obtain operational data", + .description = "The northbound subsystem failed to obtain YANG-modeled operational data", + .suggestion = "This is a bug; please report it" + }, { .code = EC_LIB_NB_TRANSACTION_CREATION_FAILED, .title = "Failure to create a configuration transaction", -- cgit v1.2.3