upgrade to oauth2client 3.0. Override some strings in GAM

to reduce custom changes to oauth2client.
This commit is contained in:
Jay Lee
2016-08-20 16:25:49 -04:00
parent f66aa71ec1
commit 219509853f
38 changed files with 2284 additions and 1017 deletions

View File

@ -21,8 +21,7 @@ credentials.
import os
import threading
from oauth2client.client import Credentials
from oauth2client.client import Storage as BaseStorage
from oauth2client import client
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
@ -32,7 +31,7 @@ class CredentialsFileSymbolicLinkError(Exception):
"""Credentials files must not be symbolic links."""
class Storage(BaseStorage):
class Storage(client.Storage):
"""Store and retrieve a single credential to and from a file."""
def __init__(self, filename):
@ -42,7 +41,7 @@ class Storage(BaseStorage):
def _validate_file(self):
if os.path.islink(self._filename):
raise CredentialsFileSymbolicLinkError(
'File: %s is a symbolic link.' % self._filename)
'File: {0} is a symbolic link.'.format(self._filename))
def locked_get(self):
"""Retrieve Credential from file.
@ -63,7 +62,7 @@ class Storage(BaseStorage):
return credentials
try:
credentials = Credentials.new_from_json(content)
credentials = client.Credentials.new_from_json(content)
credentials.set_store(self)
except ValueError:
pass