Skip to content

Commit e3dd26c

Browse files
author
Parimi Bala Neeraja
committed
Merge branch 'paneeraj_grpc_message' of github.com:CiscoTestAutomation/yang into paneeraj_grpc_message
2 parents 00c40b0 + 4c86efb commit e3dd26c

File tree

1 file changed

+10
-3
lines changed
  • connector/src/yang/connector

1 file changed

+10
-3
lines changed

connector/src/yang/connector/gnmi.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ def to_plaintext(string):
3232
return string
3333

3434

35+
GRPC_MAX_RECEIVE_MESSAGE_LENGTH = 1000000000
36+
GRPC_MAX_SEND_MESSAGE_LENGTH = 1000000000
37+
3538
# create a logger for this module
3639
log = logging.getLogger(__name__)
3740

@@ -304,10 +307,14 @@ def connect(self):
304307
port = str(dev_args.get('port'))
305308
target = '{0}:{1}'.format(host, port)
306309

307-
options = [('grpc.max_receive_message_length', 1000000000),
308-
('grpc.max_send_message_length', 1000000000)
309-
]
310+
max_receive_message_length = getattr(getattr(self.device, 'settings', {}), 'GRPC_MAX_RECEIVE_MESSAGE_LENGTH',
311+
GRPC_MAX_RECEIVE_MESSAGE_LENGTH)
312+
max_send_message_length = getattr(getattr(self.device, 'settings', {}), 'GRPC_MAX_SEND_MESSAGE_LENGTH',
313+
GRPC_MAX_SEND_MESSAGE_LENGTH)
310314

315+
options = [('grpc.max_receive_message_length', max_receive_message_length),
316+
('grpc.max_send_message_length', max_send_message_length)]
317+
311318
# Gather certificate settings
312319
root = dev_args.get('root_certificate')
313320
if not root:

0 commit comments

Comments
 (0)