diff --git a/heat/engine/resources/aws/autoscaling/autoscaling_group.py b/heat/engine/resources/aws/autoscaling/autoscaling_group.py index 48c092e5be..64aa6f8c35 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 21d1f58436..149c31a069 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 13869b571d..73f9b6f717 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)