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

Add pending -> available transitions for AWS VPC and Subnets

This commit is contained in:
Brian Nelson 2013-12-10 23:42:26 -08:00
parent 5ddd858755
commit 15483fa78e
2 changed files with 16 additions and 0 deletions

View file

@ -46,6 +46,14 @@ module Fog
def describe_subnets(filters = {})
subnets = self.data[:subnets]
# Transition from pending to available
subnets.each do |subnet|
case subnet['state']
when 'pending'
subnet['state'] = 'available'
end
end
if filters['subnet-id']
subnets = subnets.reject {|subnet| subnet['subnetId'] != filters['subnet-id']}
end

View file

@ -43,6 +43,14 @@ module Fog
def describe_vpcs(filters = {})
vpcs = self.data[:vpcs]
# Transition from pending to available
vpcs.each do |vpc|
case vpc['state']
when 'pending'
vpc['state'] = 'available'
end
end
if filters['vpc-id']
vpcs = vpcs.reject {|vpc| vpc['vpcId'] != filters['vpc-id']}
end