Feature #1852: Service is not stuck in 'scaling' if a failure occurs

This commit is contained in:
Carlos Martín committed 2013-05-27 11:42:38 +02:00
1 parent 78593f7fb8
commit d367ea88fb
2 files changed
+15 -1

No files matched your search

+5 -1
View File
@@ -90,7 +90,11 @@ class ServiceLCM
# TODO: Check scalability rules for roles that are
# not scaling now?
if service.all_roles_running?
# The service is moved to RUNNING even if the
# roles scaling ended in failure. Any error is
# handled the next cycle in the RUNNING case
if !service.any_role_scaling?
service.set_state(Service::STATE['RUNNING'])
end
when Service::STATE['UNKNOWN']
+10
View File
@@ -144,6 +144,16 @@ module OpenNebula
return false
end
def any_role_scaling?()
@roles.each do |name, role|
if role.state == Role::STATE['SCALING']
return true
end
end
return false
end
# Create a new service based on the template provided
# @param [String] template_json
# @return [nil, OpenNebula::Error] nil in case of success, Error