Bug 1278103 - Google update their api client. Needs to update the client
MozReview-Commit-ID: 5N76tXfLdPZ
--- a/testing/mozharness/mozharness/mozilla/googleplay.py
+++ b/testing/mozharness/mozharness/mozilla/googleplay.py
@@ -8,41 +8,33 @@
5) Create "New client ID"
or download the p12 key (it should remain
super private)
6) Move the file in this directory with the name
'key.p12' or use the --credentials option
"""
import httplib2
-
+from oauth2client.service_account import ServiceAccountCredentials
from apiclient.discovery import build
from oauth2client import client
# GooglePlayMixin {{{1
class GooglePlayMixin(object):
def connect_to_play(self):
""" Connect to the google play interface
"""
- # Load the key in PKCS 12 format that you downloaded from the
- # Google APIs Console when you created your Service account.
- f = file(self.config["google_play_credentials_file"], 'rb')
- key = f.read()
- f.close()
# Create an httplib2.Http object to handle our HTTP requests an
# authorize it with the Credentials. Note that the first parameter,
# service_account_name, is the Email address created for the Service
# account. It must be the email address associated with the key that
# was created.
scope = 'https://www.googleapis.com/auth/androidpublisher'
- credentials = client.SignedJwtAssertionCredentials(
- self.config["service_account"],
- key,
- scope)
+ credentials = ServiceAccountCredentials.from_p12_keyfile(self.config["service_account"], self.config["google_play_credentials_file"], scopes=scope)
http = httplib2.Http()
http = credentials.authorize(http)
service = build('androidpublisher', 'v2', http=http)
return service
--- a/testing/mozharness/requirements.txt
+++ b/testing/mozharness/requirements.txt
@@ -16,10 +16,10 @@ paramiko==1.10.0
pycrypto==2.6
pyflakes==0.6.1
pylint==0.27.0
simplejson==2.1.1
unittest2==0.5.1
virtualenv==1.5.1
wsgiref==0.1.2
urllib3==1.9.1
-google-api-python-client==1.3.1
+google-api-python-client==1.5.1
oauth2client==1.4.2