From 01924a501f1be863a665b2f0de93beb2ac63b994 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Wed, 21 Aug 2013 16:52:13 +0200 Subject: [PATCH] Use Template to instantiate TemplateResource Use the Template class, rather than the raw template data, to obtain the information required to create the schema of a TemplateResource facade. This will allow this feature to work with multiple template formats (e.g. HOT vs. CloudFormation). Change-Id: Ifde739b081e95ed9f14567f35a0a1680c5e9b631 --- heat/engine/resources/template_resource.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/heat/engine/resources/template_resource.py b/heat/engine/resources/template_resource.py index 240c2c21..84707015 100644 --- a/heat/engine/resources/template_resource.py +++ b/heat/engine/resources/template_resource.py @@ -21,6 +21,7 @@ from heat.engine import attributes from heat.engine import environment from heat.engine import properties from heat.engine import stack_resource +from heat.engine import template from heat.openstack.common import log as logging @@ -51,10 +52,11 @@ class TemplateResource(stack_resource.StackResource): # if we're not overriding via the environment, mirror the template as # a new resource if cri is None or cri.get_class() == self.__class__: + tmpl = template.Template(self.parsed_nested) self.properties_schema = (properties.Properties - .schema_from_params(self.parsed_nested.get('Parameters'))) + .schema_from_params(tmpl.param_schemata())) self.attributes_schema = (attributes.Attributes - .schema_from_outputs(self.parsed_nested.get('Outputs'))) + .schema_from_outputs(tmpl[template.OUTPUTS])) # otherwise we are overriding a resource type via the environment # and should mimic that type else: -- 2.45.2