diff --git a/lib/fog/aws/models/compute/route_table.rb b/lib/fog/aws/models/compute/route_table.rb index cc46d99b8..54315000a 100755 --- a/lib/fog/aws/models/compute/route_table.rb +++ b/lib/fog/aws/models/compute/route_table.rb @@ -48,25 +48,23 @@ module Fog def save requires :vpc_id - data = service.create_route_table(vpc_id).body['routeTableSet'].first + data = service.create_route_table(vpc_id).body['routeTable'] new_attributes = data.reject {|key,value| key == 'requestId'} merge_attributes(new_attributes) true end - - private + private - def associationSet=(new_association_set) - merge_attributes(new_association_set.first || {}) - end - - def routeSet=(new_route_set) - merge_attributes(new_route_set || {}) - end + def associationSet=(new_association_set) + merge_attributes(new_association_set.first || {}) + end + + def routeSet=(new_route_set) + merge_attributes(new_route_set || {}) + end end - end end end diff --git a/lib/fog/aws/parsers/compute/create_route_table.rb b/lib/fog/aws/parsers/compute/create_route_table.rb index 65b170122..2d3387249 100755 --- a/lib/fog/aws/parsers/compute/create_route_table.rb +++ b/lib/fog/aws/parsers/compute/create_route_table.rb @@ -11,7 +11,7 @@ module Fog @route = {} @association = {} @route_table = { 'routeSet' => [], 'tagSet' => {}, 'associationSet' => [] } - @response = { 'routeTableSet' => [] } + @response = { 'routeTable' => [] } @tag = {} end @@ -59,7 +59,7 @@ module Fog when 'routeTableId', 'vpcId' @route_table[name] = value when 'routeTable' - @response['routeTableSet'] << @route_table + @response['routeTable'] << @route_table @route_table = { 'routeSet' => {}, 'tagSet' => {}, 'associationSet' => {} } when 'requestId' @response[name] = value diff --git a/lib/fog/aws/requests/compute/create_route_table.rb b/lib/fog/aws/requests/compute/create_route_table.rb index f479539d7..8222bb451 100755 --- a/lib/fog/aws/requests/compute/create_route_table.rb +++ b/lib/fog/aws/requests/compute/create_route_table.rb @@ -14,7 +14,7 @@ module Fog # * response<~Excon::Response>: # * body<~Hash>: # * 'requestId'<~String> - Id of the request - # * 'routeTableSet'<~Array> - Information about the newly created route table + # * 'routeTable'<~Array> - Information about the newly created route table # * 'routeTableId'<~String> # * 'vpcId'<~String> # * 'routeSet'<~Array> @@ -30,7 +30,6 @@ module Fog 'VpcId' => vpc_id, :parser => Fog::Parsers::Compute::AWS::CreateRouteTable.new }) - end end @@ -40,22 +39,23 @@ module Fog vpc = self.data[:vpcs].find { |vpc| vpc["vpcId"].eql? vpc_id } unless vpc.nil? response.status = 200 - self.data[:route_tables].push({ + route_table = { 'routeTableId' => "rtb-#{Fog::Mock.random_hex(8)}", 'vpcId' => vpc["vpcId"], - 'routeSet' => { + 'routeSet' => [ 'item' => { "destinationCidrBlock" => vpc["cidrBlock"], "gatewayId" => "local", "state" => "pending" } - }, - 'associationSet' => {}, + ], + 'associationSet' => [], 'tagSet' => {} - }) + } + self.data[:route_tables].push(route_table) response.body = { 'requestId'=> Fog::AWS::Mock.request_id, - 'routeTableSet' => self.data[:route_tables] + 'routeTable' => route_table } response else