diff --git a/heat/engine/constraints.py b/heat/engine/constraints.py index 60dff634d1..2da0b39e36 100644 --- a/heat/engine/constraints.py +++ b/heat/engine/constraints.py @@ -173,8 +173,6 @@ class Schema(collections.Mapping): elif self.type == self.NUMBER: return Schema.str_to_num(value) elif self.type == self.STRING: - if value and not isinstance(value, basestring): - raise ValueError() return str(value) elif self.type == self.BOOLEAN: return strutils.bool_from_string(str(value), strict=True) diff --git a/heat/tests/test_constraints.py b/heat/tests/test_constraints.py index 7c77f70b3e..5c3550fd60 100644 --- a/heat/tests/test_constraints.py +++ b/heat/tests/test_constraints.py @@ -390,9 +390,12 @@ class SchemaTest(testtools.TestCase): self.assertIsInstance(res, basestring) res = schema.to_schema_type('1') self.assertIsInstance(res, basestring) - err = self.assertRaises(ValueError, schema.to_schema_type, 1) - self.assertEqual('Value "1" is invalid for data type "String".', - six.text_type(err)) + res = schema.to_schema_type(1) + self.assertIsInstance(res, basestring) + res = schema.to_schema_type(True) + self.assertIsInstance(res, basestring) + res = schema.to_schema_type(None) + self.assertIsInstance(res, basestring) def test_to_schema_type_boolean(self): '''Test Schema.to_schema_type method for type Boolean.'''