X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=plugins%2Fmcollective%2Fagent%2Fdiscovery.rb;fp=plugins%2Fmcollective%2Fagent%2Fdiscovery.rb;h=ede2ec4045bca7ea5d211a0c4572fae7f37566c5;hb=b87d2f4e68281062df1913440ca5753ae63314a9;hp=0000000000000000000000000000000000000000;hpb=ab0ea530b8ac956091f17b104ab2311336cfc250;p=packages%2Fprecise%2Fmcollective.git diff --git a/plugins/mcollective/agent/discovery.rb b/plugins/mcollective/agent/discovery.rb new file mode 100644 index 0000000..ede2ec4 --- /dev/null +++ b/plugins/mcollective/agent/discovery.rb @@ -0,0 +1,39 @@ +module MCollective + module Agent + # Discovery agent for The Marionette Collective + # + # Released under the Apache License, Version 2 + class Discovery + attr_reader :timeout, :meta + + def initialize + config = Config.instance.pluginconf + + @timeout = 5 + @timeout = config["discovery.timeout"].to_i if config.include?("discovery.timeout") + + @meta = {:license => "Apache License, Version 2", + :author => "R.I.Pienaar ", + :timeout => @timeout, + :name => "Discovery Agent", + :version => MCollective.version, + :url => "http://www.marionette-collective.org", + :description => "MCollective Discovery Agent"} + end + + def handlemsg(msg, stomp) + reply = "unknown request" + + case msg[:body] + when "ping" + reply = "pong" + + else + reply = "Unknown Request: #{msg[:body]}" + end + + reply + end + end + end +end