Skip to content

Commit 02c8071

Browse files
committed
common UPDATE handle ignored module get fail
Could occur only if the required YANG module was not installed but a sensible error message helps fix the problem.
1 parent 6df71ed commit 02c8071

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/common.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,7 @@ np_op_parse_config(struct lyd_node_any *node, uint32_t parse_options, struct lyd
10561056
struct lyd_node *ignored_mod;
10571057
char *xpath = NULL, *msg;
10581058
struct ly_set *set = NULL;
1059+
int r;
10591060

10601061
assert(node && node->schema && (node->schema->nodetype & LYD_NODE_ANY));
10611062

@@ -1102,8 +1103,11 @@ np_op_parse_config(struct lyd_node_any *node, uint32_t parse_options, struct lyd
11021103

11031104
if (*config) {
11041105
/* get the list of ignored modules, skip NACM */
1105-
if (sr_get_data(np2srv.sr_sess, "/libnetconf2-netconf-server:ln2-netconf-server/ignored-hello-module", 0,
1106-
np2srv.sr_timeout, 0, &sr_ln2_nc_server)) {
1106+
r = sr_get_data(np2srv.sr_sess, "/libnetconf2-netconf-server:ln2-netconf-server/ignored-hello-module", 0,
1107+
np2srv.sr_timeout, 0, &sr_ln2_nc_server);
1108+
if (r == SR_ERR_NOT_FOUND) {
1109+
WRN("Failed to get ignored <hello> modules.");
1110+
} else if (r) {
11071111
reply = np_reply_err_sr(np2srv.sr_sess, "get");
11081112
goto cleanup;
11091113
}

0 commit comments

Comments
 (0)