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,
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