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

- old
+ new

@@ -1,10 +1,9 @@ module Fog module Compute class HP class Real - # Retrieve VNC console for the specified instance # # ==== Parameters # * server_id<~Integer> - Id of instance to get console output from # * type<~String> - Type of the vnc console, defaults to 'novnc' @@ -17,29 +16,26 @@ # def get_vnc_console(server_id, type='novnc') body = { 'os-getVNCConsole' => { 'type' => type }} server_action(server_id, body, 200) end - end class Mock - def get_vnc_console(server_id, type='novnc') output = { 'type' => type, 'url' => 'https://region.compute.hpcloud.com/vnc_auto.html?token=123ABX234' } response = Excon::Response.new - if list_servers_detail.body['servers'].detect {|_| _['id'] == server_id} + if list_servers_detail.body['servers'].find {|_| _['id'] == server_id} response.body = { 'console' => output } response.status = 200 else raise Fog::Compute::HP::NotFound end response end - end end end end