mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
M #-: subscribe to service changes
This commit is contained in:
parent
13f6ea8684
commit
181cdce470
@ -91,7 +91,7 @@ class ServiceLCM
|
||||
|
||||
Thread.new do
|
||||
wd = ServiceWD.new(client, em_conf)
|
||||
wd.start @srv_pool
|
||||
wd.start(@srv_pool)
|
||||
end
|
||||
|
||||
Thread.new do
|
||||
|
@ -62,6 +62,8 @@ class ServiceWD
|
||||
def start(service_pool)
|
||||
Log.info LOG_COMP, 'Start watch dog'
|
||||
|
||||
service_pool.info_all
|
||||
|
||||
# check that all nodes are in RUNNING state, if not, notify
|
||||
check_roles_state(client, service_pool)
|
||||
|
||||
@ -161,10 +163,12 @@ class ServiceWD
|
||||
# @param service_id [Integer] Service ID to check
|
||||
# @param roles [Array] Service roles with its nodes
|
||||
def check_roles_state(client, service_pool)
|
||||
service_pool.each do |service|
|
||||
service_pool.each do |service|
|
||||
service.info
|
||||
|
||||
service.roles.each do |name, role|
|
||||
role.nodes_ids.each do |node|
|
||||
check_role_state(client, service_id, name, node)
|
||||
check_role_state(client, service.id, name, node)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user