RPC

pymco.rpc

MCollective RPC calls support.

class pymco.rpc.SimpleAction(config, msg, agent, logger=<logging.Logger object>, **kwargs)[source]

Single RPC call to MCollective

Parameters:
  • configpymco.config.Config instance.
  • msg – A dictionary like object, usually a pymco.message.Message instance.
  • **kwargs – extra keyword arguments. Set the collective here if you aren’t targeting the main collective.
call(timeout=5)[source]

Make the RPC call.

It should subscribe to the reply target, execute the RPC call and wait for the result.

Parameters:timeout – RPC call timeout.
Returns:a dictionary like object with response.
Raise:pymco.exc.TimeoutError if expected messages don’t arrive in timeout seconds.
get_reply_target()[source]

MCollective RPC call reply target.

This should build the subscription target required for listening replies to this RPC call.

Returns:middleware target for the response.
get_target()[source]

MCollective RPC call target.

Returns:middleware target for the request.