lib/fog/rackspace/requests/compute/get_server_details.rb in fog-1.22.0 vs lib/fog/rackspace/requests/compute/get_server_details.rb in fog-1.22.1

- old
+ new

@@ -1,10 +1,9 @@ module Fog module Compute class Rackspace class Real - # Get details about a server # # ==== Parameters # * server_id<~Integer> - Id of server to get details for # @@ -28,25 +27,22 @@ :expects => [200, 203], :method => 'GET', :path => "servers/#{server_id}.json" ) end - end class Mock - def get_server_details(server_id) response = Excon::Response.new - if server = list_servers_detail.body['servers'].detect {|_| _['id'].to_s == server_id.to_s} + if server = list_servers_detail.body['servers'].find {|_| _['id'].to_s == server_id.to_s} response.status = [200, 203][rand(1)] response.body = { 'server' => server } response else raise Fog::Compute::Rackspace::NotFound end end - end end end end