Skip to content

Commit

Permalink
add changes
Browse files Browse the repository at this point in the history
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
  • Loading branch information
vdahiya12 committed Jun 30, 2023
1 parent 1f14eb1 commit e29ea4d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sonic-ycabled/ycable/ycable_utilities/y_cable_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,19 +493,21 @@ def wait_for_state_change(channel_connectivity):
if credential is None or target_name is None:
return (None, None)

GRPC_CLIENT_OPTIONS.append(('grpc.ssl_target_name_override', '{}'.format(target_name)))

if is_async:
channel = grpc.aio.secure_channel("{}:{}".format(soc_ip, GRPC_PORT), credential, options=GRPC_CLIENT_OPTIONS)
ASYNC_GRPC_CLIENT_OPTIONS = []
ASYNC_GRPC_CLIENT_OPTIONS.append(('grpc.ssl_target_name_override', '{}'.format(target_name)))
channel = grpc.aio.secure_channel("{}:{}".format(soc_ip, GRPC_PORT), credential, options=ASYNC_GRPC_CLIENT_OPTIONS)
stub = linkmgr_grpc_driver_pb2_grpc.DualToRActiveStub(channel)
else:
GRPC_CLIENT_OPTIONS.append(('grpc.ssl_target_name_override', '{}'.format(target_name)))
channel = grpc.secure_channel("{}:{}".format(soc_ip, GRPC_PORT), credential, options=GRPC_CLIENT_OPTIONS)
stub = linkmgr_grpc_driver_pb2_grpc.DualToRActiveStub(channel)


else:
if is_async:
channel = grpc.aio.insecure_channel("{}:{}".format(soc_ip, GRPC_PORT), options=GRPC_CLIENT_OPTIONS)
channel = grpc.aio.insecure_channel("{}:{}".format(soc_ip, GRPC_PORT))
stub = linkmgr_grpc_driver_pb2_grpc.DualToRActiveStub(channel)
else:
channel = grpc.insecure_channel("{}:{}".format(soc_ip, GRPC_PORT), options=GRPC_CLIENT_OPTIONS)
Expand Down

0 comments on commit e29ea4d

Please sign in to comment.