diff --git a/etc/heat/templates/AWS_CloudWatch_Alarm.yaml b/etc/heat/templates/AWS_CloudWatch_Alarm.yaml index d2c1e7b6fe..e21e500d69 100644 --- a/etc/heat/templates/AWS_CloudWatch_Alarm.yaml +++ b/etc/heat/templates/AWS_CloudWatch_Alarm.yaml @@ -73,14 +73,14 @@ Resources: threshold: Ref: Threshold alarm_actions: - "Fn::Split": [",", {Ref: AlarmActions}] + Ref: AlarmActions ok_actions: - "Fn::Split": [",", {Ref: OKActions}] + Ref: OKActions insufficient_data_actions: - "Fn::Split": [",", {Ref: InsufficientDataActions}] + Ref: InsufficientDataActions statistic: "Fn::FindInMap": [StatisticMap, {Ref: Statistic}, Ceilometer] comparison_operator: "Fn::FindInMap": [ComparisonOperatorMap, {Ref: ComparisonOperator}, Ceilometer] matching_metadata: - "Fn::MemberListToMap": [Name, Value, {"Fn::Split": [",", {Ref: Dimensions}]}] + "Fn::MemberListToMap": [Name, Value, {Ref: Dimensions}] diff --git a/heat/engine/parameters.py b/heat/engine/parameters.py index dd7d28611a..8bc0598ccf 100644 --- a/heat/engine/parameters.py +++ b/heat/engine/parameters.py @@ -316,9 +316,8 @@ class CommaDelimitedListParam(Parameter, collections.Sequence): # only parse when value is not already a list if isinstance(value, list): return value - try: - if value: + if value is not None: 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 b6dfc98ec3..e5a2d5c653 100644 --- a/heat/tests/test_parameters.py +++ b/heat/tests/test_parameters.py @@ -224,6 +224,12 @@ class ParameterTest(testtools.TestCase): self.new_parameter, 'p', schema, '2') self.assertIn('wibble', str(err)) + def test_list_value_list_default_empty(self): + schema = {'Type': 'CommaDelimitedList'} + schema['Default'] = '' + p = self.new_parameter('p', schema) + self.assertEqual([''], p.value()) + def test_list_value_list_good(self): schema = {'Type': 'CommaDelimitedList', 'AllowedValues': ['foo', 'bar', 'baz']}