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

Add attribute is default in vpc

This commit is contained in:
Liu zhitong 2016-09-20 12:20:59 +02:00
parent 09a405cc14
commit c4dab2c58d
2 changed files with 9 additions and 1 deletions

View file

@ -9,6 +9,7 @@ module Fog
attribute :dhcp_options_id, :aliases => 'dhcpOptionsId'
attribute :tags, :aliases => 'tagSet'
attribute :tenancy, :aliases => 'instanceTenancy'
attribute :is_default, :aliases => 'isDefault'
def initialize(attributes={})
self.dhcp_options_id ||= "default"
@ -21,6 +22,11 @@ module Fog
state == 'available'
end
def is_default?
require :is_default
is_default
end
# Removes an existing vpc
#
# vpc.destroy

View file

@ -30,8 +30,10 @@ module Fog
end
else
case name
when 'vpcId', 'state', 'cidrBlock', 'dhcpOptionsId', 'instanceTenancy', 'isDefault'
when 'vpcId', 'state', 'cidrBlock', 'dhcpOptionsId', 'instanceTenancy'
@vpc[name] = value
when 'isDefault'
@vpc['isDefault'] = value == 'true'
when 'item'
@response['vpcSet'] << @vpc
@vpc = { 'tagSet' => {} }