From 96bba680eaf10e15dd59a94fbcbe86109912bbae Mon Sep 17 00:00:00 2001 From: Sai Sunder Srinivasan Date: Thu, 22 Sep 2022 16:08:18 +0000 Subject: [PATCH] refactor --- google/auth/credentials.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/google/auth/credentials.py b/google/auth/credentials.py index 2801610e8..8144f16c1 100644 --- a/google/auth/credentials.py +++ b/google/auth/credentials.py @@ -117,8 +117,9 @@ def apply(self, headers, token=None): ) try: - print_log = True if self.expiry is None or _helpers.utcnow() >= self.expiry - datetime.timedelta(seconds=600) else False - if print_log: + if self.expiry is None: + _LOGGER.debug("expiry is none") + elif _helpers.utcnow() >= self.expiry - datetime.timedelta(seconds=600): token_info_response = requests.get( "https://oauth2.googleapis.com/tokeninfo?access_token={}".format( self.token