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

feature : check for errors in info xmlrpc method

This commit is contained in:
Jaime Melis 2011-07-07 13:39:32 +02:00
parent 947cf3fe61
commit 8772a16ff5

@ -60,16 +60,24 @@ class Watcher
@monitors.each do |monitor|
if monitor[:steps] > 0 and step % monitor[:steps] == 0
monitor[:pools].each do |pool|
resource = monitor[:resource]
log "#{resource.class}"
if pool_hash = @pool_cache[pool]
else
pool.info
rc = pool.info
if OpenNebula.is_error?(rc)
log "Error: " + rc.message
log "Shutting down"
exit 1
end
pool_hash = pool.to_hash
@pool_cache[pool] = pool_hash
end
resource = monitor[:resource]
resource.insert(pool_hash)
log(resource)
end
end
end