]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Get rid of template caching in resources
authorZane Bitter <zbitter@redhat.com>
Thu, 13 Jun 2013 18:03:28 +0000 (20:03 +0200)
committerSteven Hardy <shardy@redhat.com>
Mon, 1 Jul 2013 11:05:44 +0000 (12:05 +0100)
This is no longer used anywhere.

Change-Id: I3b320a1668f5ba532b01b289222a56126c19c8aa

heat/engine/resource.py

index d504c71dd69ad47a812333cea2f6a00ca69aa22a..a57f767eb55f277d58df3a5a7ca9b15e2722d95c 100644 (file)
@@ -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