From 46c451c9563d0b8543fff1769fa30bb531a3c678 Mon Sep 17 00:00:00 2001 From: Brandon Dunne Date: Wed, 15 Jan 2014 09:56:42 -0500 Subject: [PATCH] [OpenStack|Network] Display subnets as a child of Network --- lib/fog/openstack/models/network/network.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/fog/openstack/models/network/network.rb b/lib/fog/openstack/models/network/network.rb index 4bafd7172..ab88f5e33 100644 --- a/lib/fog/openstack/models/network/network.rb +++ b/lib/fog/openstack/models/network/network.rb @@ -27,6 +27,10 @@ module Fog identity ? update : create end + def subnets + service.subnets.select {|s| s.network_id == self.id } + end + def create merge_attributes(service.create_network(self.attributes).body['network']) self