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:
parent
5ddd858755
commit
15483fa78e
2 changed files with 16 additions and 0 deletions
|
@ -46,6 +46,14 @@ module Fog
|
||||||
def describe_subnets(filters = {})
|
def describe_subnets(filters = {})
|
||||||
subnets = self.data[:subnets]
|
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']
|
if filters['subnet-id']
|
||||||
subnets = subnets.reject {|subnet| subnet['subnetId'] != filters['subnet-id']}
|
subnets = subnets.reject {|subnet| subnet['subnetId'] != filters['subnet-id']}
|
||||||
end
|
end
|
||||||
|
|
|
@ -43,6 +43,14 @@ module Fog
|
||||||
def describe_vpcs(filters = {})
|
def describe_vpcs(filters = {})
|
||||||
vpcs = self.data[:vpcs]
|
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']
|
if filters['vpc-id']
|
||||||
vpcs = vpcs.reject {|vpc| vpc['vpcId'] != filters['vpc-id']}
|
vpcs = vpcs.reject {|vpc| vpc['vpcId'] != filters['vpc-id']}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue