Updated mcollective.init according to OSCI-658
[packages/precise/mcollective.git] / plugins / mcollective / data / agent_data.rb
diff --git a/plugins/mcollective/data/agent_data.rb b/plugins/mcollective/data/agent_data.rb
new file mode 100644 (file)
index 0000000..8a04d37
--- /dev/null
@@ -0,0 +1,17 @@
+module MCollective
+  module Data
+    class Agent_data<Base
+      query do |plugin|
+        raise "No agent called #{plugin} found" unless PluginManager.include?("#{plugin}_agent")
+
+        agent = PluginManager["#{plugin}_agent"]
+
+        result[:agent] = plugin
+
+        [:license, :timeout, :description, :url, :version, :author].each do |item|
+          result[item] = agent.meta[item]
+        end
+      end
+    end
+  end
+end