libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [5/9] libcloud git commit: Propagate cloud_environment to Connection class.
Date Fri, 21 Apr 2017 22:12:42 GMT
Propagate cloud_environment to Connection class.


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/018e09f6
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/018e09f6
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/018e09f6

Branch: refs/heads/trunk
Commit: 018e09f62d02ba930639e230f08c562229f63eee
Parents: a5654cb
Author: Peter Amstutz <peter.amstutz@curoverse.com>
Authored: Fri Jan 13 16:58:29 2017 -0500
Committer: Peter Amstutz <peter.amstutz@curoverse.com>
Committed: Thu Apr 20 14:46:22 2017 -0400

----------------------------------------------------------------------
 libcloud/common/azure_arm.py          | 5 +++--
 libcloud/compute/drivers/azure_arm.py | 2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/018e09f6/libcloud/common/azure_arm.py
----------------------------------------------------------------------
diff --git a/libcloud/common/azure_arm.py b/libcloud/common/azure_arm.py
index a73a905..1dcf817 100644
--- a/libcloud/common/azure_arm.py
+++ b/libcloud/common/azure_arm.py
@@ -143,10 +143,11 @@ class AzureResourceManagementConnection(ConnectionUserAndKey):
     rawResponseCls = RawResponse
 
     def __init__(self, key, secret, secure=True, tenant_id=None,
-                 subscription_id=None, **kwargs):
+                 subscription_id=None, cloud_environment=None, **kwargs):
         super(AzureResourceManagementConnection, self) \
             .__init__(key, secret, **kwargs)
-        cloud_environment = kwargs.get("cloud_environment", "default")
+        if not cloud_environment:
+            cloud_environment = "default"
         if isinstance(cloud_environment, basestring):
             cloud_environment = publicEnvironments[cloud_environment]
         if not isinstance(cloud_environment, dict):

http://git-wip-us.apache.org/repos/asf/libcloud/blob/018e09f6/libcloud/compute/drivers/azure_arm.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/azure_arm.py b/libcloud/compute/drivers/azure_arm.py
index 6fb5684..2048daf 100644
--- a/libcloud/compute/drivers/azure_arm.py
+++ b/libcloud/compute/drivers/azure_arm.py
@@ -191,6 +191,7 @@ class AzureNodeDriver(NodeDriver):
                  api_version=None, region=None, **kwargs):
         self.tenant_id = tenant_id
         self.subscription_id = subscription_id
+        self.cloud_environment = kwargs.get("cloud_environment")
         super(AzureNodeDriver, self).__init__(key=key, secret=secret,
                                               secure=secure,
                                               host=host, port=port,
@@ -1351,6 +1352,7 @@ class AzureNodeDriver(NodeDriver):
         kwargs = super(AzureNodeDriver, self)._ex_connection_class_kwargs()
         kwargs['tenant_id'] = self.tenant_id
         kwargs['subscription_id'] = self.subscription_id
+        kwargs["cloud_environment"] = self.cloud_environment
         return kwargs
 
     def _to_node(self, data, fetch_nic=True):


Mime
View raw message