Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Commit

Permalink
do not include an empty UseModels List if not specified by --model
Browse files Browse the repository at this point in the history
  • Loading branch information
karimra committed Mar 6, 2020
1 parent c60c33b commit dcf54e4
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions cmd/subscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,19 @@ 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{
Prefix: gnmiPrefix,
Mode: gnmi.SubscriptionList_Mode(modeVal),
Encoding: gnmi.Encoding(encodingVal),
Subscription: subscriptions,
UseModels: models,
Qos: qos,
},
},
}, nil

}
return &gnmi.SubscribeRequest{
Request: &gnmi.SubscribeRequest_Subscribe{
Expand All @@ -292,8 +305,8 @@ func createSubscribeRequest() (*gnmi.SubscribeRequest, error) {
Mode: gnmi.SubscriptionList_Mode(modeVal),
Encoding: gnmi.Encoding(encodingVal),
Subscription: subscriptions,
UseModels: models,
Qos: qos,
//UseModels: models,
Qos: qos,
},
},
}, nil
Expand Down

0 comments on commit dcf54e4

Please sign in to comment.