tliron / puccini

Cloud topology management and deployment tools based on TOSCA
https://puccini.cloud
Apache License 2.0
88 stars 20 forks source link

"string" instead of "list" #87

Closed philippemerle closed 2 years ago

philippemerle commented 2 years ago

Puccini produces a problem on the following service template (a simplified version of an ETSI NFV SOL001 example):

tosca_definitions_version: tosca_simple_yaml_1_3
node_types:
  VNF:
    derived_from: tosca.nodes.Root
    properties:
      vnfm_info:
        type: list
        required: true
        entry_schema:
          type: string
  MyVNF:
    derived_from: VNF
    properties:
      vnfm_info:
        type: list
        entry_schema:
          type: string
        constraints: [ equal: [ '0:MyCompany-1.0.0' ] ]
topology_template:
  node_templates:
    node1:
      type: MyVNF
      properties:
        vnfm_info:
          - '0:MyCompany-1.0.0'
$ puccini-tosca compile --quirk etsinfv vnfm_info.yaml 
PROBLEMS (1)
  file:.../vnfm_info.yaml
    @25,13 topology_template.node_templates["node1"].properties["vnfm_info"][0]: "string" instead of "list"

When commenting the constraints: [ equal: [ '0:MyCompany-1.0.0' ] ] line, the problem disappears.

Why does the constraints: [ equal: [ '0:MyCompany-1.0.0' ] ] line introduce the problem?

tliron commented 2 years ago

The equal constraint accepts a single argument, not a list:

constraints: [ equal: '0:MyCompany-1.0.0' ]
philippemerle commented 2 years ago

Thank @tliron. I will inform the TC of ETSI NFV SOL 001 that constraints: [ equal: '0:MyCompany-1.0.0' ] is not TOSCA valid.

jpc4242 commented 1 year ago

BTW: SOL001 draft 431v425 already uses valid_values for the contraint

contraints: [ valid_values: [['0:MyCompany-1.0.0' ]]]