Repository: beam Updated Branches: refs/heads/master 2c8071e20 -> 69343a609
Improve gcloud logging message Project: http://git-wip-us.apache.org/repos/asf/beam/repo Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/defb1ac0 Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/defb1ac0 Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/defb1ac0 Branch: refs/heads/master Commit: defb1ac00e047b7e06c2174f435f7f6088e74f43 Parents: 2c8071e Author: Sourabh Bajaj <[email protected]> Authored: Thu Apr 13 13:39:26 2017 -0700 Committer: Ahmet Altay <[email protected]> Committed: Thu Apr 13 14:44:34 2017 -0700 ---------------------------------------------------------------------- sdks/python/apache_beam/internal/gcp/auth.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/beam/blob/defb1ac0/sdks/python/apache_beam/internal/gcp/auth.py ---------------------------------------------------------------------- diff --git a/sdks/python/apache_beam/internal/gcp/auth.py b/sdks/python/apache_beam/internal/gcp/auth.py index 97e21f4..53c2d07 100644 --- a/sdks/python/apache_beam/internal/gcp/auth.py +++ b/sdks/python/apache_beam/internal/gcp/auth.py @@ -106,9 +106,11 @@ class _GCloudWrapperCredentials(OAuth2Credentials): try: gcloud_process = processes.Popen( ['gcloud', 'auth', 'print-access-token'], stdout=processes.PIPE) - except OSError as exn: - logging.error('The gcloud tool was not found.', exc_info=True) - raise AuthenticationException('The gcloud tool was not found: %s' % exn) + except OSError: + message = 'gcloud tool not found so falling back to using ' +\ + 'application default credentials' + logging.warning(message) + raise AuthenticationException(message) output, _ = gcloud_process.communicate() self.access_token = output.strip()
