Repository: libcloud Updated Branches: refs/heads/trunk c4e4f8e2b -> 5abd001df
[google] Added warning log message about .p12 format files; modified Service Account instructions to include JSON format file Closes #539 Signed-off-by: Eric Johnson <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/5abd001d Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/5abd001d Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/5abd001d Branch: refs/heads/trunk Commit: 5abd001dfcd518166c7d332c8e2dd57d900fdbf5 Parents: c4e4f8e Author: Tom Melendez <[email protected]> Authored: Tue Jun 30 19:05:49 2015 +0000 Committer: Eric Johnson <[email protected]> Committed: Mon Jul 13 22:27:00 2015 +0000 ---------------------------------------------------------------------- libcloud/common/google.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/5abd001d/libcloud/common/google.py ---------------------------------------------------------------------- diff --git a/libcloud/common/google.py b/libcloud/common/google.py index 694cf93..a7b4fc2 100644 --- a/libcloud/common/google.py +++ b/libcloud/common/google.py @@ -32,13 +32,16 @@ package installed to use this): - Click on "Credentials" - Click on "Create New Client ID..." - Select "Service account" and click on "Create Client ID" -- Download the Private Key (should happen automatically). -- The key that you download is a PKCS12 key. It needs to be converted to - the PEM format. -- Convert the key using OpenSSL (the default password is 'notasecret'): - ``openssl pkcs12 -in YOURPRIVKEY.p12 -nodes -nocerts - -passin pass:notasecret | openssl rsa -out PRIV.pem`` -- Move the .pem file to a safe location. +- Download the Private Key (should happen automatically). The key you download + is in JSON format. +- Move the .json file to a safe location. +- Optionally, you may choose to Generate a PKCS12 key from the Console. + It needs to be converted to the PEM format. Please note, the PKCS12 format + is deprecated and may be removed in a future release. + - Convert the key using OpenSSL (the default password is 'notasecret'): + ``openssl pkcs12 -in YOURPRIVKEY.p12 -nodes -nocerts + -passin pass:notasecret | openssl rsa -out PRIV.pem`` + - Move the .pem file to a safe location. - To Authenticate, you will need to pass the Service Account's "Email address" in as the user_id and the path to the .pem file as the key. @@ -74,6 +77,7 @@ import base64 import errno import time import datetime +import logging import os import socket import sys @@ -477,6 +481,10 @@ class GoogleServiceAcctAuthConnection(GoogleBaseAuthConnection): key = key['private_key'] except ValueError: key = contents + logger = logging.getLogger(__name__) + logger.warn('%s not in JSON format. This format is ' + 'deprecated. Please download a JSON key ' + 'from the Cloud Console.' % keypath) super(GoogleServiceAcctAuthConnection, self).__init__( user_id, key, *args, **kwargs)
