Skip to content

Commit

Permalink
Allow for shared networks in instance groups
Browse files Browse the repository at this point in the history
By using fully qualified names of networks.

Signed-off-by: Quentin Pradet <quentinp@apache.org>
  • Loading branch information
bchazalet authored and pquentin committed Mar 10, 2018
1 parent 4d0f9e0 commit 51cd3e5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions libcloud/compute/drivers/gce.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 51cd3e5

Please sign in to comment.