lib/fog/azurerm/models/network/virtual_networks.rb in fog-azure-rm-0.0.0 vs lib/fog/azurerm/models/network/virtual_networks.rb in fog-azure-rm-0.0.1

- old
+ new

@@ -4,14 +4,16 @@ module Fog module Network class AzureRM class VirtualNetworks < Fog::Collection model Fog::Network::AzureRM::VirtualNetwork + attribute :resource_group def all + requires :resource_group virtual_networks = [] - service.list_virtual_networks.each do |vnet| + service.list_virtual_networks(resource_group).each do |vnet| hash = {} vnet.instance_variables.each do |var| hash[var.to_s.delete('@')] = vnet.instance_variable_get(var) end hash['resource_group'] = vnet.instance_variable_get('@id').split('/')[4] @@ -20,11 +22,9 @@ load(virtual_networks) end def get(identity, resource_group) all.find { |f| f.name == identity && f.resource_group == resource_group } - rescue Fog::Errors::NotFound - nil end def check_if_exists(name, resource_group) Fog::Logger.debug "Checkng if Virtual Network #{name} exists." if service.check_for_virtual_network(name, resource_group)