From: Zane Bitter Date: Wed, 21 Aug 2013 14:52:13 +0000 (+0200) Subject: Use Template to instantiate TemplateResource X-Git-Tag: 2014.1~157^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=01924a501f1be863a665b2f0de93beb2ac63b994;p=openstack-build%2Fheat-build.git 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 --- 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: