From 2ea4bcf5067a4243753dc2390c839a8cc7da2b9f Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Tue, 29 Apr 2014 16:39:08 -0400 Subject: [PATCH] Pass unresolved template to Resource.update() Previously the 'after' template passed to Resource.update() was completely resolved. This led to an odd situation where the contents of a resource's template snippet were either unresolved (but parsed) or resolved depending on whether the resource had been updated or not. Resolve (ha!) this discrepancy by passing a version of the template with the intrinsic functions unresolved. Change-Id: I8c11cdc3c28661db689b416833bde34cea12d98a --- heat/engine/resource.py | 3 ++- heat/engine/update.py | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/heat/engine/resource.py b/heat/engine/resource.py index e21a1e11e3..af5e367d3d 100644 --- a/heat/engine/resource.py +++ b/heat/engine/resource.py @@ -545,7 +545,8 @@ class Resource(object): self.name, self.context) after_properties.validate() - tmpl_diff = self.update_template_diff(after, before) + tmpl_diff = self.update_template_diff(function.resolve(after), + before) prop_diff = self.update_template_diff_properties(after_properties, before_properties) if callable(getattr(self, 'handle_update', None)): diff --git a/heat/engine/update.py b/heat/engine/update.py index 44f13461eb..057fe52683 100644 --- a/heat/engine/update.py +++ b/heat/engine/update.py @@ -146,8 +146,7 @@ class StackUpdate(object): # Note the new resource snippet is resolved in the context # of the existing stack (which is the stack being updated) raw_snippet = copy.deepcopy(new_res.t) - parsed_snippet = self.existing_stack.resolve_static_data(raw_snippet) - new_snippet = self.existing_stack.resolve_runtime_data(parsed_snippet) + new_snippet = self.existing_stack.resolve_static_data(raw_snippet) return existing_res.update(new_snippet, existing_snippet, prev_resource=prev_res)