2012-02-10 10:10:49 -05:00
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class Joyent
|
|
|
|
|
|
|
|
class Mock
|
|
|
|
def delete_key(keyname)
|
|
|
|
if self.data[:keys].delete(keyname)
|
|
|
|
response = Excon::Response.new
|
2012-02-21 04:29:36 -05:00
|
|
|
response.status = 204
|
2012-02-10 10:10:49 -05:00
|
|
|
response
|
|
|
|
else
|
|
|
|
raise Excon::Errors::NotFound, "Not Found"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Real
|
2012-02-21 04:29:36 -05:00
|
|
|
def delete_key(name)
|
2012-02-10 10:10:49 -05:00
|
|
|
request(
|
|
|
|
:method => "DELETE",
|
|
|
|
:path => "/my/keys/#{name}",
|
2012-02-21 04:29:36 -05:00
|
|
|
:expects => 204
|
2012-02-10 10:10:49 -05:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end # Real
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|