Commit 0ebf7ba4 authored by Robert Ma's avatar Robert Ma Committed by Commit Bot

Fix two bugs in monorail.py found in local testing

Bug: 765334
Change-Id: I8b88d07d40314fb3c4554530e3e1918f301b0202
Reviewed-on: https://chromium-review.googlesource.com/827035Reviewed-by: default avatarQuinten Yearsley <qyearsley@chromium.org>
Commit-Queue: Robert Ma <robertma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524107}
parent 227b889e
......@@ -114,12 +114,13 @@ class MonorailAPI(object):
self._oauth2_client = oauth2client.client
if service_account_key_json:
credentials = self._oauth2_client.GoogleCredentials(service_account_key_json)
credentials = self._oauth2_client.GoogleCredentials.from_stream(service_account_key_json)
else:
credentials = self._oauth2_client.GoogleCredentials.get_application_default()
# cache_discovery needs to be disabled because of https://github.com/google/google-api-python-client/issues/299
self.api = self._api_discovery.build(
'monorail', 'v1', discoveryServiceUrl=self._DISCOVERY_URL, credentials=credentials)
'monorail', 'v1', discoveryServiceUrl=self._DISCOVERY_URL, credentials=credentials, cache_discovery=False)
def insert_issue(self, issue):
return self.api.issues().insert(projectId=issue.project_id, body=issue.body).execute()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment