Orange-OpenSource / Cloudnet-TOSCA-toolbox

Set of tools for validating, visualizing and analyzing TOSCA resource descriptions
https://toscatoolbox.orange.com
MIT License
14 stars 11 forks source link

Traceback when using caps and reqs #55

Closed pmjordan closed 2 years ago

pmjordan commented 2 years ago

When translating the attached example.txt file I get a traceback as follows


[example.txt](https://github.com/Orange-OpenSource/Cloudnet-TOSCA-toolbox/files/8366434/example.txt)
Translate example.txt...
[Info] example.txt: TOSCA syntax checking
[Info] example.txt: No service template catalog to load.
[Info] example.txt: TOSCA type checking...
[Info] example.txt@57,13: topology_template:node_templates:PrdOrdCptVd:requirements[0]:TMF620_requirement:node: PrdCtgMgmt - TMF620_capability capability found

Traceback (most recent call last):
  File "/cloudnet/tosca/tosca2cloudnet.py", line 150, in main
    if type_checker.check() == False:  # or type_checker.nb_errors > 0:
  File "/cloudnet/tosca/type_system.py", line 1081, in check
    self.check_service_template_definition(self.tosca_service_template.get_yaml())
  File "/cloudnet/tosca/type_system.py", line 1572, in check_service_template_definition
    self.check_topology_template(topology_template, syntax.TOPOLOGY_TEMPLATE)
  File "/cloudnet/tosca/type_system.py", line 3451, in check_topology_template
    iterate_over_map(self.check_node_template, syntax.NODE_TEMPLATES)
  File "/cloudnet/tosca/type_system.py", line 3443, in iterate_over_map
    check_method(
  File "/cloudnet/tosca/type_system.py", line 5630, in check_node_template
    self.check_requirement_assignment(
  File "/cloudnet/tosca/type_system.py", line 5174, in check_requirement_assignment
    ) = self.check_type_in_definition(
  File "/cloudnet/tosca/type_system.py", line 1332, in check_type_in_definition
    checked = self.check_type(
  File "/cloudnet/tosca/type_system.py", line 1298, in check_type
    if self.check_type_existence(type_kinds, the_type, context_error_message):
  File "/cloudnet/tosca/type_system.py", line 1266, in check_type_existence
    type_name = self.type_system.get_type_uri(type_name)
  File "/cloudnet/tosca/type_system.py", line 147, in get_type_uri
    if self.types.get(short_type_name) is None:
TypeError: unhashable type: 'dict'```
philippemerle commented 2 years ago

@pmjordan: could you check if the last commit resolves this issue?

pmjordan commented 2 years ago

Thank you again. Issue has been resolved.