diff options
author | Rabi Mishra <ramishra@redhat.com> | 2016-03-19 19:55:55 +0530 |
---|---|---|
committer | Rabi Mishra <ramishra@redhat.com> | 2016-04-01 18:24:16 +0530 |
commit | 480271d89604d4cb09df2735d9115531e14331af (patch) | |
tree | ef81b82cb8eae2e0a3b0db199bef5b508029aa8c /heat/scaling | |
parent | 7933a8bc3d8ad4a97363e89707a74e3c67988640 (diff) | |
download | heat-480271d89604d4cb09df2735d9115531e14331af.tar.gz |
Don't try scaling when no change in size
Don't resize and send notifications when there is no
change in size i.e. max/min has been reached.
This also refactors some exception handling logic.
Change-Id: I1bb226b3067178dbdab2947609c53f3434aff9fe
Related-Bug: #1555748
Diffstat (limited to 'heat/scaling')
-rw-r--r-- | heat/scaling/cooldown.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/heat/scaling/cooldown.py b/heat/scaling/cooldown.py index effa4e6b3..b4517c1f6 100644 --- a/heat/scaling/cooldown.py +++ b/heat/scaling/cooldown.py @@ -49,13 +49,12 @@ class CooldownMixin(object): self.metadata_set(metadata) return True - def _finished_scaling(self, cooldown_reason, - changed_size=True): + def _finished_scaling(self, cooldown_reason, size_changed=True): # If we wanted to implement the AutoScaling API like AWS does, # we could maintain event history here, but since we only need # the latest event for cooldown, just store that for now metadata = self.metadata_get() - if changed_size: + if size_changed: now = timeutils.utcnow().isoformat() metadata['cooldown'] = {now: cooldown_reason} metadata['scaling_in_progress'] = False |