do not include an empty UseModels List if not specified by --model
@@ -284,7 +284,6 @@ func createSubscribeRequest() (*gnmi.SubscribeRequest, error) {
models := make([]*gnmi.ModelData, 1)
if model != "" {
models[0] = &gnmi.ModelData{Name: model}
- }
return &gnmi.SubscribeRequest{
Request: &gnmi.SubscribeRequest_Subscribe{
Subscribe: &gnmi.SubscriptionList{
@@ -298,6 +297,20 @@ func createSubscribeRequest() (*gnmi.SubscribeRequest, error) {
},
}, nil
+ }
+ return &gnmi.SubscribeRequest{
+ Request: &gnmi.SubscribeRequest_Subscribe{
+ Subscribe: &gnmi.SubscriptionList{
+ Prefix: gnmiPrefix,
+ Mode: gnmi.SubscriptionList_Mode(modeVal),
+ Encoding: gnmi.Encoding(encodingVal),
+ Subscription: subscriptions,
+ //UseModels: models,
+ Qos: qos,
+ },
+ },
+ }, nil
+
}
func printSubscribeResponse(printPrefix string, resp *gnmi.SubscribeResponse_Update) {
