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

Adding list_zones call to OpenStack

This commit is contained in:
Tom Caspy 2015-06-04 15:18:11 +03:00
parent d74db05b2d
commit da2bb5c702
2 changed files with 35 additions and 0 deletions

View file

@ -189,6 +189,9 @@ module Fog
request :list_hosts
request :get_host_details
# Zones
request :list_zones
class Mock
attr_reader :auth_token
attr_reader :auth_token_expiration

View file

@ -0,0 +1,32 @@
module Fog
module Compute
class OpenStack
class Real
def list_zones(*args)
request(
:expects => 200,
:method => 'GET',
:path => 'os-availability-zone.json'
)
end
end
class Mock
def list_zones(*args)
Excon::Response.new(
:body => { "availabilityZoneInfo" => [
{
"zoneState" => {
"available" => true
},
"hosts" => nil,
"zoneName" => "nova"
}
] },
:status => 200
)
end
end
end
end
end