Update oauth2client credential API call.

The previous version of acloud was using oauth2client 1.4.12, but now
we've updated to 3.0.0 which deprecated the credential API we called
(oauth2client.client.SignedJwtAssertionCredentials) which is now switched to
the service_account module.

https://github.com/google/oauth2client/issues/401

Bug: 111319023
Test: ./run_tests.sh && m acloud && acloud create with a service acct.
Change-Id: Id01be26e3646c82ba92402076f3f6b18afe7cfd9
diff --git a/internal/lib/auth.py b/internal/lib/auth.py
index 66d1c2c..3ef1bd3 100644
--- a/internal/lib/auth.py
+++ b/internal/lib/auth.py
@@ -38,11 +38,12 @@
 
 import logging
 import os
-import sys
 
 import httplib2
 
+# pylint: disable=import-error
 from oauth2client import client as oauth2_client
+from oauth2client import service_account as oauth2_service_account
 from oauth2client.contrib import multistore_file
 from oauth2client import tools as oauth2_tools
 
@@ -68,14 +69,12 @@
         errors.AuthentcationError: if failed to authenticate.
     """
     try:
-        with open(private_key_path) as f:
-            private_key = f.read()
-            credentials = oauth2_client.SignedJwtAssertionCredentials(
-                email, private_key, scopes)
+        credentials = oauth2_service_account.ServiceAccountCredentials.from_p12_keyfile(
+            email, private_key_path, scopes=scopes)
     except EnvironmentError as e:
         raise errors.AuthentcationError(
-            "Could not authenticate using private key file %s, error message: %s",
-            private_key_path, str(e))
+            "Could not authenticate using private key file (%s) "
+            " error message: %s" % (private_key_path, str(e)))
     return credentials