2012-02-24 06:38:05 -05:00
|
|
|
module Fog
|
|
|
|
module Identity
|
|
|
|
class OpenStack
|
|
|
|
class Real
|
|
|
|
def get_role(id)
|
|
|
|
request(
|
|
|
|
:expects => [200, 204],
|
|
|
|
:method => 'GET',
|
2012-02-26 21:43:42 -05:00
|
|
|
:path => "/OS-KSADM/roles/#{id}"
|
2012-02-24 06:38:05 -05:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Mock
|
|
|
|
def get_role(id)
|
|
|
|
response = Excon::Response.new
|
2012-02-26 21:43:42 -05:00
|
|
|
if data = self.data[:roles][id]
|
|
|
|
response.status = 200
|
|
|
|
response.body = { 'role' => data }
|
|
|
|
response
|
|
|
|
else
|
|
|
|
raise Fog::Identity::OpenStack::NotFound
|
|
|
|
end
|
2012-02-24 06:38:05 -05:00
|
|
|
end
|
|
|
|
end # class Mock
|
|
|
|
end # class OpenStack
|
|
|
|
end # module Identity
|
|
|
|
end # module Fog
|