| Class | MCollective::RPC::Helpers |
| In: |
lib/mcollective/rpc/helpers.rb
|
| Parent: | Object |
Various utilities for the RPC system
Given an array of something, make sure each is a string chomp off any new lines and return just the array of hosts
Parse JSON output as produced by printrpc and extract the "sender" of each rpc response
The simplist valid JSON based data would be:
[
{"sender" => "example.com"},
{"sender" => "another.com"}
]
Returns a blob of text representing the results in a standard way
It tries hard to do sane things so you often should not need to write your own display functions
If the agent you are getting results for has a DDL it will use the hints in there to do the right thing specifically it will look at the values of display in the DDL to choose when to show results
If you do not have a DDL you can pass these flags:
printrpc exim.mailq, :flatten => true printrpc exim.mailq, :verbose => true
If you‘ve asked it to flatten the result it will not print sender hostnames, it will just print the result as if it‘s one huge result, handy for things like showing a combined mailq.