From: Renato Westphal Date: Sat, 12 Sep 2020 01:39:35 +0000 (-0300) Subject: lib: fix handling of deleted nodes in the sysrepo plugin X-Git-Tag: base_7.6~552^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=7dac19f7de94ab562d6075314ae3c0eb1604ba2f;p=matthieu%2Ffrr.git 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 --- 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]",