Error getting relationshps in case of custom_def capability

Bug #1687598 reported by Miguel Caballer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
TOSCA Parser
Fix Released
High
Miguel Caballer

Bug Description

In case that you define a custom capability and use it in a node requirements (without specifying the node type) parsing fails with this error:

  File "toscaparser/tosca_template.py", line 101, in init
    self.topology_template = self._topology_template()
  File "toscaparser/tosca_template.py", line 120, in _topology_template
    None)
  File "toscaparser/topology_template.py", line 60, in init
    self.graph = ToscaGraph(self.nodetemplates)
  File "toscaparser/tpl_relationship_graph.py", line 19, in init
    self._create()
  File "toscaparser/tpl_relationship_graph.py", line 40, in _create
    relation = node.relationships
  File "toscaparser/nodetemplate.py", line 61, in relationships
    explicit = self._get_explicit_relationship(r, value)
  File "toscaparser/nodetemplate.py", line 140, in _get_explicit_relationship
    for rtype in self.type_definition.relationship.keys():
  File "toscaparser/elements/nodetype.py", line 86, in relationship
    relation = self._get_relation(key, value)
  File "toscaparser/elements/nodetype.py", line 117, in _get_relation
    ntype = NodeType(ndtype)
  File "toscaparser/elements/nodetype.py", line 30, in init
    super(NodeType, self).__init__(ntype, self.NODE_PREFIX, custom_def)
  File "toscaparser/elements/statefulentitytype.py", line 38, in init
    if entitytype.startswith(self.TOSCA + ":"):
AttributeError: 'NoneType' object has no attribute 'startswith'

Changed in tosca-parser:
assignee: nobody → Miguel Caballer (micafer1)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tosca-parser (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/461742

Changed in tosca-parser:
status: New → In Progress
Changed in tosca-parser:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tosca-parser (master)

Reviewed: https://review.openstack.org/461742
Committed: https://git.openstack.org/cgit/openstack/tosca-parser/commit/?id=c3e180db7928d9eb78b565e16749542a6a663d3d
Submitter: Jenkins
Branch: master

commit c3e180db7928d9eb78b565e16749542a6a663d3d
Author: Miguel Caballer <email address hidden>
Date: Tue May 2 13:34:00 2017 +0200

    Fix error getting relationshps in case of custom_def capability

    Change-Id: I5bbc21113451d17e887ee79426e4205d40f57f6a
    Related-Bug: #1687598

Changed in tosca-parser:
status: In Progress → Fix Committed
Changed in tosca-parser:
status: Fix Committed → Fix Released
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.