Skip to content

Commit

Permalink
Merge pull request #1148 from balasankarrajaguru/dcs-support
Browse files Browse the repository at this point in the history
Add timeout for GRPC calls
  • Loading branch information
dineshbaburam91 committed Jan 4, 2022
2 parents ddf2fbb + 09281a5 commit d3c065a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/jnpr/junos/dcs.py
Expand Up @@ -57,6 +57,7 @@ def __init__(self, **kvargs):
self._grpc_dcs_pb2 = self._grpc_deps.get("dcs_pb2")
self._dev_uuid = self._grpc_deps.get("uuid")
self._dev_info = self._grpc_deps.get("device_info")
self._grpc_timeout = self._grpc_deps.get("grpc_timeout")

self.junos_dev_handler = JunosDeviceHandler(
device_params={"name": "junos", "local": False}
Expand Down Expand Up @@ -147,10 +148,14 @@ def _rpc_reply(self, rpc_cmd_e, *args, **kwargs):
else rpc_cmd_e
)
request_rpc = self._grpc_dcs_pb2.OpRequest(
command=[rpc_cmd], device_info=self._dev_info, telemetry=True
command=[rpc_cmd],
device_info=self._dev_info,
telemetry=True,
)
res = self._grpc_conn_stub.Op(
request=request_rpc, metadata=self._grpc_meta_data
request=request_rpc,
metadata=self._grpc_meta_data,
timeout=self._grpc_timeout,
)
if res.error_code != self._grpc_types_pb2.NoError:
raise EzErrors.DCSRpcError(
Expand Down

0 comments on commit d3c065a

Please sign in to comment.