Skip to content

Commit

Permalink
Dropping usage of connection.credentials in logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhermes committed Feb 23, 2017
1 parent 9ebef22 commit a151715
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
6 changes: 3 additions & 3 deletions logging/google/cloud/logging/_gax.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ def make_gax_logging_api(client):
:returns: A metrics API instance with the proper credentials.
"""
channel = make_secure_channel(
client._connection.credentials, DEFAULT_USER_AGENT,
client._credentials, DEFAULT_USER_AGENT,
LoggingServiceV2Client.SERVICE_ADDRESS)
generated = LoggingServiceV2Client(
channel=channel, lib_name='gccl', lib_version=__version__)
Expand All @@ -550,7 +550,7 @@ def make_gax_metrics_api(client):
:returns: A metrics API instance with the proper credentials.
"""
channel = make_secure_channel(
client._connection.credentials, DEFAULT_USER_AGENT,
client._credentials, DEFAULT_USER_AGENT,
MetricsServiceV2Client.SERVICE_ADDRESS)
generated = MetricsServiceV2Client(
channel=channel, lib_name='gccl', lib_version=__version__)
Expand All @@ -567,7 +567,7 @@ def make_gax_sinks_api(client):
:returns: A metrics API instance with the proper credentials.
"""
channel = make_secure_channel(
client._connection.credentials, DEFAULT_USER_AGENT,
client._credentials, DEFAULT_USER_AGENT,
ConfigServiceV2Client.SERVICE_ADDRESS)
generated = ConfigServiceV2Client(
channel=channel, lib_name='gccl', lib_version=__version__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class BackgroundThreadTransport(Transport):
def __init__(self, client, name):
http = copy.deepcopy(client._http)
self.client = client.__class__(
client.project, client._connection.credentials, http)
client.project, client._credentials, http)
logger = self.client.logger(name)
self.worker = _Worker(logger)

Expand Down
9 changes: 3 additions & 6 deletions logging/unit_tests/test__gax.py
Original file line number Diff line number Diff line change
Expand Up @@ -1113,8 +1113,7 @@ def test_it(self):
from google.cloud.logging._gax import DEFAULT_USER_AGENT

creds = object()
conn = mock.Mock(credentials=creds, spec=['credentials'])
client = mock.Mock(_connection=conn, spec=['_connection'])
client = mock.Mock(_credentials=creds, spec=['_credentials'])
channels = []
channel_args = []
generated_api_kwargs = []
Expand Down Expand Up @@ -1167,8 +1166,7 @@ def test_it(self):
from google.cloud.logging._gax import DEFAULT_USER_AGENT

creds = object()
conn = mock.Mock(credentials=creds, spec=['credentials'])
client = mock.Mock(_connection=conn, spec=['_connection'])
client = mock.Mock(_credentials=creds, spec=['_credentials'])
channels = []
channel_args = []
generated_api_kwargs = []
Expand Down Expand Up @@ -1221,8 +1219,7 @@ def test_it(self):
from google.cloud.logging._gax import DEFAULT_USER_AGENT

creds = object()
conn = mock.Mock(credentials=creds, spec=['credentials'])
client = mock.Mock(_connection=conn, spec=['_connection'])
client = mock.Mock(_credentials=creds, spec=['_credentials'])
channels = []
channel_args = []
generated_api_kwargs = []
Expand Down

0 comments on commit a151715

Please sign in to comment.