mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Updated associate_route_table mock to return the correct association id and with additional fields that were previously missing.
This commit is contained in:
parent
32e7d16190
commit
ff37b88b12
1 changed files with 7 additions and 4 deletions
|
@ -31,16 +31,17 @@ module Fog
|
|||
class Mock
|
||||
|
||||
def associate_route_table(routeTableId, subnetId)
|
||||
response = Excon::Response.new
|
||||
routetable = self.data[:route_tables].find { |routetable| routetable["routeTableId"].eql? routeTableId }
|
||||
subnet = self.data[:subnets].find { |subnet| subnet["subnetId"].eql? subnetId }
|
||||
|
||||
if !routetable.nil? && !subnet.nil?
|
||||
response = Excon::Response.new
|
||||
response.status = 200
|
||||
routetable["associationSet"].push(add_route_association(routeTableId, subnetId))
|
||||
association = add_route_association(routeTableId, subnetId)
|
||||
routetable["associationSet"].push(association)
|
||||
response.body = {
|
||||
'requestId' => Fog::AWS::Mock.request_id,
|
||||
'associationId' => "rtbassoc-#{Fog::Mock.random_hex(8)}"
|
||||
'associationId' => association['routeTableAssociationId']
|
||||
}
|
||||
response
|
||||
elsif routetable.nil?
|
||||
|
@ -56,7 +57,9 @@ module Fog
|
|||
def add_route_association(routeTableId, subnetId, main=nil)
|
||||
response = {
|
||||
"routeTableAssociationId" => "rtbassoc-#{Fog::Mock.random_hex(8)}",
|
||||
"routeTableId" => routeTableId
|
||||
"routeTableId" => routeTableId,
|
||||
"subnetId" => nil,
|
||||
"main" => false
|
||||
}
|
||||
if main
|
||||
response['main'] = true
|
||||
|
|
Loading…
Add table
Reference in a new issue