mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Do the same thing for vpcs as previously done for subnets
This commit is contained in:
parent
d93de63a58
commit
f61143703d
4 changed files with 13 additions and 17 deletions
|
@ -199,7 +199,8 @@ module Fog
|
|||
:tag_sets => Hash.new do |tag_set_hash, resource_id|
|
||||
tag_set_hash[resource_id] = {}
|
||||
end,
|
||||
:subnets => []
|
||||
:subnets => [],
|
||||
:vpcs => []
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -43,16 +43,17 @@ module Fog
|
|||
Excon::Response.new.tap do |response|
|
||||
if cidrBlock
|
||||
response.status = 200
|
||||
self.data[:vpcs].push({
|
||||
'vpcId' => Fog::AWS::Mock.request_id,
|
||||
'state' => 'pending',
|
||||
'cidrBlock' => cidrBlock,
|
||||
'dhcpOptionsId' => Fog::AWS::Mock.request_id,
|
||||
'tagSet' => {}
|
||||
|
||||
})
|
||||
response.body = {
|
||||
'requestId' => Fog::AWS::Mock.request_id,
|
||||
'vpcSet' => [
|
||||
'vpcId' => Fog::AWS::Mock.request_id,
|
||||
'state' => 'pending',
|
||||
'cidrBlock' => cidrBlock,
|
||||
'dhcpOptionsId' => Fog::AWS::Mock.request_id,
|
||||
'tagSet' => {}
|
||||
]
|
||||
'vpcSet' => self.data[:vpcs]
|
||||
}
|
||||
else
|
||||
response.status = 400
|
||||
|
|
|
@ -34,7 +34,8 @@ module Fog
|
|||
Excon::Response.new.tap do |response|
|
||||
if vpc_id
|
||||
response.status = 200
|
||||
|
||||
self.data[:vpcs].reject! { |v| v['vpcId'] == vpc_id }
|
||||
|
||||
response.body = {
|
||||
'requestId' => Fog::AWS::Mock.request_id,
|
||||
'return' => true
|
||||
|
|
|
@ -45,14 +45,7 @@ module Fog
|
|||
response.status = 200
|
||||
response.body = {
|
||||
'requestId' => Fog::AWS::Mock.request_id,
|
||||
'vpcSet' => [
|
||||
'vpcId' => Fog::AWS::Mock.request_id,
|
||||
'state' => 'pending',
|
||||
'cidrBlock' => '10.255.255.0/24',
|
||||
'dhcpOptionsId' => Fog::AWS::Mock.request_id,
|
||||
'instanceTenancy' => 'default',
|
||||
'tagSet' => {}
|
||||
]
|
||||
'vpcSet' => self.data[:vpcs]
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue