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:
parent
79eedad51b
commit
44a2af8614
1 changed files with 19 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue