summaryrefslogtreecommitdiff
path: root/heat_integrationtests/functional/test_template_resource.py
diff options
context:
space:
mode:
authorThomas Herve <therve@redhat.com>2016-03-17 16:03:08 +0100
committerThomas Herve <therve@redhat.com>2016-03-17 16:26:40 +0100
commit90fc4fe89e76e18df8831e1163c064eae76fbf69 (patch)
treeb6743b075e80e9ad35baeca9fb10ae577bc191ed /heat_integrationtests/functional/test_template_resource.py
parent5a4f3e084c7a8a305ab04f8a26262bfe78df8ea0 (diff)
downloadheat-90fc4fe89e76e18df8831e1163c064eae76fbf69.tar.gz
Remove unknown parameters in patched update
When updating a stack with the existing flag, we keep the parameters from the old template to be used against the new version. Sometimes parameters will get remove and won't make sense anymore, and keeping them would break update with a 'Parameter was not defined' error. This filters out such parameters so that the updates succeed. Change-Id: I6f2aa77da28d271dd001a137bb574b5470292f15 Closes-Bug: #1558610
Diffstat (limited to 'heat_integrationtests/functional/test_template_resource.py')
-rw-r--r--heat_integrationtests/functional/test_template_resource.py66
1 files changed, 66 insertions, 0 deletions
diff --git a/heat_integrationtests/functional/test_template_resource.py b/heat_integrationtests/functional/test_template_resource.py
index 9a3e83369..ebfd73e8a 100644
--- a/heat_integrationtests/functional/test_template_resource.py
+++ b/heat_integrationtests/functional/test_template_resource.py
@@ -935,3 +935,69 @@ resources:
stack_identifier,
self.main_template_update,
files={'resource.yaml': self.nested_templ_update})
+
+
+class TemplateResourceRemovedParamTest(functional_base.FunctionalTestsBase):
+
+ main_template = '''
+heat_template_version: 2013-05-23
+parameters:
+ value1:
+ type: string
+ default: foo
+resources:
+ my_resource:
+ type: resource.yaml
+ properties:
+ value1: {get_param: value1}
+'''
+ nested_templ = '''
+heat_template_version: 2013-05-23
+parameters:
+ value1:
+ type: string
+ default: foo
+resources:
+ test:
+ type: OS::Heat::TestResource
+ properties:
+ value: {get_param: value1}
+'''
+ main_template_update = '''
+heat_template_version: 2013-05-23
+resources:
+ my_resource:
+ type: resource.yaml
+'''
+ nested_templ_update = '''
+heat_template_version: 2013-05-23
+parameters:
+ value1:
+ type: string
+ default: foo
+ value2:
+ type: string
+ default: bar
+resources:
+ test:
+ type: OS::Heat::TestResource
+ properties:
+ value:
+ str_replace:
+ template: VAL1-VAL2
+ params:
+ VAL1: {get_param: value1}
+ VAL2: {get_param: value2}
+'''
+
+ def test_update(self):
+ stack_identifier = self.stack_create(
+ template=self.main_template,
+ environment={'parameters': {'value1': 'spam'}},
+ files={'resource.yaml': self.nested_templ})
+
+ self.update_stack(
+ stack_identifier,
+ self.main_template_update,
+ environment={'parameter_defaults': {'value2': 'egg'}},
+ files={'resource.yaml': self.nested_templ_update}, existing=True)