Merge "To reset metadata for resources when mark healthy" into stable/ocata

This commit is contained in:
Jenkins 2017-04-03 21:11:05 +00:00 committed by Gerrit Code Review
commit e2a317a6ab
3 changed files with 14 additions and 3 deletions

View File

@ -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')

View File

@ -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

View File

@ -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)