-
Bug
-
Resolution: Done
-
High
-
Casablanca Release
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.