Skip to content
Snippets Groups Projects

Fix not being able to deal with uints from subscribers

Merged Fabian Seidl requested to merge hotfix-uint-vals-from-gnmi-subscriptions into master
1 file
+ 11
1
Compare changes
  • Side-by-side
  • Inline
@@ -245,7 +245,17 @@ func (n *NetworkElementWatcher) handleSubscribeResponseUpdate(resp *gpb.Subscrib
log.Errorf("Error trying to create a string from path: %v", err)
}
pathsAndValues[pathString] = update.Val.GetStringVal()
switch v := update.GetVal().GetValue().(type) {
case *gpb.TypedValue_StringVal:
pathsAndValues[pathString] = update.Val.GetStringVal()
case *gpb.TypedValue_JsonIetfVal:
pathsAndValues[pathString] = string(update.GetVal().GetJsonIetfVal())
case *gpb.TypedValue_UintVal:
pathsAndValues[pathString] = fmt.Sprintf("%d", update.Val.GetUintVal())
default:
log.Errorf("The given value of type: %T, provided by a SubResponse from network element with ID: %s is not supported", v, subscriptionInfo.NetworkElementID)
return
}
}
mneID, err := uuid.Parse(subscriptionInfo.NetworkElementID)
Loading