From 4ac51e2430f099bc4f4881e4a83b5ea13c418131 Mon Sep 17 00:00:00 2001 From: Christian Hopps Date: Mon, 17 Apr 2023 01:16:32 -0400 Subject: [PATCH] lib: fix broken "show yang operational-data" functionality Previously was using an API that returned the root of the data tree given the users input xpath value, and then used it like it was the leaf node (last not first). So basically this CLI command only worked when one requested the root node of the model. Signed-off-by: Christian Hopps --- lib/northbound.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/northbound.c b/lib/northbound.c index ba9b6d59b4..775f6ff92f 100644 --- a/lib/northbound.c +++ b/lib/northbound.c @@ -2129,8 +2129,8 @@ int nb_oper_data_iterate(const char *xpath, struct yang_translator *translator, * all YANG lists (if any). */ - LY_ERR err = lyd_new_path(NULL, ly_native_ctx, xpath, NULL, - LYD_NEW_PATH_UPDATE, &dnode); + LY_ERR err = lyd_new_path2(NULL, ly_native_ctx, xpath, NULL, 0, 0, + LYD_NEW_PATH_UPDATE, NULL, &dnode); if (err || !dnode) { const char *errmsg = err ? ly_errmsg(ly_native_ctx) : "node not found";