summaryrefslogtreecommitdiff
path: root/lib/northbound_sysrepo.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2020-09-11 22:39:35 -0300
committerRenato Westphal <renato@opensourcerouting.org>2020-09-15 15:56:53 -0300
commit7dac19f7de94ab562d6075314ae3c0eb1604ba2f (patch)
treec6ca05ee75f84bd737bde47da21aa6d3f93d4ec4 /lib/northbound_sysrepo.c
parent88e635ee6397b93a3263dbe7951f637ae4936e39 (diff)
lib: fix handling of deleted nodes in the sysrepo plugin
Make the sysrepo plugin ignore the deletion of configuration nodes that don't exist anymore instead of logging an error and rejecting the changes. This is necessary because Sysrepo delivers delete notifications for all nodes of a deleted data tree instead of delivering a single delete notification of the top-level subtree node (which would suffice for the northbound layer). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/northbound_sysrepo.c')
-rw-r--r--lib/northbound_sysrepo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/northbound_sysrepo.c b/lib/northbound_sysrepo.c
index 145164b90d..856af306e6 100644
--- a/lib/northbound_sysrepo.c
+++ b/lib/northbound_sysrepo.c
@@ -223,7 +223,7 @@ static int frr_sr_process_change(struct nb_config *candidate,
ret = nb_candidate_edit(candidate, nb_node, nb_op, xpath, NULL, data);
yang_data_free(data);
- if (ret != NB_OK) {
+ if (ret != NB_OK && ret != NB_ERR_NOT_FOUND) {
flog_warn(
EC_LIB_NB_CANDIDATE_EDIT_ERROR,
"%s: failed to edit candidate configuration: operation [%s] xpath [%s]",