2018-07-02 10:53:13 |
Miguel Caballer |
description |
If you set the host requirement in long format (setting the capability type and/or the relatinship type) the parser fails:
some:
type: tosca.nodes.SoftwareComponent
requirements:
- host:
node: server
capability: tosca.capabilities.indigo.Container
relationship: tosca.relationships.HostedOn
This is the error:
File "/home/micafer/codigo/git_im/im/toscaparser/tosca_template.py", line 101, in __init__
self.topology_template = self._topology_template()
File "/home/micafer/codigo/git_im/im/toscaparser/tosca_template.py", line 120, in _topology_template
None)
File "/home/micafer/codigo/git_im/im/toscaparser/topology_template.py", line 63, in __init__
self._process_intrinsic_functions()
File "/home/micafer/codigo/git_im/im/toscaparser/topology_template.py", line 252, in _process_intrinsic_functions
prop.value)
File "/home/micafer/codigo/git_im/im/toscaparser/functions.py", line 856, in get_function
return func(tosca_tpl, node_template, func_name, func_args)
File "/home/micafer/codigo/git_im/im/toscaparser/functions.py", line 54, in __init__
self.validate()
File "/home/micafer/codigo/git_im/im/toscaparser/functions.py", line 146, in validate
self._find_node_template_containing_attribute()
File "/home/micafer/codigo/git_im/im/toscaparser/functions.py", line 215, in _find_node_template_containing_attribute
node_tpl = self._find_node_template(self.args[0])
File "/home/micafer/codigo/git_im/im/toscaparser/functions.py", line 258, in _find_node_template
node_tpl = self._find_host_containing_attribute()
File "/home/micafer/codigo/git_im/im/toscaparser/functions.py", line 239, in _find_host_containing_attribute
target_type = target_node.type_definition
AttributeError: 'NoneType' object has no attribute 'type_definition' |
If you set the host requirement in long format (setting the capability type and/or the relatinship type) and the function get_property or get_attribute are used the parser fails:
node_types:
tosca.nodes.SomeSoftwareComponent:
derived_from: tosca.nodes.SoftwareComponent
properties:
test:
type: string
topology_template:
node_templates:
some:
type: tosca.nodes.SomeSoftwareComponent
properties:
test: { get_attribute: [ HOST, private_address ] }
requirements:
- host:
node: server
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
server:
type: tosca.nodes.Compute
This is the 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 63, in __init__
self._process_intrinsic_functions()
File "toscaparser/topology_template.py", line 252, in _process_intrinsic_functions
prop.value)
File "toscaparser/functions.py", line 856, in get_function
return func(tosca_tpl, node_template, func_name, func_args)
File "toscaparser/functions.py", line 54, in __init__
self.validate()
File "toscaparser/functions.py", line 146, in validate
self._find_node_template_containing_attribute()
File "toscaparser/functions.py", line 215, in _find_node_template_containing_attribute
node_tpl = self._find_node_template(self.args[0])
File "toscaparser/functions.py", line 258, in _find_node_template
node_tpl = self._find_host_containing_attribute()
File "toscaparser/functions.py", line 239, in _find_host_containing_attribute
target_type = target_node.type_definition
AttributeError: 'NoneType' object has no attribute 'type_definition' |
|