From 3168e8b43e77a10c54a57345d2c06f9f4e4800c7 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Mon, 19 Aug 2013 20:51:45 +0200 Subject: [PATCH] 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 --- heat/engine/resources/template_resource.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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 -- 2.45.2