diff --git a/lib/fog/openstack/compute.rb b/lib/fog/openstack/compute.rb index 5a956efb9..c96f2caa7 100644 --- a/lib/fog/openstack/compute.rb +++ b/lib/fog/openstack/compute.rb @@ -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 diff --git a/lib/fog/openstack/requests/compute/list_zones.rb b/lib/fog/openstack/requests/compute/list_zones.rb new file mode 100644 index 000000000..e3cab6347 --- /dev/null +++ b/lib/fog/openstack/requests/compute/list_zones.rb @@ -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