Don't return list in a parameter as this : try to translate the elements of the list.

Change-Id: I515c806a28f63ab902d683a7e8260fcd029d585f
This commit is contained in:
Mathieu Velten 2016-07-01 12:08:15 +02:00
parent ebc1edb12e
commit 63d6003b3d
3 changed files with 16 additions and 1 deletions

View File

@ -135,7 +135,7 @@ log = logging.getLogger('heat-translator')
TOSCA_TO_HOT_TYPE = _generate_type_map()
BASE_TYPES = six.string_types + six.integer_types + (dict, list, OrderedDict)
BASE_TYPES = six.string_types + six.integer_types + (dict, OrderedDict)
class TranslateNodeTemplates(object):
@ -415,6 +415,14 @@ class TranslateNodeTemplates(object):
if res:
return res
if isinstance(param_value, list):
translated_list = []
for elem in param_value:
translated_elem = self.translate_param_value(elem, resource)
if translated_elem:
translated_list.append(translated_elem)
return translated_list
if isinstance(param_value, BASE_TYPES):
return param_value

View File

@ -46,3 +46,7 @@ outputs:
template: $s0$s1$s2
static_map_val:
value: static_value
test_list_of_functions:
value:
- get_input: map_val
- static_value

View File

@ -79,3 +79,6 @@ topology_template:
concat_map_val:
value: { concat: [ 'http://', { get_property: [ myapp, myfeature, my_map, test_key ] }, ':8080' ] }
test_list_of_functions:
value: [ { get_property: [ myapp, myfeature, my_map, test_key ] }, { get_property: [ myapp, myfeature, my_map, test_key_static ] } ]