Comment 0 for bug 1566081

Revision history for this message
Bob Haddleton (bob-haddleton) wrote :

When the ip_address property of a tosca.nodes.network.Port object is specified heat-translator fails with an error from tosca_network_port.py:

Traceback (most recent call last):
  File "/home/bobh/git/heat-translator/translator/tests/test_tosca_hot_translation.py", line 587, in test_hot_translate_helloworld_with_userkey
    params)
  File "/home/bobh/git/heat-translator/translator/common/utils.py", line 243, in compare_tosca_translation_with_hot
    output = translate.translate()
  File "/home/bobh/git/heat-translator/translator/hot/tosca_translator.py", line 42, in translate
    self.hot_template.resources = self.node_translator.translate()
  File "/home/bobh/git/heat-translator/translator/hot/translate_node_templates.py", line 151, in translate
    return self._translate_nodetemplates()
  File "/home/bobh/git/heat-translator/translator/hot/translate_node_templates.py", line 280, in _translate_nodetemplates
    self._recursive_handle_properties(resource)
  File "/home/bobh/git/heat-translator/translator/hot/translate_node_templates.py", line 165, in _recursive_handle_properties
    resource.handle_properties()
  File "/home/bobh/git/heat-translator/translator/hot/tosca/tosca_network_port.py", line 59, in handle_properties
    fixed_ip['ip_address'] = value
TypeError: list indices must be integers, not str

The problem is that tosca_network_port.py declares fixed_ips = [] instead of fixed_ips = {}, and then it uses it as a dict.

Affects: tacker