Using ip_address property of Port node causes errors

Bug #1566081 reported by Bob Haddleton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Heat Translator
Fix Released
Undecided
Bob Haddleton
tacker
In Progress
Medium
Bob Haddleton

Bug Description

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.

Changed in heat-translator:
assignee: nobody → Bob Haddleton (bob-haddleton)
description: updated
Changed in tacker:
assignee: nobody → Bob Haddleton (bob-haddleton)
Changed in heat-translator:
status: New → In Progress
Changed in tacker:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat-translator (master)

Reviewed: https://review.openstack.org/301412
Committed: https://git.openstack.org/cgit/openstack/heat-translator/commit/?id=4d6db7f639e3feacc8c22eda424f87ad340cd8a5
Submitter: Jenkins
Branch: master

commit 4d6db7f639e3feacc8c22eda424f87ad340cd8a5
Author: Bob Haddleton <email address hidden>
Date: Mon Apr 4 19:55:25 2016 -0500

    Fixed ip_address handling for tosca_network_port.py

    Closes-Bug: 1566081
    Change-Id: I37bdc3e6147597d6c7d81c59699edc9cd5caacdb

Changed in heat-translator:
status: In Progress → Fix Released
Changed in tacker:
importance: Undecided → Low
importance: Low → Medium
milestone: none → newton-2
Revision history for this message
Matt Rutkowski (mrutkows) wrote :

It appears that tosca-translator is moving forward adopting the CSD03 defn. of CP as follows (See https://review.openstack.org/#/c/310359/):

Here is the link to the v1.0 NFV spec. CSD03:
http://docs.oasis-open.org/tosca/tosca-nfv/v1.0/csd03/tosca-nfv-v1.0-csd03.pdf

Section 8.5.3:
tosca.nodes.nfv.CP:
  derived_from: tosca.nodes.network.Port
  properties:
    type:
      type: string
      required: false
    anti_spoof_protection:
      type: boolean
      required: false
  requirements:
    - virtualLink:
        capability: tosca.capabilities.nfv.VirtualLinkable
        relationship: tosca.relationships.nfv.VirtualLinksTo

    - virtualbinding:
        capability: tosca.capabilities.nfv.VirtualBindable
        relationship: tosca.relationships.nfv.VirtualBindsTo
  attributes:
    address:
      type: string

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.