summaryrefslogtreecommitdiffstats
path: root/lib/northbound.c
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2024-01-19 16:25:57 +0100
committerChristian Hopps <chopps@labn.net>2024-01-19 16:25:57 +0100
commitf05a4e3b577b50f20b85ae95e53222c133bc7b1f (patch)
tree4fb4addbd1556930dacae90172cc7f8ee3e6a373 /lib/northbound.c
parentMerge pull request #15160 from vjardin/doc_typo (diff)
downloadfrr-f05a4e3b577b50f20b85ae95e53222c133bc7b1f.tar.xz
frr-f05a4e3b577b50f20b85ae95e53222c133bc7b1f.zip
lib: libyang logging temp off to avoid unwanted log message
We don't want libyang logging when an schema path doesn't exist since this is an acceptable outcome. Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/northbound.c')
-rw-r--r--lib/northbound.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/northbound.c b/lib/northbound.c
index 42e4ebbcc..ea34c9cc0 100644
--- a/lib/northbound.c
+++ b/lib/northbound.c
@@ -157,12 +157,21 @@ void nb_nodes_delete(void)
struct nb_node *nb_node_find(const char *path)
{
const struct lysc_node *snode;
+ uint32_t llopts;
/*
* Use libyang to find the schema node associated to the path and get
- * the northbound node from there (snode private pointer).
+ * the northbound node from there (snode private pointer). We need to
+ * disable logging temporarily to avoid libyang from logging an error
+ * message when the node is not found.
*/
+ llopts = ly_log_options(LY_LOSTORE);
+ llopts &= ~LY_LOLOG;
+ ly_temp_log_options(&llopts);
+
snode = yang_find_snode(ly_native_ctx, path, 0);
+
+ ly_temp_log_options(NULL);
if (!snode)
return NULL;