2012-02-23 05:57:48 -05:00
|
|
|
module Fog
|
|
|
|
module Image
|
|
|
|
class OpenStack
|
|
|
|
class Real
|
2012-02-27 07:12:52 -05:00
|
|
|
def get_shared_images(tenant_id)
|
2012-02-23 05:57:48 -05:00
|
|
|
request(
|
|
|
|
:expects => [200, 204],
|
|
|
|
:method => 'GET',
|
2012-02-27 07:12:52 -05:00
|
|
|
:path => "shared-images/#{tenant_id}"
|
2012-02-23 05:57:48 -05:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end # class Real
|
|
|
|
|
|
|
|
class Mock
|
2012-02-27 07:12:52 -05:00
|
|
|
def get_shared_images(tenant_id)
|
2012-02-23 05:57:48 -05:00
|
|
|
response = Excon::Response.new
|
|
|
|
response.status = [200, 204][rand(1)]
|
|
|
|
response.body = {
|
2012-02-27 07:12:52 -05:00
|
|
|
"shared_images"=>[
|
|
|
|
{"image_id"=>"ff528b20431645ebb5fa4b0a71ca002f",
|
|
|
|
"can_share"=>false}
|
|
|
|
]
|
|
|
|
}
|
2012-02-23 05:57:48 -05:00
|
|
|
response
|
|
|
|
end # def list_tenants
|
|
|
|
end # class Mock
|
|
|
|
end # class OpenStack
|
|
|
|
end # module Identity
|
|
|
|
end # module Fog
|