]> git.proxmox.com Git - mirror_frr.git/commit - lib/northbound.c
lib: don't ignore error messages generated during the commit apply phase
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 14 Aug 2020 22:49:41 +0000 (19:49 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Sat, 15 Aug 2020 00:37:14 +0000 (21:37 -0300)
commit0fe5b904b76ee37ee0d6ad6230e1ea330694f2ea
tree201eab657120726aab76a520647f42295030d379
parent2ed8d0249da4af0bd73cdc6907dd4e93cf8d970b
lib: don't ignore error messages generated during the commit apply phase

While a configuration transaction can't be rejected once it reaches
the APPLY phase, we should allow NB callbacks to generate error
or warning messages when a configuration change is being applied.
That should be useful, for example, to return warnings back to
the user informing that the applied configuration has some kind of
inconsistency or is missing something in order to be effectively
activated. The infrastructure for this was already present, but the
northbound layer was ignoring all errors/warnings generated during
the apply/abort phases instead of returning them to the user. This
commit changes that.

In the gRPC plugin, extend the Commit() RPC adding a new
"error_message" field to the response type. This is necessary to
allow errors/warnings to be returned even when the commit operation
succeeds (since grpc::Status::OK doesn't support error messages
like the other status codes).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
grpc/frr-northbound.proto
lib/northbound.c
lib/northbound.h
lib/northbound_cli.c
lib/northbound_confd.c
lib/northbound_grpc.cpp
lib/northbound_sysrepo.c