Skip to content

Commit 3b3f701

Browse files
author
kkumara3
committed
changed cisco_grpc_client to support python 3
1 parent 650458b commit 3b3f701

File tree

3 files changed

+710
-153
lines changed

3 files changed

+710
-153
lines changed

lib/cisco_grpc_client.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121

2222

2323
import grpc
24+
from . import ems_grpc_pb2
25+
from . import json_format
26+
from . import ems_grpc_pb2
27+
from . import telemetry_pb2
2428
from grpc.beta import implementations
25-
import ems_grpc_pb2
26-
import protobuf_json
27-
import ems_grpc_pb2
28-
import telemetry_pb2
2929

3030
class CiscoGRPCClient(object):
3131
"""This class creates grpc calls using python.
@@ -103,7 +103,8 @@ def getsubscription(self, sub_id, unmarshal=True):
103103
telemetry_pb = telemetry_pb2.Telemetry()
104104
telemetry_pb.ParseFromString(segment.data)
105105
# Return in JSON format instead of protobuf.
106-
yield protobuf_json.pb2json(telemetry_pb)
106+
yield json_format.MessageToJson(telemetry_pb)
107+
107108

108109
def connectivityhandler(self, callback):
109110
"""Passing of a callback to monitor connectivety state updates.

0 commit comments

Comments
 (0)