1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-11 05:17:41 +03:00

Merge branch 'feature-696' of git.opennebula.org:one into feature-696

This commit is contained in:
Jaime Melis 2011-07-07 13:41:11 +02:00
commit 79b04d2f6e
2 changed files with 9 additions and 9 deletions

View File

@ -54,11 +54,11 @@ module OneWatchClient
mon = Hash.new
monitoring_resources.each { |opt|
mon[opt] = case opt
when allowed_samples.include?(opt)
sum_monitoring(rsql, kind, opt)
when "total", "active", "error"
count_monitoring(rsql, opt)
opt = opt.to_sym
if allowed_samples.has_key?(opt)
mon[opt] = sum_monitoring(rsql, kind, opt)
elsif [:total, :active, :error].include?(opt)
mon[opt] = count_monitoring(rsql, opt)
end
}
@ -85,9 +85,9 @@ module OneWatchClient
def count_monitoring(rsql, opt)
resources = case opt
when "total" then rsql
when "active" then rsql.active
when "error" then rsql.error
when :total then rsql
when :active then rsql.active
when :error then rsql.error
else return nil
end

View File

@ -115,7 +115,7 @@ module WatchHelper
:timestamp => timestamp,
:last_poll => vm['LAST_POLL'],
:state => vm['STATE'],
:lcm_state => vm['LCM_STATE'],
:lcm_state => vm['LCM_STATE']
}
VM_SAMPLE.each { |key,value|