1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

feature #720: Fix ruby 1.9 problem in watch_client

This commit is contained in:
Ruben S. Montero 2011-08-31 17:00:19 +02:00
parent d488cffddc
commit d9792bb1f5

View File

@ -98,14 +98,14 @@ module OneWatchClient
max_per_vm =
rsql.
group(:id, :last_poll).
select(:last_poll, :MAX[mr.to_sym].as(:max_mr))
select{[:last_poll, max(mr.to_sym).as(:max_mr)]}
# SUM the monitoring resource for each last_poll value
last_poll_and_sum =
max_per_vm.
from_self.
group(:last_poll).
select(:last_poll, :SUM[:max_mr].as(:sum_mr))
select{[:last_poll, sum(:max_mr).as(:sum_mr)]}
# Retrieve the information in an Array
a = Array.new
@ -113,7 +113,7 @@ module OneWatchClient
if row[:last_poll] && row[:last_poll] != 0
a << [row[:last_poll], row[:sum_mr].to_i]
end
end
end
a
end
@ -229,4 +229,4 @@ module OneWatchClient
end
end
end
end
end