libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From quent...@apache.org
Subject [1/9] libcloud git commit: Allow shared network/subnetwork
Date Fri, 19 Jan 2018 20:25:09 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk f7d527e33 -> 44f4afcda


Allow shared network/subnetwork

If they come as fully qualified resource URLs (https://)

Signed-off-by: Quentin Pradet <quentinp@apache.org>


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

Branch: refs/heads/trunk
Commit: 40fb1af22e5adc6f8bff9ed5739ebb92c815c5f2
Parents: f7d527e
Author: Boris Chazalet <bchazalet@companywatch.net>
Authored: Thu Jan 18 10:05:29 2018 +0100
Committer: Quentin Pradet <quentinp@apache.org>
Committed: Sat Jan 20 00:22:52 2018 +0400

----------------------------------------------------------------------
 libcloud/compute/drivers/gce.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/40fb1af2/libcloud/compute/drivers/gce.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py
index 893fd96..5e182ff 100644
--- a/libcloud/compute/drivers/gce.py
+++ b/libcloud/compute/drivers/gce.py
@@ -7074,7 +7074,7 @@ class GCENodeDriver(NodeDriver):
         region_name = None
         if name.startswith('https://'):
             parts = self._get_components_from_path(name)
-            name = parts['name']
+            #name = parts['name']
             region_name = parts['region']
         else:
             if isinstance(region, GCERegion):
@@ -7092,7 +7092,8 @@ class GCENodeDriver(NodeDriver):
             else:
                 region_name = region.name
 
-        request = '/regions/%s/subnetworks/%s' % (region_name, name)
+        #request = '/regions/%s/subnetworks/%s' % (region_name, name)
+        request = '%s' % (name)
         response = self.connection.request(request, method='GET').object
         return self._to_subnetwork(response)
 
@@ -7106,7 +7107,10 @@ class GCENodeDriver(NodeDriver):
         :return:  A Network object for the network
         :rtype:   :class:`GCENetwork`
         """
-        request = '/global/networks/%s' % (name)
+        if name.startswith('https://'):
+          request = name
+        else:
+          request = '/global/networks/%s' % (name)
         response = self.connection.request(request, method='GET').object
         return self._to_network(response)
 


Mime
View raw message