]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: fix handling of deleted nodes in the sysrepo plugin
authorRenato Westphal <renato@opensourcerouting.org>
Sat, 12 Sep 2020 01:39:35 +0000 (22:39 -0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Tue, 6 Oct 2020 12:54:24 +0000 (15:54 +0300)
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>
lib/northbound_sysrepo.c

index 145164b90dd3d6e61f91f45a0b6686545507c7ec..856af306e69e49e8ef6eab18960792353d9ebaae 100644 (file)
@@ -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]",