From 51cd3e5ea35d597d2656e8f8b735a4171223fcf4 Mon Sep 17 00:00:00 2001 From: Boris Chazalet Date: Wed, 7 Mar 2018 18:35:13 +0100 Subject: [PATCH] Allow for shared networks in instance groups By using fully qualified names of networks. Signed-off-by: Quentin Pradet --- libcloud/compute/drivers/gce.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py index a20ce216fe..3ecb3cad8b 100644 --- a/libcloud/compute/drivers/gce.py +++ b/libcloud/compute/drivers/gce.py @@ -9025,13 +9025,11 @@ def _to_instancegroup(self, instancegroup): # 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,