diff --git a/controller/nucleus/networkElementWatcher.go b/controller/nucleus/networkElementWatcher.go index 21b910e977f91989ff09fdbc2a06f4d554c64fc4..8b078ea41062ed92a145f8ef354b85bebc8763d4 100644 --- a/controller/nucleus/networkElementWatcher.go +++ b/controller/nucleus/networkElementWatcher.go @@ -216,22 +216,7 @@ func (n *NetworkElementWatcher) handleSubscribeResponseUpdate(resp *gpb.Subscrib // Paths should be provided in the following format [][]string{{"system", "config", "hostname"}}. func (n *NetworkElementWatcher) mergeGnmiSubscriptions(gNMISusbcriptionPathsFromMne, gNMISusbcriptionPathsFromConfig [][]string) [][]string { // create slice with all elements - var tempJoinedPaths = gNMISusbcriptionPathsFromMne - - for _, configPath := range gNMISusbcriptionPathsFromConfig { - tempJoinedPaths = append(tempJoinedPaths, configPath) - } - - // sort slice - sort.Slice(tempJoinedPaths[:], func(i, j int) bool { - for elem := range tempJoinedPaths[i] { - if tempJoinedPaths[i][elem] == tempJoinedPaths[j][elem] { - continue - } - return tempJoinedPaths[i][elem] < tempJoinedPaths[j][elem] - } - return false - }) + var tempJoinedPaths = append(gNMISusbcriptionPathsFromMne, gNMISusbcriptionPathsFromConfig...) // remove duplicates inResult := make(map[string]bool) @@ -245,4 +230,5 @@ func (n *NetworkElementWatcher) mergeGnmiSubscriptions(gNMISusbcriptionPathsFrom } return joinedPaths + }