occiware/ecore

[curl command generator]Add support to encoded single quote in occi attributes values

Closed this issue · 0 comments

example :
curl -v -X PUT http://localhost:8080/compute/8dd7a35c-165a-4be6-97be-f88f75aeb406 -H 'Content-Type: text/occi' -H 'Category: compute; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind", vmimage; scheme="http://occiware.org/occi/infrastructure/crtp/backend#"; class="mixin", vmwarefolders; scheme="http://occiware.org/occi/infrastructure/crtp/backend#"; class="mixin", user_data; scheme="http://schemas.ogf.org/occi/infrastructure/compute#"; class="mixin", credential; scheme="http://occiware.org/occi/infrastructure/crtp/backend#"; class="mixin";' -H 'X-OCCI-Attribute: occi.core.id="8dd7a35c-165a-4be6-97be-f88f75aeb406"' -H 'X-OCCI-Attribute: occi.core.title="martserver"' -H 'X-OCCI-Attribute: occi.core.summary="MartServer Inria & Scalair VMware infrastructure test instance."' -H 'X-OCCI-Attribute: occi.compute.userdata="touch userdata.txt | echo 'toto:1,titi: hello world' > /tmp/userdata.txt"' -H 'X-OCCI-Attribute: user="test"' -H 'X-OCCI-Attribute: password="mypass"' ...

See user data part.
occi.compute.userdata="touch userdata.txt | echo 'toto:1,titi: hello world' > /tmp/userdata.txt"'
This may be replaced by:
occi.compute.userdata="touch userdata.txt | echo \u0027toto:1,titi: hello world\u0027 > /tmp/userdata.txt"'