pull/23203/head
Richard Belleville 5 years ago
parent 4de06d0e22
commit 2b09327a6f
  1. 3
      src/python/grpcio/grpc/__init__.py
  2. 8
      src/python/grpcio_tests/tests/interop/client.py

@ -1881,8 +1881,7 @@ def compute_engine_channel_credentials():
with any other call credential, the connection may suddenly and unexpectedly
begin failing RPCs.
"""
return ChannelCredentials(
_cygrpc.channel_credentials_compute_engine())
return ChannelCredentials(_cygrpc.channel_credentials_compute_engine())
def channel_ready_future(channel):

@ -110,8 +110,9 @@ def get_secure_channel_parameters(args):
if args.custom_credentials_type is not None:
if args.custom_credentials_type == "compute_engine_channel_creds":
if call_credentials is not None:
raise ValueError("Cannot use both compute_engine_creds " +
"and {} as call creds.".format(call_credentials))
raise ValueError(
"Cannot use both compute_engine_creds " +
"and {} as call creds.".format(call_credentials))
google_credentials, unused_project_id = google_auth.default(
scopes=[args.oauth_scope])
call_creds = grpc.metadata_call_credentials(
@ -119,7 +120,8 @@ def get_secure_channel_parameters(args):
credentials=google_credentials,
request=google_auth.transport.requests.Request()))
channel_credentials = grpc.compute_engine_channel_credentials()
channel_credentials = grpc.composite_channel_credentials(channel_credentials, call_creds)
channel_credentials = grpc.composite_channel_credentials(
channel_credentials, call_creds)
else:
raise ValueError("Unknown credentials type '{}'".format(
args.custom_credentials_type))

Loading…
Cancel
Save