mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
609995ccbe
reverted back to double quoted string Conflicts: lib/fog/openstack/identity.rb lib/fog/openstack/requests/compute/get_volume_details.rb lib/fog/openstack/requests/compute/list_security_groups.rb lib/fog/openstack/requests/identity/list_tenants.rb lib/fog/openstack/requests/image/create_image.rb lib/fog/openstack/requests/image/list_public_images.rb lib/fog/openstack/requests/image/list_public_images_detailed.rb lib/fog/openstack/requests/image/update_image.rb tests/openstack/requests/compute/volume_tests.rb
31 lines
770 B
Ruby
31 lines
770 B
Ruby
module Fog
|
|
module Identity
|
|
class OpenStack
|
|
class Real
|
|
def get_tenant(id)
|
|
request(
|
|
:expects => [200, 204],
|
|
:method => 'GET',
|
|
:path => "tenants/#{id}"
|
|
)
|
|
end
|
|
end # class Real
|
|
|
|
class Mock
|
|
def get_tenant(id)
|
|
response = Excon::Response.new
|
|
response.status = [200, 204][rand(1)]
|
|
response.body = {
|
|
'tenant' => {
|
|
'id' => id,
|
|
'description' => 'Has access to everything',
|
|
'enabled' => true,
|
|
'name' => 'admin'
|
|
}
|
|
}
|
|
response
|
|
end # def list_tenants
|
|
end # class Mock
|
|
end # class OpenStack
|
|
end # module Identity
|
|
end # module Fog
|