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():
5151 formatted_messages = []
5252 try :
5353 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" }
5655 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
6357 if not args .process_all :
6458 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 ):
6661 if message .sync_response :
6762 synced = True
6863 logging .info ("Synced with latest state." )
You can’t perform that action at this time.
0 commit comments