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