Feature #2118: Add cooldown time after a set-cardinality action

This commit is contained in:
Carlos Martín committed 2013-06-12 17:54:18 +02:00
1 parent dafe3cd58a
commit bf0245d17c
2 files changed
+7

No files matched your search

+5
View File
@@ -730,6 +730,11 @@ module OpenNebula
@body['cooldown_duration'] = cooldown_duration.to_i
end
# Updates the duration for the next cooldown with the default value
def set_default_cooldown_duration()
set_cooldown_duration(@body['cooldown'].to_i)
end
# Sets the cooldown end time from now + the duration set in set_cooldown_duration
# @return [true, false] true if the cooldown duration is bigger than 0
def apply_cooldown_duration()
+2
View File
@@ -345,6 +345,8 @@ module OpenNebula
role.set_state(Role::STATE['SCALING'])
role.set_default_cooldown_duration()
self.set_state(Service::STATE['SCALING'])
return self.update
end