Skip to content
Snippets Groups Projects

Resolve "The key for more complex paths in the map containing information of update events should be improved"

1 file
+ 0
11
Compare changes
  • Side-by-side
  • Inline
@@ -184,22 +184,11 @@ func (n *NetworkElementWatcher) handleSubscribeResponseUpdate(resp *gpb.Subscrib
pathsAndValues := make(map[string]string, len(resp.Update.Update))
for _, update := range resp.Update.Update {
//pathString := ""
pathString, err := ygot.PathToString(update.Path)
if err != nil {
log.Errorf("Error trying to create a string from path: %v", err)
}
log.Info("Generated path string, used as key in pathAndValues map: ", pathString)
//// go through elem to build full path
//for _, elem := range update.Path.Elem {
// // remove unwanted parts of path string example: "name:\"system\"" -> "system"
// filteredElem := elem.String()[strings.Index(elem.String(), ":\"")+2 : len(elem.String())-1]
// pathString += filteredElem + "/"
//}
pathsAndValues[pathString] = update.Val.GetStringVal()
}
Loading