lib/fog/hp/requests/compute/get_console_output.rb in fog-1.22.0 vs lib/fog/hp/requests/compute/get_console_output.rb in fog-1.22.1

- old
+ new

@@ -1,10 +1,9 @@ module Fog module Compute class HP class Real - # Retrieve console output for specified instance # # ==== Parameters # * server_id<~Integer> - Id of instance to get console output from # * num_lines<~Integer> - Number of lines of console output from the end @@ -15,27 +14,24 @@ # def get_console_output(server_id, num_lines) body = { 'os-getConsoleOutput' => { 'length' => num_lines }} server_action(server_id, body, 200) end - end class Mock - def get_console_output(server_id, num_lines) output = "" response = Excon::Response.new - if list_servers_detail.body['servers'].detect {|_| _['id'] == server_id} + if list_servers_detail.body['servers'].find {|_| _['id'] == server_id} (1..num_lines).each {|i| output += "Console Output Line #{i} \r\n"} response.body = { 'output' => output } response.status = 200 else raise Fog::Compute::HP::NotFound end response end - end end end end