From ef4726441a96ebfb43649293be0ed9a10b89864f Mon Sep 17 00:00:00 2001 From: Rupak Ganguly Date: Thu, 30 May 2013 15:34:07 -0400 Subject: [PATCH] Add subnets collection to the network model. --- lib/fog/hp/models/network/network.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/fog/hp/models/network/network.rb b/lib/fog/hp/models/network/network.rb index af1b23c7a..63b4cfc19 100644 --- a/lib/fog/hp/models/network/network.rb +++ b/lib/fog/hp/models/network/network.rb @@ -10,7 +10,6 @@ module Fog attribute :name attribute :tenant_id attribute :status - attribute :subnets attribute :shared attribute :admin_state_up attribute :router_external, :aliases => 'router:external' @@ -25,6 +24,15 @@ module Fog self.status == 'ACTIVE' end + def subnets + @subnets ||= begin + Fog::HP::Network::Subnets.new({ + :service => service, + :filters => {:network_id => self.id} + }) + end + end + def save identity ? update : create end