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'
Related fix proposed to branch: master /review. openstack. org/461742
Review: https:/