From 06021e9350e5f84d0909fe3dbbce0be5902551c1 Mon Sep 17 00:00:00 2001 From: Eugene Howe Date: Wed, 22 Mar 2017 13:50:14 -0400 Subject: [PATCH] fix create_db_subnet_group mock --- lib/fog/aws/requests/rds/create_db_subnet_group.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/fog/aws/requests/rds/create_db_subnet_group.rb b/lib/fog/aws/requests/rds/create_db_subnet_group.rb index 0c4d37c1f..46c189cc5 100644 --- a/lib/fog/aws/requests/rds/create_db_subnet_group.rb +++ b/lib/fog/aws/requests/rds/create_db_subnet_group.rb @@ -31,15 +31,14 @@ module Fog end # collection = Fog::Compute::AWS.new(:aws_access_key_id => 'mock key', :aws_secret_access_key => 'mock secret') - collection = Fog::Compute[:aws] - collection.region = @region + compute_data = Fog::Compute::AWS::Mock.data[self.region][self.aws_access_key_id] subnets = subnet_ids.map do |snid| - subnet = collection.subnets.get(snid) + subnet = compute_data[:subnets].detect { |s| s['subnetId'] == snid } raise Fog::AWS::RDS::NotFound.new("InvalidSubnet => The subnet '#{snid}' was not found") if subnet.nil? subnet end - vpc_id = subnets.first.vpc_id + vpc_id = subnets.first['vpcId'] data = { 'DBSubnetGroupName' => name,