class MCollective::Application::Find

Public Instance Methods

main() click to toggle source
   # File lib/mcollective/application/find.rb
 4 def main
 5   mc = rpcclient("rpcutil")
 6 
 7   starttime = Time.now
 8 
 9   mc.detect_and_set_stdin_discovery
10 
11   nodes = mc.discover
12 
13   discoverytime = Time.now - starttime
14 
15   STDERR.puts if options[:verbose]
16 
17   nodes.each {|c| puts c}
18 
19   STDERR.puts "\nDiscovered %s nodes in %.2f seconds using the %s discovery plugin" % [nodes.size, discoverytime, mc.client.discoverer.discovery_method] if options[:verbose]
20 
21   nodes.size > 0 ? exit(0) : exit(1)
22 end