mcollective-client 2.7.0 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mcollective/agent/discovery.rb +37 -0
- data/lib/mcollective/agent/rpcutil.ddl +220 -0
- data/lib/mcollective/agent/rpcutil.rb +108 -0
- data/lib/mcollective/aggregate/average.ddl +33 -0
- data/lib/mcollective/aggregate/average.rb +29 -0
- data/lib/mcollective/aggregate/result.rb +3 -3
- data/lib/mcollective/aggregate/sum.ddl +33 -0
- data/lib/mcollective/aggregate/sum.rb +18 -0
- data/lib/mcollective/aggregate/summary.ddl +33 -0
- data/lib/mcollective/aggregate/summary.rb +53 -0
- data/lib/mcollective/aggregate.rb +2 -2
- data/lib/mcollective/application/completion.rb +104 -0
- data/lib/mcollective/application/facts.rb +62 -0
- data/lib/mcollective/application/find.rb +21 -0
- data/lib/mcollective/application/help.rb +28 -0
- data/lib/mcollective/application/inventory.rb +344 -0
- data/lib/mcollective/application/ping.rb +77 -0
- data/lib/mcollective/application/plugin.rb +369 -0
- data/lib/mcollective/application/rpc.rb +121 -0
- data/lib/mcollective/application.rb +2 -0
- data/lib/mcollective/audit/logfile.rb +26 -0
- data/lib/mcollective/config.rb +16 -9
- data/lib/mcollective/connector/activemq.ddl +9 -0
- data/lib/mcollective/connector/activemq.rb +572 -0
- data/lib/mcollective/connector/rabbitmq.ddl +9 -0
- data/lib/mcollective/connector/rabbitmq.rb +484 -0
- data/lib/mcollective/connector.rb +1 -1
- data/lib/mcollective/data/agent_data.ddl +22 -0
- data/lib/mcollective/data/agent_data.rb +17 -0
- data/lib/mcollective/data/collective_data.ddl +20 -0
- data/lib/mcollective/data/collective_data.rb +9 -0
- data/lib/mcollective/data/fact_data.ddl +28 -0
- data/lib/mcollective/data/fact_data.rb +55 -0
- data/lib/mcollective/data/fstat_data.ddl +89 -0
- data/lib/mcollective/data/fstat_data.rb +56 -0
- data/lib/mcollective/data.rb +2 -2
- data/lib/mcollective/ddl.rb +4 -4
- data/lib/mcollective/discovery/flatfile.ddl +11 -0
- data/lib/mcollective/discovery/flatfile.rb +48 -0
- data/lib/mcollective/discovery/mc.ddl +11 -0
- data/lib/mcollective/discovery/mc.rb +30 -0
- data/lib/mcollective/discovery/stdin.ddl +11 -0
- data/lib/mcollective/discovery/stdin.rb +66 -0
- data/lib/mcollective/facts/yaml_facts.rb +61 -0
- data/lib/mcollective/facts.rb +1 -1
- data/lib/mcollective/generators.rb +3 -3
- data/lib/mcollective/logger.rb +1 -1
- data/lib/mcollective/matcher/scanner.rb +1 -1
- data/lib/mcollective/matcher.rb +2 -2
- data/lib/mcollective/pluginpackager/debpackage_packager.rb +237 -0
- data/lib/mcollective/pluginpackager/modulepackage_packager.rb +127 -0
- data/lib/mcollective/pluginpackager/ospackage_packager.rb +59 -0
- data/lib/mcollective/pluginpackager/rpmpackage_packager.rb +180 -0
- data/lib/mcollective/pluginpackager/templates/debian/Makefile.erb +7 -0
- data/lib/mcollective/pluginpackager/templates/debian/changelog.erb +5 -0
- data/lib/mcollective/pluginpackager/templates/debian/compat.erb +1 -0
- data/lib/mcollective/pluginpackager/templates/debian/control.erb +15 -0
- data/lib/mcollective/pluginpackager/templates/debian/copyright.erb +8 -0
- data/lib/mcollective/pluginpackager/templates/debian/rules.erb +6 -0
- data/lib/mcollective/pluginpackager/templates/module/Modulefile.erb +5 -0
- data/lib/mcollective/pluginpackager/templates/module/README.md.erb +37 -0
- data/lib/mcollective/pluginpackager/templates/module/_manifest.pp.erb +9 -0
- data/lib/mcollective/pluginpackager/templates/redhat/rpm_spec.erb +63 -0
- data/lib/mcollective/pluginpackager.rb +2 -2
- data/lib/mcollective/registration/agentlist.rb +10 -0
- data/lib/mcollective/registration.rb +1 -1
- data/lib/mcollective/rpc/stats.rb +0 -1
- data/lib/mcollective/rpc.rb +11 -11
- data/lib/mcollective/security/aes_security.rb +394 -0
- data/lib/mcollective/security/psk.rb +117 -0
- data/lib/mcollective/security/ssl.rb +328 -0
- data/lib/mcollective/security.rb +1 -1
- data/lib/mcollective/util.rb +18 -18
- data/lib/mcollective/validator/array_validator.ddl +7 -0
- data/lib/mcollective/validator/array_validator.rb +9 -0
- data/lib/mcollective/validator/ipv4address_validator.ddl +7 -0
- data/lib/mcollective/validator/ipv4address_validator.rb +16 -0
- data/lib/mcollective/validator/ipv6address_validator.ddl +7 -0
- data/lib/mcollective/validator/ipv6address_validator.rb +16 -0
- data/lib/mcollective/validator/length_validator.ddl +7 -0
- data/lib/mcollective/validator/length_validator.rb +11 -0
- data/lib/mcollective/validator/regex_validator.ddl +7 -0
- data/lib/mcollective/validator/regex_validator.rb +9 -0
- data/lib/mcollective/validator/shellsafe_validator.ddl +7 -0
- data/lib/mcollective/validator/shellsafe_validator.rb +13 -0
- data/lib/mcollective/validator/typecheck_validator.ddl +7 -0
- data/lib/mcollective/validator/typecheck_validator.rb +28 -0
- data/lib/mcollective.rb +31 -31
- data/spec/spec_helper.rb +0 -5
- data/spec/unit/{plugins/mcollective → mcollective}/agent/rpcutil_spec.rb +1 -1
- data/spec/unit/{agents_spec.rb → mcollective/agents_spec.rb} +0 -0
- data/spec/unit/{plugins/mcollective → mcollective}/aggregate/average_spec.rb +1 -1
- data/spec/unit/{aggregate → mcollective/aggregate}/base_spec.rb +0 -0
- data/spec/unit/{aggregate → mcollective/aggregate}/result/base_spec.rb +0 -0
- data/spec/unit/{aggregate → mcollective/aggregate}/result/collection_result_spec.rb +0 -0
- data/spec/unit/{aggregate → mcollective/aggregate}/result/numeric_result_spec.rb +0 -0
- data/spec/unit/{plugins/mcollective → mcollective}/aggregate/sum_spec.rb +1 -1
- data/spec/unit/{plugins/mcollective → mcollective}/aggregate/summary_spec.rb +1 -1
- data/spec/unit/{aggregate_spec.rb → mcollective/aggregate_spec.rb} +0 -0
- data/spec/unit/{plugins/mcollective → mcollective}/application/plugin_spec.rb +1 -1
- data/spec/unit/{application_spec.rb → mcollective/application_spec.rb} +0 -0
- data/spec/unit/{applications_spec.rb → mcollective/applications_spec.rb} +1 -1
- data/spec/unit/{array_spec.rb → mcollective/array_spec.rb} +0 -0
- data/spec/unit/{plugins/mcollective → mcollective}/audit/logfile_spec.rb +1 -1
- data/spec/unit/{cache_spec.rb → mcollective/cache_spec.rb} +0 -0
- data/spec/unit/{client_spec.rb → mcollective/client_spec.rb} +0 -0
- data/spec/unit/{config_spec.rb → mcollective/config_spec.rb} +12 -7
- data/spec/unit/{plugins/mcollective → mcollective}/connector/activemq_spec.rb +1 -1
- data/spec/unit/{connector → mcollective/connector}/base_spec.rb +0 -0
- data/spec/unit/{plugins/mcollective → mcollective}/connector/rabbitmq_spec.rb +1 -1
- data/spec/unit/{plugins/mcollective → mcollective}/data/agent_data_spec.rb +1 -1
- data/spec/unit/{data → mcollective/data}/base_spec.rb +0 -0
- data/spec/unit/{plugins/mcollective → mcollective}/data/collective_data_spec.rb +1 -1
- data/spec/unit/{plugins/mcollective → mcollective}/data/fact_data_spec.rb +1 -1
- data/spec/unit/{plugins/mcollective → mcollective}/data/fstat_data_spec.rb +1 -1
- data/spec/unit/{data → mcollective/data}/result_spec.rb +0 -0
- data/spec/unit/{data_spec.rb → mcollective/data_spec.rb} +0 -0
- data/spec/unit/{ddl → mcollective/ddl}/agentddl_spec.rb +0 -0
- data/spec/unit/{ddl → mcollective/ddl}/base_spec.rb +0 -0
- data/spec/unit/{ddl → mcollective/ddl}/dataddl_spec.rb +0 -0
- data/spec/unit/{ddl → mcollective/ddl}/discoveryddl_spec.rb +0 -0
- data/spec/unit/{ddl_spec.rb → mcollective/ddl_spec.rb} +0 -0
- data/spec/unit/{plugins/mcollective → mcollective}/discovery/flatfile_spec.rb +1 -1
- data/spec/unit/{plugins/mcollective → mcollective}/discovery/mc_spec.rb +1 -1
- data/spec/unit/{plugins/mcollective → mcollective}/discovery/stdin_spec.rb +1 -1
- data/spec/unit/{discovery_spec.rb → mcollective/discovery_spec.rb} +0 -0
- data/spec/unit/{facts → mcollective/facts}/base_spec.rb +0 -0
- data/spec/unit/{plugins/mcollective → mcollective}/facts/yaml_facts_spec.rb +1 -1
- data/spec/unit/{facts_spec.rb → mcollective/facts_spec.rb} +0 -0
- data/spec/unit/{generators → mcollective/generators}/agent_generator_spec.rb +0 -0
- data/spec/unit/{generators → mcollective/generators}/base_spec.rb +0 -0
- data/spec/unit/{generators → mcollective/generators}/data_generator_spec.rb +0 -0
- data/spec/unit/{generators → mcollective/generators}/snippets/agent_ddl +0 -0
- data/spec/unit/{generators → mcollective/generators}/snippets/data_ddl +0 -0
- data/spec/unit/{log_spec.rb → mcollective/log_spec.rb} +0 -0
- data/spec/unit/{logger → mcollective/logger}/base_spec.rb +0 -0
- data/spec/unit/{logger → mcollective/logger}/console_logger_spec.rb +0 -0
- data/spec/unit/{logger → mcollective/logger}/file_logger_spec.rb +0 -0
- data/spec/unit/{logger → mcollective/logger}/syslog_logger_spec.rb +0 -0
- data/spec/unit/{matcher → mcollective/matcher}/parser_spec.rb +0 -0
- data/spec/unit/{matcher → mcollective/matcher}/scanner_spec.rb +0 -0
- data/spec/unit/{matcher_spec.rb → mcollective/matcher_spec.rb} +0 -0
- data/spec/unit/{message_spec.rb → mcollective/message_spec.rb} +0 -0
- data/spec/unit/{monkey_patches_spec.rb → mcollective/monkey_patches_spec.rb} +0 -0
- data/spec/unit/{optionparser_spec.rb → mcollective/optionparser_spec.rb} +0 -0
- data/spec/unit/{plugins/mcollective → mcollective}/packagers/debpackage_packager_spec.rb +1 -1
- data/spec/unit/{plugins/mcollective → mcollective}/packagers/modulepackage_packager_spec.rb +1 -1
- data/spec/unit/{plugins/mcollective → mcollective}/packagers/ospackage_spec.rb +1 -1
- data/spec/unit/{plugins/mcollective → mcollective}/packagers/rpmpackage_packager_spec.rb +1 -1
- data/spec/unit/{pluginmanager_spec.rb → mcollective/pluginmanager_spec.rb} +0 -0
- data/spec/unit/{pluginpackager → mcollective/pluginpackager}/agent_definition_spec.rb +0 -0
- data/spec/unit/{pluginpackager → mcollective/pluginpackager}/standard_definition_spec.rb +0 -0
- data/spec/unit/{pluginpackager_spec.rb → mcollective/pluginpackager_spec.rb} +0 -0
- data/spec/unit/{registration → mcollective/registration}/base_spec.rb +0 -0
- data/spec/unit/{rpc → mcollective/rpc}/actionrunner_spec.rb +0 -0
- data/spec/unit/{rpc → mcollective/rpc}/agent_spec.rb +0 -0
- data/spec/unit/{rpc → mcollective/rpc}/client_spec.rb +0 -0
- data/spec/unit/{rpc → mcollective/rpc}/helpers_spec.rb +0 -0
- data/spec/unit/{rpc → mcollective/rpc}/reply_spec.rb +0 -0
- data/spec/unit/{rpc → mcollective/rpc}/request_spec.rb +0 -0
- data/spec/unit/{rpc → mcollective/rpc}/result_spec.rb +0 -0
- data/spec/unit/{rpc → mcollective/rpc}/stats_spec.rb +0 -0
- data/spec/unit/{rpc_spec.rb → mcollective/rpc_spec.rb} +0 -0
- data/spec/unit/{runner_spec.rb → mcollective/runner_spec.rb} +0 -0
- data/spec/unit/{runnerstats_spec.rb → mcollective/runnerstats_spec.rb} +0 -0
- data/spec/unit/{plugins/mcollective → mcollective}/security/aes_security_spec.rb +1 -1
- data/spec/unit/{security → mcollective/security}/base_spec.rb +0 -0
- data/spec/unit/{plugins/mcollective → mcollective}/security/psk_spec.rb +1 -1
- data/spec/unit/{shell_spec.rb → mcollective/shell_spec.rb} +0 -0
- data/spec/unit/{ssl_spec.rb → mcollective/ssl_spec.rb} +12 -12
- data/spec/unit/{string_spec.rb → mcollective/string_spec.rb} +0 -0
- data/spec/unit/{symbol_spec.rb → mcollective/symbol_spec.rb} +0 -0
- data/spec/unit/{unix_daemon_spec.rb → mcollective/unix_daemon_spec.rb} +0 -0
- data/spec/unit/{util_spec.rb → mcollective/util_spec.rb} +28 -6
- data/spec/unit/{plugins/mcollective → mcollective}/validator/array_validator_spec.rb +1 -1
- data/spec/unit/{plugins/mcollective → mcollective}/validator/ipv4address_validator_spec.rb +1 -1
- data/spec/unit/{plugins/mcollective → mcollective}/validator/ipv6address_validator_spec.rb +1 -1
- data/spec/unit/{plugins/mcollective → mcollective}/validator/length_validator_spec.rb +1 -1
- data/spec/unit/{plugins/mcollective → mcollective}/validator/regex_validator_spec.rb +1 -1
- data/spec/unit/{plugins/mcollective → mcollective}/validator/shellsafe_validator_spec.rb +1 -1
- data/spec/unit/{plugins/mcollective → mcollective}/validator/typecheck_validator_spec.rb +1 -1
- data/spec/unit/{validator_spec.rb → mcollective/validator_spec.rb} +1 -1
- data/spec/unit/{vendor_spec.rb → mcollective/vendor_spec.rb} +2 -2
- data/spec/unit/{windows_daemon_spec.rb → mcollective/windows_daemon_spec.rb} +0 -0
- metadata +361 -284
- checksums.yaml +0 -7
@@ -193,6 +193,28 @@ module MCollective
|
|
193
193
|
end
|
194
194
|
end
|
195
195
|
|
196
|
+
describe '#config_file_for_user' do
|
197
|
+
before :each do
|
198
|
+
File.stubs(:expand_path).raises
|
199
|
+
File.stubs(:readable?).returns(false)
|
200
|
+
Util.stubs(:windows?).returns(false)
|
201
|
+
end
|
202
|
+
|
203
|
+
it 'should default to /etc/puppetlabs/agent/mcollective/client.cfg if ~/.mcollective can not be expanded' do
|
204
|
+
Util.config_file_for_user.should == '/etc/puppetlabs/agent/mcollective/client.cfg'
|
205
|
+
end
|
206
|
+
|
207
|
+
it 'should default to ~/.mcollective if it can be expanded' do
|
208
|
+
File.expects(:expand_path).with('~/.mcollective').returns('/home/mco/.mcollective')
|
209
|
+
Util.config_file_for_user.should == '/home/mco/.mcollective'
|
210
|
+
end
|
211
|
+
|
212
|
+
it 'should choose /etc/mcollective/client.cfg if it is readable' do
|
213
|
+
File.expects(:readable?).with('/etc/mcollective/client.cfg').returns(true)
|
214
|
+
Util.config_file_for_user.should == '/etc/mcollective/client.cfg'
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
196
218
|
describe "#default_options" do
|
197
219
|
it "should supply correct default options" do
|
198
220
|
Config.instance.stubs(:default_discovery_options).returns([])
|
@@ -462,8 +484,8 @@ module MCollective
|
|
462
484
|
Util.stubs(:terminal_dimensions).returns([0,0])
|
463
485
|
|
464
486
|
rootdir = File.dirname(__FILE__)
|
465
|
-
input = File.read("#{rootdir}
|
466
|
-
output = File.read("#{rootdir}
|
487
|
+
input = File.read("#{rootdir}/../../fixtures/util/4.in")
|
488
|
+
output = File.read("#{rootdir}/../../fixtures/util/4.out")
|
467
489
|
|
468
490
|
(Util.align_text(input, nil, 3) + "\n").should == output
|
469
491
|
end
|
@@ -486,14 +508,14 @@ module MCollective
|
|
486
508
|
it "should correctly align strings" do
|
487
509
|
rootdir = File.dirname(__FILE__)
|
488
510
|
(1..2).each do |i|
|
489
|
-
input = File.read("#{rootdir}
|
490
|
-
output = File.read("#{rootdir}
|
511
|
+
input = File.read("#{rootdir}/../../fixtures/util/#{i}.in")
|
512
|
+
output = File.read("#{rootdir}/../../fixtures/util/#{i}.out")
|
491
513
|
|
492
514
|
(Util.align_text(input, 158 , 5) + "\n").should == output
|
493
515
|
end
|
494
516
|
|
495
|
-
input = File.read("#{rootdir}
|
496
|
-
output = File.read("#{rootdir}
|
517
|
+
input = File.read("#{rootdir}/../../fixtures/util/3.in")
|
518
|
+
output = File.read("#{rootdir}/../../fixtures/util/3.out")
|
497
519
|
|
498
520
|
(Util.align_text(input, 30, 0) + "\n").should == output
|
499
521
|
end
|
@@ -7,7 +7,7 @@ module MCollective
|
|
7
7
|
describe "#vendor_dir" do
|
8
8
|
it "should return correct vendor directory" do
|
9
9
|
specdir = File.dirname(__FILE__)
|
10
|
-
expected_dir = File.expand_path("#{specdir}
|
10
|
+
expected_dir = File.expand_path("#{specdir}/../../../lib/mcollective/vendor")
|
11
11
|
Vendor.vendor_dir.should == expected_dir
|
12
12
|
end
|
13
13
|
end
|
@@ -15,7 +15,7 @@ module MCollective
|
|
15
15
|
describe "#load_entry" do
|
16
16
|
it "should attempt to load the correct path" do
|
17
17
|
specdir = File.dirname(__FILE__)
|
18
|
-
expected_dir = File.expand_path("#{specdir}
|
18
|
+
expected_dir = File.expand_path("#{specdir}/../../../lib/mcollective/vendor")
|
19
19
|
|
20
20
|
Class.any_instance.stubs("load").with("#{expected_dir}/foo").once
|
21
21
|
|
File without changes
|