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.
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): bobh/git/ heat-translator /translator/ tests/test_ tosca_hot_ translation. py", line 587, in test_hot_ translate_ helloworld_ with_userkey bobh/git/ heat-translator /translator/ common/ utils.py" , line 243, in compare_ tosca_translati on_with_ hot translate( ) bobh/git/ heat-translator /translator/ hot/tosca_ translator. py", line 42, in translate hot_template. resources = self.node_ translator. translate( ) bobh/git/ heat-translator /translator/ hot/translate_ node_templates. py", line 151, in translate _nodetemplates( ) bobh/git/ heat-translator /translator/ hot/translate_ node_templates. py", line 280, in _translate_ nodetemplates _recursive_ handle_ properties( resource) bobh/git/ heat-translator /translator/ hot/translate_ node_templates. py", line 165, in _recursive_ handle_ properties handle_ properties( ) bobh/git/ heat-translator /translator/ hot/tosca/ tosca_network_ port.py" , line 59, in handle_properties ip['ip_ address' ] = value
File "/home/
params)
File "/home/
output = translate.
File "/home/
self.
File "/home/
return self._translate
File "/home/
self.
File "/home/
resource.
File "/home/
fixed_
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