diff --git a/heat/engine/properties.py b/heat/engine/properties.py index 20217d8f76..a4861b0510 100644 --- a/heat/engine/properties.py +++ b/heat/engine/properties.py @@ -135,7 +135,8 @@ class Schema(constr.Schema): param.STRING: cls.STRING, param.NUMBER: cls.NUMBER, param.LIST: cls.LIST, - param.MAP: cls.MAP + param.MAP: cls.MAP, + param.BOOLEAN: cls.BOOLEAN } # make update_allowed true by default on TemplateResources diff --git a/heat/tests/test_provider_template.py b/heat/tests/test_provider_template.py index a8a9f84751..6bf920757b 100644 --- a/heat/tests/test_provider_template.py +++ b/heat/tests/test_provider_template.py @@ -339,6 +339,37 @@ class ProviderTemplateTest(HeatTestCase): self.assertRaises(exception.StackValidationFailed, temp_res.validate) + def test_boolean_type_provider(self): + provider = { + 'HeatTemplateFormatVersion': '2012-12-12', + 'Parameters': { + 'Foo': {'Type': 'Boolean'}, + }, + } + files = {'test_resource.template': json.dumps(provider)} + + class DummyResource(object): + properties_schema = {"Foo": + properties.Schema(properties.Schema.BOOLEAN)} + attributes_schema = {} + + env = environment.Environment() + resource._register_class('DummyResource', DummyResource) + env.load({'resource_registry': + {'DummyResource': 'test_resource.template'}}) + stack = parser.Stack(utils.dummy_context(), 'test_stack', + parser.Template( + {'HeatTemplateFormatVersion': '2012-12-12'}, + files=files), env=env, + stack_id=str(uuid.uuid4())) + + definition = rsrc_defn.ResourceDefinition('test_t_res', + "DummyResource", + {"Foo": "False"}) + temp_res = template_resource.TemplateResource('test_t_res', + definition, stack) + self.assertIsNone(temp_res.validate()) + def test_get_template_resource(self): # assertion: if the name matches {.yaml|.template} we get the # TemplateResource class.