mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Add is_shared attribute to network Model
is_shared reports whether a network is shared across all vDCs within an organization, or just within the vDC it is defined in.
This commit is contained in:
parent
c8227647e8
commit
6bedc5f3b4
3 changed files with 8 additions and 0 deletions
|
@ -13,6 +13,7 @@ module Fog
|
|||
attribute :href
|
||||
attribute :description
|
||||
attribute :is_inherited
|
||||
attribute :is_shared
|
||||
attribute :fence_mode
|
||||
attribute :gateway
|
||||
attribute :netmask
|
||||
|
|
|
@ -20,6 +20,7 @@ module Fog
|
|||
service.add_id_from_href!(data)
|
||||
data[:name] = raw_network[:name]
|
||||
data[:description] = raw_network[:Description]
|
||||
data[:is_shared] = raw_network[:IsShared]
|
||||
net_config = raw_network[:Configuration]
|
||||
data[:fence_mode] = net_config[:FenceMode]
|
||||
ip_scope = net_config[:IpScopes][:IpScope]
|
||||
|
|
|
@ -58,6 +58,12 @@ Shindo.tests("Compute::VcloudDirector | networks", ['vclouddirector', 'all']) do
|
|||
end
|
||||
end
|
||||
|
||||
tests("Compute::VcloudDirector | network", ['is_shared is a string boolean']) do
|
||||
tests("#is_shared is either 'true' or 'false'").returns(true) {
|
||||
[ 'false', 'true' ].include?(network.is_shared)
|
||||
}
|
||||
end
|
||||
|
||||
# NB: get_by_name is buggy with orgVdcNetworks - network names are only
|
||||
# unique per-vDC, not per organization.
|
||||
# As a result, it returns the *first* network matching that name.
|
||||
|
|
Loading…
Reference in a new issue