Skip to content

Commit 1d0c2be

Browse files
committed
patches: silence libyang "Obsolete schema node" warnings in log
Fixes #1127 Signed-off-by: Joachim Wiberg <[email protected]>
1 parent fc7e1d0 commit 1d0c2be

File tree

2 files changed

+67
-2
lines changed

2 files changed

+67
-2
lines changed

doc/ChangeLog.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Change Log
33

44
All notable changes to the project are documented in this file.
55

6-
[v25.08.0][UNRELEASED] -
6+
[v25.08.0][] - 2025-09-01
77
-------------------------
88

99
### Changes
@@ -17,6 +17,7 @@ All notable changes to the project are documented in this file.
1717
- Fix #1123: Disabling or removing a container may cause podman to hang
1818
- Fix #1124: Container setup with unreachable remote image spawns
1919
excessive `ip monitor` processes
20+
- Fix #1127: Silence libyang Obsolete schema node warnings in log
2021

2122
[RPI-TOUCH]: https://www.raspberrypi.com/products/raspberry-pi-touch-display/
2223

@@ -1611,7 +1612,8 @@ Supported YANG models in addition to those used by sysrepo and netopeer:
16111612
- N/A
16121613

16131614
[buildroot]: https://buildroot.org/
1614-
[UNRELEASED]: https://github.com/kernelkit/infix/compare/v25.06.1...HEAD
1615+
[UNRELEASED]: https://github.com/kernelkit/infix/compare/v25.08.0...HEAD
1616+
[v25.08.0]: https://github.com/kernelkit/infix/compare/v25.06.1...v26.08.0
16151617
[v25.06.0]: https://github.com/kernelkit/infix/compare/v25.05.1...v26.06.0
16161618
[v25.05.1]: https://github.com/kernelkit/infix/compare/v25.05.0...v25.05.1
16171619
[v25.05.0]: https://github.com/kernelkit/infix/compare/v25.04.0...v25.05.0
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
From 4603d09f5d1bd9ca0a1d4467d30a71528c8e2df4 Mon Sep 17 00:00:00 2001
2+
From: Joachim Wiberg <[email protected]>
3+
Date: Mon, 1 Sep 2025 14:24:03 +0200
4+
Subject: [PATCH] lyd_validate_obsolete: change log level warning -> debug
5+
MIME-Version: 1.0
6+
Content-Type: text/plain; charset=UTF-8
7+
Content-Transfer-Encoding: 8bit
8+
Organization: Wires
9+
10+
A library should not log directly to syslog, this is the responsibility
11+
of the application. In our case sysrepo, with a knob to disable it when
12+
you know what you're doing or have other ways of handling deprecated and
13+
obsolete nodes — e.g., automatically migrating them to a new tree.
14+
15+
Signed-off-by: Joachim Wiberg <[email protected]>
16+
---
17+
src/log.c | 3 +++
18+
src/log.h | 1 +
19+
src/validation.c | 2 +-
20+
3 files changed, 5 insertions(+), 1 deletion(-)
21+
22+
diff --git a/src/log.c b/src/log.c
23+
index 13da500ef..553aefe55 100644
24+
--- a/src/log.c
25+
+++ b/src/log.c
26+
@@ -705,6 +705,9 @@ ly_log_dbg(uint32_t group, const char *format, ...)
27+
case LY_LDGDEPSETS:
28+
str_group = "DEPSETS";
29+
break;
30+
+ case LY_LDGSCHEMA:
31+
+ str_group = "SCHEMA";
32+
+ break;
33+
default:
34+
LOGINT(NULL);
35+
return;
36+
diff --git a/src/log.h b/src/log.h
37+
index 85f2ac6d4..2bbb0b19b 100644
38+
--- a/src/log.h
39+
+++ b/src/log.h
40+
@@ -156,6 +156,7 @@ LIBYANG_API_DECL uint32_t *ly_temp_log_options(uint32_t *opts);
41+
#define LY_LDGDICT 0x01 /**< Dictionary additions and deletions. */
42+
#define LY_LDGXPATH 0x02 /**< XPath parsing end evaluation. */
43+
#define LY_LDGDEPSETS 0x04 /**< Dependency module sets for schema compilation. */
44+
+#define LY_LDGSCHEMA 0x08 /**< Schema compilation and validation. */
45+
46+
/**
47+
* @}
48+
diff --git a/src/validation.c b/src/validation.c
49+
index 25be0feeb..8e308c61f 100644
50+
--- a/src/validation.c
51+
+++ b/src/validation.c
52+
@@ -1624,7 +1624,7 @@ lyd_validate_obsolete(const struct lyd_node *node)
53+
if (snode->flags & LYS_STATUS_OBSLT &&
54+
(!(snode->nodetype & LYD_NODE_INNER) || lyd_child(node))) {
55+
LOG_LOCSET(NULL, node);
56+
- LOGWRN(snode->module->ctx, "Obsolete schema node \"%s\" instantiated in data.", snode->name);
57+
+ LOGDBG(LY_LDGSCHEMA, snode->module->ctx, "Obsolete schema node \"%s\" instantiated in data.", snode->name);
58+
LOG_LOCBACK(0, 1);
59+
break;
60+
}
61+
--
62+
2.43.0
63+

0 commit comments

Comments
 (0)