Changed oauth2 refresh logs wording
Changed the wording of logs from oauth2 refresh in both Chromite libs
and third_party oauth2client (which is deprecated).
BUG=chromium:878404
TEST=none
Change-Id: Icb75e029133c418f6e42c4f4395ab727da628a3a
Reviewed-on: https://chromium-review.googlesource.com/1194303
Commit-Ready: Alec Thilenius <athilenius@google.com>
Tested-by: Alec Thilenius <athilenius@google.com>
Reviewed-by: Jason Clinton <jclinton@chromium.org>
diff --git a/lib/auth.py b/lib/auth.py
index 496d8fb..a276950 100644
--- a/lib/auth.py
+++ b/lib/auth.py
@@ -193,7 +193,7 @@
resp, content = self.http.request(*args, **kwargs)
if resp.status in REFRESH_STATUS_CODES:
- logging.info('Refreshing due to a %s', resp.status)
+ logging.info('OAuth token TTL expired, auto-refreshing')
# Token expired, force token renew
kwargs_copy = dict(self.kwargs, force_token_renew=True)
diff --git a/third_party/oauth2client/client.py b/third_party/oauth2client/client.py
index cd5959f..0bfe004 100644
--- a/third_party/oauth2client/client.py
+++ b/third_party/oauth2client/client.py
@@ -601,9 +601,10 @@
for refresh_attempt in range(max_refresh_attempts):
if resp.status not in REFRESH_STATUS_CODES:
break
- logger.info('Refreshing due to a %s (attempt %s/%s)',
- resp.status, refresh_attempt + 1,
- max_refresh_attempts)
+ logger.info(
+ 'OAuth token TTL expired, auto-refreshing (attempt %s/%s)',
+ refresh_attempt + 1,
+ max_refresh_attempts)
self._refresh(request_orig)
self.apply(headers)
if body_stream_position is not None: