From b6dcaf21e5c2377673295c1996636dc8f2f666ac Mon Sep 17 00:00:00 2001 From: Rodrigo Estebanez Date: Wed, 12 Jun 2013 18:51:14 +0200 Subject: [PATCH] fix defaults --- lib/fog/vcloudng/compute.rb | 19 +++---------------- lib/fog/vcloudng/shared.rb | 2 +- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/lib/fog/vcloudng/compute.rb b/lib/fog/vcloudng/compute.rb index 908c79465..d858af07e 100644 --- a/lib/fog/vcloudng/compute.rb +++ b/lib/fog/vcloudng/compute.rb @@ -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 diff --git a/lib/fog/vcloudng/shared.rb b/lib/fog/vcloudng/shared.rb index 6bba4c06c..5666382b1 100644 --- a/lib/fog/vcloudng/shared.rb +++ b/lib/fog/vcloudng/shared.rb @@ -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