From 92593dd8bf10331ef35ba40aef013c47b775be24 Mon Sep 17 00:00:00 2001 From: Sergio Rubio Date: Mon, 18 Mar 2013 12:51:40 +0100 Subject: [PATCH] [digitalocean|compute] added power_cycle_server mock code --- .../requests/compute/power_cycle_server.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/fog/digitalocean/requests/compute/power_cycle_server.rb b/lib/fog/digitalocean/requests/compute/power_cycle_server.rb index acfe5d961..62d9fc981 100644 --- a/lib/fog/digitalocean/requests/compute/power_cycle_server.rb +++ b/lib/fog/digitalocean/requests/compute/power_cycle_server.rb @@ -16,7 +16,15 @@ module Fog class Mock def power_cycle_server( id ) - Fog::Mock.not_implemented + response = Excon::Response.new + response.status = 200 + server = self.data[:servers].find { |s| s['id'] == id } + server['status'] = 'off' if server + response.body = { + "event_id" => Fog::Mock.random_numbers(1).to_i, + "status" => "OK" + } + response end end