From 239c38307b75d601c71cb676340c61aa2c43f1de Mon Sep 17 00:00:00 2001 From: JUN JIE NAN Date: Mon, 22 Jul 2013 12:22:12 +0800 Subject: [PATCH] Add `default` attribute in hot parameter definition So `default' in hot is translated to `Default' in cfn Change-Id: Ifd50dbb993dd0cb177b0e16652c6ef17d12cd2e5 Fixes: bug #1199311 --- heat/engine/hot.py | 1 + heat/tests/test_hot.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) 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) -- 2.45.2