]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Add `default` attribute in hot parameter definition
authorJUN JIE NAN <nanjj@cn.ibm.com>
Mon, 22 Jul 2013 04:22:12 +0000 (12:22 +0800)
committerJUN JIE NAN <nanjj@cn.ibm.com>
Mon, 22 Jul 2013 04:27:57 +0000 (12:27 +0800)
So `default' in hot is translated to `Default' in cfn

Change-Id: Ifd50dbb993dd0cb177b0e16652c6ef17d12cd2e5
Fixes: bug #1199311
heat/engine/hot.py
heat/tests/test_hot.py

index 801e72fba72419c38cdddb351526e104cf38a108..50374690fc061717e51dadd749ff96ec76e52985 100644 (file)
@@ -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'}
index 68d7c8ebd3caf1a453c6372c874e20c38b1a4fa9..d91ecef2fa0b5bf0ebe8f9449452f633ed761562 100644 (file)
@@ -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)