diff --git a/tripleoclient/utils.py b/tripleoclient/utils.py
index 066e74ce..0b0c13de 100644
--- a/tripleoclient/utils.py
+++ b/tripleoclient/utils.py
@@ -901,7 +901,9 @@ 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)
+ # NOTE(hjensas): If the list have no items there is nothing to replace.
+ if template_part:
+ return map(replaced_list_value, template_part)
else:
return template_part
If I get it right we are doing some recursive function calling, trying to find dicts with 'get_file' or 'type' and replace things based on link_replacement. If the template_part is a list, and it's empty there is nothing to replace. So we can simply return the template_part?
@lmiccini - Would this fix it?
diff --git a/tripleoclient /utils. py b/tripleoclient /utils. py /utils. py /utils. py links_in_ template( template_ part, link_replacement): dict_value( k, v)
for k, v in six.iteritems( template_ part)} template_ part, list): list_value, template_part) list_value, template_part)
index 066e74ce..0b0c13de 100644
--- a/tripleoclient
+++ b/tripleoclient
@@ -901,7 +901,9 @@ def replace_
return {k: replaced_
elif isinstance(
- return map(replaced_
+ # NOTE(hjensas): If the list have no items there is nothing to replace.
+ if template_part:
+ return map(replaced_
else:
return template_part
If I get it right we are doing some recursive function calling, trying to find dicts with 'get_file' or 'type' and replace things based on link_replacement. If the template_part is a list, and it's empty there is nothing to replace. So we can simply return the template_part?