Merge "Fix for HOT parameter types conversion" into stable/juno

This commit is contained in:
Jenkins 2015-07-10 10:34:05 +00:00 committed by Gerrit Code Review
commit 24f20f83b4
1 changed files with 11 additions and 7 deletions

View File

@ -116,12 +116,12 @@ class HotPackage(murano.packages.application_package.ApplicationPackage):
contract = '$'
parameter_type = value['type']
if parameter_type == 'string':
if parameter_type in ('string', 'comma_delimited_list', 'json'):
contract += '.string()'
elif parameter_type == 'number':
contract += '.int()'
elif parameter_type == 'json':
contract += '.object()'
elif parameter_type == 'boolean':
contract += '.bool()'
else:
raise ValueError('Unsupported parameter type ' + parameter_type)
@ -295,10 +295,15 @@ class HotPackage(murano.packages.application_package.ApplicationPackage):
'label': name.title().replace('_', ' ')
}
parameter_type = parameter_spec['type']
if parameter_type == 'string':
translated['type'] = 'string'
elif parameter_type == 'number':
if parameter_type == 'number':
translated['type'] = 'integer'
elif parameter_type == 'boolean':
translated['type'] = 'boolean'
else:
# string, json, and comma_delimited_list parameters are all
# displayed as strings in UI. Any unsuported parameter would also
# be displayed as strings.
translated['type'] = 'string'
if 'description' in parameter_spec:
translated['description'] = parameter_spec['description']
@ -404,5 +409,4 @@ class HotPackage(murano.packages.application_package.ApplicationPackage):
}
]
}
return translated