diff --git a/lib/vmpooler/api/dashboard.rb b/lib/vmpooler/api/dashboard.rb index 84bae1d..4c56798 100644 --- a/lib/vmpooler/api/dashboard.rb +++ b/lib/vmpooler/api/dashboard.rb @@ -83,7 +83,7 @@ module Vmpooler history ||= {} begin - buffer = open(graph_link('.ready.*&from=-1hour&format=json')).read + buffer = URI.parse(graph_link('.ready.*&from=-1hour&format=json')).read history = JSON.parse(buffer) history.each do |pool| @@ -136,7 +136,7 @@ module Vmpooler if params[:history] if graph_url begin - buffer = open(graph_link('.running.*&from=-1hour&format=json')).read + buffer = URI.parse(graph_link('.running.*&from=-1hour&format=json')).read JSON.parse(buffer).each do |pool| if pool['target'] =~ /.*\.(.*)$/ pool['name'] = Regexp.last_match[1] diff --git a/lib/vmpooler/logger.rb b/lib/vmpooler/logger.rb index f8a9644..218ec4c 100644 --- a/lib/vmpooler/logger.rb +++ b/lib/vmpooler/logger.rb @@ -16,7 +16,7 @@ module Vmpooler puts "[#{stamp}] #{string}" if ENV['VMPOOLER_DEBUG'] - open(@file, 'a') do |f| + File.open(@file, 'a') do |f| f.puts "[#{stamp}] #{string}" end end