Uploaded image for project: 'Service Design and Creation'
  1. Service Design and Creation
  2. SDC-1918

SDC can not handle complex string in tosca yaml

XMLWordPrintable

      When onboarding a csar with complex yaml string, such as the user_data property defined as the followings:

       

      VDU_vgw_0:
         type: tosca.nodes.nfv.Vdu.Compute
         properties:
           name: { get_input: vgw_name_0 }
           description: vgw
           ... ... 
           user_data: |
             #!/bin/bash
             METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
             apt-get -y install jq
             get_metadata ()  {
                 echo $METADATA | jq -r ".meta.$1"
             }
      

        The the user_data property will completely be dropped in the exported SDC csar's tosca template, which is not the expected behavior. 

      Also, if we have the user_data property defined as the following string (deleting the first line staring with #!):

       

      VDU_vgw_0:
          type: tosca.nodes.nfv.Vdu.Compute
          properties:
            name: { get_input: vgw_name_0 }
            description: vgw
            ... ...
            user_data: |
             METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json`
             apt-get -y install jq
             get_metadata ()  {
                 echo $METADATA | jq -r ".meta.$1"
             }
      

      The user_data property in the exported SDC csar's tsoca template does NOT contain the new line '\n' character in each of the line, leaving the user_data property as a single line string in the exported csar, which is also not the expected behavior.

       

      It seems there is a bug when SDC deals with the string in tosca yaml.

       

            lianhaolu lianhaolu
            lianhaolu lianhaolu
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: