used google-auth

This commit is contained in:
Soham Banerjee 2021-07-01 11:53:52 +05:30
parent 667750f3ff
commit 2f71fba8bf
No known key found for this signature in database
GPG key ID: 7D5D03FB878B0376

View file

@ -5,7 +5,7 @@ import logging
from googleapiclient import discovery
from googleapiclient import errors as googleapiclient_errors
import httplib2
from oauth2client.service_account import ServiceAccountCredentials
from google.oauth2.service_account import Credentials
import zope.interface
from certbot import errors
@ -82,7 +82,7 @@ class _GoogleClient:
scopes = ['https://www.googleapis.com/auth/ndev.clouddns.readwrite']
if account_json is not None:
try:
credentials = ServiceAccountCredentials.from_json_keyfile_name(account_json, scopes)
credentials = Credentials.from_json_keyfile_name(account_json, scopes)
with open(account_json) as account:
self.project_id = json.load(account)['project_id']
except Exception as e: