summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-04-03 21:11:05 +0000
committerGerrit Code Review <review@openstack.org>2017-04-03 21:11:05 +0000
commite2a317a6ab48ab500b645266afcb57c6319e37b4 (patch)
tree9a5f2c2c3dc942f4d7583235c4b6b63113035f14
parent84e1669ddebcafef6baa5237e8cbc9ff99aba1f2 (diff)
parente139a32799cc0a0b13a11ca68538805389a7ecb2 (diff)
downloadheat-8.0.1.tar.gz
Merge "To reset metadata for resources when mark healthy" into stable/ocata8.0.1
-rw-r--r--heat/engine/resources/aws/autoscaling/autoscaling_group.py2
-rw-r--r--heat/engine/resources/openstack/heat/scaling_policy.py4
-rw-r--r--heat/tests/autoscaling/test_heat_scaling_policy.py11
3 files changed, 14 insertions, 3 deletions
diff --git a/heat/engine/resources/aws/autoscaling/autoscaling_group.py b/heat/engine/resources/aws/autoscaling/autoscaling_group.py
index 48c092e5b..64aa6f8c3 100644
--- a/heat/engine/resources/aws/autoscaling/autoscaling_group.py
+++ b/heat/engine/resources/aws/autoscaling/autoscaling_group.py
@@ -35,7 +35,7 @@ from heat.scaling import scalingutil as sc_util
LOG = logging.getLogger(__name__)
-class AutoScalingGroup(instgrp.InstanceGroup, cooldown.CooldownMixin):
+class AutoScalingGroup(cooldown.CooldownMixin, instgrp.InstanceGroup):
support_status = support.SupportStatus(version='2014.1')
diff --git a/heat/engine/resources/openstack/heat/scaling_policy.py b/heat/engine/resources/openstack/heat/scaling_policy.py
index 21d1f5843..149c31a06 100644
--- a/heat/engine/resources/openstack/heat/scaling_policy.py
+++ b/heat/engine/resources/openstack/heat/scaling_policy.py
@@ -30,8 +30,8 @@ from heat.scaling import scalingutil as sc_util
LOG = logging.getLogger(__name__)
-class AutoScalingPolicy(signal_responder.SignalResponder,
- cooldown.CooldownMixin):
+class AutoScalingPolicy(cooldown.CooldownMixin,
+ signal_responder.SignalResponder):
"""A resource to manage scaling of `OS::Heat::AutoScalingGroup`.
**Note** while it may incidentally support
diff --git a/heat/tests/autoscaling/test_heat_scaling_policy.py b/heat/tests/autoscaling/test_heat_scaling_policy.py
index 13869b571..73f9b6f71 100644
--- a/heat/tests/autoscaling/test_heat_scaling_policy.py
+++ b/heat/tests/autoscaling/test_heat_scaling_policy.py
@@ -124,6 +124,17 @@ class TestAutoScalingPolicy(common.HeatTestCase):
mock_cip.assert_called_once_with()
self.assertEqual([], dont_call.call_args_list)
+ def test_policy_metadata_reset(self):
+ t = template_format.parse(as_template)
+ stack = utils.parse_stack(t, params=as_params)
+ pol = self.create_scaling_policy(t, stack, 'my-policy')
+ metadata = {'scaling_in_progress': True}
+ pol.metadata_set(metadata)
+ pol.handle_metadata_reset()
+
+ new_metadata = pol.metadata_get()
+ self.assertEqual({'scaling_in_progress': False}, new_metadata)
+
def test_scaling_policy_cooldown_ok(self):
t = template_format.parse(as_template)
stack = utils.parse_stack(t, params=as_params)