diff --git a/controller/northbound/server/pnd.go b/controller/northbound/server/pnd.go index 989f5f15ff53a2cf3af5aba11d1d4a4d2ac6c790..64d3e163492f0926bef4e462898981f9ef9f9fcc 100644 --- a/controller/northbound/server/pnd.go +++ b/controller/northbound/server/pnd.go @@ -58,6 +58,8 @@ func (p PndServer) GetMne(ctx context.Context, request *ppb.GetMneRequest) (*ppb return nil, status.Errorf(codes.Aborted, "%v", err) } + // TODO(path): This needs some adjustments when we're switching towards a new + // path request handling. mne, err := fillMneBySpecificPath(networkElement, "/") if err != nil { log.Error(err) @@ -330,11 +332,6 @@ func (p PndServer) GetPath(ctx context.Context, request *ppb.GetPathRequest) (*p return nil, status.Errorf(codes.Aborted, "%v", err) } - networkElement, err := pnd.GetNetworkElement(request.Mneid) - if err != nil { - log.Error(err) - return nil, status.Errorf(codes.Aborted, "%v", err) - } mneuid, err := uuid.Parse(request.Mneid) if err != nil { log.Error(err) @@ -344,13 +341,7 @@ func (p PndServer) GetPath(ctx context.Context, request *ppb.GetPathRequest) (*p // In case we get the path from grpc-gateway we have to replace path := strings.ReplaceAll(request.Path, "||", "/") - _, err = pnd.Request(mneuid, path) - if err != nil { - log.Error(err) - return nil, status.Errorf(codes.Aborted, "%v", err) - } - - mne, err := fillMneBySpecificPath(networkElement, path) + resp, err := pnd.Request(mneuid, path) if err != nil { log.Error(err) return nil, status.Errorf(codes.Aborted, "%v", err) @@ -363,7 +354,7 @@ func (p PndServer) GetPath(ctx context.Context, request *ppb.GetPathRequest) (*p Name: pnd.GetName(), Description: pnd.GetDescription(), }, - MneNotification: mne.MneNotification, + MneNotification: resp.(*gnmi.GetResponse).Notification, }, nil } diff --git a/controller/nucleus/principalNetworkDomain.go b/controller/nucleus/principalNetworkDomain.go index 0b6d8b999353f80ae6dddc29176ac7722117d8cd..e7b6a6f383e69813bed352b2f687a3ac575546fb 100644 --- a/controller/nucleus/principalNetworkDomain.go +++ b/controller/nucleus/principalNetworkDomain.go @@ -433,6 +433,7 @@ func (pnd *pndImplementation) Request(uuid uuid.UUID, path string) (proto.Messag return nil, err } + // TODO(path): We probably have to remove this when we address path request handling. err = pnd.networkElementService.Update(mne) if err != nil { return nil, err