From 0fe5b904b76ee37ee0d6ad6230e1ea330694f2ea Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Fri, 14 Aug 2020 19:49:41 -0300 Subject: 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 --- grpc/frr-northbound.proto | 3 +++ 1 file changed, 3 insertions(+) (limited to 'grpc') diff --git a/grpc/frr-northbound.proto b/grpc/frr-northbound.proto index d18554df27..32544ba694 100644 --- a/grpc/frr-northbound.proto +++ b/grpc/frr-northbound.proto @@ -287,6 +287,9 @@ message CommitResponse { // ID of the created configuration transaction (when the phase is APPLY // or ALL). uint32 transaction_id = 1; + + // Human-readable error or warning message(s). + string error_message = 2; } // -- cgit v1.2.3