mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[compute|aws] Add different availability zones for each region to the mock.
Closes #262.
This commit is contained in:
parent
90a79f0639
commit
707a46ae75
1 changed files with 17 additions and 1 deletions
|
@ -43,13 +43,29 @@ module Fog
|
|||
|
||||
response = Excon::Response.new
|
||||
|
||||
availability_zone_info = [
|
||||
all_zones = [
|
||||
{"messageSet" => [], "regionName" => "us-east-1", "zoneName" => "us-east-1a", "zoneState" => "available"},
|
||||
{"messageSet" => [], "regionName" => "us-east-1", "zoneName" => "us-east-1b", "zoneState" => "available"},
|
||||
{"messageSet" => [], "regionName" => "us-east-1", "zoneName" => "us-east-1c", "zoneState" => "available"},
|
||||
{"messageSet" => [], "regionName" => "us-east-1", "zoneName" => "us-east-1d", "zoneState" => "available"},
|
||||
|
||||
{"messageSet" => [], "regionName" => "us-west-1", "zoneName" => "us-west-1a", "zoneState" => "available"},
|
||||
{"messageSet" => [], "regionName" => "us-west-1", "zoneName" => "us-west-1b", "zoneState" => "available"},
|
||||
{"messageSet" => [], "regionName" => "us-west-1", "zoneName" => "us-west-1c", "zoneState" => "available"},
|
||||
|
||||
{"messageSet" => [], "regionName" => "eu-west-1", "zoneName" => "eu-west-1a", "zoneState" => "available"},
|
||||
{"messageSet" => [], "regionName" => "eu-west-1", "zoneName" => "eu-west-1b", "zoneState" => "available"},
|
||||
{"messageSet" => [], "regionName" => "eu-west-1", "zoneName" => "eu-west-1c", "zoneState" => "available"},
|
||||
|
||||
{"messageSet" => [], "regionName" => "ap-northeast-1", "zoneName" => "ap-northeast-1a", "zoneState" => "available"},
|
||||
{"messageSet" => [], "regionName" => "ap-northeast-1", "zoneName" => "ap-northeast-1b", "zoneState" => "available"},
|
||||
|
||||
{"messageSet" => [], "regionName" => "ap-southeast-1", "zoneName" => "ap-southeast-1a", "zoneState" => "available"},
|
||||
{"messageSet" => [], "regionName" => "ap-southeast-1", "zoneName" => "ap-southeast-1b", "zoneState" => "available"},
|
||||
]
|
||||
|
||||
availability_zone_info = all_zones.select { |zoneinfo| zoneinfo["regionName"] == @region }
|
||||
|
||||
aliases = {'region-name' => 'regionName', 'zone-name' => 'zoneName', 'state' => 'zoneState'}
|
||||
for filter_key, filter_value in filters
|
||||
aliased_key = aliases[filter_key]
|
||||
|
|
Loading…
Reference in a new issue