diff --git a/etc/heat/templates/AWS_CloudWatch_Alarm.yaml b/etc/heat/templates/AWS_CloudWatch_Alarm.yaml index e21e500d6..2e5f36625 100644 --- a/etc/heat/templates/AWS_CloudWatch_Alarm.yaml +++ b/etc/heat/templates/AWS_CloudWatch_Alarm.yaml @@ -43,6 +43,7 @@ Parameters: Default: '' Dimensions: Type: CommaDelimitedList + Default: '' Mappings: ComparisonOperatorMap: diff --git a/heat/engine/parameters.py b/heat/engine/parameters.py index 2118f8aff..76f108f89 100644 --- a/heat/engine/parameters.py +++ b/heat/engine/parameters.py @@ -335,6 +335,8 @@ class CommaDelimitedListParam(Parameter, collections.Sequence): return value try: if value is not None: + if value == '': + return [] return value.split(',') except (KeyError, AttributeError) as err: message = _('Value must be a comma-delimited list string: %s') diff --git a/heat/tests/test_parameters.py b/heat/tests/test_parameters.py index ef0885563..8c0e6c209 100644 --- a/heat/tests/test_parameters.py +++ b/heat/tests/test_parameters.py @@ -251,10 +251,9 @@ class ParameterTest(testtools.TestCase): self.assertIn('wibble', six.text_type(err)) def test_list_value_list_default_empty(self): - schema = {'Type': 'CommaDelimitedList'} - schema['Default'] = '' + schema = {'Type': 'CommaDelimitedList', 'Default': ''} p = self.new_parameter('p', schema) - self.assertEqual([''], p.value()) + self.assertEqual([], p.value()) def test_list_value_list_good(self): schema = {'Type': 'CommaDelimitedList',