From 7dac19f7de94ab562d6075314ae3c0eb1604ba2f Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Fri, 11 Sep 2020 22:39:35 -0300 Subject: [PATCH] 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 --- lib/northbound_sysrepo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]", -- 2.39.5