diff options
author | Anant Patil <anant.patil@hp.com> | 2016-05-20 08:30:24 +0000 |
---|---|---|
committer | Anant Patil <anant.patil@hp.com> | 2016-05-20 08:34:42 +0000 |
commit | 43dde8b5250b96144eb64cbb03721b7e38a5debd (patch) | |
tree | d68f22d408e52a213e7cddcfe668091a63f9bee5 /heat/tests/test_template.py | |
parent | 7fb8c5862f7a29783af837c1788c437f672e1788 (diff) | |
download | heat-43dde8b5250b96144eb64cbb03721b7e38a5debd.tar.gz |
Convergence: show parameters while deleting stack
In case of convergence, delete is an update of stack with empty
template. The issue with it is that the stack-show will not show the
parameters used to create/update the stack. The fix is to retain the
environment from the last template in the empty template and then update
the stack with that template so that the stack-show will show the
parameters properly.
Change-Id: Ia45ad5d024456cd583c282a42b26c9528512e73c
Closes-Bug: #1583673
Diffstat (limited to 'heat/tests/test_template.py')
-rw-r--r-- | heat/tests/test_template.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/heat/tests/test_template.py b/heat/tests/test_template.py index 8eb6bb387..28b6ee8a4 100644 --- a/heat/tests/test_template.py +++ b/heat/tests/test_template.py @@ -973,6 +973,26 @@ class TemplateTest(common.HeatTestCase): self.assertEqual({}, empty_template['resources']) self.assertEqual({}, empty_template['outputs']) + def test_create_empty_template_from_another_template(self): + res_param_template = template_format.parse('''{ + "HeatTemplateFormatVersion" : "2012-12-12", + "Parameters" : { + "foo" : { "Type" : "String" }, + "blarg" : { "Type" : "String", "Default": "quux" } + }, + "Resources" : { + "foo" : { "Type" : "GenericResourceType" }, + "blarg" : { "Type" : "GenericResourceType" } + } + }''') + + env = environment.Environment({'foo': 'bar'}) + hot_tmpl = template.Template(res_param_template, env) + empty_template = template.Template.create_empty_template( + from_template=hot_tmpl) + self.assertEqual({}, empty_template['Resources']) + self.assertEqual(hot_tmpl.env, empty_template.env) + class TemplateFnErrorTest(common.HeatTestCase): scenarios = [ |