Add some documentation on how to properly pass JSON to the scripts
Thanks to misc for helping figuring this out. Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
parent
8e730bd249
commit
052a5963d2
1 changed files with 10 additions and 0 deletions
10
README.rst
10
README.rst
|
@ -70,6 +70,16 @@ Good Practice
|
||||||
non-zero return code carefully so as to not kill all the workers and break
|
non-zero return code carefully so as to not kill all the workers and break
|
||||||
loopabull
|
loopabull
|
||||||
|
|
||||||
|
* Passing JSON blobs to a shell script can be tricky, especially with regards
|
||||||
|
to the quotes used. Imaging a fedmsg messages containing itself some JSON
|
||||||
|
fields (we do have some), you quickly end up with a mix of single-quote
|
||||||
|
``'`` and double-quotes ``"``. The proper way to pass the message to the
|
||||||
|
script avoiding issues with quotes is to use: ``{{ msg | to_json | quote }}``
|
||||||
|
(note the lack of quotes surrounding this, ``| quote`` takes care of adding
|
||||||
|
them).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.. _Ansible: https://github.com/ansible/ansible
|
.. _Ansible: https://github.com/ansible/ansible
|
||||||
.. _fedmsg: http://www.fedmsg.com/en/latest/
|
.. _fedmsg: http://www.fedmsg.com/en/latest/
|
||||||
.. _Fedora: https://getfedora.org/
|
.. _Fedora: https://getfedora.org/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue