1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

default_network_name

This commit is contained in:
Rodrigo Estebanez 2013-06-12 19:52:15 +02:00
parent 79eedad51b
commit 44a2af8614

View file

@ -83,18 +83,27 @@ module Fog
nil
end
end
end
def default_ssh_key
if default_ssh_key
@default_ssh_key ||= begin
keys = get_keys_list(default_organization_id).body["Keys"]
keys.find { |item| item["IsDefault"] == "true" }
def default_network_name
if default_vdc_id
@default_network_name ||= begin
networks = get_vdc(default_vdc_id).body['AvailableNetworks']
if networks.length == 1
networks.first['name']
else
nil
end
end
end
else
nil
end
end
end
class Mock
include Fog::Vcloudng::Shared::Mock
include Fog::Vcloudng::Shared::Parser