Allow for shared networks in instance groups

By using fully qualified names of networks.

Signed-off-by: Quentin Pradet <[email protected]>


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

Branch: refs/heads/trunk
Commit: 51cd3e5ea35d597d2656e8f8b735a4171223fcf4
Parents: 4d0f9e0
Author: Boris Chazalet <[email protected]>
Authored: Wed Mar 7 18:35:13 2018 +0100
Committer: Quentin Pradet <[email protected]>
Committed: Sat Mar 10 08:27:06 2018 +0400

----------------------------------------------------------------------
 libcloud/compute/drivers/gce.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/51cd3e5e/libcloud/compute/drivers/gce.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py
index a20ce21..3ecb3ca 100644
--- a/libcloud/compute/drivers/gce.py
+++ b/libcloud/compute/drivers/gce.py
@@ -9025,13 +9025,11 @@ class GCENodeDriver(NodeDriver):
         # does not contain instances.
         network = instancegroup.get('network', None)
         if network:
-            obj_name = self._get_components_from_path(network)['name']
-            network = self.ex_get_network(obj_name)
+            network = self.ex_get_network(network)
 
         subnetwork = instancegroup.get('subnetwork', None)
         if subnetwork:
-            parts = self._get_components_from_path(subnetwork)
-            subnetwork = self.ex_get_subnetwork(parts['name'], parts['region'])
+            subnetwork = self.ex_get_subnetwork(subnetwork)
 
         return GCEInstanceGroup(
             id=instancegroup['id'], name=instancegroup['name'], zone=zone,

Reply via email to