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 = '$'
|
contract = '$'
|
||||||
|
|
||||||
parameter_type = value['type']
|
parameter_type = value['type']
|
||||||
if parameter_type == 'string':
|
if parameter_type in ('string', 'comma_delimited_list', 'json'):
|
||||||
contract += '.string()'
|
contract += '.string()'
|
||||||
elif parameter_type == 'number':
|
elif parameter_type == 'number':
|
||||||
contract += '.int()'
|
contract += '.int()'
|
||||||
elif parameter_type == 'json':
|
elif parameter_type == 'boolean':
|
||||||
contract += '.object()'
|
contract += '.bool()'
|
||||||
else:
|
else:
|
||||||
raise ValueError('Unsupported parameter type ' + parameter_type)
|
raise ValueError('Unsupported parameter type ' + parameter_type)
|
||||||
|
|
||||||
|
@ -295,10 +295,15 @@ class HotPackage(murano.packages.application_package.ApplicationPackage):
|
||||||
'label': name.title().replace('_', ' ')
|
'label': name.title().replace('_', ' ')
|
||||||
}
|
}
|
||||||
parameter_type = parameter_spec['type']
|
parameter_type = parameter_spec['type']
|
||||||
if parameter_type == 'string':
|
if parameter_type == 'number':
|
||||||
translated['type'] = 'string'
|
|
||||||
elif parameter_type == 'number':
|
|
||||||
translated['type'] = 'integer'
|
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:
|
if 'description' in parameter_spec:
|
||||||
translated['description'] = parameter_spec['description']
|
translated['description'] = parameter_spec['description']
|
||||||
|
@ -404,5 +409,4 @@ class HotPackage(murano.packages.application_package.ApplicationPackage):
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
return translated
|
return translated
|
||||||
|
|
Loading…
Reference in New Issue