From: JUN JIE NAN Date: Mon, 22 Jul 2013 04:22:12 +0000 (+0800) Subject: Add `default` attribute in hot parameter definition X-Git-Tag: 2014.1~336^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=239c38307b75d601c71cb676340c61aa2c43f1de;p=openstack-build%2Fheat-build.git Add `default` attribute in hot parameter definition So `default' in hot is translated to `Default' in cfn Change-Id: Ifd50dbb993dd0cb177b0e16652c6ef17d12cd2e5 Fixes: bug #1199311 --- diff --git a/heat/engine/hot.py b/heat/engine/hot.py index 801e72fb..50374690 100644 --- a/heat/engine/hot.py +++ b/heat/engine/hot.py @@ -84,6 +84,7 @@ class HOTemplate(template.Template): def _translate_parameters(self, parameters): """Get the parameters of the template translated into CFN format.""" HOT_TO_CFN_ATTRS = {'type': 'Type', + 'default': 'Default', 'description': 'Description'} HOT_TO_CFN_TYPES = {'string': 'String'} diff --git a/heat/tests/test_hot.py b/heat/tests/test_hot.py index 68d7c8eb..d91ecef2 100644 --- a/heat/tests/test_hot.py +++ b/heat/tests/test_hot.py @@ -60,9 +60,12 @@ class HOTemplateTest(HeatTestCase): param1: description: foo type: string + default: boo ''') - expected = {'param1': {'Description': 'foo', 'Type': 'String'}} + expected = {'param1': {'Description': 'foo', + 'Type': 'String', + 'Default': 'boo'}} tmpl = parser.Template(hot_tpl) self.assertEqual(tmpl[hot.PARAMETERS], expected)