Force list when returning map(replaced_list_value, template_part)
As suggested by Jiri in this review adding a list() around 'map(replaced_list_value, template_part)' fixes the py3 issue for me. Closes-bug: #1819737 Change-Id: I1241985eac1aa7e092a11db5a443da0055ff0141
This commit is contained in:
parent
969e01ad88
commit
f388fceeef
|
@ -811,6 +811,12 @@ class TestReplaceLinks(TestCase):
|
|||
source = (
|
||||
'description: my template\n'
|
||||
'heat_template_version: "2014-10-16"\n'
|
||||
'parameters:\n'
|
||||
' foo:\n'
|
||||
' default: ["bar"]\n'
|
||||
' type: json\n'
|
||||
' bar:\n'
|
||||
' default: []\n'
|
||||
'resources:\n'
|
||||
' test_config:\n'
|
||||
' properties:\n'
|
||||
|
@ -820,6 +826,12 @@ class TestReplaceLinks(TestCase):
|
|||
expected = (
|
||||
'description: my template\n'
|
||||
'heat_template_version: "2014-10-16"\n'
|
||||
'parameters:\n'
|
||||
' foo:\n'
|
||||
' default: ["bar"]\n'
|
||||
' type: json\n'
|
||||
' bar:\n'
|
||||
' default: []\n'
|
||||
'resources:\n'
|
||||
' test_config:\n'
|
||||
' properties:\n'
|
||||
|
|
|
@ -901,7 +901,7 @@ def replace_links_in_template(template_part, link_replacement):
|
|||
return {k: replaced_dict_value(k, v)
|
||||
for k, v in six.iteritems(template_part)}
|
||||
elif isinstance(template_part, list):
|
||||
return map(replaced_list_value, template_part)
|
||||
return list(map(replaced_list_value, template_part))
|
||||
else:
|
||||
return template_part
|
||||
|
||||
|
|
Loading…
Reference in New Issue