diff --git a/lib/fog/digitalocean/requests/compute/shutdown_server.rb b/lib/fog/digitalocean/requests/compute/shutdown_server.rb index 8448c7889..d108f2d5d 100644 --- a/lib/fog/digitalocean/requests/compute/shutdown_server.rb +++ b/lib/fog/digitalocean/requests/compute/shutdown_server.rb @@ -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