lib/fog/azurerm/models/network/virtual_networks.rb in fog-azure-rm-0.0.1 vs lib/fog/azurerm/models/network/virtual_networks.rb in fog-azure-rm-0.0.2
- old
+ new
@@ -10,24 +10,19 @@
def all
requires :resource_group
virtual_networks = []
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]
- virtual_networks << hash
+ virtual_networks << Fog::Network::AzureRM::VirtualNetwork.parse(vnet)
end
load(virtual_networks)
end
- def get(identity, resource_group)
- all.find { |f| f.name == identity && f.resource_group == resource_group }
+ def get(identity)
+ all.find { |f| f.name == identity }
end
- def check_if_exists(name, resource_group)
+ def check_if_exists(resource_group, name)
Fog::Logger.debug "Checkng if Virtual Network #{name} exists."
if service.check_for_virtual_network(name, resource_group)
Fog::Logger.debug "Virtual Network #{name} exists."
true
else