diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-01-19 18:35:56 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-01-19 18:35:56 +0000 |
commit | 8031e3cf71feaa6c8a3b75fb0f69e8cd1f9eed44 (patch) | |
tree | cec6e5af1b3eb92d5c57ed05538d05ae39d22f6c | |
parent | 0598aa36debdac6cfd937106ccb624904a85088b (diff) | |
parent | d8abdfd34ff089d0173da525da03cfbb20412c83 (diff) | |
download | heat-8031e3cf71feaa6c8a3b75fb0f69e8cd1f9eed44.tar.gz |
Merge "Always update nested stacks" into stable/juno
-rw-r--r-- | heat/engine/stack_resource.py | 6 | ||||
-rw-r--r-- | heat/tests/test_autoscaling_update_policy.py | 2 | ||||
-rw-r--r-- | heat/tests/test_provider_template.py | 19 | ||||
-rw-r--r-- | heat/tests/test_resource_group.py | 4 |
4 files changed, 15 insertions, 16 deletions
diff --git a/heat/engine/stack_resource.py b/heat/engine/stack_resource.py index 788465698..71971f146 100644 --- a/heat/engine/stack_resource.py +++ b/heat/engine/stack_resource.py @@ -59,6 +59,12 @@ class StackResource(resource.Resource): self.attributes_schema, self._resolve_attribute) + def _needs_update(self, after, before, after_props, before_props, + prev_resource): + # Always issue an update to the nested stack and let the individual + # resources in it decide if they need updating. + return True + def nested(self): ''' Return a Stack object representing the nested (child) stack. diff --git a/heat/tests/test_autoscaling_update_policy.py b/heat/tests/test_autoscaling_update_policy.py index ecea89fe9..2b40c7356 100644 --- a/heat/tests/test_autoscaling_update_policy.py +++ b/heat/tests/test_autoscaling_update_policy.py @@ -660,7 +660,7 @@ class AutoScalingGroupTest(HeatTestCase): num_updates_expected_on_updt=9, num_creates_expected_on_updt=1, num_deletes_expected_on_updt=1, - num_reloads_expected_on_updt=12, + num_reloads_expected_on_updt=13, update_replace=True, update_image_id=update_image) diff --git a/heat/tests/test_provider_template.py b/heat/tests/test_provider_template.py index 13eb380ed..44e578e3a 100644 --- a/heat/tests/test_provider_template.py +++ b/heat/tests/test_provider_template.py @@ -847,7 +847,7 @@ Outputs: Value: {'Fn::GetAtt': [NestedResource, value]} ''' - EXPECTED = (REPLACE, UPDATE, NOCHANGE) = ('replace', 'update', 'nochange') + EXPECTED = (UPDATE, NOCHANGE) = ('update', 'nochange') scenarios = [ ('no_changes', dict(template=main_template, provider=initial_tmpl, @@ -860,10 +860,10 @@ Outputs: expect=UPDATE)), ('provider_props_change', dict(template=main_template, provider=prop_change_tmpl, - expect=REPLACE)), + expect=NOCHANGE)), ('provider_attr_change', dict(template=main_template, provider=attr_change_tmpl, - expect=REPLACE)), + expect=NOCHANGE)), ] def setUp(self): @@ -889,19 +889,12 @@ Outputs: updated_stack = parser.Stack(self.ctx, stack.name, tmpl) stack.update(updated_stack) self.assertEqual(('UPDATE', 'COMPLETE'), stack.state) - if self.expect == self.REPLACE: - self.assertNotEqual(initial_id, - stack.output('identifier')) - self.assertNotEqual(initial_val, - stack.output('value')) - elif self.expect == self.NOCHANGE: - self.assertEqual(initial_id, - stack.output('identifier')) + self.assertEqual(initial_id, + stack.output('identifier')) + if self.expect == self.NOCHANGE: self.assertEqual(initial_val, stack.output('value')) else: - self.assertEqual(initial_id, - stack.output('identifier')) self.assertNotEqual(initial_val, stack.output('value')) self.m.VerifyAll() diff --git a/heat/tests/test_resource_group.py b/heat/tests/test_resource_group.py index ce22a4715..630154984 100644 --- a/heat/tests/test_resource_group.py +++ b/heat/tests/test_resource_group.py @@ -409,8 +409,8 @@ class ResourceGroupTest(common.HeatTestCase): new_snip = copy.deepcopy(resg.t) scheduler.TaskRunner(resg.update, new_snip)() self.stack = resg.nested() - self.assertEqual((resg.CREATE, resg.COMPLETE), resg.state) - self.assertEqual((resg.CREATE, resg.COMPLETE), resg.nested().state) + self.assertEqual((resg.UPDATE, resg.COMPLETE), resg.state) + self.assertEqual((resg.UPDATE, resg.COMPLETE), resg.nested().state) self.assertEqual(2, len(resg.nested())) resource_names = [r.name for r in resg.nested().iter_resources()] self.assertEqual(['0', '1'], sorted(resource_names)) |