Merge "heat engine : map DBInstance DBSecurityGroups parameter correctly"

This commit is contained in:
Jenkins 2013-01-07 16:17:32 +00:00 committed by Gerrit Code Review
commit 0d683a1fff
2 changed files with 10 additions and 3 deletions

View File

@ -46,7 +46,8 @@ mysql_template = r'''
},
"DBSecurityGroups" : {
"Type": "List"
"Type": "CommaDelimitedList",
"Default": ""
},
"Port" : {
@ -214,7 +215,13 @@ class DBInstance(stack.Stack):
# Ignore the not implemented ones
for key, value in self.properties_schema.items():
if value.get('Implemented', True) and key != 'Engine':
params[key] = self.properties[key]
# There is a mismatch between the properties "List" format
# and the parameters "CommaDelimitedList" format, so we need
# to translate lists into the expected comma-delimited form
if isinstance(self.properties[key], list):
params[key] = ','.join(self.properties[key])
else:
params[key] = self.properties[key]
p = self.stack.resolve_static_data(params)
return p

View File

@ -83,7 +83,7 @@ class DBInstanceTest(unittest.TestCase):
'AllocatedStorage': u'5',
'DBInstanceClass': u'db.m1.small',
'DBName': u'wordpress',
'DBSecurityGroups': [],
'DBSecurityGroups': '',
'KeyName': 'test',
'MasterUserPassword': u'admin',
'MasterUsername': u'admin',