From 95526b1c81ee9e6904b5458b959c9dccd3486509 Mon Sep 17 00:00:00 2001 From: Rob Shakir Date: Mon, 6 Jan 2025 20:41:53 +0000 Subject: [PATCH] Fix syntax error. --- gribi/gribi.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gribi/gribi.go b/gribi/gribi.go index b7a58550..a57a52cc 100644 --- a/gribi/gribi.go +++ b/gribi/gribi.go @@ -62,9 +62,8 @@ func New(s *grpc.Server, gClient gpb.GNMIClient, target string, root *oc.Root, s } srv := &Server{ - UnimplementedGRIBIServer: &gribipb.UnimplementedGRIBIServer{}, - Server: gs, - s: s, + Server: gs, + s: s, } gribipb.RegisterGRIBIServer(s, srv) @@ -159,11 +158,16 @@ func createGRIBIServer(gClient gpb.GNMIClient, target string, root *oc.Root, sys log.Infof("Sent route %v with response %v", routeReq, resp) } - return server.New(append([]server.ServerOpt{ + s, err := server.New(append([]server.ServerOpt{ server.WithPostChangeRIBHook(ribHookfn), server.WithRIBResolvedEntryHook(ribAddfn), server.WithVRFs(networkInstances), }, opts...)...) + if err != nil { + return nil, err + } + s.UnimplementedGRIBIServer = &gribipb.UnimplementedGRIBIServer{} + return s, nil } // createSetRouteRequest converts a Route to a sysrib SetRouteRequest