choria-io / mcorpc-ruby-support

Support libraries to enable Ruby agents and clients to communicate with the Choria Server
https://choria.io/
Apache License 2.0
1 stars 8 forks source link

Add a helper to access bolt task results #179

Closed smortex closed 2 years ago

smortex commented 2 years ago

Bolt tasks can return a Hash or a raw String. When a raw string is returned, it is wrapped in a JSON object and the output is placed in an _output key, so in any case, stdout contains a JSON representation of a data structure containing the return value of the task.

This is accessible through $result['data']['stdout'].parsejson which is a bit cumbersome.