When a coustom defined datatype is used in a function and an attribute is requested in a the function an InvalidTypeError error is raised.
toscaparser.common.exception.ValidationError:
The pre-parsed input failed validation with the following error(s):
InvalidTypeError: Type "tosca.datatypes.SomeDataType" is not a valid type.
...
self.tosca = ToscaTemplate(yaml_dict_tpl=copy.deepcopy(self.yaml))
File /usr/local/lib/python3.8/dist-packages/toscaparser/tosca_template.py, line 103, in __init__
self.topology_template = self._topology_template()
File /usr/local/lib/python3.8/dist-packages/toscaparser/tosca_template.py, line 118, in _topology_template
return TopologyTemplate(self._tpl_topology_template(),
File /usr/local/lib/python3.8/dist-packages/toscaparser/topology_template.py, line 63, in __init__
self._process_intrinsic_functions()
File /usr/local/lib/python3.8/dist-packages/toscaparser/topology_template.py, line 338, in _process_intrinsic_functions
func = functions.get_function(self, self.outputs, output.value)
File /usr/local/lib/python3.8/dist-packages/toscaparser/functions.py, line 897, in get_function
return func(tosca_tpl, node_template, func_name, func_args)
File /usr/local/lib/python3.8/dist-packages/toscaparser/functions.py, line 51, in __init__
self.validate()
File /usr/local/lib/python3.8/dist-packages/toscaparser/functions.py, line 182, in validate
data_type = DataType(value_type)
File /usr/local/lib/python3.8/dist-packages/toscaparser/elements/datatype.py, line 21, in __init__
super(DataType, self).__init__(datatypename,
File /usr/local/lib/python3.8/dist-packages/toscaparser/elements/statefulentitytype.py, line 50, in __init__
ExceptionCollector.appendException(
KeyError: 'Illegal arguments for function "get_attribute". Attribute name "tasks" not found in "tosca.datatypes.SomeDataType"'
...
self.tosca = ToscaTemplate(yaml_dict_tpl=copy.deepcopy(self.yaml))
File /usr/local/lib/python3.8/dist-packages/toscaparser/tosca_template.py, line 103, in __init__
self.topology_template = self._topology_template()
File /usr/local/lib/python3.8/dist-packages/toscaparser/tosca_template.py, line 118, in _topology_template
return TopologyTemplate(self._tpl_topology_template(),
File /usr/local/lib/python3.8/dist-packages/toscaparser/topology_template.py, line 63, in __init__
self._process_intrinsic_functions()
File /usr/local/lib/python3.8/dist-packages/toscaparser/topology_template.py, line 338, in _process_intrinsic_functions
func = functions.get_function(self, self.outputs, output.value)
File /usr/local/lib/python3.8/dist-packages/toscaparser/functions.py, line 897, in get_function
return func(tosca_tpl, node_template, func_name, func_args)
File /usr/local/lib/python3.8/dist-packages/toscaparser/functions.py, line 51, in __init__
self.validate()
File /usr/local/lib/python3.8/dist-packages/toscaparser/functions.py, line 189, in validate
ExceptionCollector.appendException(
Thanks Miguel!!