You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2015/04/06 12:02:13 UTC
[14/52] [abbrv] libcloud git commit: moved subscription_id from
common/base.py to common/azure.py
moved subscription_id from common/base.py to common/azure.py
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/4e1f8f79
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/4e1f8f79
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/4e1f8f79
Branch: refs/heads/trunk
Commit: 4e1f8f79c8349e0cf099cfdfe4b67d8756d0c094
Parents: ae39549
Author: Matt Baldwin <ba...@gmail.com>
Authored: Tue Jul 1 13:59:50 2014 -0700
Committer: Michael Bennett <mi...@securitycompass.com>
Committed: Wed Nov 19 13:03:15 2014 -0500
----------------------------------------------------------------------
libcloud/common/azure.py | 20 +++++++++++---------
libcloud/common/base.py | 7 +++----
2 files changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/4e1f8f79/libcloud/common/azure.py
----------------------------------------------------------------------
diff --git a/libcloud/common/azure.py b/libcloud/common/azure.py
index b742933..931da74 100644
--- a/libcloud/common/azure.py
+++ b/libcloud/common/azure.py
@@ -214,25 +214,27 @@ class AzureServiceManagementConnection(CertificateConnection):
Check to see if PyCrypto is available, and convert key file path into a
key string if the key is in a file.
- :param user_id: Email address to be used for Service Account
- authentication.
- :type user_id: ``str``
+ :param subscription_id: Azure subscription ID.
+ :type subscription_id: ``str``
- :param key: The RSA Key or path to file containing the key.
- :type key: ``str``
+ :param key_file: The PEM file used to authenticate with the service.
+ :type key_file: ``str``
"""
+ super(AzureServiceManagementConnection, self).__init__(
+ key_file, *args, **kwargs)
+
+ self.subscription_id = subscription_id
+
keypath = os.path.expanduser(key_file)
self.keyfile = keypath;
is_file_path = os.path.exists(keypath) and os.path.isfile(keypath)
if not is_file_path:
raise InvalidCredsError(
- 'pem file needed to authenticate to Microsoft Azure')
+ 'You need an certificate PEM file to authenticate with '
+ 'Microsoft Azure. This can be found in the portal.')
self.key_file = key_file
- super(AzureServiceManagementConnection, self).__init__(
- subscription_id, key_file, *args, **kwargs)
-
def add_default_headers(self, headers):
"""
@inherits: :class:`Connection.add_default_headers`
http://git-wip-us.apache.org/repos/asf/libcloud/blob/4e1f8f79/libcloud/common/base.py
----------------------------------------------------------------------
diff --git a/libcloud/common/base.py b/libcloud/common/base.py
index 9223956..9bbb1a6 100644
--- a/libcloud/common/base.py
+++ b/libcloud/common/base.py
@@ -950,19 +950,18 @@ class ConnectionKey(Connection):
class CertificateConnection(Connection):
"""
- Base connection class which accepts a single ``key`` argument.
+ Base connection class which accepts a single ``cert_file`` argument.
"""
- def __init__(self, subscription_id, cert_file, secure=True, host=None, port=None, url=None,
+ def __init__(self, cert_file, secure=True, host=None, port=None, url=None,
timeout=None):
"""
- Initialize `user_id` and `key`; set `secure` to an ``int`` based on
+ Initialize `cert_file`; set `secure` to an ``int`` based on
passed value.
"""
super(CertificateConnection, self).__init__(secure=secure, host=host,
port=port, url=url, timeout=timeout)
self.cert_file = cert_file
- self.subscription_id = subscription_id
class ConnectionUserAndKey(ConnectionKey):
"""