File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -51,18 +51,13 @@ def main():
51
51
formatted_messages = []
52
52
try :
53
53
logging .info ("Subscribing to %s ..." , args .xpath )
54
- subscription_list = proto .gnmi_pb2 .SubscriptionList ()
55
- subscription_list .mode = proto .gnmi_pb2 .SubscriptionList .Mode .Value ("STREAM" )
54
+ sub_args = {"xpath_subscriptions" : args .xpath , "sub_mode" : "ON_CHANGE" }
56
55
if args .encoding :
57
- subscription_list .encoding = proto .gnmi_pb2 .Encoding .Value (args .encoding )
58
- subscription = proto .gnmi_pb2 .Subscription ()
59
- subscription .path .CopyFrom (client .parse_xpath_to_gnmi_path (args .xpath ))
60
- subscription .mode = proto .gnmi_pb2 .SubscriptionMode .Value ("ON_CHANGE" )
61
- subscription_list .subscription .append (subscription )
62
- synced = False
56
+ sub_args ["encoding" ] = args .encoding
63
57
if not args .process_all :
64
58
logging .info ("Ignoring messages before sync_response." )
65
- for message in client .subscribe ([subscription_list ]):
59
+ synced = False
60
+ for message in client .subscribe_xpaths (** sub_args ):
66
61
if message .sync_response :
67
62
synced = True
68
63
logging .info ("Synced with latest state." )
You can’t perform that action at this time.
0 commit comments