mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[digitalocean|compute] added shutdown_server mock code
This commit is contained in:
parent
1ed6aa1b06
commit
3ea97fb23f
1 changed files with 12 additions and 1 deletions
|
@ -16,7 +16,18 @@ module Fog
|
|||
class Mock
|
||||
|
||||
def shutdown_server( id )
|
||||
Fog::Mock.not_implemented
|
||||
response = Excon::Response.new
|
||||
response.status = 200
|
||||
server = self.data[:servers].find { |s| s['id'] == id }
|
||||
|
||||
# Simulate reboot
|
||||
server['status'] = 'off' if server
|
||||
|
||||
response.body = {
|
||||
"event_id" => Fog::Mock.random_numbers(1).to_i,
|
||||
"status" => "OK"
|
||||
}
|
||||
response
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue