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

fix defaults

This commit is contained in:
Rodrigo Estebanez 2013-06-12 18:51:14 +02:00
parent 27a925c44a
commit b6dcaf21e5
2 changed files with 4 additions and 17 deletions

View file

@ -57,7 +57,7 @@ module Fog
link['type'] == 'application/vnd.vmware.vcloud.vdc+xml'
}
if vdcs.length == 1
vdcs.first['href'].split('/').last.to_i
vdcs.first['href'].split('/').last
else
nil
end
@ -72,7 +72,7 @@ module Fog
@default_network_id ||= begin
networks = get_vdc(default_vdc_id).body['AvailableNetworks']
if networks.length == 1
networks.first['href'].split('/').last.to_i
networks.first['href'].split('/').last
else
nil
end
@ -82,20 +82,7 @@ module Fog
end
end
def default_public_ip_id
if default_vdc_id
@default_public_ip_id ||= begin
ips = get_public_ips(default_vdc_id).body['PublicIpAddresses']
if ips.length == 1
ips.first['href'].split('/').last.to_i
else
nil
end
end
else
nil
end
end
end
def default_ssh_key

View file

@ -9,7 +9,7 @@ module Fog
@default_organization_id ||= begin
org_list = get_organizations.body['OrgList']
if org_list.length == 1
org_list.first['href'].split('/').last.to_i
org_list.first['href'].split('/').last
else
nil
end