ispras / clouni

Cloud Unifier Tool for Service Orchestration
Apache License 2.0
5 stars 8 forks source link

Brackets in mapping #35

Closed bura2017 closed 2 years ago

bura2017 commented 2 years ago

Clouni CLI command which was executed clouni --template-file tosca-server-example.yaml --cluster-name test --provider openstack --debug

Input TOSCA template


topology_template:
  node_templates:
    tosca_server_example:
      type: tosca.nodes.Compute
      properties:
        meta: "cube_master=true"
        public_address: 10.100.157.77
        networks:
          default:
            network_name: sandbox_net
      capabilities:
        host:
          properties:
            num_cpus: 1
            disk_size: 10 GiB
            mem_size: 1 GiB
        endpoint:
          properties:
            protocol: tcp
            port: 22
            initiator: target
            ip_address: 0.0.0.0
        os:
          properties:
            architecture: x86_64
            type: cirros
            version: 0.4.0

**Current result**
Some modules didn't convert multiple brackets {{{{
~~~yaml
  - set_fact:
      target_objects: '{{{{ facts_result["ansible_facts"]["openstack_networks"] }}}}'

Expected result Brackets must be converted correctly

  - set_fact:
      target_objects: '{{ facts_result["ansible_facts"]["openstack_networks"] }}'

Describe the bug Function format_value from translating_to_provider.py is called several times on the same value - that's why some brackets converted several times and others are not converted