Class MCollective::RPC::ActionRunner
In: lib/mcollective/rpc/actionrunner.rb
Parent: Object

A helper used by RPC::Agent#implemented_by to delegate an action to an external script. At present only JSON based serialization is supported in future ones based on key=val pairs etc will be added

It serializes the request object into an input file and creates an empty output file. It then calls the external command reading the output file at the end.

any STDERR gets logged at error level and any STDOUT gets logged at info level.

It will interpret the exit code from the application the same way RPC::Reply#fail! and fail handles their codes creating a consistent interface, the message part of the fail message will come from STDERR

Generally externals should just exit with code 1 on failure and print to STDERR, this is exactly what Perl die() does and translates perfectly to our model

It uses the MCollective::Shell wrapper to call the external application

Methods

Attributes

action  [R] 
agent  [R] 
command  [R] 
format  [R] 
request  [R] 
stderr  [R] 
stdout  [R] 

Public Class methods

Public Instance methods

[Validate]