From: Zane Bitter Date: Thu, 13 Jun 2013 18:03:28 +0000 (+0200) Subject: Get rid of template caching in resources X-Git-Tag: 2014.1~407^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=30fbc1ec985cda13c64ee812c665b8a361b7156a;p=openstack-build%2Fheat-build.git Get rid of template caching in resources This is no longer used anywhere. Change-Id: I3b320a1668f5ba532b01b289222a56126c19c8aa --- diff --git a/heat/engine/resource.py b/heat/engine/resource.py index d504c71d..a57f767e 100644 --- a/heat/engine/resource.py +++ b/heat/engine/resource.py @@ -161,7 +161,6 @@ class Resource(object): self.name = name self.json_snippet = json_snippet self.t = stack.resolve_static_data(json_snippet) - self.cached_t = None self.properties = Properties(self.properties_schema, self.t.get('Properties', {}), self.stack.resolve_runtime_data, @@ -209,29 +208,18 @@ class Resource(object): return identifier.ResourceIdentifier(resource_name=self.name, **self.stack.identifier()) - def parsed_template(self, section=None, default={}, cached=False): + def parsed_template(self, section=None, default={}): ''' Return the parsed template data for the resource. May be limited to only one section of the data, in which case a default value may also be supplied. ''' - if cached and self.cached_t: - t = self.cached_t - else: - t = self.t if section is None: - template = t + template = self.t else: - template = t.get(section, default) + template = self.t.get(section, default) return self.stack.resolve_runtime_data(template) - def cache_template(self): - ''' - make a cache of the resource's parsed template - this can then be used via parsed_template(cached=True) - ''' - self.cached_t = self.stack.resolve_runtime_data(self.t) - def update_template_diff(self, after, before): ''' Returns the difference between the before and after json snippets. If