choria-mcorpc-support 2.23.3 → 2.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/mcollective.rb +3 -2
- data/lib/mcollective/application/find.rb +1 -1
- data/lib/mcollective/application/plugin.rb +2 -15
- data/lib/mcollective/client.rb +1 -1
- data/lib/mcollective/config.rb +135 -103
- data/lib/mcollective/discovery.rb +11 -63
- data/lib/mcollective/discovery/broadcast.ddl +11 -0
- data/lib/mcollective/discovery/choria.ddl +6 -4
- data/lib/mcollective/discovery/delegate.ddl +13 -0
- data/lib/mcollective/discovery/delegate.rb +73 -0
- data/lib/mcollective/discovery/external.ddl +13 -0
- data/lib/mcollective/discovery/file.ddl +13 -0
- data/lib/mcollective/discovery/flatfile.ddl +7 -5
- data/lib/mcollective/discovery/inventory.ddl +13 -0
- data/lib/mcollective/discovery/mc.ddl +3 -3
- data/lib/mcollective/optionparser.rb +1 -1
- data/lib/mcollective/pluginpackager/forge_packager.rb +1 -1
- data/lib/mcollective/rpc/client.rb +4 -2
- metadata +9 -23
- data/lib/mcollective/data.rb +0 -96
- data/lib/mcollective/data/agent_data.ddl +0 -22
- data/lib/mcollective/data/agent_data.rb +0 -17
- data/lib/mcollective/data/base.rb +0 -68
- data/lib/mcollective/data/bolt_task_data.ddl +0 -90
- data/lib/mcollective/data/bolt_task_data.rb +0 -32
- data/lib/mcollective/data/collective_data.ddl +0 -20
- data/lib/mcollective/data/collective_data.rb +0 -9
- data/lib/mcollective/data/fact_data.ddl +0 -28
- data/lib/mcollective/data/fact_data.rb +0 -55
- data/lib/mcollective/data/fstat_data.ddl +0 -89
- data/lib/mcollective/data/fstat_data.rb +0 -54
- data/lib/mcollective/data/result.rb +0 -50
- data/lib/mcollective/ddl/dataddl.rb +0 -56
- data/lib/mcollective/discovery/choria.rb +0 -223
- data/lib/mcollective/discovery/flatfile.rb +0 -47
- data/lib/mcollective/discovery/stdin.ddl +0 -11
- data/lib/mcollective/discovery/stdin.rb +0 -67
- data/lib/mcollective/generators/data_generator.rb +0 -50
- data/lib/mcollective/generators/templates/data_input_snippet.erb +0 -7
@@ -1,50 +0,0 @@
|
|
1
|
-
module MCollective
|
2
|
-
module Generators
|
3
|
-
class DataGenerator < Base
|
4
|
-
attr_accessor :ddl, :content
|
5
|
-
|
6
|
-
def initialize(plugin_name, outputs=[], name=nil, description=nil, author=nil,
|
7
|
-
license=nil, version=nil, url=nil, timeout=nil)
|
8
|
-
|
9
|
-
super(name, description, author, license, version, url, timeout)
|
10
|
-
@mod_name = "Data"
|
11
|
-
@pclass = "Base"
|
12
|
-
@plugin_name = plugin_name
|
13
|
-
@outputs = outputs
|
14
|
-
@ddl = create_ddl
|
15
|
-
@content = create_plugin_content
|
16
|
-
@plugin = create_plugin_string
|
17
|
-
write_plugins
|
18
|
-
end
|
19
|
-
|
20
|
-
def create_ddl
|
21
|
-
query_text = "dataquery :description => \"Query information\" do\n"
|
22
|
-
query_text += ERB.new(File.read(File.join(File.dirname(__FILE__), "templates", "data_input_snippet.erb"))).result
|
23
|
-
|
24
|
-
@outputs.each_with_index do |output, i|
|
25
|
-
query_text += "%2s%s" % [" ", "output :#{output},\n"]
|
26
|
-
query_text += "%9s%s" % [" ", ":description => \"%DESCRIPTION%\",\n"]
|
27
|
-
query_text += "%9s%s" % [" ", ":display_as => \"%DESCRIPTION%\"\n"]
|
28
|
-
query_text += "\n" unless @outputs.size == (i + 1)
|
29
|
-
end
|
30
|
-
|
31
|
-
query_text += "end"
|
32
|
-
|
33
|
-
# Use inherited method to create metadata part of the ddl
|
34
|
-
create_metadata_string + query_text
|
35
|
-
end
|
36
|
-
|
37
|
-
def create_plugin_content
|
38
|
-
content_text = "%6s%s" % [" ", "query do |what|\n"]
|
39
|
-
|
40
|
-
@outputs.each do |output|
|
41
|
-
content_text += "%8s%s" % [" ", "result[:#{output}] = nil\n"]
|
42
|
-
end
|
43
|
-
content_text += "%6s%s" % [" ", "end\n"]
|
44
|
-
|
45
|
-
# Add actions to agent file
|
46
|
-
content_text
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|