Merge "Add Dimensions Default in AWS_CloudWatch_Alarm.yaml"

This commit is contained in:
Jenkins 2014-11-21 03:24:47 +00:00 committed by Gerrit Code Review
commit f3809ce6e1
3 changed files with 5 additions and 3 deletions

View File

@ -43,6 +43,7 @@ Parameters:
Default: ''
Dimensions:
Type: CommaDelimitedList
Default: ''
Mappings:
ComparisonOperatorMap:

View File

@ -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')

View File

@ -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',