Merge "Fix for HOT parameter types conversion" into stable/juno
This commit is contained in:
commit
24f20f83b4
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue