Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Commit

Permalink
Merge f816a34 into cbe87f4
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin-kolda committed Feb 28, 2019
2 parents cbe87f4 + f816a34 commit 69b92b5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/commons/config/appinfo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import googleapiclient.discovery
import httplib2
from oauth2client.client import GoogleCredentials

from src.commons.config.configuration import configuration
Expand All @@ -9,12 +8,11 @@ class AppInfo(object):

def __init__(self):
self.app_id = configuration.backup_project_id
self.http = self.__create_http()
self.service = googleapiclient.discovery.build(
'appengine',
'v1',
credentials=GoogleCredentials.get_application_default(),
http=self.http,
credentials=self._create_credentials(),
http=self._create_http(),
)

def get_location(self):
Expand All @@ -23,5 +21,9 @@ def get_location(self):
return "EU" if location_id.startswith("europe") else "US"

@staticmethod
def __create_http():
return httplib2.Http(timeout=60)
def _create_credentials():
return GoogleCredentials.get_application_default()

@staticmethod
def _create_http():
return None

0 comments on commit 69b92b5

Please sign in to comment.