Skip to content
Snippets Groups Projects

Resolve "Add error handling in case the paths for gNMI Subscription for an MNE is empty"

1 file
+ 4
1
Compare changes
  • Side-by-side
  • Inline
@@ -9,6 +9,7 @@ import (
mnepb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/networkelement"
ppb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/pnd"
tpb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/transport"
"code.fbi.h-da.de/danet/gosdn/controller/config"
"code.fbi.h-da.de/danet/gosdn/controller/conflict"
"code.fbi.h-da.de/danet/gosdn/controller/customerrs"
"code.fbi.h-da.de/danet/gosdn/controller/interfaces/change"
@@ -629,7 +630,9 @@ func (n *NetworkElementServer) addMne(ctx context.Context,
return uuid.Nil, err
}
n.networkElementWatchter.SubscribeToNetworkElement(mne, nil)
if mne.GetGnmiSubscriptionPaths() != nil || config.GetGnmiSubscriptionPaths() != nil {
n.networkElementWatchter.SubscribeToNetworkElement(mne, nil)
}
} else {
err = fmt.Errorf("invalid transport data provided")
return uuid.Nil, err
Loading