From: Zane Bitter Date: Mon, 19 Aug 2013 18:51:45 +0000 (+0200) Subject: Allow Parameters to set defaults for TemplateResource X-Git-Tag: 2014.1~188^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=3168e8b43e77a10c54a57345d2c06f9f4e4800c7;p=openstack-build%2Fheat-build.git Allow Parameters to set defaults for TemplateResource Although it is theoretically possible to infer default values for the Properties of a TemplateResource from the Parameters of the provider template, this presents a number of conversion issues that are presently unhandled. Instead, pass parameter values only for properties that are supplied. For the others, allow the parameter defaults in the template to be used. Change-Id: I2ba49ffeee06c3a272694c18b3875f843ade1e6c --- diff --git a/heat/engine/resources/template_resource.py b/heat/engine/resources/template_resource.py index fd3ce62b..b629f576 100644 --- a/heat/engine/resources/template_resource.py +++ b/heat/engine/resources/template_resource.py @@ -67,15 +67,18 @@ class TemplateResource(stack_resource.StackResource): for n, v in iter(self.properties.props.items()): if not v.implemented(): continue - elif v.type() == properties.LIST: + + val = self.properties[n] + + if val is not None: # take a list and create a CommaDelimitedList - val = self.properties[n] - if val: - params[n] = ','.join(val) - else: + if v.type() == properties.LIST: + val = ','.join(val) + # for MAP, the JSON param takes either a collection or string, # so just pass it on and let the param validate as appropriate - params[n] = self.properties[n] + + params[n] = val return params