Merge lp:~lynxman/ubuntu/quantal/mcollective/mcollective20 into lp:ubuntu/quantal/mcollective
- Quantal (12.10)
- mcollective20
- Merge into quantal
Status: | Merged |
---|---|
Merge reported by: | Stefano Rivera |
Merged at revision: | not available |
Proposed branch: | lp:~lynxman/ubuntu/quantal/mcollective/mcollective20 |
Merge into: | lp:ubuntu/quantal/mcollective |
Diff against target: |
54351 lines (+22099/-24786) 320 files modified
.pc/applied-patches (+0/-1) .pc/pluginsdir.patch/etc/client.cfg.dist (+0/-21) .pc/pluginsdir.patch/etc/server.cfg.dist (+0/-22) bin/mc-call-agent (+54/-0) bin/mco (+37/-0) bin/mcollectived (+49/-0) debian/README.source (+1/-1) debian/changelog (+30/-0) debian/control (+11/-16) debian/copyright (+7/-7) debian/mcollective-client.config (+0/-9) debian/mcollective-client.templates (+0/-11) debian/mcollective-common.NEWS (+10/-0) debian/mcollective-common.templates (+23/-12) debian/mcollective.README.Debian (+13/-0) debian/mcollective.postinst (+52/-52) debian/mcollective.templates (+12/-2) debian/mcollective.upstart (+15/-0) debian/patches/pluginsdir.patch (+13/-28) debian/po/nl.po (+109/-0) doc/classes/Array.html (+41/-35) doc/classes/Dir.html (+212/-0) doc/classes/MCollective.html (+137/-227) doc/classes/MCollective/Agent.html (+0/-116) doc/classes/MCollective/Agent/Discovery.html (+0/-251) doc/classes/MCollective/Agent/Rpcutil.html (+0/-111) doc/classes/MCollective/Agents.html (+260/-164) doc/classes/MCollective/Application.html (+621/-387) doc/classes/MCollective/Application/Controller.html (+0/-270) doc/classes/MCollective/Application/Facts.html (+0/-252) doc/classes/MCollective/Application/Find.html (+0/-155) doc/classes/MCollective/Application/Help.html (+0/-182) doc/classes/MCollective/Application/Inventory.html (+0/-798) doc/classes/MCollective/Application/Ping.html (+0/-167) doc/classes/MCollective/Application/Rpc.html (+0/-268) doc/classes/MCollective/Applications.html (+152/-140) doc/classes/MCollective/Client.html (+375/-306) doc/classes/MCollective/Config.html (+241/-183) doc/classes/MCollective/Connector.html (+4/-10) doc/classes/MCollective/Connector/Base.html (+9/-11) doc/classes/MCollective/Connector/Stomp.html (+0/-488) doc/classes/MCollective/Facts.html (+30/-41) doc/classes/MCollective/Facts/Bar.html (+0/-113) doc/classes/MCollective/Facts/Base.html (+91/-93) doc/classes/MCollective/Facts/Testfacts.html (+0/-115) doc/classes/MCollective/Facts/Yaml_facts.html (+0/-247) doc/classes/MCollective/Foo.html (+0/-113) doc/classes/MCollective/Log.html (+144/-146) doc/classes/MCollective/Logger.html (+4/-8) doc/classes/MCollective/Logger/Base.html (+35/-37) doc/classes/MCollective/Logger/Console_logger.html (+80/-80) doc/classes/MCollective/Logger/File_logger.html (+50/-50) doc/classes/MCollective/Logger/Syslog_logger.html (+112/-80) doc/classes/MCollective/Matcher.html (+138/-0) doc/classes/MCollective/Matcher/Parser.html (+270/-0) doc/classes/MCollective/Matcher/Scanner.html (+242/-0) doc/classes/MCollective/Message.html (+676/-0) doc/classes/MCollective/MsgDoesNotMatchRequestID.html (+2/-2) doc/classes/MCollective/MsgTTLExpired.html (+111/-0) doc/classes/MCollective/Optionparser.html (+193/-133) doc/classes/MCollective/PluginManager.html (+246/-128) doc/classes/MCollective/PluginPackager.html (+335/-0) doc/classes/MCollective/PluginPackager/AgentDefinition.html (+389/-0) doc/classes/MCollective/PluginPackager/StandardDefinition.html (+336/-0) doc/classes/MCollective/RPC.html (+199/-209) doc/classes/MCollective/RPC/ActionRunner.html (+177/-147) doc/classes/MCollective/RPC/Agent.html (+194/-131) doc/classes/MCollective/RPC/Audit.html (+7/-9) doc/classes/MCollective/RPC/Client.html (+651/-372) doc/classes/MCollective/RPC/DDL.html (+269/-257) doc/classes/MCollective/RPC/Helpers.html (+412/-294) doc/classes/MCollective/RPC/Logfile.html (+0/-168) doc/classes/MCollective/RPC/Progress.html (+49/-51) doc/classes/MCollective/RPC/Reply.html (+87/-89) doc/classes/MCollective/RPC/Request.html (+68/-70) doc/classes/MCollective/RPC/Result.html (+67/-40) doc/classes/MCollective/RPC/Stats.html (+240/-242) doc/classes/MCollective/Registration.html (+2/-9) doc/classes/MCollective/Registration/Agentlist.html (+0/-154) doc/classes/MCollective/Registration/Base.html (+166/-44) doc/classes/MCollective/Request.html (+0/-172) doc/classes/MCollective/Runner.html (+64/-111) doc/classes/MCollective/RunnerStats.html (+106/-78) doc/classes/MCollective/SSL.html (+387/-260) doc/classes/MCollective/Security.html (+2/-31) doc/classes/MCollective/Security/Aes_security.html (+0/-733) doc/classes/MCollective/Security/Base.html (+376/-279) doc/classes/MCollective/Security/Psk.html (+0/-335) doc/classes/MCollective/Security/Sshkey.html (+0/-395) doc/classes/MCollective/Security/Ssl.html (+0/-420) doc/classes/MCollective/Shell.html (+65/-67) doc/classes/MCollective/UnixDaemon.html (+198/-0) doc/classes/MCollective/Util.html (+430/-353) doc/classes/MCollective/Vendor.html (+0/-248) doc/classes/MCollective/WindowsDaemon.html (+204/-0) doc/classes/Object.html (+0/-148) doc/classes/Symbol.html (+9/-11) doc/created.rid (+1/-1) doc/files/ext/mc-rpc-restserver_rb.html (+0/-125) doc/files/lib/mcollective/agents_rb.html (+1/-1) doc/files/lib/mcollective/application_rb.html (+1/-1) doc/files/lib/mcollective/applications_rb.html (+1/-1) doc/files/lib/mcollective/client_rb.html (+1/-1) doc/files/lib/mcollective/config_rb.html (+1/-1) doc/files/lib/mcollective/connector/base_rb.html (+1/-1) doc/files/lib/mcollective/connector_rb.html (+1/-1) doc/files/lib/mcollective/facts/base_rb.html (+1/-1) doc/files/lib/mcollective/facts_rb.html (+1/-1) doc/files/lib/mcollective/log_rb.html (+1/-1) doc/files/lib/mcollective/logger/base_rb.html (+1/-1) doc/files/lib/mcollective/logger/console_logger_rb.html (+1/-1) doc/files/lib/mcollective/logger/file_logger_rb.html (+1/-1) doc/files/lib/mcollective/logger/syslog_logger_rb.html (+1/-1) doc/files/lib/mcollective/logger_rb.html (+1/-1) doc/files/lib/mcollective/matcher/parser_rb.html (+101/-0) doc/files/lib/mcollective/matcher/scanner_rb.html (+101/-0) doc/files/lib/mcollective/matcher_rb.html (+101/-0) doc/files/lib/mcollective/message_rb.html (+101/-0) doc/files/lib/mcollective/monkey_patches_rb.html (+14/-1) doc/files/lib/mcollective/optionparser_rb.html (+1/-1) doc/files/lib/mcollective/pluginmanager_rb.html (+1/-1) doc/files/lib/mcollective/pluginpackager/agent_definition_rb.html (+101/-0) doc/files/lib/mcollective/pluginpackager/standard_definition_rb.html (+101/-0) doc/files/lib/mcollective/pluginpackager_rb.html (+101/-0) doc/files/lib/mcollective/registration/base_rb.html (+1/-1) doc/files/lib/mcollective/registration_rb.html (+1/-1) doc/files/lib/mcollective/request_rb.html (+0/-101) doc/files/lib/mcollective/rpc/actionrunner_rb.html (+1/-1) doc/files/lib/mcollective/rpc/agent_rb.html (+1/-1) doc/files/lib/mcollective/rpc/audit_rb.html (+1/-1) doc/files/lib/mcollective/rpc/client_rb.html (+1/-1) doc/files/lib/mcollective/rpc/ddl_rb.html (+1/-1) doc/files/lib/mcollective/rpc/helpers_rb.html (+1/-1) doc/files/lib/mcollective/rpc/progress_rb.html (+1/-1) doc/files/lib/mcollective/rpc/reply_rb.html (+1/-1) doc/files/lib/mcollective/rpc/request_rb.html (+1/-1) doc/files/lib/mcollective/rpc/result_rb.html (+1/-1) doc/files/lib/mcollective/rpc/stats_rb.html (+1/-1) doc/files/lib/mcollective/rpc_rb.html (+1/-1) doc/files/lib/mcollective/runner_rb.html (+1/-1) doc/files/lib/mcollective/runnerstats_rb.html (+1/-1) doc/files/lib/mcollective/security/base_rb.html (+1/-1) doc/files/lib/mcollective/security_rb.html (+1/-1) doc/files/lib/mcollective/shell_rb.html (+1/-1) doc/files/lib/mcollective/ssl_rb.html (+2/-1) doc/files/lib/mcollective/unix_daemon_rb.html (+101/-0) doc/files/lib/mcollective/util_rb.html (+1/-1) doc/files/lib/mcollective/vendor_rb.html (+0/-108) doc/files/lib/mcollective/windows_daemon_rb.html (+108/-0) doc/files/lib/mcollective_rb.html (+4/-2) doc/files/mcollectived_rb.html (+0/-109) doc/files/plugins/mcollective/agent/discovery_rb.html (+0/-101) doc/files/plugins/mcollective/agent/rpcutil_rb.html (+0/-101) doc/files/plugins/mcollective/application/controller_rb.html (+0/-109) doc/files/plugins/mcollective/application/facts_rb.html (+0/-101) doc/files/plugins/mcollective/application/find_rb.html (+0/-101) doc/files/plugins/mcollective/application/help_rb.html (+0/-101) doc/files/plugins/mcollective/application/inventory_rb.html (+0/-108) doc/files/plugins/mcollective/application/ping_rb.html (+0/-101) doc/files/plugins/mcollective/application/rpc_rb.html (+0/-101) doc/files/plugins/mcollective/audit/logfile_rb.html (+0/-108) doc/files/plugins/mcollective/connector/stomp_rb.html (+0/-108) doc/files/plugins/mcollective/facts/yaml_facts_rb.html (+0/-108) doc/files/plugins/mcollective/registration/agentlist_rb.html (+0/-101) doc/files/plugins/mcollective/security/aes_security_rb.html (+0/-101) doc/files/plugins/mcollective/security/psk_rb.html (+0/-108) doc/files/plugins/mcollective/security/sshkey_rb.html (+0/-111) doc/files/plugins/mcollective/security/ssl_rb.html (+0/-109) doc/files/spec/monkey_patches/instance_variable_defined_rb.html (+0/-101) doc/files/spec/spec_helper_rb.html (+0/-115) doc/files/spec/unit/application_spec_rb.html (+0/-101) doc/files/spec/unit/applications_spec_rb.html (+0/-101) doc/files/spec/unit/config_spec_rb.html (+0/-101) doc/files/spec/unit/facts/base_spec_rb.html (+0/-101) doc/files/spec/unit/facts_spec_rb.html (+0/-101) doc/files/spec/unit/log_spec_rb.html (+0/-101) doc/files/spec/unit/logger/base_spec_rb.html (+0/-101) doc/files/spec/unit/optionparser_spec_rb.html (+0/-101) doc/files/spec/unit/pluginmanager_spec_rb.html (+0/-101) doc/files/spec/unit/rpc/actionrunner_spec_rb.html (+0/-101) doc/files/spec/unit/rpc/agent_spec_rb.html (+0/-101) doc/files/spec/unit/rpc/reply_spec_rb.html (+0/-101) doc/files/spec/unit/rpc/request_spec_rb.html (+0/-101) doc/files/spec/unit/rpc/result_spec_rb.html (+0/-101) doc/files/spec/unit/rpc/stats_spec_rb.html (+0/-101) doc/files/spec/unit/security/base_spec_rb.html (+0/-101) doc/files/spec/unit/security/psk_spec_rb.html (+0/-101) doc/files/spec/unit/shell_spec_rb.html (+0/-101) doc/files/spec/unit/ssl_spec_rb.html (+0/-101) doc/files/spec/unit/util_spec_rb.html (+0/-101) doc/files/spec/unit/vendor_spec_rb.html (+0/-101) doc/fr_class_index.html (+11/-24) doc/fr_file_index.html (+9/-44) doc/fr_method_index.html (+319/-325) doc/index.html (+2/-2) etc/client.cfg.dist (+5/-5) etc/server.cfg.dist (+3/-3) ext/Makefile (+3/-3) ext/activemq/examples/multi-broker-mesh/README (+0/-21) ext/activemq/examples/multi-broker-mesh/broker1-activemq.xml (+0/-76) ext/activemq/examples/multi-broker-mesh/broker2-activemq.xml (+0/-75) ext/activemq/examples/multi-broker-mesh/broker3-activemq.xml (+0/-71) ext/activemq/examples/multi-broker/README (+3/-3) ext/activemq/examples/multi-broker/broker1-activemq.xml (+97/-37) ext/activemq/examples/multi-broker/broker2-activemq.xml (+40/-34) ext/activemq/examples/multi-broker/broker3-activemq.xml (+40/-34) ext/activemq/examples/single-broker/README (+1/-1) ext/activemq/examples/single-broker/activemq.xml (+19/-3) ext/debian/changelog (+0/-12) ext/debian/mcollective-client.install (+2/-0) ext/debian/mcollective-common.install (+7/-1) ext/debian/mcollective.init (+85/-0) ext/debian/mcollective.install (+0/-1) ext/debian/patches/conffile.dpatch (+8/-8) ext/debian/patches/pluginsdir.dpatch (+2/-2) ext/mc-rpc-restserver.rb (+12/-12) ext/redhat/mcollective.init (+139/-0) ext/redhat/mcollective.spec (+131/-0) ext/solaris/README (+23/-8) ext/solaris/build (+8/-4) ext/stompclient (+0/-2) ext/windows/README.md (+34/-0) ext/windows/environment.bat (+16/-0) ext/windows/mco.bat (+7/-0) ext/windows/register_service.bat (+7/-0) ext/windows/service_manager.rb (+94/-0) ext/windows/unregister_service.bat (+7/-0) lib/mcollective.rb (+48/-43) lib/mcollective/agents.rb (+158/-127) lib/mcollective/application.rb (+352/-254) lib/mcollective/applications.rb (+143/-129) lib/mcollective/client.rb (+290/-264) lib/mcollective/config.rb (+200/-170) lib/mcollective/connector.rb (+16/-17) lib/mcollective/connector/base.rb (+21/-23) lib/mcollective/facts.rb (+37/-38) lib/mcollective/facts/base.rb (+83/-83) lib/mcollective/log.rb (+100/-102) lib/mcollective/logger.rb (+3/-3) lib/mcollective/logger/base.rb (+70/-70) lib/mcollective/logger/console_logger.rb (+58/-58) lib/mcollective/logger/file_logger.rb (+41/-41) lib/mcollective/logger/syslog_logger.rb (+50/-38) lib/mcollective/matcher.rb (+16/-0) lib/mcollective/matcher/parser.rb (+93/-0) lib/mcollective/matcher/scanner.rb (+123/-0) lib/mcollective/message.rb (+201/-0) lib/mcollective/monkey_patches.rb (+102/-7) lib/mcollective/optionparser.rb (+162/-137) lib/mcollective/pluginmanager.rb (+178/-118) lib/mcollective/pluginpackager.rb (+61/-0) lib/mcollective/pluginpackager/agent_definition.rb (+86/-0) lib/mcollective/pluginpackager/standard_definition.rb (+66/-0) lib/mcollective/registration.rb (+14/-15) lib/mcollective/registration/base.rb (+72/-49) lib/mcollective/request.rb (+0/-15) lib/mcollective/rpc.rb (+184/-166) lib/mcollective/rpc/actionrunner.rb (+139/-127) lib/mcollective/rpc/agent.rb (+438/-389) lib/mcollective/rpc/audit.rb (+34/-35) lib/mcollective/rpc/client.rb (+790/-541) lib/mcollective/rpc/ddl.rb (+255/-243) lib/mcollective/rpc/helpers.rb (+336/-266) lib/mcollective/rpc/progress.rb (+60/-62) lib/mcollective/rpc/reply.rb (+57/-58) lib/mcollective/rpc/request.rb (+48/-49) lib/mcollective/rpc/result.rb (+38/-30) lib/mcollective/rpc/stats.rb (+182/-184) lib/mcollective/runner.rb (+129/-155) lib/mcollective/runnerstats.rb (+88/-80) lib/mcollective/security.rb (+24/-25) lib/mcollective/security/base.rb (+234/-183) lib/mcollective/shell.rb (+85/-85) lib/mcollective/ssl.rb (+241/-196) lib/mcollective/unix_daemon.rb (+37/-0) lib/mcollective/util.rb (+272/-256) lib/mcollective/vendor.rb (+37/-37) lib/mcollective/windows_daemon.rb (+25/-0) mc-call-agent (+0/-56) mc-controller (+0/-16) mc-facts (+0/-16) mc-find-hosts (+0/-12) mc-inventory (+0/-16) mc-ping (+0/-16) mc-rpc (+0/-16) mco (+0/-26) mcollective.init (+0/-3) mcollective.init-rh (+0/-107) mcollective.spec (+0/-127) mcollectived.rb (+0/-61) plugins/mcollective/agent/discovery.rb (+71/-69) plugins/mcollective/agent/rpcutil.ddl (+4/-0) plugins/mcollective/agent/rpcutil.rb (+93/-93) plugins/mcollective/application/controller.rb (+78/-78) plugins/mcollective/application/facts.rb (+51/-49) plugins/mcollective/application/find.rb (+13/-11) plugins/mcollective/application/help.rb (+23/-24) plugins/mcollective/application/inventory.rb (+327/-350) plugins/mcollective/application/ping.rb (+76/-28) plugins/mcollective/application/plugin.rb (+192/-0) plugins/mcollective/application/rpc.rb (+138/-107) plugins/mcollective/audit/logfile.rb (+21/-22) plugins/mcollective/connector/activemq.rb (+401/-0) plugins/mcollective/connector/stomp.rb (+336/-226) plugins/mcollective/facts/yaml_facts.rb (+58/-59) plugins/mcollective/pluginpackager/debpackage_packager.rb (+137/-0) plugins/mcollective/pluginpackager/ospackage_packager.rb (+59/-0) plugins/mcollective/pluginpackager/rpmpackage_packager.rb (+85/-0) plugins/mcollective/pluginpackager/templates/debian/Makefile.erb (+7/-0) plugins/mcollective/pluginpackager/templates/debian/changelog.erb (+5/-0) plugins/mcollective/pluginpackager/templates/debian/compat.erb (+1/-0) plugins/mcollective/pluginpackager/templates/debian/control.erb (+11/-0) plugins/mcollective/pluginpackager/templates/debian/copyright.erb (+8/-0) plugins/mcollective/pluginpackager/templates/debian/rules.erb (+6/-0) plugins/mcollective/pluginpackager/templates/redhat/rpm_spec.erb (+43/-0) plugins/mcollective/registration/agentlist.rb (+7/-8) plugins/mcollective/security/aes_security.rb (+326/-255) plugins/mcollective/security/psk.rb (+114/-111) plugins/mcollective/security/sshkey.rb (+0/-153) plugins/mcollective/security/ssl.rb (+322/-276) |
To merge this branch: | bzr merge lp:~lynxman/ubuntu/quantal/mcollective/mcollective20 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stefano Rivera | Needs Fixing | ||
Jamie Strandboge | Needs Fixing | ||
Ubuntu branches | Pending | ||
Review via email: mp+107792@code.launchpad.net |
Commit message
Description of the change
mcollective (2.0.0+
* Merge from debian unstable, remaining changes
- debian/control: Package mcollective-
to install mcollective + his AMPQ server of choice, we now
choose activemq by default but support for rabbitmq-stomp is
also integrated
- debian/
avoid daemonize if running on system with upstart
- debian/
behaviour and check on daemonize option in config file
-- Marc Cluet <email address hidden> Tue, 29 May 2012 14:52:36 +0100
Marc Cluet (lynxman) wrote : | # |
Hi Jamie,
I've just fixed all the changes and did a proper merge using the method suggested by James Page, this should be all OK now and the branch has been rewritten.
Stefano Rivera (stefanor) wrote : | # |
I still see several undocumented changes:
* Updating README.Debian and dependencies to mention libsystemu-ruby instead of ruby-systemu (which looks wrong btw)
* Updating dependencies from ruby-stomp to libruby-stop (again, looks wrong)
* Rewording package descriptions
* Rewording mcollective-common and mcollective debconf questions
* Changing tabs to spaces in debian/
* Pointing libdir at /usr/libexec (err, why? We don't usually use /usr/libexec)
Stefano Rivera (stefanor) wrote : | # |
Marking this merge proposal as work-in-progress to remove it from the sponsorship queue. Please set it back to "Nedes Review" when it's ready to be reviewed again.
Marc Cluet (lynxman) wrote : | # |
Fixed stefano's suggestions:
* Changed dependency for libstomp-ruby to ruby-stomp
* Changed dependency for libsystemu-ruby to ruby-systemu
* Used debian templates for mcollective and mcollective-common debconf questions
* Removed unnecessary templates for mcollective-client debconf questions
About the ones I didn't change
* Rewording package descriptions
Package descriptions were overwritten with the ones chosen by Debian to narrow the delta
* Pointing libdir at /usr/libexec (err, why? We don't usually use /usr/libexec)
/usr/libexec is the default location for mcollective, even if bizarre it's compatible across all platforms. It's also working this way in other Linux distributions and its the way upstream recommends as well, I wouldn't change it unless there was a very very good reason to do so.
- 21. By Marc Cluet
-
Minor changelog fixes
- 22. By Marc Cluet
-
Fixed descriptions in control file to show debian descriptions
Preview Diff
1 | === renamed directory '.pc' => '.pc' |
2 | === removed file '.pc/applied-patches' |
3 | --- .pc/applied-patches 2011-11-09 18:12:27 +0000 |
4 | +++ .pc/applied-patches 1970-01-01 00:00:00 +0000 |
5 | @@ -1,1 +0,0 @@ |
6 | -pluginsdir.patch |
7 | |
8 | === removed directory '.pc/pluginsdir.patch' |
9 | === removed directory '.pc/pluginsdir.patch/etc' |
10 | === removed file '.pc/pluginsdir.patch/etc/client.cfg.dist' |
11 | --- .pc/pluginsdir.patch/etc/client.cfg.dist 2011-11-09 18:12:27 +0000 |
12 | +++ .pc/pluginsdir.patch/etc/client.cfg.dist 1970-01-01 00:00:00 +0000 |
13 | @@ -1,21 +0,0 @@ |
14 | -topicprefix = /topic/ |
15 | -main_collective = mcollective |
16 | -collectives = mcollective |
17 | -libdir = /usr/libexec/mcollective |
18 | -logfile = /dev/null |
19 | -loglevel = info |
20 | - |
21 | -# Plugins |
22 | -securityprovider = psk |
23 | -plugin.psk = unset |
24 | - |
25 | -connector = stomp |
26 | -plugin.stomp.host = stomp.example.com |
27 | -plugin.stomp.port = 6163 |
28 | -plugin.stomp.user = mcollective |
29 | -plugin.stomp.password = marionette |
30 | - |
31 | -# Facts |
32 | -factsource = yaml |
33 | -plugin.yaml = /etc/mcollective/facts.yaml |
34 | - |
35 | |
36 | === removed file '.pc/pluginsdir.patch/etc/server.cfg.dist' |
37 | --- .pc/pluginsdir.patch/etc/server.cfg.dist 2011-11-09 18:12:27 +0000 |
38 | +++ .pc/pluginsdir.patch/etc/server.cfg.dist 1970-01-01 00:00:00 +0000 |
39 | @@ -1,22 +0,0 @@ |
40 | -topicprefix = /topic/ |
41 | -main_collective = mcollective |
42 | -collectives = mcollective |
43 | -libdir = /usr/libexec/mcollective |
44 | -logfile = /var/log/mcollective.log |
45 | -loglevel = info |
46 | -daemonize = 1 |
47 | - |
48 | -# Plugins |
49 | -securityprovider = psk |
50 | -plugin.psk = unset |
51 | - |
52 | -connector = stomp |
53 | -plugin.stomp.host = stomp.example.com |
54 | -plugin.stomp.port = 6163 |
55 | -plugin.stomp.user = mcollective |
56 | -plugin.stomp.password = marionette |
57 | - |
58 | -# Facts |
59 | -factsource = yaml |
60 | -plugin.yaml = /etc/mcollective/facts.yaml |
61 | - |
62 | |
63 | === renamed file 'COPYING' => 'COPYING' |
64 | === added directory 'bin' |
65 | === added file 'bin/mc-call-agent' |
66 | --- bin/mc-call-agent 1970-01-01 00:00:00 +0000 |
67 | +++ bin/mc-call-agent 2012-06-06 17:53:29 +0000 |
68 | @@ -0,0 +1,54 @@ |
69 | +#!/usr/bin/env ruby |
70 | + |
71 | +require 'mcollective' |
72 | +require 'pp' |
73 | + |
74 | +oparser = MCollective::Optionparser.new({:verbose => true}, "filter") |
75 | + |
76 | +options = oparser.parse{|parser, options| |
77 | + parser.define_head "Call an agent parsing an argument to it" |
78 | + parser.banner = "Usage: mc-call-agent [options] --agent agent --argument arg" |
79 | + |
80 | + parser.on('-a', '--agent AGENT', 'Agent to call') do |v| |
81 | + options[:agent] = v |
82 | + end |
83 | + |
84 | + parser.on('--arg', '--argument ARGUMENT', 'Argument to pass to agent') do |v| |
85 | + options[:argument] = v |
86 | + end |
87 | +} |
88 | + |
89 | +if options[:agent] == nil || options[:argument] == nil |
90 | + puts("Please use either --agent or --argument") |
91 | + exit 1 |
92 | +end |
93 | + |
94 | +begin |
95 | + options[:filter]["agent"] << options[:agent] |
96 | + |
97 | + client = MCollective::Client.new(options[:config]) |
98 | + client.options = options |
99 | + |
100 | + c = 0 |
101 | + |
102 | + stats = client.discovered_req(options[:argument], options[:agent]) do |resp| |
103 | + next if resp == nil |
104 | + |
105 | + c += 1 |
106 | + |
107 | + if options[:verbose] |
108 | + puts("#{resp[:senderid]}>") |
109 | + pp resp[:body] |
110 | + else |
111 | + puts if c % 4 == 1 |
112 | + printf("%-30s", resp[:senderid]) |
113 | + end |
114 | + end |
115 | + |
116 | + client.disconnect |
117 | +rescue Exception => e |
118 | + STDERR.puts "Could not call remote agent: #{e}" |
119 | + exit 1 |
120 | +end |
121 | + |
122 | +client.display_stats(stats) |
123 | |
124 | === added file 'bin/mco' |
125 | --- bin/mco 1970-01-01 00:00:00 +0000 |
126 | +++ bin/mco 2012-06-06 17:53:29 +0000 |
127 | @@ -0,0 +1,37 @@ |
128 | +#!/usr/bin/env ruby |
129 | + |
130 | +require 'mcollective' |
131 | + |
132 | +Version = MCollective.version |
133 | +known_applications = MCollective::Applications.list |
134 | + |
135 | +# links from mc-ping to mc will result in ping being run |
136 | +if $0 =~ /mc\-([a-zA-Z\-_\.]+)$/ |
137 | + app_name = $1 |
138 | +else |
139 | + app_name = ARGV.first |
140 | + ARGV.delete_at(0) |
141 | +end |
142 | + |
143 | +if known_applications.include?(app_name) |
144 | + # make sure the various options classes shows the right help etc |
145 | + $0 = app_name |
146 | + |
147 | + MCollective::Applications.run(app_name) |
148 | +else |
149 | + puts "The Marionette Collective version #{MCollective.version}" |
150 | + puts |
151 | + puts "usage: #{$0} command <options>" |
152 | + puts |
153 | + puts "Known commands:" |
154 | + puts |
155 | + |
156 | + known_applications.sort.uniq.in_groups_of(3) do |apps| |
157 | + puts " %-20s %-20s %-20s" % [apps[0], apps[1], apps[2]] |
158 | + end |
159 | + |
160 | + puts |
161 | + puts "Type '#{$0} help' for a detailed list of commands and '#{$0} help command'" |
162 | + puts "to get detailed help for a command" |
163 | + puts |
164 | +end |
165 | |
166 | === added file 'bin/mcollectived' |
167 | --- bin/mcollectived 1970-01-01 00:00:00 +0000 |
168 | +++ bin/mcollectived 2012-06-06 17:53:29 +0000 |
169 | @@ -0,0 +1,49 @@ |
170 | +#!/usr/bin/env ruby |
171 | + |
172 | +require 'mcollective' |
173 | +require 'getoptlong' |
174 | + |
175 | +opts = GetoptLong.new( |
176 | + [ '--help', '-h', GetoptLong::NO_ARGUMENT ], |
177 | + [ '--config', '-c', GetoptLong::REQUIRED_ARGUMENT], |
178 | + [ '--pidfile', '-p', GetoptLong::REQUIRED_ARGUMENT] |
179 | +) |
180 | + |
181 | +configfile = "/etc/mcollective/server.cfg" |
182 | +pid = "" |
183 | + |
184 | +opts.each do |opt, arg| |
185 | + case opt |
186 | + when '--help' |
187 | + puts "Usage: mcollectived.rb [--config /path/to/config] [--pidfile /path/to/pid]" |
188 | + exit |
189 | + when '--config' |
190 | + configfile = arg |
191 | + when '--pidfile' |
192 | + pid = arg |
193 | + end |
194 | +end |
195 | + |
196 | +config = MCollective::Config.instance |
197 | + |
198 | +config.loadconfig(configfile) unless config.configured |
199 | + |
200 | +MCollective::Log.info("The Marionette Collective #{MCollective::VERSION} started logging at #{config.loglevel} level") |
201 | + |
202 | +if config.daemonize |
203 | + MCollective::Log.debug("Starting in the background (#{config.daemonize})") |
204 | + |
205 | + if MCollective::Util.windows? |
206 | + require 'mcollective/windows_daemon' |
207 | + |
208 | + MCollective::WindowsDaemon.daemonize_runner |
209 | + else |
210 | + require 'mcollective/unix_daemon' |
211 | + |
212 | + MCollective::UnixDaemon.daemonize_runner(pid) |
213 | + end |
214 | +else |
215 | + MCollective::Log.debug("Starting in the foreground") |
216 | + runner = MCollective::Runner.new(configfile) |
217 | + runner.run |
218 | +end |
219 | |
220 | === renamed directory 'debian' => 'debian' |
221 | === modified file 'debian/README.source' |
222 | --- debian/README.source 2011-11-09 18:12:27 +0000 |
223 | +++ debian/README.source 2012-06-06 17:53:29 +0000 |
224 | @@ -3,7 +3,7 @@ |
225 | |
226 | This source is created by pre-stripping the embedded systemu and json library |
227 | from the upstream tarball. The Debian package of mcollective depends on |
228 | -libsystemu-ruby and ruby-json Debian packages. |
229 | +ruby-systemu and ruby-json Debian packages. |
230 | |
231 | Also ext/activemq/wlcg-patch.tgz and ext/activemq/apache-activemq.spec was |
232 | removed from Debian source tarball. It contains stuff from the ActiveMQ |
233 | |
234 | === modified file 'debian/changelog' |
235 | --- debian/changelog 2012-05-29 17:44:49 +0000 |
236 | +++ debian/changelog 2012-06-06 17:53:29 +0000 |
237 | @@ -1,3 +1,33 @@ |
238 | +mcollective (2.0.0+dfsg-1ubuntu1) quantal; urgency=low |
239 | + |
240 | + * Merge from debian unstable, remaning changes |
241 | + - debian/control: Package mcollective-middleware allows the user |
242 | + to install mcollective + his AMPQ server of choice, we now |
243 | + choose activemq by default but support for rabbitmq-stomp is |
244 | + also integrated |
245 | + - debian/mcollective.postinst: Added fix for mcollective server.cfg to |
246 | + avoid daemonize if running on system with upstart |
247 | + - debian/mcollective.postinst: Fixed tabs |
248 | + - debian/mcollective.upstart: Added upstart file |
249 | + * Added checks to avoid starting when RUN=no and when daemonize=1 |
250 | + on the config file (incompatible with upstart script) |
251 | + |
252 | + -- Marc Cluet <marc.cluet@ubuntu.com> Wed, 06 Jun 2012 14:18:14 +0100 |
253 | + |
254 | +mcollective (2.0.0+dfsg-1) unstable; urgency=low |
255 | + |
256 | + * New Upstream Release |
257 | + * d/mcollective.README.Debian: added note about the log feature |
258 | + of ActiveMQ. Thanks to R.I.Pienaar for the advice. |
259 | + * d/mcollective.triggers: Merged from Ubuntu package |
260 | + * Adding initial Dutch debconf translation from |
261 | + Jeroen Schot <schot@A-Eskwadraat.nl> (Closes: #671301) |
262 | + * d/copyright: updated to version 1.0 |
263 | + * d/control: updated standards version |
264 | + * d/control: updated binary list of mcollective-client |
265 | + |
266 | + -- Jonas Genannt <jonas.genannt@capi2name.de> Sun, 27 May 2012 16:53:56 +0200 |
267 | + |
268 | mcollective (1.2.1+dfsg-2ubuntu2) quantal; urgency=low |
269 | |
270 | * Fixed trigger issue in mcollective.postinst (LP: #999996) |
271 | |
272 | === modified file 'debian/control' |
273 | --- debian/control 2011-11-09 18:12:27 +0000 |
274 | +++ debian/control 2012-06-06 17:53:29 +0000 |
275 | @@ -5,7 +5,8 @@ |
276 | XSBC-Original-Maintainer: Puppet Package Maintainers <pkg-puppet-devel@lists.alioth.debian.org> |
277 | Uploaders: Jonas Genannt <jonas.genannt@capi2name.de>, Micah Anderson <micah@debian.org> |
278 | Build-Depends: debhelper (>= 8) |
279 | -Standards-Version: 3.9.2 |
280 | +DM-Upload-Allowed: yes |
281 | +Standards-Version: 3.9.3 |
282 | Homepage: http://projects.puppetlabs.com/projects/mcollective |
283 | Vcs-Git: git://git.debian.org/git/pkg-puppet/mcollective.git |
284 | Vcs-Browser: http://git.debian.org/?p=pkg-puppet/mcollective.git |
285 | @@ -15,7 +16,7 @@ |
286 | Depends: ${misc:Depends}, ruby | ruby-interpreter, mcollective-common (>= ${source:Version}) |
287 | Suggests: activemq |
288 | Recommends: mcollective-client |
289 | -Description: Build server orchestration or parallel job execution systems |
290 | +Description: Marionette Collective clustering framework - server |
291 | The Marionette Collective is a framework for building server |
292 | orchestration and parallel job execution systems. |
293 | . |
294 | @@ -23,7 +24,7 @@ |
295 | |
296 | Package: mcollective-middleware |
297 | Architecture: all |
298 | -Depends: ${misc:Depends}, activemq | rabbitmq-stomp, mcollective |
299 | +Depends: ${misc:Depends}, activemq | rabbitmq-stomp, mcollective (>= ${source:Version}) |
300 | Description: Build server orchestration or parallel job execution systems |
301 | The Marionette Collective aka. mcollective is a framework |
302 | to build server orchestration or parallel job execution system |
303 | @@ -36,25 +37,19 @@ |
304 | Architecture: all |
305 | Suggests: mcollective |
306 | Depends: ${misc:Depends}, ruby | ruby-interpreter, mcollective-common (>= ${source:Version}) |
307 | -Description: Build server orchestration or parallel job execution systems |
308 | - The Marionette Collective aka. mcollective is a framework |
309 | - to build server orchestration or parallel job execution system |
310 | +Description: Marionette Collective clustering framework - clients |
311 | + The Marionette Collective is a framework for building server |
312 | + orchestration and parallel job execution systems. |
313 | . |
314 | - This package contains the MCollective client utilities: |
315 | + This package provides the MCollective client utilities: |
316 | * mco |
317 | - * mc-rpc |
318 | - * mc-facts |
319 | - * mc-find-hosts |
320 | - * mc-ping |
321 | * mc-call-agent |
322 | - * mc-controller |
323 | - * mc-inventory |
324 | |
325 | Package: mcollective-common |
326 | Architecture: all |
327 | Suggests: mcollective-doc |
328 | -Depends: ${misc:Depends}, ruby | ruby-interpreter, rubygems, libstomp-ruby, libsystemu-ruby, ruby-json |
329 | -Description: Build server orchestration or parallel job execution systems |
330 | +Depends: ${misc:Depends}, ruby | ruby-interpreter, rubygems, ruby-stomp, ruby-systemu, ruby-json |
331 | +Description: Marionette Collective clustering framework - common files |
332 | The Marionette Collective is a framework for building server |
333 | orchestration and parallel job execution systems. |
334 | . |
335 | @@ -64,7 +59,7 @@ |
336 | Architecture: all |
337 | Section: doc |
338 | Depends: ${misc:Depends} |
339 | -Description: Documentation for mcollective |
340 | +Description: Marionette Collective clustering framework - documentation |
341 | The Marionette Collective is a framework for building server |
342 | orchestration and parallel job execution systems. |
343 | . |
344 | |
345 | === modified file 'debian/copyright' |
346 | --- debian/copyright 2011-11-09 18:12:27 +0000 |
347 | +++ debian/copyright 2012-06-06 17:53:29 +0000 |
348 | @@ -1,10 +1,10 @@ |
349 | -Format-Specification: http://anonscm.debian.org/viewvc/dep/web/deps/dep5.mdwn?revision=135 |
350 | -Maintainer: R.I.Pienaar <rip@devco.net> |
351 | +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ |
352 | +Upstream-Contact: R.I.Pienaar <rip@devco.net> |
353 | Source: http://downloads.puppetlabs.com/mcollective/ |
354 | -Name: Mcollective |
355 | +Upstream-Name: Mcollective |
356 | |
357 | Files: * |
358 | -Copyright: 2010 - 2011 Puppet Labs |
359 | +Copyright: 2010-2011 Puppet Labs |
360 | License: Apache |
361 | |
362 | Files: ext/stompclient |
363 | @@ -12,12 +12,12 @@ |
364 | License: Apache |
365 | |
366 | Files: ext/action_helpers/perl/lib/MCollective/Action.pm |
367 | -Copyright: 2011, Richard Clamp |
368 | +Copyright: 2011 Richard Clamp <richardc@unixbeard.net> |
369 | License: Artistic or GPL-1 |
370 | |
371 | Files: debian/* |
372 | -Copyright: 2010 - 2011, Riccardo Setti <giskard@debian.org> |
373 | - 2011, Jonas Genannt <jonas.genannt@capi2name.de> |
374 | +Copyright: 2010-2011 Riccardo Setti <giskard@debian.org> |
375 | + 2011 Jonas Genannt <jonas.genannt@capi2name.de> |
376 | License: Apache |
377 | |
378 | License: Apache |
379 | |
380 | === removed file 'debian/mcollective-client.config' |
381 | --- debian/mcollective-client.config 2011-06-27 10:09:19 +0000 |
382 | +++ debian/mcollective-client.config 1970-01-01 00:00:00 +0000 |
383 | @@ -1,9 +0,0 @@ |
384 | -#!/bin/sh -e |
385 | -# A simplified version of debconf's own config script. |
386 | -. /usr/share/debconf/confmodule |
387 | -# Ask for the stomp host |
388 | -db_get mcollective/stomp_host || true |
389 | -[ -z "$RET" ] && db_set mcollective/stomp_host "$(hostname)" |
390 | -db_input high mcollective/stomp_host || true |
391 | -db_input medium mcollective/psk_key || true |
392 | -db_go |
393 | |
394 | === removed file 'debian/mcollective-client.templates' |
395 | --- debian/mcollective-client.templates 2011-07-11 06:49:27 +0000 |
396 | +++ debian/mcollective-client.templates 1970-01-01 00:00:00 +0000 |
397 | @@ -1,11 +0,0 @@ |
398 | -Template: mcollective/stomp_host |
399 | -Type: string |
400 | -_Description: Location of the STOMP MPQ server: |
401 | - mcollective depends on a STOMP server to pass messages |
402 | - amongst the collective. |
403 | - |
404 | -Template: mcollective/psk_key |
405 | -Type: password |
406 | -_Description: PSK Key for mcollective: |
407 | - mcollective encrypts all its messages using a pre-shared key (PSK) |
408 | - by default it'll be set to "unset", you should change this |
409 | |
410 | === added file 'debian/mcollective-common.NEWS' |
411 | --- debian/mcollective-common.NEWS 1970-01-01 00:00:00 +0000 |
412 | +++ debian/mcollective-common.NEWS 2012-06-06 17:53:29 +0000 |
413 | @@ -0,0 +1,10 @@ |
414 | +mcollective (2.0.0+dfsg-1) unstable; urgency=low |
415 | + |
416 | + This release is not compatible with older versions. Client scripts and agents |
417 | + written for older versions will continue to work but a network hosting both |
418 | + 2.0.0 clients and older one will effectively be split into 2 networks. While |
419 | + planning your upgrade you should plan to have machines running the client for |
420 | + both versions to retain full control during upgrade. The upgrade is best done |
421 | + in an scheduled window where all machines are updated together. |
422 | + |
423 | + -- Jonas Genannt <jonas.genannt@capi2name.de> Sun, 27 May 2012 16:53:56 +0200 |
424 | |
425 | === modified file 'debian/mcollective-common.templates' |
426 | --- debian/mcollective-common.templates 2011-11-09 18:12:27 +0000 |
427 | +++ debian/mcollective-common.templates 2012-06-06 17:53:29 +0000 |
428 | @@ -1,31 +1,42 @@ |
429 | +# These templates have been reviewed by the debian-l10n-english |
430 | +# team |
431 | +# |
432 | +# If modifications/additions/rewording are needed, please ask |
433 | +# debian-l10n-english@lists.debian.org for advice. |
434 | +# |
435 | +# Even minor modifications require translation updates and such |
436 | +# changes should be coordinated with translators and reviewers. |
437 | + |
438 | Template: mcollective/security_psk |
439 | Type: string |
440 | Default: unset |
441 | -_Description: Security PSK key for all MCollective instances: |
442 | - Please specify the psk for security within your MCollective |
443 | - instances |
444 | +_Description: MCollective PSK: |
445 | + Please specify the Pre-Shared Key that should be used between |
446 | + MCollective instances. |
447 | |
448 | Template: mcollective/stomp_host |
449 | Type: string |
450 | Default: localhost |
451 | -_Description: Hostname of your ActiveMQ host: |
452 | - Please specify the hostname/ip address of your Message Queue |
453 | - server (Apache ActiceMQ). |
454 | +_Description: Message Queue server host: |
455 | + Please specify the hostname or IP address of the Message Queue server |
456 | + for MCollective. |
457 | |
458 | Template: mcollective/stomp_port |
459 | Type: string |
460 | Default: 6163 |
461 | -_Description: Port of your ActiveMQ instance: |
462 | - Please specify the port of your Message Queue server (Apache ActiveMQ). |
463 | +_Description: Message Queue server port: |
464 | + Please specify the listening port of the Message Queue server. |
465 | |
466 | Template: mcollective/stomp_user |
467 | Type: string |
468 | Default: mcollective |
469 | -_Description: STOMP user from your ActiveMQ instance: |
470 | - Please specify the username of your Message Queue server (Apache ActiveMQ). |
471 | +_Description: Message Queue server username: |
472 | + Please specify the STOMP username that should be used with the |
473 | + Message Queue server. |
474 | |
475 | Template: mcollective/stomp_password |
476 | Type: password |
477 | Default: marionette |
478 | -_Description: STOMP password from your ActiveMQ instance: |
479 | - Please specify the password of your Message Queue server (Apache ActiveMQ). |
480 | +_Description: Message Queue server password: |
481 | + Please specify the STOMP password that should be used with the |
482 | + Message Queue server. |
483 | |
484 | === modified file 'debian/mcollective.README.Debian' |
485 | --- debian/mcollective.README.Debian 2011-06-18 16:44:23 +0000 |
486 | +++ debian/mcollective.README.Debian 2012-06-06 17:53:29 +0000 |
487 | @@ -38,6 +38,11 @@ |
488 | |
489 | Edit configuration, setup new password and username. |
490 | |
491 | +In case you need logging: |
492 | + |
493 | + # cp /etc/activemq/instances-available/main/log4j.properties \ |
494 | + /etc/activemq/instances-available/mcollective/ |
495 | + |
496 | Register new ActiveMQ instance: |
497 | |
498 | # ln -s /etc/activemq/instances-available/mcollective \ |
499 | @@ -47,4 +52,12 @@ |
500 | |
501 | # invoke-rc.d activemq start |
502 | |
503 | + |
504 | +ActiveMQ Log configuration: |
505 | +-------------------------- |
506 | + |
507 | +By default ActiveMQ does not log. To enabled logging you need to copy |
508 | +the file /etc/activemq/instances-available/main/log4j.properties into |
509 | +your MCollective instance configuration directory. Than restart your ActiveMQ. |
510 | + |
511 | -- Jonas Genannt <jonas.genannt@capi2name.de> Mon 25 Jul 2011 20:36:23 +0200 |
512 | |
513 | === modified file 'debian/mcollective.postinst' |
514 | --- debian/mcollective.postinst 2012-05-29 17:44:49 +0000 |
515 | +++ debian/mcollective.postinst 2012-06-06 17:53:29 +0000 |
516 | @@ -13,58 +13,58 @@ |
517 | MCOLLECTIVE_SERVER_CFG="/etc/mcollective/server.cfg" |
518 | |
519 | case "$1" in |
520 | - configure) |
521 | - db_version 2.0 |
522 | - |
523 | - if [ ! -e "$MCOLLECTIVE_SERVER_CFG" ]; then |
524 | - cp /usr/share/mcollective/server.cfg $MCOLLECTIVE_SERVER_CFG |
525 | - fi |
526 | - |
527 | - if [ -f /etc/init/mcollective.conf ]; then |
528 | - sed -i "s@^daemonize.*@daemonize = 0@" $MCOLLECTIVE_SERVER_CFG |
529 | - fi |
530 | - |
531 | - chmod 600 $MCOLLECTIVE_SERVER_CFG |
532 | - |
533 | - db_get mcollective/start_on_boot |
534 | - MC_START_ONBOOT=${RET:-no} |
535 | - if [ "$MC_START_ONBOOT" = "true" ]; then |
536 | - MC_START_ONBOOT=yes |
537 | - else |
538 | - MC_START_ONBOOT=no |
539 | - fi |
540 | - |
541 | - db_get mcollective/security_psk |
542 | - MC_SECURITY_PSK=${RET:-} |
543 | - |
544 | - db_get mcollective/stomp_host |
545 | - MC_STOMP_HOST=${RET:-} |
546 | - |
547 | - db_get mcollective/stomp_port |
548 | - MC_STOMP_PORT=${RET:-} |
549 | - |
550 | - db_get mcollective/stomp_user |
551 | - MC_STOMP_USER=${RET:-} |
552 | - |
553 | - db_get mcollective/stomp_password |
554 | - MC_STOMP_PASSWORD=${RET:-} |
555 | - |
556 | - sed -i "s@^plugin.psk.*@plugin.psk = $MC_SECURITY_PSK@" $MCOLLECTIVE_SERVER_CFG |
557 | - sed -i "s@^plugin.stomp.host.*@plugin.stomp.host= $MC_STOMP_HOST@" $MCOLLECTIVE_SERVER_CFG |
558 | - sed -i "s@^plugin.stomp.port.*@plugin.stomp.port= $MC_STOMP_PORT@" $MCOLLECTIVE_SERVER_CFG |
559 | - sed -i "s@^plugin.stomp.user.*@plugin.stomp.user= $MC_STOMP_USER@" $MCOLLECTIVE_SERVER_CFG |
560 | - sed -i "s@^plugin.stomp.password.*@plugin.stomp.password= $MC_STOMP_PASSWORD@" $MCOLLECTIVE_SERVER_CFG |
561 | - |
562 | - sed -i "s@^RUN.*@RUN=$MC_START_ONBOOT@" /etc/default/mcollective |
563 | - |
564 | - db_stop |
565 | - ;; |
566 | - abort-upgrade|abort-remove|abort-deconfigure) |
567 | - ;; |
568 | - *) |
569 | - echo "postinst called with unknown argument \`${1}'" >&2 |
570 | - exit 1 |
571 | - ;; |
572 | + configure) |
573 | + db_version 2.0 |
574 | + |
575 | + if [ ! -e "$MCOLLECTIVE_SERVER_CFG" ]; then |
576 | + cp /usr/share/mcollective/server.cfg $MCOLLECTIVE_SERVER_CFG |
577 | + fi |
578 | + |
579 | + if [ -f /etc/init/mcollective.conf ]; then |
580 | + sed -i "s@^daemonize.*@daemonize = 0@" $MCOLLECTIVE_SERVER_CFG |
581 | + fi |
582 | + |
583 | + chmod 600 $MCOLLECTIVE_SERVER_CFG |
584 | + |
585 | + db_get mcollective/start_on_boot |
586 | + MC_START_ONBOOT=${RET:-no} |
587 | + if [ "$MC_START_ONBOOT" = "true" ]; then |
588 | + MC_START_ONBOOT=yes |
589 | + else |
590 | + MC_START_ONBOOT=no |
591 | + fi |
592 | + |
593 | + db_get mcollective/security_psk |
594 | + MC_SECURITY_PSK=${RET:-} |
595 | + |
596 | + db_get mcollective/stomp_host |
597 | + MC_STOMP_HOST=${RET:-} |
598 | + |
599 | + db_get mcollective/stomp_port |
600 | + MC_STOMP_PORT=${RET:-} |
601 | + |
602 | + db_get mcollective/stomp_user |
603 | + MC_STOMP_USER=${RET:-} |
604 | + |
605 | + db_get mcollective/stomp_password |
606 | + MC_STOMP_PASSWORD=${RET:-} |
607 | + |
608 | + sed -i "s@^plugin.psk.*@plugin.psk = $MC_SECURITY_PSK@" $MCOLLECTIVE_SERVER_CFG |
609 | + sed -i "s@^plugin.stomp.host.*@plugin.stomp.host= $MC_STOMP_HOST@" $MCOLLECTIVE_SERVER_CFG |
610 | + sed -i "s@^plugin.stomp.port.*@plugin.stomp.port= $MC_STOMP_PORT@" $MCOLLECTIVE_SERVER_CFG |
611 | + sed -i "s@^plugin.stomp.user.*@plugin.stomp.user= $MC_STOMP_USER@" $MCOLLECTIVE_SERVER_CFG |
612 | + sed -i "s@^plugin.stomp.password.*@plugin.stomp.password= $MC_STOMP_PASSWORD@" $MCOLLECTIVE_SERVER_CFG |
613 | + |
614 | + sed -i "s@^RUN.*@RUN=$MC_START_ONBOOT@" /etc/default/mcollective |
615 | + |
616 | + db_stop |
617 | + ;; |
618 | + abort-upgrade|abort-remove|abort-deconfigure) |
619 | + ;; |
620 | + *) |
621 | + echo "postinst called with unknown argument \`${1}'" >&2 |
622 | + exit 1 |
623 | + ;; |
624 | esac |
625 | |
626 | #DEBHELPER# |
627 | |
628 | === modified file 'debian/mcollective.templates' |
629 | --- debian/mcollective.templates 2011-11-09 18:12:27 +0000 |
630 | +++ debian/mcollective.templates 2012-06-06 17:53:29 +0000 |
631 | @@ -1,5 +1,15 @@ |
632 | +# These templates have been reviewed by the debian-l10n-english |
633 | +# team |
634 | +# |
635 | +# If modifications/additions/rewording are needed, please ask |
636 | +# debian-l10n-english@lists.debian.org for advice. |
637 | +# |
638 | +# Even minor modifications require translation updates and such |
639 | +# changes should be coordinated with translators and reviewers. |
640 | + |
641 | Template: mcollective/start_on_boot |
642 | Type: boolean |
643 | Default: false |
644 | -_Description: Should MCollective started onboot? |
645 | - Start MCollective daemon onboot. |
646 | +_Description: Start MCollective on boot? |
647 | + Please choose whether the MCollective daemon should be started when |
648 | + booting this machine. |
649 | |
650 | === modified file 'debian/mcollective.upstart' |
651 | --- debian/mcollective.upstart 2011-11-09 18:12:27 +0000 |
652 | +++ debian/mcollective.upstart 2012-06-06 17:53:29 +0000 |
653 | @@ -5,5 +5,20 @@ |
654 | stop on runlevel [!2345] |
655 | respawn |
656 | |
657 | +pre-start script |
658 | + # Check that our configuration file is sane |
659 | + if [ "$(cat /etc/mcollective/server.cfg | grep ^daemonize | awk -F"=" '{print $NF}' | tr -d " ")" -ne "0" ] |
660 | + then |
661 | + logger -is -t "$UPSTART_JOB" "ERROR: mcollective config in server.cfg sets daemonize=1, not compatible with upstart scripts, aborting start" |
662 | + exit 1 |
663 | + fi |
664 | + # Check that we're allowed to start |
665 | + if [ "$(cat /etc/default/mcollective | grep -i ^run | awk '{print $NF}')" = "no" ] |
666 | + then |
667 | + logger -is -t "$UPSTART_JOB" "ERROR: mcollective default is set to RUN=no, edit /etc/default/mcollective to change behaviour" |
668 | + exit 1 |
669 | + fi |
670 | +end script |
671 | + |
672 | env RUBYLIB=/usr/local/lib/site_ruby/1.8:$RUBYLIB |
673 | exec /usr/sbin/mcollectived --pid="/var/run/mcollectived.pid" --config="/etc/mcollective/server.cfg" |
674 | |
675 | === modified file 'debian/patches/pluginsdir.patch' |
676 | --- debian/patches/pluginsdir.patch 2011-11-09 18:12:27 +0000 |
677 | +++ debian/patches/pluginsdir.patch 2012-06-06 17:53:29 +0000 |
678 | @@ -1,30 +1,24 @@ |
679 | -Description: Move plugins dir, change stomp host |
680 | +Description: Move plugins dir |
681 | Author: <marc.cluet@ubuntu.com> |
682 | Upstream: no |
683 | -diff -uNr mcollective-1.2.0.orig/etc/client.cfg.dist mcollective-1.2.0/etc/client.cfg.dist |
684 | ---- mcollective-1.2.0.orig/etc/client.cfg.dist 2011-04-29 06:38:26.000000000 -0700 |
685 | -+++ mcollective-1.2.0/etc/client.cfg.dist 2011-05-05 07:34:31.503846649 -0700 |
686 | + |
687 | +diff --git a/etc/client.cfg.dist b/etc/client.cfg.dist |
688 | +index 3ad4203..dfb6530 100644 |
689 | +--- a/etc/client.cfg.dist |
690 | ++++ b/etc/client.cfg.dist |
691 | @@ -1,7 +1,7 @@ |
692 | topicprefix = /topic/ |
693 | main_collective = mcollective |
694 | collectives = mcollective |
695 | -libdir = /usr/libexec/mcollective |
696 | +libdir = /usr/share/mcollective/plugins |
697 | - logfile = /dev/null |
698 | - loglevel = info |
699 | - |
700 | -@@ -10,7 +10,7 @@ |
701 | - plugin.psk = unset |
702 | - |
703 | - connector = stomp |
704 | --plugin.stomp.host = stomp.example.com |
705 | -+plugin.stomp.host = localhost |
706 | - plugin.stomp.port = 6163 |
707 | - plugin.stomp.user = mcollective |
708 | - plugin.stomp.password = marionette |
709 | -diff -uNr mcollective-1.2.0.orig/etc/server.cfg.dist mcollective-1.2.0/etc/server.cfg.dist |
710 | ---- mcollective-1.2.0.orig/etc/server.cfg.dist 2011-04-29 06:38:26.000000000 -0700 |
711 | -+++ mcollective-1.2.0/etc/server.cfg.dist 2011-05-05 07:34:44.900541658 -0700 |
712 | + logger_type = console |
713 | + loglevel = warn |
714 | + |
715 | +diff --git a/etc/server.cfg.dist b/etc/server.cfg.dist |
716 | +index 4fec901..487f64e 100644 |
717 | +--- a/etc/server.cfg.dist |
718 | ++++ b/etc/server.cfg.dist |
719 | @@ -1,7 +1,7 @@ |
720 | topicprefix = /topic/ |
721 | main_collective = mcollective |
722 | @@ -34,12 +28,3 @@ |
723 | logfile = /var/log/mcollective.log |
724 | loglevel = info |
725 | daemonize = 1 |
726 | -@@ -11,7 +11,7 @@ |
727 | - plugin.psk = unset |
728 | - |
729 | - connector = stomp |
730 | --plugin.stomp.host = stomp.example.com |
731 | -+plugin.stomp.host = localhost |
732 | - plugin.stomp.port = 6163 |
733 | - plugin.stomp.user = mcollective |
734 | - plugin.stomp.password = marionette |
735 | |
736 | === added file 'debian/po/nl.po' |
737 | --- debian/po/nl.po 1970-01-01 00:00:00 +0000 |
738 | +++ debian/po/nl.po 2012-06-06 17:53:29 +0000 |
739 | @@ -0,0 +1,109 @@ |
740 | +# Dutch translation of mcollective debconf templates. |
741 | +# Copyright (C) 2012 THE PACKAGE'S COPYRIGHT HOLDER |
742 | +# This file is distributed under the same license as the mcollective package. |
743 | +# Jeroen Schot <schot@a-eskwadraat.nl>, 2012. |
744 | +# |
745 | +msgid "" |
746 | +msgstr "" |
747 | +"Project-Id-Version: mcollective 1.2.1+dfsg-2\n" |
748 | +"Report-Msgid-Bugs-To: mcollective@packages.debian.org\n" |
749 | +"POT-Creation-Date: 2011-10-10 07:09+0200\n" |
750 | +"PO-Revision-Date: 2012-05-03 09:27+0200\n" |
751 | +"Last-Translator: Jeroen Schot <schot@a-eskwadraat.nl>\n" |
752 | +"Language-Team: Debian l10n Dutch <debian-l10n-dutch@lists.debian.org>\n" |
753 | +"Language: nl\n" |
754 | +"MIME-Version: 1.0\n" |
755 | +"Content-Type: text/plain; charset=UTF-8\n" |
756 | +"Content-Transfer-Encoding: 8bit\n" |
757 | + |
758 | +#. Type: string |
759 | +#. Description |
760 | +#: ../mcollective-common.templates:2001 |
761 | +msgid "MCollective PSK:" |
762 | +msgstr "MCollective PSK:" |
763 | + |
764 | +#. Type: string |
765 | +#. Description |
766 | +#: ../mcollective-common.templates:2001 |
767 | +msgid "" |
768 | +"Please specify the Pre-Shared Key that should be used between MCollective " |
769 | +"instances." |
770 | +msgstr "" |
771 | +"Geef de vooraf gedeelde sleutel (PSK) die gebruikt moet worden tussen de " |
772 | +"verschillende MCollective-instanties." |
773 | + |
774 | +#. Type: string |
775 | +#. Description |
776 | +#: ../mcollective-common.templates:3001 |
777 | +msgid "Message Queue server host:" |
778 | +msgstr "Message-Qeueu-server:" |
779 | + |
780 | +#. Type: string |
781 | +#. Description |
782 | +#: ../mcollective-common.templates:3001 |
783 | +msgid "" |
784 | +"Please specify the hostname or IP address of the Message Queue server for " |
785 | +"MCollective." |
786 | +msgstr "" |
787 | +"Wat is de computernaam of het IP-adres van de Message-Queue-server voor " |
788 | +"MCollective?" |
789 | + |
790 | +#. Type: string |
791 | +#. Description |
792 | +#: ../mcollective-common.templates:4001 |
793 | +msgid "Message Queue server port:" |
794 | +msgstr "Message-Queue-serverpoort:" |
795 | + |
796 | +#. Type: string |
797 | +#. Description |
798 | +#: ../mcollective-common.templates:4001 |
799 | +msgid "Please specify the listening port of the Message Queue server." |
800 | +msgstr "Op welke poort moet de Message-Queue-server luisteren?" |
801 | + |
802 | +#. Type: string |
803 | +#. Description |
804 | +#: ../mcollective-common.templates:5001 |
805 | +msgid "Message Queue server username:" |
806 | +msgstr "Message Queue-servergebruikersnaam:" |
807 | + |
808 | +#. Type: string |
809 | +#. Description |
810 | +#: ../mcollective-common.templates:5001 |
811 | +msgid "" |
812 | +"Please specify the STOMP username that should be used with the Message Queue " |
813 | +"server." |
814 | +msgstr "" |
815 | +"Welke STOMP-gebruikersnaam moet er worden gebruikt met de Message-Queue-" |
816 | +"server?" |
817 | + |
818 | +#. Type: password |
819 | +#. Description |
820 | +#: ../mcollective-common.templates:6001 |
821 | +msgid "Message Queue server password:" |
822 | +msgstr "Message-Queue-serverwachtwoord:" |
823 | + |
824 | +#. Type: password |
825 | +#. Description |
826 | +#: ../mcollective-common.templates:6001 |
827 | +msgid "" |
828 | +"Please specify the STOMP password that should be used with the Message Queue " |
829 | +"server." |
830 | +msgstr "" |
831 | +"Wat is het STOMP-wachtwoord dat moet worden gebruikt met de Message-Queue-" |
832 | +"server?" |
833 | + |
834 | +#. Type: boolean |
835 | +#. Description |
836 | +#: ../mcollective.templates:2001 |
837 | +msgid "Start MCollective on boot?" |
838 | +msgstr "Mcollective opstarten bij de systeemstart?" |
839 | + |
840 | +#. Type: boolean |
841 | +#. Description |
842 | +#: ../mcollective.templates:2001 |
843 | +msgid "" |
844 | +"Please choose whether the MCollective daemon should be started when booting " |
845 | +"this machine." |
846 | +msgstr "" |
847 | +"Geef aan of de MCollective-achtergronddienst moet worden opgestart bij het " |
848 | +"starten van deze computer." |
849 | |
850 | === renamed directory 'doc' => 'doc' |
851 | === modified file 'doc/classes/Array.html' |
852 | --- doc/classes/Array.html 2011-11-09 18:12:27 +0000 |
853 | +++ doc/classes/Array.html 2012-06-06 17:53:29 +0000 |
854 | @@ -55,8 +55,8 @@ |
855 | <tr class="top-aligned-row"> |
856 | <td><strong>In:</strong></td> |
857 | <td> |
858 | - <a href="../files/plugins/mcollective/application/inventory_rb.html"> |
859 | - plugins/mcollective/application/inventory.rb |
860 | + <a href="../files/lib/mcollective/monkey_patches_rb.html"> |
861 | + lib/mcollective/monkey_patches.rb |
862 | </a> |
863 | <br /> |
864 | </td> |
865 | @@ -65,9 +65,7 @@ |
866 | <tr class="top-aligned-row"> |
867 | <td><strong>Parent:</strong></td> |
868 | <td> |
869 | - <a href="Object.html"> |
870 | Object |
871 | - </a> |
872 | </td> |
873 | </tr> |
874 | </table> |
875 | @@ -82,8 +80,7 @@ |
876 | |
877 | <div id="description"> |
878 | <p> |
879 | -Monkey patching array with a <a href="Array.html#M000002">in_groups_of</a> |
880 | -method that walks an array in groups, pass a block to call the block on |
881 | +a method # that walks an array in groups, pass a block to call the block on |
882 | each sub array |
883 | </p> |
884 | |
885 | @@ -96,7 +93,7 @@ |
886 | <h3 class="section-bar">Methods</h3> |
887 | |
888 | <div class="name-list"> |
889 | - <a href="#M000002">in_groups_of</a> |
890 | + <a href="#M000003">in_groups_of</a> |
891 | </div> |
892 | </div> |
893 | |
894 | @@ -118,43 +115,52 @@ |
895 | <div id="methods"> |
896 | <h3 class="section-bar">Public Instance methods</h3> |
897 | |
898 | - <div id="method-M000002" class="method-detail"> |
899 | - <a name="M000002"></a> |
900 | + <div id="method-M000003" class="method-detail"> |
901 | + <a name="M000003"></a> |
902 | |
903 | <div class="method-heading"> |
904 | - <a href="#M000002" class="method-signature"> |
905 | + <a href="#M000003" class="method-signature"> |
906 | <span class="method-name">in_groups_of</span><span class="method-args">(chunk_size, padded_with=nil) {|a| ...}</span> |
907 | </a> |
908 | </div> |
909 | |
910 | <div class="method-description"> |
911 | <p><a class="source-toggle" href="#" |
912 | - onclick="toggleCode('M000002-source');return false;">[Source]</a></p> |
913 | - <div class="method-source-code" id="M000002-source"> |
914 | + onclick="toggleCode('M000003-source');return false;">[Source]</a></p> |
915 | + <div class="method-source-code" id="M000003-source"> |
916 | <pre> |
917 | - <span class="ruby-comment cmt"># File plugins/mcollective/application/inventory.rb, line 7</span> |
918 | - 7: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">in_groups_of</span>(<span class="ruby-identifier">chunk_size</span>, <span class="ruby-identifier">padded_with</span>=<span class="ruby-keyword kw">nil</span>) |
919 | - 8: <span class="ruby-identifier">arr</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">clone</span> |
920 | - 9: |
921 | -10: <span class="ruby-comment cmt"># how many to add</span> |
922 | -11: <span class="ruby-identifier">padding</span> = <span class="ruby-identifier">chunk_size</span> <span class="ruby-operator">-</span> (<span class="ruby-identifier">arr</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">chunk_size</span>) |
923 | -12: |
924 | -13: <span class="ruby-comment cmt"># pad at the end</span> |
925 | -14: <span class="ruby-identifier">arr</span>.<span class="ruby-identifier">concat</span>([<span class="ruby-identifier">padded_with</span>] <span class="ruby-operator">*</span> <span class="ruby-identifier">padding</span>) |
926 | -15: |
927 | -16: <span class="ruby-comment cmt"># how many chunks we'll make</span> |
928 | -17: <span class="ruby-identifier">count</span> = <span class="ruby-identifier">arr</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">chunk_size</span> |
929 | -18: |
930 | -19: <span class="ruby-comment cmt"># make that many arrays</span> |
931 | -20: <span class="ruby-identifier">result</span> = [] |
932 | -21: <span class="ruby-identifier">count</span>.<span class="ruby-identifier">times</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">result</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">arr</span>[<span class="ruby-identifier">s</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">chunk_size</span>, <span class="ruby-identifier">chunk_size</span>]} |
933 | -22: |
934 | -23: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span> |
935 | -24: <span class="ruby-identifier">result</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">a</span>)} |
936 | -25: <span class="ruby-keyword kw">else</span> |
937 | -26: <span class="ruby-identifier">result</span> |
938 | -27: <span class="ruby-keyword kw">end</span> |
939 | -28: <span class="ruby-keyword kw">end</span> |
940 | + <span class="ruby-comment cmt"># File lib/mcollective/monkey_patches.rb, line 21</span> |
941 | +21: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">in_groups_of</span>(<span class="ruby-identifier">chunk_size</span>, <span class="ruby-identifier">padded_with</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>) |
942 | +22: <span class="ruby-identifier">arr</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">clone</span> |
943 | +23: |
944 | +24: <span class="ruby-comment cmt"># how many to add</span> |
945 | +25: <span class="ruby-identifier">padding</span> = <span class="ruby-identifier">chunk_size</span> <span class="ruby-operator">-</span> (<span class="ruby-identifier">arr</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">chunk_size</span>) |
946 | +26: |
947 | +27: <span class="ruby-comment cmt"># pad at the end</span> |
948 | +28: <span class="ruby-identifier">arr</span>.<span class="ruby-identifier">concat</span>([<span class="ruby-identifier">padded_with</span>] <span class="ruby-operator">*</span> <span class="ruby-identifier">padding</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">padding</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">chunk_size</span> |
949 | +29: |
950 | +30: <span class="ruby-comment cmt"># how many chunks we'll make</span> |
951 | +31: <span class="ruby-identifier">count</span> = <span class="ruby-identifier">arr</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">chunk_size</span> |
952 | +32: |
953 | +33: <span class="ruby-comment cmt"># make that many arrays</span> |
954 | +34: <span class="ruby-identifier">result</span> = [] |
955 | +35: <span class="ruby-identifier">count</span>.<span class="ruby-identifier">times</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">result</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">arr</span>[<span class="ruby-identifier">s</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">chunk_size</span>, <span class="ruby-identifier">chunk_size</span>]} |
956 | +36: |
957 | +37: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span> |
958 | +38: <span class="ruby-identifier">result</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span> |
959 | +39: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">arity</span> |
960 | +40: <span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span> |
961 | +41: <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">a</span>) |
962 | +42: <span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span> |
963 | +43: <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">a</span>, (<span class="ruby-identifier">i</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)) |
964 | +44: <span class="ruby-keyword kw">else</span> |
965 | +45: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Expected 1 or 2 arguments, got #{block.arity}"</span> |
966 | +46: <span class="ruby-keyword kw">end</span> |
967 | +47: <span class="ruby-keyword kw">end</span> |
968 | +48: <span class="ruby-keyword kw">else</span> |
969 | +49: <span class="ruby-identifier">result</span> |
970 | +50: <span class="ruby-keyword kw">end</span> |
971 | +51: <span class="ruby-keyword kw">end</span> |
972 | </pre> |
973 | </div> |
974 | </div> |
975 | |
976 | === added file 'doc/classes/Dir.html' |
977 | --- doc/classes/Dir.html 1970-01-01 00:00:00 +0000 |
978 | +++ doc/classes/Dir.html 2012-06-06 17:53:29 +0000 |
979 | @@ -0,0 +1,212 @@ |
980 | +<?xml version="1.0" encoding="iso-8859-1"?> |
981 | +<!DOCTYPE html |
982 | + PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
983 | + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
984 | + |
985 | +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
986 | +<head> |
987 | + <title>Class: Dir</title> |
988 | + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
989 | + <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
990 | + <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" /> |
991 | + <script type="text/javascript"> |
992 | + // <![CDATA[ |
993 | + |
994 | + function popupCode( url ) { |
995 | + window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") |
996 | + } |
997 | + |
998 | + function toggleCode( id ) { |
999 | + if ( document.getElementById ) |
1000 | + elem = document.getElementById( id ); |
1001 | + else if ( document.all ) |
1002 | + elem = eval( "document.all." + id ); |
1003 | + else |
1004 | + return false; |
1005 | + |
1006 | + elemStyle = elem.style; |
1007 | + |
1008 | + if ( elemStyle.display != "block" ) { |
1009 | + elemStyle.display = "block" |
1010 | + } else { |
1011 | + elemStyle.display = "none" |
1012 | + } |
1013 | + |
1014 | + return true; |
1015 | + } |
1016 | + |
1017 | + // Make codeblocks hidden by default |
1018 | + document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) |
1019 | + |
1020 | + // ]]> |
1021 | + </script> |
1022 | + |
1023 | +</head> |
1024 | +<body> |
1025 | + |
1026 | + |
1027 | + |
1028 | + <div id="classHeader"> |
1029 | + <table class="header-table"> |
1030 | + <tr class="top-aligned-row"> |
1031 | + <td><strong>Class</strong></td> |
1032 | + <td class="class-name-in-header">Dir</td> |
1033 | + </tr> |
1034 | + <tr class="top-aligned-row"> |
1035 | + <td><strong>In:</strong></td> |
1036 | + <td> |
1037 | + <a href="../files/lib/mcollective/monkey_patches_rb.html"> |
1038 | + lib/mcollective/monkey_patches.rb |
1039 | + </a> |
1040 | + <br /> |
1041 | + </td> |
1042 | + </tr> |
1043 | + |
1044 | + <tr class="top-aligned-row"> |
1045 | + <td><strong>Parent:</strong></td> |
1046 | + <td> |
1047 | + Object |
1048 | + </td> |
1049 | + </tr> |
1050 | + </table> |
1051 | + </div> |
1052 | + <!-- banner header --> |
1053 | + |
1054 | + <div id="bodyContent"> |
1055 | + |
1056 | + |
1057 | + |
1058 | + <div id="contextContent"> |
1059 | + |
1060 | + |
1061 | + |
1062 | + </div> |
1063 | + |
1064 | + <div id="method-list"> |
1065 | + <h3 class="section-bar">Methods</h3> |
1066 | + |
1067 | + <div class="name-list"> |
1068 | + <a href="#M000001">mktmpdir</a> |
1069 | + <a href="#M000002">tmpdir</a> |
1070 | + </div> |
1071 | + </div> |
1072 | + |
1073 | + </div> |
1074 | + |
1075 | + |
1076 | + <!-- if includes --> |
1077 | + |
1078 | + <div id="section"> |
1079 | + |
1080 | + |
1081 | + |
1082 | + |
1083 | + |
1084 | + |
1085 | + |
1086 | + |
1087 | + <!-- if method_list --> |
1088 | + <div id="methods"> |
1089 | + <h3 class="section-bar">Public Class methods</h3> |
1090 | + |
1091 | + <div id="method-M000001" class="method-detail"> |
1092 | + <a name="M000001"></a> |
1093 | + |
1094 | + <div class="method-heading"> |
1095 | + <a href="#M000001" class="method-signature"> |
1096 | + <span class="method-name">mktmpdir</span><span class="method-args">(prefix_suffix=nil, tmpdir=nil) {|path| ...}</span> |
1097 | + </a> |
1098 | + </div> |
1099 | + |
1100 | + <div class="method-description"> |
1101 | + <p><a class="source-toggle" href="#" |
1102 | + onclick="toggleCode('M000001-source');return false;">[Source]</a></p> |
1103 | + <div class="method-source-code" id="M000001-source"> |
1104 | +<pre> |
1105 | + <span class="ruby-comment cmt"># File lib/mcollective/monkey_patches.rb, line 55</span> |
1106 | +55: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">mktmpdir</span>(<span class="ruby-identifier">prefix_suffix</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">tmpdir</span>=<span class="ruby-keyword kw">nil</span>) |
1107 | +56: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">prefix_suffix</span> |
1108 | +57: <span class="ruby-keyword kw">when</span> <span class="ruby-keyword kw">nil</span> |
1109 | +58: <span class="ruby-identifier">prefix</span> = <span class="ruby-value str">"d"</span> |
1110 | +59: <span class="ruby-identifier">suffix</span> = <span class="ruby-value str">""</span> |
1111 | +60: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">String</span> |
1112 | +61: <span class="ruby-identifier">prefix</span> = <span class="ruby-identifier">prefix_suffix</span> |
1113 | +62: <span class="ruby-identifier">suffix</span> = <span class="ruby-value str">""</span> |
1114 | +63: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Array</span> |
1115 | +64: <span class="ruby-identifier">prefix</span> = <span class="ruby-identifier">prefix_suffix</span>[<span class="ruby-value">0</span>] |
1116 | +65: <span class="ruby-identifier">suffix</span> = <span class="ruby-identifier">prefix_suffix</span>[<span class="ruby-value">1</span>] |
1117 | +66: <span class="ruby-keyword kw">else</span> |
1118 | +67: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">"unexpected prefix_suffix: #{prefix_suffix.inspect}"</span> |
1119 | +68: <span class="ruby-keyword kw">end</span> |
1120 | +69: <span class="ruby-identifier">tmpdir</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">tmpdir</span> |
1121 | +70: <span class="ruby-identifier">t</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">"%Y%m%d"</span>) |
1122 | +71: <span class="ruby-identifier">n</span> = <span class="ruby-keyword kw">nil</span> |
1123 | +72: <span class="ruby-keyword kw">begin</span> |
1124 | +73: <span class="ruby-identifier">path</span> = <span class="ruby-node">"#{tmpdir}/#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"</span> |
1125 | +74: <span class="ruby-identifier">path</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"-#{n}"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">n</span> |
1126 | +75: <span class="ruby-identifier">path</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">suffix</span> |
1127 | +76: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">mkdir</span>(<span class="ruby-identifier">path</span>, <span class="ruby-value">0700</span>) |
1128 | +77: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EEXIST</span> |
1129 | +78: <span class="ruby-identifier">n</span> <span class="ruby-operator">||=</span> <span class="ruby-value">0</span> |
1130 | +79: <span class="ruby-identifier">n</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> |
1131 | +80: <span class="ruby-keyword kw">retry</span> |
1132 | +81: <span class="ruby-keyword kw">end</span> |
1133 | +82: |
1134 | +83: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span> |
1135 | +84: <span class="ruby-keyword kw">begin</span> |
1136 | +85: <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">path</span> |
1137 | +86: <span class="ruby-keyword kw">ensure</span> |
1138 | +87: <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">remove_entry_secure</span> <span class="ruby-identifier">path</span> |
1139 | +88: <span class="ruby-keyword kw">end</span> |
1140 | +89: <span class="ruby-keyword kw">else</span> |
1141 | +90: <span class="ruby-identifier">path</span> |
1142 | +91: <span class="ruby-keyword kw">end</span> |
1143 | +92: <span class="ruby-keyword kw">end</span> |
1144 | +</pre> |
1145 | + </div> |
1146 | + </div> |
1147 | + </div> |
1148 | + |
1149 | + <div id="method-M000002" class="method-detail"> |
1150 | + <a name="M000002"></a> |
1151 | + |
1152 | + <div class="method-heading"> |
1153 | + <a href="#M000002" class="method-signature"> |
1154 | + <span class="method-name">tmpdir</span><span class="method-args">()</span> |
1155 | + </a> |
1156 | + </div> |
1157 | + |
1158 | + <div class="method-description"> |
1159 | + <p><a class="source-toggle" href="#" |
1160 | + onclick="toggleCode('M000002-source');return false;">[Source]</a></p> |
1161 | + <div class="method-source-code" id="M000002-source"> |
1162 | +<pre> |
1163 | + <span class="ruby-comment cmt"># File lib/mcollective/monkey_patches.rb, line 94</span> |
1164 | + 94: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">tmpdir</span> |
1165 | + 95: <span class="ruby-identifier">tmp</span> = <span class="ruby-value str">'.'</span> |
1166 | + 96: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">dir</span> <span class="ruby-keyword kw">in</span> [<span class="ruby-constant">ENV</span>[<span class="ruby-value str">'TMPDIR'</span>], <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'TMP'</span>], <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'TEMP'</span>], <span class="ruby-value str">'/tmp'</span>] |
1167 | + 97: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dir</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">stat</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">stat</span>(<span class="ruby-identifier">dir</span>) <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">stat</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">stat</span>.<span class="ruby-identifier">writable?</span> |
1168 | + 98: <span class="ruby-identifier">tmp</span> = <span class="ruby-identifier">dir</span> |
1169 | + 99: <span class="ruby-keyword kw">break</span> |
1170 | +100: <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span> |
1171 | +101: <span class="ruby-keyword kw">end</span> |
1172 | +102: <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">tmp</span>) |
1173 | +103: <span class="ruby-keyword kw">end</span> |
1174 | +</pre> |
1175 | + </div> |
1176 | + </div> |
1177 | + </div> |
1178 | + |
1179 | + |
1180 | + </div> |
1181 | + |
1182 | + |
1183 | + </div> |
1184 | + |
1185 | + |
1186 | +<div id="validator-badges"> |
1187 | + <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> |
1188 | +</div> |
1189 | + |
1190 | +</body> |
1191 | +</html> |
1192 | \ No newline at end of file |
1193 | |
1194 | === modified file 'doc/classes/MCollective.html' |
1195 | --- doc/classes/MCollective.html 2011-11-09 18:12:27 +0000 |
1196 | +++ doc/classes/MCollective.html 2012-06-06 17:53:29 +0000 |
1197 | @@ -55,106 +55,6 @@ |
1198 | <tr class="top-aligned-row"> |
1199 | <td><strong>In:</strong></td> |
1200 | <td> |
1201 | - <a href="../files/spec/unit/facts_spec_rb.html"> |
1202 | - spec/unit/facts_spec.rb |
1203 | - </a> |
1204 | - <br /> |
1205 | - <a href="../files/spec/unit/optionparser_spec_rb.html"> |
1206 | - spec/unit/optionparser_spec.rb |
1207 | - </a> |
1208 | - <br /> |
1209 | - <a href="../files/spec/unit/pluginmanager_spec_rb.html"> |
1210 | - spec/unit/pluginmanager_spec.rb |
1211 | - </a> |
1212 | - <br /> |
1213 | - <a href="../files/spec/unit/log_spec_rb.html"> |
1214 | - spec/unit/log_spec.rb |
1215 | - </a> |
1216 | - <br /> |
1217 | - <a href="../files/spec/unit/vendor_spec_rb.html"> |
1218 | - spec/unit/vendor_spec.rb |
1219 | - </a> |
1220 | - <br /> |
1221 | - <a href="../files/spec/unit/shell_spec_rb.html"> |
1222 | - spec/unit/shell_spec.rb |
1223 | - </a> |
1224 | - <br /> |
1225 | - <a href="../files/spec/unit/application_spec_rb.html"> |
1226 | - spec/unit/application_spec.rb |
1227 | - </a> |
1228 | - <br /> |
1229 | - <a href="../files/spec/unit/rpc/actionrunner_spec_rb.html"> |
1230 | - spec/unit/rpc/actionrunner_spec.rb |
1231 | - </a> |
1232 | - <br /> |
1233 | - <a href="../files/spec/unit/rpc/reply_spec_rb.html"> |
1234 | - spec/unit/rpc/reply_spec.rb |
1235 | - </a> |
1236 | - <br /> |
1237 | - <a href="../files/spec/unit/rpc/request_spec_rb.html"> |
1238 | - spec/unit/rpc/request_spec.rb |
1239 | - </a> |
1240 | - <br /> |
1241 | - <a href="../files/spec/unit/rpc/agent_spec_rb.html"> |
1242 | - spec/unit/rpc/agent_spec.rb |
1243 | - </a> |
1244 | - <br /> |
1245 | - <a href="../files/spec/unit/rpc/result_spec_rb.html"> |
1246 | - spec/unit/rpc/result_spec.rb |
1247 | - </a> |
1248 | - <br /> |
1249 | - <a href="../files/spec/unit/rpc/stats_spec_rb.html"> |
1250 | - spec/unit/rpc/stats_spec.rb |
1251 | - </a> |
1252 | - <br /> |
1253 | - <a href="../files/spec/unit/config_spec_rb.html"> |
1254 | - spec/unit/config_spec.rb |
1255 | - </a> |
1256 | - <br /> |
1257 | - <a href="../files/spec/unit/applications_spec_rb.html"> |
1258 | - spec/unit/applications_spec.rb |
1259 | - </a> |
1260 | - <br /> |
1261 | - <a href="../files/spec/unit/util_spec_rb.html"> |
1262 | - spec/unit/util_spec.rb |
1263 | - </a> |
1264 | - <br /> |
1265 | - <a href="../files/spec/unit/ssl_spec_rb.html"> |
1266 | - spec/unit/ssl_spec.rb |
1267 | - </a> |
1268 | - <br /> |
1269 | - <a href="../files/lib/mcollective/logger_rb.html"> |
1270 | - lib/mcollective/logger.rb |
1271 | - </a> |
1272 | - <br /> |
1273 | - <a href="../files/lib/mcollective/pluginmanager_rb.html"> |
1274 | - lib/mcollective/pluginmanager.rb |
1275 | - </a> |
1276 | - <br /> |
1277 | - <a href="../files/lib/mcollective/optionparser_rb.html"> |
1278 | - lib/mcollective/optionparser.rb |
1279 | - </a> |
1280 | - <br /> |
1281 | - <a href="../files/lib/mcollective/vendor_rb.html"> |
1282 | - lib/mcollective/vendor.rb |
1283 | - </a> |
1284 | - <br /> |
1285 | - <a href="../files/lib/mcollective/runnerstats_rb.html"> |
1286 | - lib/mcollective/runnerstats.rb |
1287 | - </a> |
1288 | - <br /> |
1289 | - <a href="../files/lib/mcollective/application_rb.html"> |
1290 | - lib/mcollective/application.rb |
1291 | - </a> |
1292 | - <br /> |
1293 | - <a href="../files/lib/mcollective/runner_rb.html"> |
1294 | - lib/mcollective/runner.rb |
1295 | - </a> |
1296 | - <br /> |
1297 | - <a href="../files/lib/mcollective/security/base_rb.html"> |
1298 | - lib/mcollective/security/base.rb |
1299 | - </a> |
1300 | - <br /> |
1301 | <a href="../files/lib/mcollective/logger/syslog_logger_rb.html"> |
1302 | lib/mcollective/logger/syslog_logger.rb |
1303 | </a> |
1304 | @@ -171,96 +71,80 @@ |
1305 | lib/mcollective/logger/file_logger.rb |
1306 | </a> |
1307 | <br /> |
1308 | - <a href="../files/lib/mcollective/util_rb.html"> |
1309 | - lib/mcollective/util.rb |
1310 | + <a href="../files/lib/mcollective/optionparser_rb.html"> |
1311 | + lib/mcollective/optionparser.rb |
1312 | </a> |
1313 | <br /> |
1314 | - <a href="../files/lib/mcollective/facts/base_rb.html"> |
1315 | - lib/mcollective/facts/base.rb |
1316 | + <a href="../files/lib/mcollective/registration_rb.html"> |
1317 | + lib/mcollective/registration.rb |
1318 | </a> |
1319 | <br /> |
1320 | <a href="../files/lib/mcollective/log_rb.html"> |
1321 | lib/mcollective/log.rb |
1322 | </a> |
1323 | <br /> |
1324 | + <a href="../files/lib/mcollective/agents_rb.html"> |
1325 | + lib/mcollective/agents.rb |
1326 | + </a> |
1327 | + <br /> |
1328 | <a href="../files/lib/mcollective/connector/base_rb.html"> |
1329 | lib/mcollective/connector/base.rb |
1330 | </a> |
1331 | <br /> |
1332 | - <a href="../files/lib/mcollective/request_rb.html"> |
1333 | - lib/mcollective/request.rb |
1334 | + <a href="../files/lib/mcollective/runner_rb.html"> |
1335 | + lib/mcollective/runner.rb |
1336 | </a> |
1337 | <br /> |
1338 | - <a href="../files/lib/mcollective/connector_rb.html"> |
1339 | - lib/mcollective/connector.rb |
1340 | + <a href="../files/lib/mcollective/registration/base_rb.html"> |
1341 | + lib/mcollective/registration/base.rb |
1342 | </a> |
1343 | <br /> |
1344 | <a href="../files/lib/mcollective/ssl_rb.html"> |
1345 | lib/mcollective/ssl.rb |
1346 | </a> |
1347 | <br /> |
1348 | - <a href="../files/lib/mcollective/shell_rb.html"> |
1349 | - lib/mcollective/shell.rb |
1350 | - </a> |
1351 | - <br /> |
1352 | - <a href="../files/lib/mcollective/security_rb.html"> |
1353 | - lib/mcollective/security.rb |
1354 | - </a> |
1355 | - <br /> |
1356 | - <a href="../files/lib/mcollective/agents_rb.html"> |
1357 | - lib/mcollective/agents.rb |
1358 | - </a> |
1359 | - <br /> |
1360 | - <a href="../files/lib/mcollective/facts_rb.html"> |
1361 | - lib/mcollective/facts.rb |
1362 | - </a> |
1363 | - <br /> |
1364 | - <a href="../files/lib/mcollective/config_rb.html"> |
1365 | - lib/mcollective/config.rb |
1366 | - </a> |
1367 | - <br /> |
1368 | - <a href="../files/lib/mcollective/rpc_rb.html"> |
1369 | - lib/mcollective/rpc.rb |
1370 | - </a> |
1371 | - <br /> |
1372 | - <a href="../files/lib/mcollective/registration_rb.html"> |
1373 | - lib/mcollective/registration.rb |
1374 | - </a> |
1375 | - <br /> |
1376 | - <a href="../files/lib/mcollective/client_rb.html"> |
1377 | - lib/mcollective/client.rb |
1378 | - </a> |
1379 | - <br /> |
1380 | - <a href="../files/lib/mcollective/rpc/ddl_rb.html"> |
1381 | - lib/mcollective/rpc/ddl.rb |
1382 | - </a> |
1383 | - <br /> |
1384 | - <a href="../files/lib/mcollective/rpc/stats_rb.html"> |
1385 | - lib/mcollective/rpc/stats.rb |
1386 | + <a href="../files/lib/mcollective/application_rb.html"> |
1387 | + lib/mcollective/application.rb |
1388 | + </a> |
1389 | + <br /> |
1390 | + <a href="../files/lib/mcollective/matcher/scanner_rb.html"> |
1391 | + lib/mcollective/matcher/scanner.rb |
1392 | + </a> |
1393 | + <br /> |
1394 | + <a href="../files/lib/mcollective/matcher/parser_rb.html"> |
1395 | + lib/mcollective/matcher/parser.rb |
1396 | + </a> |
1397 | + <br /> |
1398 | + <a href="../files/lib/mcollective/rpc/reply_rb.html"> |
1399 | + lib/mcollective/rpc/reply.rb |
1400 | + </a> |
1401 | + <br /> |
1402 | + <a href="../files/lib/mcollective/rpc/request_rb.html"> |
1403 | + lib/mcollective/rpc/request.rb |
1404 | + </a> |
1405 | + <br /> |
1406 | + <a href="../files/lib/mcollective/rpc/audit_rb.html"> |
1407 | + lib/mcollective/rpc/audit.rb |
1408 | </a> |
1409 | <br /> |
1410 | <a href="../files/lib/mcollective/rpc/result_rb.html"> |
1411 | lib/mcollective/rpc/result.rb |
1412 | </a> |
1413 | <br /> |
1414 | - <a href="../files/lib/mcollective/rpc/agent_rb.html"> |
1415 | - lib/mcollective/rpc/agent.rb |
1416 | - </a> |
1417 | - <br /> |
1418 | <a href="../files/lib/mcollective/rpc/progress_rb.html"> |
1419 | lib/mcollective/rpc/progress.rb |
1420 | </a> |
1421 | <br /> |
1422 | - <a href="../files/lib/mcollective/rpc/request_rb.html"> |
1423 | - lib/mcollective/rpc/request.rb |
1424 | - </a> |
1425 | - <br /> |
1426 | <a href="../files/lib/mcollective/rpc/actionrunner_rb.html"> |
1427 | lib/mcollective/rpc/actionrunner.rb |
1428 | </a> |
1429 | <br /> |
1430 | - <a href="../files/lib/mcollective/rpc/audit_rb.html"> |
1431 | - lib/mcollective/rpc/audit.rb |
1432 | + <a href="../files/lib/mcollective/rpc/agent_rb.html"> |
1433 | + lib/mcollective/rpc/agent.rb |
1434 | + </a> |
1435 | + <br /> |
1436 | + <a href="../files/lib/mcollective/rpc/ddl_rb.html"> |
1437 | + lib/mcollective/rpc/ddl.rb |
1438 | </a> |
1439 | <br /> |
1440 | <a href="../files/lib/mcollective/rpc/client_rb.html"> |
1441 | @@ -271,74 +155,98 @@ |
1442 | lib/mcollective/rpc/helpers.rb |
1443 | </a> |
1444 | <br /> |
1445 | - <a href="../files/lib/mcollective/rpc/reply_rb.html"> |
1446 | - lib/mcollective/rpc/reply.rb |
1447 | + <a href="../files/lib/mcollective/rpc/stats_rb.html"> |
1448 | + lib/mcollective/rpc/stats.rb |
1449 | + </a> |
1450 | + <br /> |
1451 | + <a href="../files/lib/mcollective/shell_rb.html"> |
1452 | + lib/mcollective/shell.rb |
1453 | </a> |
1454 | <br /> |
1455 | <a href="../files/lib/mcollective/applications_rb.html"> |
1456 | lib/mcollective/applications.rb |
1457 | </a> |
1458 | <br /> |
1459 | - <a href="../files/lib/mcollective/registration/base_rb.html"> |
1460 | - lib/mcollective/registration/base.rb |
1461 | + <a href="../files/lib/mcollective/rpc_rb.html"> |
1462 | + lib/mcollective/rpc.rb |
1463 | + </a> |
1464 | + <br /> |
1465 | + <a href="../files/lib/mcollective/client_rb.html"> |
1466 | + lib/mcollective/client.rb |
1467 | + </a> |
1468 | + <br /> |
1469 | + <a href="../files/lib/mcollective/pluginmanager_rb.html"> |
1470 | + lib/mcollective/pluginmanager.rb |
1471 | + </a> |
1472 | + <br /> |
1473 | + <a href="../files/lib/mcollective/facts_rb.html"> |
1474 | + lib/mcollective/facts.rb |
1475 | + </a> |
1476 | + <br /> |
1477 | + <a href="../files/lib/mcollective/message_rb.html"> |
1478 | + lib/mcollective/message.rb |
1479 | + </a> |
1480 | + <br /> |
1481 | + <a href="../files/lib/mcollective/util_rb.html"> |
1482 | + lib/mcollective/util.rb |
1483 | + </a> |
1484 | + <br /> |
1485 | + <a href="../files/lib/mcollective/facts/base_rb.html"> |
1486 | + lib/mcollective/facts/base.rb |
1487 | + </a> |
1488 | + <br /> |
1489 | + <a href="../files/lib/mcollective/security/base_rb.html"> |
1490 | + lib/mcollective/security/base.rb |
1491 | + </a> |
1492 | + <br /> |
1493 | + <a href="../files/lib/mcollective/config_rb.html"> |
1494 | + lib/mcollective/config.rb |
1495 | + </a> |
1496 | + <br /> |
1497 | + <a href="../files/lib/mcollective/matcher_rb.html"> |
1498 | + lib/mcollective/matcher.rb |
1499 | + </a> |
1500 | + <br /> |
1501 | + <a href="../files/lib/mcollective/unix_daemon_rb.html"> |
1502 | + lib/mcollective/unix_daemon.rb |
1503 | + </a> |
1504 | + <br /> |
1505 | + <a href="../files/lib/mcollective/pluginpackager_rb.html"> |
1506 | + lib/mcollective/pluginpackager.rb |
1507 | + </a> |
1508 | + <br /> |
1509 | + <a href="../files/lib/mcollective/security_rb.html"> |
1510 | + lib/mcollective/security.rb |
1511 | + </a> |
1512 | + <br /> |
1513 | + <a href="../files/lib/mcollective/pluginpackager/standard_definition_rb.html"> |
1514 | + lib/mcollective/pluginpackager/standard_definition.rb |
1515 | + </a> |
1516 | + <br /> |
1517 | + <a href="../files/lib/mcollective/pluginpackager/agent_definition_rb.html"> |
1518 | + lib/mcollective/pluginpackager/agent_definition.rb |
1519 | + </a> |
1520 | + <br /> |
1521 | + <a href="../files/lib/mcollective/runnerstats_rb.html"> |
1522 | + lib/mcollective/runnerstats.rb |
1523 | + </a> |
1524 | + <br /> |
1525 | + <a href="../files/lib/mcollective/connector_rb.html"> |
1526 | + lib/mcollective/connector.rb |
1527 | + </a> |
1528 | + <br /> |
1529 | + <a href="../files/lib/mcollective/windows_daemon_rb.html"> |
1530 | + lib/mcollective/windows_daemon.rb |
1531 | + </a> |
1532 | + <br /> |
1533 | + <a href="../files/lib/mcollective/logger_rb.html"> |
1534 | + lib/mcollective/logger.rb |
1535 | </a> |
1536 | <br /> |
1537 | <a href="../files/lib/mcollective_rb.html"> |
1538 | lib/mcollective.rb |
1539 | </a> |
1540 | <br /> |
1541 | - <a href="../files/plugins/mcollective/agent/discovery_rb.html"> |
1542 | - plugins/mcollective/agent/discovery.rb |
1543 | - </a> |
1544 | - <br /> |
1545 | - <a href="../files/plugins/mcollective/agent/rpcutil_rb.html"> |
1546 | - plugins/mcollective/agent/rpcutil.rb |
1547 | - </a> |
1548 | - <br /> |
1549 | - <a href="../files/plugins/mcollective/security/sshkey_rb.html"> |
1550 | - plugins/mcollective/security/sshkey.rb |
1551 | - </a> |
1552 | - <br /> |
1553 | - <a href="../files/plugins/mcollective/security/ssl_rb.html"> |
1554 | - plugins/mcollective/security/ssl.rb |
1555 | - </a> |
1556 | - <br /> |
1557 | - <a href="../files/plugins/mcollective/security/aes_security_rb.html"> |
1558 | - plugins/mcollective/security/aes_security.rb |
1559 | - </a> |
1560 | - <br /> |
1561 | - <a href="../files/plugins/mcollective/security/psk_rb.html"> |
1562 | - plugins/mcollective/security/psk.rb |
1563 | - </a> |
1564 | - <br /> |
1565 | - <a href="../files/plugins/mcollective/facts/yaml_facts_rb.html"> |
1566 | - plugins/mcollective/facts/yaml_facts.rb |
1567 | - </a> |
1568 | - <br /> |
1569 | - <a href="../files/plugins/mcollective/connector/stomp_rb.html"> |
1570 | - plugins/mcollective/connector/stomp.rb |
1571 | - </a> |
1572 | - <br /> |
1573 | - <a href="../files/plugins/mcollective/audit/logfile_rb.html"> |
1574 | - plugins/mcollective/audit/logfile.rb |
1575 | - </a> |
1576 | - <br /> |
1577 | - <a href="../files/plugins/mcollective/application/help_rb.html"> |
1578 | - plugins/mcollective/application/help.rb |
1579 | - </a> |
1580 | - <br /> |
1581 | - <a href="../files/plugins/mcollective/application/controller_rb.html"> |
1582 | - plugins/mcollective/application/controller.rb |
1583 | - </a> |
1584 | - <br /> |
1585 | - <a href="../files/plugins/mcollective/application/ping_rb.html"> |
1586 | - plugins/mcollective/application/ping.rb |
1587 | - </a> |
1588 | - <br /> |
1589 | - <a href="../files/plugins/mcollective/registration/agentlist_rb.html"> |
1590 | - plugins/mcollective/registration/agentlist.rb |
1591 | - </a> |
1592 | - <br /> |
1593 | </td> |
1594 | </tr> |
1595 | |
1596 | @@ -376,7 +284,7 @@ |
1597 | <h3 class="section-bar">Methods</h3> |
1598 | |
1599 | <div class="name-list"> |
1600 | - <a href="#M000004">version</a> |
1601 | + <a href="#M000005">version</a> |
1602 | </div> |
1603 | </div> |
1604 | |
1605 | @@ -390,11 +298,12 @@ |
1606 | <div id="class-list"> |
1607 | <h3 class="section-bar">Classes and Modules</h3> |
1608 | |
1609 | - Module <a href="MCollective/Agent.html" class="link">MCollective::Agent</a><br /> |
1610 | -Module <a href="MCollective/Connector.html" class="link">MCollective::Connector</a><br /> |
1611 | + Module <a href="MCollective/Connector.html" class="link">MCollective::Connector</a><br /> |
1612 | Module <a href="MCollective/Facts.html" class="link">MCollective::Facts</a><br /> |
1613 | Module <a href="MCollective/Logger.html" class="link">MCollective::Logger</a><br /> |
1614 | +Module <a href="MCollective/Matcher.html" class="link">MCollective::Matcher</a><br /> |
1615 | Module <a href="MCollective/PluginManager.html" class="link">MCollective::PluginManager</a><br /> |
1616 | +Module <a href="MCollective/PluginPackager.html" class="link">MCollective::PluginPackager</a><br /> |
1617 | Module <a href="MCollective/RPC.html" class="link">MCollective::RPC</a><br /> |
1618 | Module <a href="MCollective/Registration.html" class="link">MCollective::Registration</a><br /> |
1619 | Module <a href="MCollective/Security.html" class="link">MCollective::Security</a><br /> |
1620 | @@ -405,24 +314,25 @@ |
1621 | Class <a href="MCollective/Client.html" class="link">MCollective::Client</a><br /> |
1622 | Class <a href="MCollective/Config.html" class="link">MCollective::Config</a><br /> |
1623 | Class <a href="MCollective/DDLValidationError.html" class="link">MCollective::DDLValidationError</a><br /> |
1624 | -Class <a href="MCollective/Foo.html" class="link">MCollective::Foo</a><br /> |
1625 | Class <a href="MCollective/InvalidRPCData.html" class="link">MCollective::InvalidRPCData</a><br /> |
1626 | Class <a href="MCollective/Log.html" class="link">MCollective::Log</a><br /> |
1627 | +Class <a href="MCollective/Message.html" class="link">MCollective::Message</a><br /> |
1628 | Class <a href="MCollective/MissingRPCData.html" class="link">MCollective::MissingRPCData</a><br /> |
1629 | Class <a href="MCollective/MsgDoesNotMatchRequestID.html" class="link">MCollective::MsgDoesNotMatchRequestID</a><br /> |
1630 | +Class <a href="MCollective/MsgTTLExpired.html" class="link">MCollective::MsgTTLExpired</a><br /> |
1631 | Class <a href="MCollective/NotTargettedAtUs.html" class="link">MCollective::NotTargettedAtUs</a><br /> |
1632 | Class <a href="MCollective/Optionparser.html" class="link">MCollective::Optionparser</a><br /> |
1633 | Class <a href="MCollective/RPCAborted.html" class="link">MCollective::RPCAborted</a><br /> |
1634 | Class <a href="MCollective/RPCError.html" class="link">MCollective::RPCError</a><br /> |
1635 | -Class <a href="MCollective/Request.html" class="link">MCollective::Request</a><br /> |
1636 | Class <a href="MCollective/Runner.html" class="link">MCollective::Runner</a><br /> |
1637 | Class <a href="MCollective/RunnerStats.html" class="link">MCollective::RunnerStats</a><br /> |
1638 | Class <a href="MCollective/SSL.html" class="link">MCollective::SSL</a><br /> |
1639 | Class <a href="MCollective/SecurityValidationFailed.html" class="link">MCollective::SecurityValidationFailed</a><br /> |
1640 | Class <a href="MCollective/Shell.html" class="link">MCollective::Shell</a><br /> |
1641 | +Class <a href="MCollective/UnixDaemon.html" class="link">MCollective::UnixDaemon</a><br /> |
1642 | Class <a href="MCollective/UnknownRPCAction.html" class="link">MCollective::UnknownRPCAction</a><br /> |
1643 | Class <a href="MCollective/UnknownRPCError.html" class="link">MCollective::UnknownRPCError</a><br /> |
1644 | -Class <a href="MCollective/Vendor.html" class="link">MCollective::Vendor</a><br /> |
1645 | +Class <a href="MCollective/WindowsDaemon.html" class="link">MCollective::WindowsDaemon</a><br /> |
1646 | |
1647 | </div> |
1648 | |
1649 | @@ -449,24 +359,24 @@ |
1650 | <div id="methods"> |
1651 | <h3 class="section-bar">Public Class methods</h3> |
1652 | |
1653 | - <div id="method-M000004" class="method-detail"> |
1654 | - <a name="M000004"></a> |
1655 | + <div id="method-M000005" class="method-detail"> |
1656 | + <a name="M000005"></a> |
1657 | |
1658 | <div class="method-heading"> |
1659 | - <a href="#M000004" class="method-signature"> |
1660 | + <a href="#M000005" class="method-signature"> |
1661 | <span class="method-name">version</span><span class="method-args">()</span> |
1662 | </a> |
1663 | </div> |
1664 | |
1665 | <div class="method-description"> |
1666 | <p><a class="source-toggle" href="#" |
1667 | - onclick="toggleCode('M000004-source');return false;">[Source]</a></p> |
1668 | - <div class="method-source-code" id="M000004-source"> |
1669 | + onclick="toggleCode('M000005-source');return false;">[Source]</a></p> |
1670 | + <div class="method-source-code" id="M000005-source"> |
1671 | <pre> |
1672 | - <span class="ruby-comment cmt"># File lib/mcollective.rb, line 60</span> |
1673 | -60: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">version</span> |
1674 | -61: <span class="ruby-constant">VERSION</span> |
1675 | -62: <span class="ruby-keyword kw">end</span> |
1676 | + <span class="ruby-comment cmt"># File lib/mcollective.rb, line 67</span> |
1677 | +67: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">version</span> |
1678 | +68: <span class="ruby-constant">VERSION</span> |
1679 | +69: <span class="ruby-keyword kw">end</span> |
1680 | </pre> |
1681 | </div> |
1682 | </div> |
1683 | |
1684 | === removed directory 'doc/classes/MCollective/Agent' |
1685 | === removed file 'doc/classes/MCollective/Agent.html' |
1686 | --- doc/classes/MCollective/Agent.html 2011-11-09 18:12:27 +0000 |
1687 | +++ doc/classes/MCollective/Agent.html 1970-01-01 00:00:00 +0000 |
1688 | @@ -1,116 +0,0 @@ |
1689 | -<?xml version="1.0" encoding="iso-8859-1"?> |
1690 | -<!DOCTYPE html |
1691 | - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
1692 | - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
1693 | - |
1694 | -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
1695 | -<head> |
1696 | - <title>Module: MCollective::Agent</title> |
1697 | - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
1698 | - <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
1699 | - <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> |
1700 | - <script type="text/javascript"> |
1701 | - // <![CDATA[ |
1702 | - |
1703 | - function popupCode( url ) { |
1704 | - window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") |
1705 | - } |
1706 | - |
1707 | - function toggleCode( id ) { |
1708 | - if ( document.getElementById ) |
1709 | - elem = document.getElementById( id ); |
1710 | - else if ( document.all ) |
1711 | - elem = eval( "document.all." + id ); |
1712 | - else |
1713 | - return false; |
1714 | - |
1715 | - elemStyle = elem.style; |
1716 | - |
1717 | - if ( elemStyle.display != "block" ) { |
1718 | - elemStyle.display = "block" |
1719 | - } else { |
1720 | - elemStyle.display = "none" |
1721 | - } |
1722 | - |
1723 | - return true; |
1724 | - } |
1725 | - |
1726 | - // Make codeblocks hidden by default |
1727 | - document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) |
1728 | - |
1729 | - // ]]> |
1730 | - </script> |
1731 | - |
1732 | -</head> |
1733 | -<body> |
1734 | - |
1735 | - |
1736 | - |
1737 | - <div id="classHeader"> |
1738 | - <table class="header-table"> |
1739 | - <tr class="top-aligned-row"> |
1740 | - <td><strong>Module</strong></td> |
1741 | - <td class="class-name-in-header">MCollective::Agent</td> |
1742 | - </tr> |
1743 | - <tr class="top-aligned-row"> |
1744 | - <td><strong>In:</strong></td> |
1745 | - <td> |
1746 | - <a href="../../files/plugins/mcollective/agent/discovery_rb.html"> |
1747 | - plugins/mcollective/agent/discovery.rb |
1748 | - </a> |
1749 | - <br /> |
1750 | - <a href="../../files/plugins/mcollective/agent/rpcutil_rb.html"> |
1751 | - plugins/mcollective/agent/rpcutil.rb |
1752 | - </a> |
1753 | - <br /> |
1754 | - </td> |
1755 | - </tr> |
1756 | - |
1757 | - </table> |
1758 | - </div> |
1759 | - <!-- banner header --> |
1760 | - |
1761 | - <div id="bodyContent"> |
1762 | - |
1763 | - |
1764 | - |
1765 | - <div id="contextContent"> |
1766 | - |
1767 | - |
1768 | - |
1769 | - </div> |
1770 | - |
1771 | - |
1772 | - </div> |
1773 | - |
1774 | - |
1775 | - <!-- if includes --> |
1776 | - |
1777 | - <div id="section"> |
1778 | - |
1779 | - <div id="class-list"> |
1780 | - <h3 class="section-bar">Classes and Modules</h3> |
1781 | - |
1782 | - Class <a href="Agent/Discovery.html" class="link">MCollective::Agent::Discovery</a><br /> |
1783 | -Class <a href="Agent/Rpcutil.html" class="link">MCollective::Agent::Rpcutil</a><br /> |
1784 | - |
1785 | - </div> |
1786 | - |
1787 | - |
1788 | - |
1789 | - |
1790 | - |
1791 | - |
1792 | - |
1793 | - <!-- if method_list --> |
1794 | - |
1795 | - |
1796 | - </div> |
1797 | - |
1798 | - |
1799 | -<div id="validator-badges"> |
1800 | - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> |
1801 | -</div> |
1802 | - |
1803 | -</body> |
1804 | -</html> |
1805 | \ No newline at end of file |
1806 | |
1807 | === removed file 'doc/classes/MCollective/Agent/Discovery.html' |
1808 | --- doc/classes/MCollective/Agent/Discovery.html 2011-11-09 18:12:27 +0000 |
1809 | +++ doc/classes/MCollective/Agent/Discovery.html 1970-01-01 00:00:00 +0000 |
1810 | @@ -1,251 +0,0 @@ |
1811 | -<?xml version="1.0" encoding="iso-8859-1"?> |
1812 | -<!DOCTYPE html |
1813 | - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
1814 | - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
1815 | - |
1816 | -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
1817 | -<head> |
1818 | - <title>Class: MCollective::Agent::Discovery</title> |
1819 | - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
1820 | - <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
1821 | - <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> |
1822 | - <script type="text/javascript"> |
1823 | - // <![CDATA[ |
1824 | - |
1825 | - function popupCode( url ) { |
1826 | - window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") |
1827 | - } |
1828 | - |
1829 | - function toggleCode( id ) { |
1830 | - if ( document.getElementById ) |
1831 | - elem = document.getElementById( id ); |
1832 | - else if ( document.all ) |
1833 | - elem = eval( "document.all." + id ); |
1834 | - else |
1835 | - return false; |
1836 | - |
1837 | - elemStyle = elem.style; |
1838 | - |
1839 | - if ( elemStyle.display != "block" ) { |
1840 | - elemStyle.display = "block" |
1841 | - } else { |
1842 | - elemStyle.display = "none" |
1843 | - } |
1844 | - |
1845 | - return true; |
1846 | - } |
1847 | - |
1848 | - // Make codeblocks hidden by default |
1849 | - document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) |
1850 | - |
1851 | - // ]]> |
1852 | - </script> |
1853 | - |
1854 | -</head> |
1855 | -<body> |
1856 | - |
1857 | - |
1858 | - |
1859 | - <div id="classHeader"> |
1860 | - <table class="header-table"> |
1861 | - <tr class="top-aligned-row"> |
1862 | - <td><strong>Class</strong></td> |
1863 | - <td class="class-name-in-header">MCollective::Agent::Discovery</td> |
1864 | - </tr> |
1865 | - <tr class="top-aligned-row"> |
1866 | - <td><strong>In:</strong></td> |
1867 | - <td> |
1868 | - <a href="../../../files/plugins/mcollective/agent/discovery_rb.html"> |
1869 | - plugins/mcollective/agent/discovery.rb |
1870 | - </a> |
1871 | - <br /> |
1872 | - </td> |
1873 | - </tr> |
1874 | - |
1875 | - <tr class="top-aligned-row"> |
1876 | - <td><strong>Parent:</strong></td> |
1877 | - <td> |
1878 | - <a href="../../Object.html"> |
1879 | - Object |
1880 | - </a> |
1881 | - </td> |
1882 | - </tr> |
1883 | - </table> |
1884 | - </div> |
1885 | - <!-- banner header --> |
1886 | - |
1887 | - <div id="bodyContent"> |
1888 | - |
1889 | - |
1890 | - |
1891 | - <div id="contextContent"> |
1892 | - |
1893 | - <div id="description"> |
1894 | - <p> |
1895 | -<a href="Discovery.html">Discovery</a> agent for The Marionette Collective |
1896 | -</p> |
1897 | -<p> |
1898 | -Released under the Apache License, Version 2 |
1899 | -</p> |
1900 | - |
1901 | - </div> |
1902 | - |
1903 | - |
1904 | - </div> |
1905 | - |
1906 | - <div id="method-list"> |
1907 | - <h3 class="section-bar">Methods</h3> |
1908 | - |
1909 | - <div class="name-list"> |
1910 | - <a href="#M000079">handlemsg</a> |
1911 | - <a href="#M000080">help</a> |
1912 | - <a href="#M000078">new</a> |
1913 | - </div> |
1914 | - </div> |
1915 | - |
1916 | - </div> |
1917 | - |
1918 | - |
1919 | - <!-- if includes --> |
1920 | - |
1921 | - <div id="section"> |
1922 | - |
1923 | - |
1924 | - |
1925 | - |
1926 | - |
1927 | - <div id="attribute-list"> |
1928 | - <h3 class="section-bar">Attributes</h3> |
1929 | - |
1930 | - <div class="name-list"> |
1931 | - <table> |
1932 | - <tr class="top-aligned-row context-row"> |
1933 | - <td class="context-item-name">meta</td> |
1934 | - <td class="context-item-value"> [R] </td> |
1935 | - <td class="context-item-desc"></td> |
1936 | - </tr> |
1937 | - <tr class="top-aligned-row context-row"> |
1938 | - <td class="context-item-name">timeout</td> |
1939 | - <td class="context-item-value"> [R] </td> |
1940 | - <td class="context-item-desc"></td> |
1941 | - </tr> |
1942 | - </table> |
1943 | - </div> |
1944 | - </div> |
1945 | - |
1946 | - |
1947 | - |
1948 | - <!-- if method_list --> |
1949 | - <div id="methods"> |
1950 | - <h3 class="section-bar">Public Class methods</h3> |
1951 | - |
1952 | - <div id="method-M000078" class="method-detail"> |
1953 | - <a name="M000078"></a> |
1954 | - |
1955 | - <div class="method-heading"> |
1956 | - <a href="#M000078" class="method-signature"> |
1957 | - <span class="method-name">new</span><span class="method-args">()</span> |
1958 | - </a> |
1959 | - </div> |
1960 | - |
1961 | - <div class="method-description"> |
1962 | - <p><a class="source-toggle" href="#" |
1963 | - onclick="toggleCode('M000078-source');return false;">[Source]</a></p> |
1964 | - <div class="method-source-code" id="M000078-source"> |
1965 | -<pre> |
1966 | - <span class="ruby-comment cmt"># File plugins/mcollective/agent/discovery.rb, line 9</span> |
1967 | - 9: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> |
1968 | -10: <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">pluginconf</span> |
1969 | -11: |
1970 | -12: <span class="ruby-ivar">@timeout</span> = <span class="ruby-value">5</span> |
1971 | -13: <span class="ruby-ivar">@timeout</span> = <span class="ruby-identifier">config</span>[<span class="ruby-value str">"discovery.timeout"</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">"discovery.timeout"</span>) |
1972 | -14: |
1973 | -15: <span class="ruby-ivar">@meta</span> = {<span class="ruby-identifier">:license</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"Apache License, Version 2"</span>, |
1974 | -16: <span class="ruby-identifier">:author</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"R.I.Pienaar <rip@devco.net>"</span>, |
1975 | -17: <span class="ruby-identifier">:timeout</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@timeout</span>} |
1976 | -18: <span class="ruby-keyword kw">end</span> |
1977 | -</pre> |
1978 | - </div> |
1979 | - </div> |
1980 | - </div> |
1981 | - |
1982 | - <h3 class="section-bar">Public Instance methods</h3> |
1983 | - |
1984 | - <div id="method-M000079" class="method-detail"> |
1985 | - <a name="M000079"></a> |
1986 | - |
1987 | - <div class="method-heading"> |
1988 | - <a href="#M000079" class="method-signature"> |
1989 | - <span class="method-name">handlemsg</span><span class="method-args">(msg, stomp)</span> |
1990 | - </a> |
1991 | - </div> |
1992 | - |
1993 | - <div class="method-description"> |
1994 | - <p><a class="source-toggle" href="#" |
1995 | - onclick="toggleCode('M000079-source');return false;">[Source]</a></p> |
1996 | - <div class="method-source-code" id="M000079-source"> |
1997 | -<pre> |
1998 | - <span class="ruby-comment cmt"># File plugins/mcollective/agent/discovery.rb, line 20</span> |
1999 | -20: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handlemsg</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">stomp</span>) |
2000 | -21: <span class="ruby-identifier">reply</span> = <span class="ruby-value str">"unknown request"</span> |
2001 | -22: |
2002 | -23: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">msg</span>[<span class="ruby-identifier">:body</span>] |
2003 | -24: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">"inventory"</span> |
2004 | -25: <span class="ruby-identifier">reply</span> = <span class="ruby-identifier">inventory</span> |
2005 | -26: |
2006 | -27: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/echo (.+)/</span> |
2007 | -28: <span class="ruby-identifier">reply</span> = <span class="ruby-identifier">$1</span> |
2008 | -29: |
2009 | -30: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">"ping"</span> |
2010 | -31: <span class="ruby-identifier">reply</span> = <span class="ruby-value str">"pong"</span> |
2011 | -32: |
2012 | -33: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/^get_fact (.+)/</span> |
2013 | -34: <span class="ruby-identifier">reply</span> = <span class="ruby-constant">Facts</span>[<span class="ruby-identifier">$1</span>] |
2014 | -35: |
2015 | -36: <span class="ruby-keyword kw">else</span> |
2016 | -37: <span class="ruby-identifier">reply</span> = <span class="ruby-node">"Unknown Request: #{msg[:body]}"</span> |
2017 | -38: <span class="ruby-keyword kw">end</span> |
2018 | -39: |
2019 | -40: <span class="ruby-identifier">reply</span> |
2020 | -41: <span class="ruby-keyword kw">end</span> |
2021 | -</pre> |
2022 | - </div> |
2023 | - </div> |
2024 | - </div> |
2025 | - |
2026 | - <div id="method-M000080" class="method-detail"> |
2027 | - <a name="M000080"></a> |
2028 | - |
2029 | - <div class="method-heading"> |
2030 | - <a href="#M000080" class="method-signature"> |
2031 | - <span class="method-name">help</span><span class="method-args">()</span> |
2032 | - </a> |
2033 | - </div> |
2034 | - |
2035 | - <div class="method-description"> |
2036 | - <p><a class="source-toggle" href="#" |
2037 | - onclick="toggleCode('M000080-source');return false;">[Source]</a></p> |
2038 | - <div class="method-source-code" id="M000080-source"> |
2039 | -<pre> |
2040 | - <span class="ruby-comment cmt"># File plugins/mcollective/agent/discovery.rb, line 43</span> |
2041 | -43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">help</span> |
2042 | -44: <span class="ruby-value str">"Discovery Agent\n===============\n\nAgent to facilitate discovery of machines and data about machines.\n\nAccepted Messages\n-----------------\n\ninventory - returns a hash with various bits of information like\nlist of agents, threads, etc\n\nping - simply responds with 'pong'\nget_fact fact - replies with the value of a facter fact\n"</span> |
2043 | -45: <span class="ruby-keyword kw">end</span> |
2044 | -</pre> |
2045 | - </div> |
2046 | - </div> |
2047 | - </div> |
2048 | - |
2049 | - |
2050 | - </div> |
2051 | - |
2052 | - |
2053 | - </div> |
2054 | - |
2055 | - |
2056 | -<div id="validator-badges"> |
2057 | - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> |
2058 | -</div> |
2059 | - |
2060 | -</body> |
2061 | -</html> |
2062 | \ No newline at end of file |
2063 | |
2064 | === removed file 'doc/classes/MCollective/Agent/Rpcutil.html' |
2065 | --- doc/classes/MCollective/Agent/Rpcutil.html 2011-11-09 18:12:27 +0000 |
2066 | +++ doc/classes/MCollective/Agent/Rpcutil.html 1970-01-01 00:00:00 +0000 |
2067 | @@ -1,111 +0,0 @@ |
2068 | -<?xml version="1.0" encoding="iso-8859-1"?> |
2069 | -<!DOCTYPE html |
2070 | - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
2071 | - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
2072 | - |
2073 | -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
2074 | -<head> |
2075 | - <title>Class: MCollective::Agent::Rpcutil</title> |
2076 | - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
2077 | - <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
2078 | - <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> |
2079 | - <script type="text/javascript"> |
2080 | - // <![CDATA[ |
2081 | - |
2082 | - function popupCode( url ) { |
2083 | - window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") |
2084 | - } |
2085 | - |
2086 | - function toggleCode( id ) { |
2087 | - if ( document.getElementById ) |
2088 | - elem = document.getElementById( id ); |
2089 | - else if ( document.all ) |
2090 | - elem = eval( "document.all." + id ); |
2091 | - else |
2092 | - return false; |
2093 | - |
2094 | - elemStyle = elem.style; |
2095 | - |
2096 | - if ( elemStyle.display != "block" ) { |
2097 | - elemStyle.display = "block" |
2098 | - } else { |
2099 | - elemStyle.display = "none" |
2100 | - } |
2101 | - |
2102 | - return true; |
2103 | - } |
2104 | - |
2105 | - // Make codeblocks hidden by default |
2106 | - document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) |
2107 | - |
2108 | - // ]]> |
2109 | - </script> |
2110 | - |
2111 | -</head> |
2112 | -<body> |
2113 | - |
2114 | - |
2115 | - |
2116 | - <div id="classHeader"> |
2117 | - <table class="header-table"> |
2118 | - <tr class="top-aligned-row"> |
2119 | - <td><strong>Class</strong></td> |
2120 | - <td class="class-name-in-header">MCollective::Agent::Rpcutil</td> |
2121 | - </tr> |
2122 | - <tr class="top-aligned-row"> |
2123 | - <td><strong>In:</strong></td> |
2124 | - <td> |
2125 | - <a href="../../../files/plugins/mcollective/agent/rpcutil_rb.html"> |
2126 | - plugins/mcollective/agent/rpcutil.rb |
2127 | - </a> |
2128 | - <br /> |
2129 | - </td> |
2130 | - </tr> |
2131 | - |
2132 | - <tr class="top-aligned-row"> |
2133 | - <td><strong>Parent:</strong></td> |
2134 | - <td> |
2135 | - RPC::Agent |
2136 | - </td> |
2137 | - </tr> |
2138 | - </table> |
2139 | - </div> |
2140 | - <!-- banner header --> |
2141 | - |
2142 | - <div id="bodyContent"> |
2143 | - |
2144 | - |
2145 | - |
2146 | - <div id="contextContent"> |
2147 | - |
2148 | - |
2149 | - |
2150 | - </div> |
2151 | - |
2152 | - |
2153 | - </div> |
2154 | - |
2155 | - |
2156 | - <!-- if includes --> |
2157 | - |
2158 | - <div id="section"> |
2159 | - |
2160 | - |
2161 | - |
2162 | - |
2163 | - |
2164 | - |
2165 | - |
2166 | - |
2167 | - <!-- if method_list --> |
2168 | - |
2169 | - |
2170 | - </div> |
2171 | - |
2172 | - |
2173 | -<div id="validator-badges"> |
2174 | - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> |
2175 | -</div> |
2176 | - |
2177 | -</body> |
2178 | -</html> |
2179 | \ No newline at end of file |
2180 | |
2181 | === modified file 'doc/classes/MCollective/Agents.html' |
2182 | --- doc/classes/MCollective/Agents.html 2011-11-09 18:12:27 +0000 |
2183 | +++ doc/classes/MCollective/Agents.html 2012-06-06 17:53:29 +0000 |
2184 | @@ -65,9 +65,7 @@ |
2185 | <tr class="top-aligned-row"> |
2186 | <td><strong>Parent:</strong></td> |
2187 | <td> |
2188 | - <a href="../Object.html"> |
2189 | Object |
2190 | - </a> |
2191 | </td> |
2192 | </tr> |
2193 | </table> |
2194 | @@ -96,14 +94,17 @@ |
2195 | <h3 class="section-bar">Methods</h3> |
2196 | |
2197 | <div class="name-list"> |
2198 | - <a href="#M000266">agentlist</a> |
2199 | - <a href="#M000265">dispatch</a> |
2200 | - <a href="#M000262">findagentfile</a> |
2201 | - <a href="#M000264">help</a> |
2202 | - <a href="#M000263">include?</a> |
2203 | - <a href="#M000261">loadagent</a> |
2204 | - <a href="#M000260">loadagents</a> |
2205 | - <a href="#M000259">new</a> |
2206 | + <a href="#M000313">activate_agent?</a> |
2207 | + <a href="#M000318">agentlist</a> |
2208 | + <a href="#M000312">class_for_agent</a> |
2209 | + <a href="#M000309">clear!</a> |
2210 | + <a href="#M000317">dispatch</a> |
2211 | + <a href="#M000314">findagentfile</a> |
2212 | + <a href="#M000316">help</a> |
2213 | + <a href="#M000315">include?</a> |
2214 | + <a href="#M000311">loadagent</a> |
2215 | + <a href="#M000310">loadagents</a> |
2216 | + <a href="#M000308">new</a> |
2217 | </div> |
2218 | </div> |
2219 | |
2220 | @@ -125,11 +126,11 @@ |
2221 | <div id="methods"> |
2222 | <h3 class="section-bar">Public Class methods</h3> |
2223 | |
2224 | - <div id="method-M000266" class="method-detail"> |
2225 | - <a name="M000266"></a> |
2226 | + <div id="method-M000318" class="method-detail"> |
2227 | + <a name="M000318"></a> |
2228 | |
2229 | <div class="method-heading"> |
2230 | - <a href="#M000266" class="method-signature"> |
2231 | + <a href="#M000318" class="method-signature"> |
2232 | <span class="method-name">agentlist</span><span class="method-args">()</span> |
2233 | </a> |
2234 | </div> |
2235 | @@ -139,41 +140,41 @@ |
2236 | Get a list of agents that we have |
2237 | </p> |
2238 | <p><a class="source-toggle" href="#" |
2239 | - onclick="toggleCode('M000266-source');return false;">[Source]</a></p> |
2240 | - <div class="method-source-code" id="M000266-source"> |
2241 | + onclick="toggleCode('M000318-source');return false;">[Source]</a></p> |
2242 | + <div class="method-source-code" id="M000318-source"> |
2243 | <pre> |
2244 | - <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 123</span> |
2245 | -123: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">agentlist</span> |
2246 | -124: <span class="ruby-ivar">@@agents</span>.<span class="ruby-identifier">keys</span> |
2247 | -125: <span class="ruby-keyword kw">end</span> |
2248 | + <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 156</span> |
2249 | +156: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">agentlist</span> |
2250 | +157: <span class="ruby-ivar">@@agents</span>.<span class="ruby-identifier">keys</span> |
2251 | +158: <span class="ruby-keyword kw">end</span> |
2252 | </pre> |
2253 | </div> |
2254 | </div> |
2255 | </div> |
2256 | |
2257 | - <div id="method-M000259" class="method-detail"> |
2258 | - <a name="M000259"></a> |
2259 | + <div id="method-M000308" class="method-detail"> |
2260 | + <a name="M000308"></a> |
2261 | |
2262 | <div class="method-heading"> |
2263 | - <a href="#M000259" class="method-signature"> |
2264 | - <span class="method-name">new</span><span class="method-args">()</span> |
2265 | + <a href="#M000308" class="method-signature"> |
2266 | + <span class="method-name">new</span><span class="method-args">(agents = {})</span> |
2267 | </a> |
2268 | </div> |
2269 | |
2270 | <div class="method-description"> |
2271 | <p><a class="source-toggle" href="#" |
2272 | - onclick="toggleCode('M000259-source');return false;">[Source]</a></p> |
2273 | - <div class="method-source-code" id="M000259-source"> |
2274 | + onclick="toggleCode('M000308-source');return false;">[Source]</a></p> |
2275 | + <div class="method-source-code" id="M000308-source"> |
2276 | <pre> |
2277 | <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 5</span> |
2278 | - 5: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> |
2279 | - 6: <span class="ruby-ivar">@config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span> |
2280 | - 7: <span class="ruby-identifier">raise</span> (<span class="ruby-value str">"Configuration has not been loaded, can't load agents"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">configured</span> |
2281 | + 5: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">agents</span> = {}) |
2282 | + 6: <span class="ruby-ivar">@config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span> |
2283 | + 7: <span class="ruby-identifier">raise</span> (<span class="ruby-value str">"Configuration has not been loaded, can't load agents"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">configured</span> |
2284 | 8: |
2285 | - 9: <span class="ruby-ivar">@@agents</span> = {} |
2286 | + 9: <span class="ruby-ivar">@@agents</span> = <span class="ruby-identifier">agents</span> |
2287 | 10: |
2288 | -11: <span class="ruby-identifier">loadagents</span> |
2289 | -12: <span class="ruby-keyword kw">end</span> |
2290 | +11: <span class="ruby-identifier">loadagents</span> |
2291 | +12: <span class="ruby-keyword kw">end</span> |
2292 | </pre> |
2293 | </div> |
2294 | </div> |
2295 | @@ -181,12 +182,106 @@ |
2296 | |
2297 | <h3 class="section-bar">Public Instance methods</h3> |
2298 | |
2299 | - <div id="method-M000265" class="method-detail"> |
2300 | - <a name="M000265"></a> |
2301 | - |
2302 | - <div class="method-heading"> |
2303 | - <a href="#M000265" class="method-signature"> |
2304 | - <span class="method-name">dispatch</span><span class="method-args">(msg, target, connection) {|replies| ...}</span> |
2305 | + <div id="method-M000313" class="method-detail"> |
2306 | + <a name="M000313"></a> |
2307 | + |
2308 | + <div class="method-heading"> |
2309 | + <a href="#M000313" class="method-signature"> |
2310 | + <span class="method-name">activate_agent?</span><span class="method-args">(agent)</span> |
2311 | + </a> |
2312 | + </div> |
2313 | + |
2314 | + <div class="method-description"> |
2315 | + <p> |
2316 | +Checks if a plugin should be activated by calling activate? on it if it |
2317 | +responds to that method else always activate it |
2318 | +</p> |
2319 | + <p><a class="source-toggle" href="#" |
2320 | + onclick="toggleCode('M000313-source');return false;">[Source]</a></p> |
2321 | + <div class="method-source-code" id="M000313-source"> |
2322 | +<pre> |
2323 | + <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 80</span> |
2324 | +80: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">activate_agent?</span>(<span class="ruby-identifier">agent</span>) |
2325 | +81: <span class="ruby-identifier">klass</span> = <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-value str">"MCollective"</span>).<span class="ruby-identifier">const_get</span>(<span class="ruby-value str">"Agent"</span>).<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">agent</span>.<span class="ruby-identifier">capitalize</span>) |
2326 | +82: |
2327 | +83: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value str">"activate?"</span>) |
2328 | +84: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">activate?</span> |
2329 | +85: <span class="ruby-keyword kw">else</span> |
2330 | +86: <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">"#{klass} does not have an activate? method, activating as default"</span>) |
2331 | +87: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> |
2332 | +88: <span class="ruby-keyword kw">end</span> |
2333 | +89: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span> |
2334 | +90: <span class="ruby-constant">Log</span>.<span class="ruby-identifier">warn</span>(<span class="ruby-node">"Agent activation check for #{agent} failed: #{e.class}: #{e}"</span>) |
2335 | +91: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> |
2336 | +92: <span class="ruby-keyword kw">end</span> |
2337 | +</pre> |
2338 | + </div> |
2339 | + </div> |
2340 | + </div> |
2341 | + |
2342 | + <div id="method-M000312" class="method-detail"> |
2343 | + <a name="M000312"></a> |
2344 | + |
2345 | + <div class="method-heading"> |
2346 | + <a href="#M000312" class="method-signature"> |
2347 | + <span class="method-name">class_for_agent</span><span class="method-args">(agent)</span> |
2348 | + </a> |
2349 | + </div> |
2350 | + |
2351 | + <div class="method-description"> |
2352 | + <p> |
2353 | +Builds a class name string given a Agent name |
2354 | +</p> |
2355 | + <p><a class="source-toggle" href="#" |
2356 | + onclick="toggleCode('M000312-source');return false;">[Source]</a></p> |
2357 | + <div class="method-source-code" id="M000312-source"> |
2358 | +<pre> |
2359 | + <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 73</span> |
2360 | +73: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">class_for_agent</span>(<span class="ruby-identifier">agent</span>) |
2361 | +74: <span class="ruby-node">"MCollective::Agent::#{agent.capitalize}"</span> |
2362 | +75: <span class="ruby-keyword kw">end</span> |
2363 | +</pre> |
2364 | + </div> |
2365 | + </div> |
2366 | + </div> |
2367 | + |
2368 | + <div id="method-M000309" class="method-detail"> |
2369 | + <a name="M000309"></a> |
2370 | + |
2371 | + <div class="method-heading"> |
2372 | + <a href="#M000309" class="method-signature"> |
2373 | + <span class="method-name">clear!</span><span class="method-args">()</span> |
2374 | + </a> |
2375 | + </div> |
2376 | + |
2377 | + <div class="method-description"> |
2378 | + <p> |
2379 | +Deletes all agents |
2380 | +</p> |
2381 | + <p><a class="source-toggle" href="#" |
2382 | + onclick="toggleCode('M000309-source');return false;">[Source]</a></p> |
2383 | + <div class="method-source-code" id="M000309-source"> |
2384 | +<pre> |
2385 | + <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 15</span> |
2386 | +15: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear!</span> |
2387 | +16: <span class="ruby-ivar">@@agents</span>.<span class="ruby-identifier">each_key</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">agent</span><span class="ruby-operator">|</span> |
2388 | +17: <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">delete</span> <span class="ruby-node">"#{agent}_agent"</span> |
2389 | +18: <span class="ruby-constant">Util</span>.<span class="ruby-identifier">unsubscribe</span>(<span class="ruby-constant">Util</span>.<span class="ruby-identifier">make_subscriptions</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">:broadcast</span>)) |
2390 | +19: <span class="ruby-keyword kw">end</span> |
2391 | +20: |
2392 | +21: <span class="ruby-ivar">@@agents</span> = {} |
2393 | +22: <span class="ruby-keyword kw">end</span> |
2394 | +</pre> |
2395 | + </div> |
2396 | + </div> |
2397 | + </div> |
2398 | + |
2399 | + <div id="method-M000317" class="method-detail"> |
2400 | + <a name="M000317"></a> |
2401 | + |
2402 | + <div class="method-heading"> |
2403 | + <a href="#M000317" class="method-signature"> |
2404 | + <span class="method-name">dispatch</span><span class="method-args">(request, connection) {|replies| ...}</span> |
2405 | </a> |
2406 | </div> |
2407 | |
2408 | @@ -196,45 +291,45 @@ |
2409 | there are any replies to process from the agent |
2410 | </p> |
2411 | <p><a class="source-toggle" href="#" |
2412 | - onclick="toggleCode('M000265-source');return false;">[Source]</a></p> |
2413 | - <div class="method-source-code" id="M000265-source"> |
2414 | + onclick="toggleCode('M000317-source');return false;">[Source]</a></p> |
2415 | + <div class="method-source-code" id="M000317-source"> |
2416 | <pre> |
2417 | - <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 96</span> |
2418 | - 96: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dispatch</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">target</span>, <span class="ruby-identifier">connection</span>) |
2419 | - 97: <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">"Dispatching a message to agent #{target}"</span>) |
2420 | - 98: |
2421 | - 99: <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> |
2422 | -100: <span class="ruby-keyword kw">begin</span> |
2423 | -101: <span class="ruby-identifier">agent</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-node">"#{target}_agent"</span>] |
2424 | -102: |
2425 | -103: <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-identifier">timeout</span>(<span class="ruby-identifier">agent</span>.<span class="ruby-identifier">timeout</span>) <span class="ruby-keyword kw">do</span> |
2426 | -104: <span class="ruby-identifier">replies</span> = <span class="ruby-identifier">agent</span>.<span class="ruby-identifier">handlemsg</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">connection</span>) |
2427 | -105: |
2428 | -106: <span class="ruby-comment cmt"># Agents can decide if they wish to reply or not,</span> |
2429 | -107: <span class="ruby-comment cmt"># returning nil will mean nothing goes back to the</span> |
2430 | -108: <span class="ruby-comment cmt"># requestor</span> |
2431 | -109: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">replies</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span> |
2432 | -110: <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">replies</span>) |
2433 | -111: <span class="ruby-keyword kw">end</span> |
2434 | -112: <span class="ruby-keyword kw">end</span> |
2435 | -113: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span> |
2436 | -114: <span class="ruby-constant">Log</span>.<span class="ruby-identifier">warn</span>(<span class="ruby-node">"Timeout while handling message for #{target}"</span>) |
2437 | -115: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span> |
2438 | -116: <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">"Execution of #{target} failed: #{e}"</span>) |
2439 | -117: <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">"\n\t\t"</span>)) |
2440 | -118: <span class="ruby-keyword kw">end</span> |
2441 | -119: <span class="ruby-keyword kw">end</span> |
2442 | -120: <span class="ruby-keyword kw">end</span> |
2443 | + <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 129</span> |
2444 | +129: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dispatch</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">connection</span>) |
2445 | +130: <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">"Dispatching a message to agent #{request.agent}"</span>) |
2446 | +131: |
2447 | +132: <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> |
2448 | +133: <span class="ruby-keyword kw">begin</span> |
2449 | +134: <span class="ruby-identifier">agent</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-node">"#{request.agent}_agent"</span>] |
2450 | +135: |
2451 | +136: <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-identifier">timeout</span>(<span class="ruby-identifier">agent</span>.<span class="ruby-identifier">timeout</span>) <span class="ruby-keyword kw">do</span> |
2452 | +137: <span class="ruby-identifier">replies</span> = <span class="ruby-identifier">agent</span>.<span class="ruby-identifier">handlemsg</span>(<span class="ruby-identifier">request</span>.<span class="ruby-identifier">payload</span>, <span class="ruby-identifier">connection</span>) |
2453 | +138: |
2454 | +139: <span class="ruby-comment cmt"># Agents can decide if they wish to reply or not,</span> |
2455 | +140: <span class="ruby-comment cmt"># returning nil will mean nothing goes back to the</span> |
2456 | +141: <span class="ruby-comment cmt"># requestor</span> |
2457 | +142: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">replies</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span> |
2458 | +143: <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">replies</span>) |
2459 | +144: <span class="ruby-keyword kw">end</span> |
2460 | +145: <span class="ruby-keyword kw">end</span> |
2461 | +146: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span> |
2462 | +147: <span class="ruby-constant">Log</span>.<span class="ruby-identifier">warn</span>(<span class="ruby-node">"Timeout while handling message for #{request.agent}"</span>) |
2463 | +148: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span> |
2464 | +149: <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">"Execution of #{request.agent} failed: #{e}"</span>) |
2465 | +150: <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">"\n\t\t"</span>)) |
2466 | +151: <span class="ruby-keyword kw">end</span> |
2467 | +152: <span class="ruby-keyword kw">end</span> |
2468 | +153: <span class="ruby-keyword kw">end</span> |
2469 | </pre> |
2470 | </div> |
2471 | </div> |
2472 | </div> |
2473 | |
2474 | - <div id="method-M000262" class="method-detail"> |
2475 | - <a name="M000262"></a> |
2476 | + <div id="method-M000314" class="method-detail"> |
2477 | + <a name="M000314"></a> |
2478 | |
2479 | <div class="method-heading"> |
2480 | - <a href="#M000262" class="method-signature"> |
2481 | + <a href="#M000314" class="method-signature"> |
2482 | <span class="method-name">findagentfile</span><span class="method-args">(agentname)</span> |
2483 | </a> |
2484 | </div> |
2485 | @@ -244,67 +339,67 @@ |
2486 | searches the libdirs for agents |
2487 | </p> |
2488 | <p><a class="source-toggle" href="#" |
2489 | - onclick="toggleCode('M000262-source');return false;">[Source]</a></p> |
2490 | - <div class="method-source-code" id="M000262-source"> |
2491 | + onclick="toggleCode('M000314-source');return false;">[Source]</a></p> |
2492 | + <div class="method-source-code" id="M000314-source"> |
2493 | <pre> |
2494 | - <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 62</span> |
2495 | -62: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">findagentfile</span>(<span class="ruby-identifier">agentname</span>) |
2496 | -63: <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">libdir</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">libdir</span><span class="ruby-operator">|</span> |
2497 | -64: <span class="ruby-identifier">agentfile</span> = <span class="ruby-node">"#{libdir}/mcollective/agent/#{agentname}.rb"</span> |
2498 | -65: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">agentfile</span>) |
2499 | -66: <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">"Found #{agentname} at #{agentfile}"</span>) |
2500 | -67: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">agentfile</span> |
2501 | -68: <span class="ruby-keyword kw">end</span> |
2502 | -69: <span class="ruby-keyword kw">end</span> |
2503 | -70: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> |
2504 | -71: <span class="ruby-keyword kw">end</span> |
2505 | + <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 95</span> |
2506 | + 95: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">findagentfile</span>(<span class="ruby-identifier">agentname</span>) |
2507 | + 96: <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">libdir</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">libdir</span><span class="ruby-operator">|</span> |
2508 | + 97: <span class="ruby-identifier">agentfile</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>([<span class="ruby-identifier">libdir</span>, <span class="ruby-value str">"mcollective"</span>, <span class="ruby-value str">"agent"</span>, <span class="ruby-node">"#{agentname}.rb"</span>]) |
2509 | + 98: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">agentfile</span>) |
2510 | + 99: <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">"Found #{agentname} at #{agentfile}"</span>) |
2511 | +100: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">agentfile</span> |
2512 | +101: <span class="ruby-keyword kw">end</span> |
2513 | +102: <span class="ruby-keyword kw">end</span> |
2514 | +103: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> |
2515 | +104: <span class="ruby-keyword kw">end</span> |
2516 | </pre> |
2517 | </div> |
2518 | </div> |
2519 | </div> |
2520 | |
2521 | - <div id="method-M000264" class="method-detail"> |
2522 | - <a name="M000264"></a> |
2523 | + <div id="method-M000316" class="method-detail"> |
2524 | + <a name="M000316"></a> |
2525 | |
2526 | <div class="method-heading"> |
2527 | - <a href="#M000264" class="method-signature"> |
2528 | + <a href="#M000316" class="method-signature"> |
2529 | <span class="method-name">help</span><span class="method-args">(agentname)</span> |
2530 | </a> |
2531 | </div> |
2532 | |
2533 | <div class="method-description"> |
2534 | <p> |
2535 | -Returns the <a href="Agents.html#M000264">help</a> for an agent after first |
2536 | +Returns the <a href="Agents.html#M000316">help</a> for an agent after first |
2537 | trying to get rid of some indentation infront |
2538 | </p> |
2539 | <p><a class="source-toggle" href="#" |
2540 | - onclick="toggleCode('M000264-source');return false;">[Source]</a></p> |
2541 | - <div class="method-source-code" id="M000264-source"> |
2542 | + onclick="toggleCode('M000316-source');return false;">[Source]</a></p> |
2543 | + <div class="method-source-code" id="M000316-source"> |
2544 | <pre> |
2545 | - <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 80</span> |
2546 | -80: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">help</span>(<span class="ruby-identifier">agentname</span>) |
2547 | -81: <span class="ruby-identifier">raise</span>(<span class="ruby-value str">"No such agent"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">include?</span>(<span class="ruby-identifier">agentname</span>) |
2548 | -82: |
2549 | -83: <span class="ruby-identifier">body</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-node">"#{agentname}_agent"</span>].<span class="ruby-identifier">help</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">"\n"</span>) |
2550 | -84: |
2551 | -85: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^(\s+)\S/</span> |
2552 | -86: <span class="ruby-identifier">indent</span> = <span class="ruby-identifier">$1</span> |
2553 | -87: |
2554 | -88: <span class="ruby-identifier">body</span> = <span class="ruby-identifier">body</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">b</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/^#{indent}/</span>, <span class="ruby-value str">""</span>)} |
2555 | -89: <span class="ruby-keyword kw">end</span> |
2556 | -90: |
2557 | -91: <span class="ruby-identifier">body</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">"\n"</span>) |
2558 | -92: <span class="ruby-keyword kw">end</span> |
2559 | + <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 113</span> |
2560 | +113: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">help</span>(<span class="ruby-identifier">agentname</span>) |
2561 | +114: <span class="ruby-identifier">raise</span>(<span class="ruby-value str">"No such agent"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">include?</span>(<span class="ruby-identifier">agentname</span>) |
2562 | +115: |
2563 | +116: <span class="ruby-identifier">body</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-node">"#{agentname}_agent"</span>].<span class="ruby-identifier">help</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">"\n"</span>) |
2564 | +117: |
2565 | +118: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^(\s+)\S/</span> |
2566 | +119: <span class="ruby-identifier">indent</span> = <span class="ruby-identifier">$1</span> |
2567 | +120: |
2568 | +121: <span class="ruby-identifier">body</span> = <span class="ruby-identifier">body</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span> <span class="ruby-identifier">b</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/^#{indent}/</span>, <span class="ruby-value str">""</span>)} |
2569 | +122: <span class="ruby-keyword kw">end</span> |
2570 | +123: |
2571 | +124: <span class="ruby-identifier">body</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">"\n"</span>) |
2572 | +125: <span class="ruby-keyword kw">end</span> |
2573 | </pre> |
2574 | </div> |
2575 | </div> |
2576 | </div> |
2577 | |
2578 | - <div id="method-M000263" class="method-detail"> |
2579 | - <a name="M000263"></a> |
2580 | + <div id="method-M000315" class="method-detail"> |
2581 | + <a name="M000315"></a> |
2582 | |
2583 | <div class="method-heading"> |
2584 | - <a href="#M000263" class="method-signature"> |
2585 | + <a href="#M000315" class="method-signature"> |
2586 | <span class="method-name">include?</span><span class="method-args">(agentname)</span> |
2587 | </a> |
2588 | </div> |
2589 | @@ -314,23 +409,23 @@ |
2590 | Determines if we have an agent with a certain name |
2591 | </p> |
2592 | <p><a class="source-toggle" href="#" |
2593 | - onclick="toggleCode('M000263-source');return false;">[Source]</a></p> |
2594 | - <div class="method-source-code" id="M000263-source"> |
2595 | + onclick="toggleCode('M000315-source');return false;">[Source]</a></p> |
2596 | + <div class="method-source-code" id="M000315-source"> |
2597 | <pre> |
2598 | - <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 74</span> |
2599 | -74: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">include?</span>(<span class="ruby-identifier">agentname</span>) |
2600 | -75: <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-node">"#{agentname}_agent"</span>) |
2601 | -76: <span class="ruby-keyword kw">end</span> |
2602 | + <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 107</span> |
2603 | +107: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">include?</span>(<span class="ruby-identifier">agentname</span>) |
2604 | +108: <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-node">"#{agentname}_agent"</span>) |
2605 | +109: <span class="ruby-keyword kw">end</span> |
2606 | </pre> |
2607 | </div> |
2608 | </div> |
2609 | </div> |
2610 | |
2611 | - <div id="method-M000261" class="method-detail"> |
2612 | - <a name="M000261"></a> |
2613 | + <div id="method-M000311" class="method-detail"> |
2614 | + <a name="M000311"></a> |
2615 | |
2616 | <div class="method-heading"> |
2617 | - <a href="#M000261" class="method-signature"> |
2618 | + <a href="#M000311" class="method-signature"> |
2619 | <span class="method-name">loadagent</span><span class="method-args">(agentname)</span> |
2620 | </a> |
2621 | </div> |
2622 | @@ -340,42 +435,49 @@ |
2623 | Loads a specified agent from disk if available |
2624 | </p> |
2625 | <p><a class="source-toggle" href="#" |
2626 | - onclick="toggleCode('M000261-source');return false;">[Source]</a></p> |
2627 | - <div class="method-source-code" id="M000261-source"> |
2628 | + onclick="toggleCode('M000311-source');return false;">[Source]</a></p> |
2629 | + <div class="method-source-code" id="M000311-source"> |
2630 | <pre> |
2631 | - <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 38</span> |
2632 | -38: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">loadagent</span>(<span class="ruby-identifier">agentname</span>) |
2633 | -39: <span class="ruby-identifier">agentfile</span> = <span class="ruby-identifier">findagentfile</span>(<span class="ruby-identifier">agentname</span>) |
2634 | -40: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">agentfile</span> |
2635 | -41: <span class="ruby-identifier">classname</span> = <span class="ruby-node">"MCollective::Agent::#{agentname.capitalize}"</span> |
2636 | -42: |
2637 | -43: <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-node">"#{agentname}_agent"</span>) |
2638 | -44: |
2639 | -45: <span class="ruby-keyword kw">begin</span> |
2640 | -46: <span class="ruby-identifier">single_instance</span> = [<span class="ruby-value str">"registration"</span>, <span class="ruby-value str">"discovery"</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">agentname</span>) |
2641 | -47: |
2642 | -48: <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">loadclass</span>(<span class="ruby-identifier">classname</span>) |
2643 | -49: <span class="ruby-constant">PluginManager</span> <span class="ruby-operator"><<</span> {<span class="ruby-identifier">:type</span> =<span class="ruby-operator">></span> <span class="ruby-node">"#{agentname}_agent"</span>, <span class="ruby-identifier">:class</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">classname</span>, <span class="ruby-identifier">:single_instance</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">single_instance</span>} |
2644 | -50: |
2645 | -51: <span class="ruby-constant">Util</span>.<span class="ruby-identifier">subscribe</span>(<span class="ruby-constant">Util</span>.<span class="ruby-identifier">make_target</span>(<span class="ruby-identifier">agentname</span>, <span class="ruby-identifier">:command</span>)) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@@agents</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">agentname</span>) |
2646 | -52: |
2647 | -53: <span class="ruby-ivar">@@agents</span>[<span class="ruby-identifier">agentname</span>] = {<span class="ruby-identifier">:file</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">agentfile</span>} |
2648 | -54: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> |
2649 | -55: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span> |
2650 | -56: <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">"Loading agent #{agentname} failed: #{e}"</span>) |
2651 | -57: <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-node">"#{agentname}_agent"</span>) |
2652 | -58: <span class="ruby-keyword kw">end</span> |
2653 | -59: <span class="ruby-keyword kw">end</span> |
2654 | + <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 42</span> |
2655 | +42: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">loadagent</span>(<span class="ruby-identifier">agentname</span>) |
2656 | +43: <span class="ruby-identifier">agentfile</span> = <span class="ruby-identifier">findagentfile</span>(<span class="ruby-identifier">agentname</span>) |
2657 | +44: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">agentfile</span> |
2658 | +45: <span class="ruby-identifier">classname</span> = <span class="ruby-identifier">class_for_agent</span>(<span class="ruby-identifier">agentname</span>) |
2659 | +46: |
2660 | +47: <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-node">"#{agentname}_agent"</span>) |
2661 | +48: |
2662 | +49: <span class="ruby-keyword kw">begin</span> |
2663 | +50: <span class="ruby-identifier">single_instance</span> = [<span class="ruby-value str">"registration"</span>, <span class="ruby-value str">"discovery"</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">agentname</span>) |
2664 | +51: |
2665 | +52: <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">loadclass</span>(<span class="ruby-identifier">classname</span>) |
2666 | +53: |
2667 | +54: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">activate_agent?</span>(<span class="ruby-identifier">agentname</span>) |
2668 | +55: <span class="ruby-constant">PluginManager</span> <span class="ruby-operator"><<</span> {<span class="ruby-identifier">:type</span> =<span class="ruby-operator">></span> <span class="ruby-node">"#{agentname}_agent"</span>, <span class="ruby-identifier">:class</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">classname</span>, <span class="ruby-identifier">:single_instance</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">single_instance</span>} |
2669 | +56: |
2670 | +57: <span class="ruby-constant">Util</span>.<span class="ruby-identifier">subscribe</span>(<span class="ruby-constant">Util</span>.<span class="ruby-identifier">make_subscriptions</span>(<span class="ruby-identifier">agentname</span>, <span class="ruby-identifier">:broadcast</span>)) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@@agents</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">agentname</span>) |
2671 | +58: |
2672 | +59: <span class="ruby-ivar">@@agents</span>[<span class="ruby-identifier">agentname</span>] = {<span class="ruby-identifier">:file</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">agentfile</span>} |
2673 | +60: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> |
2674 | +61: <span class="ruby-keyword kw">else</span> |
2675 | +62: <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">"Not activating agent #{agentname} due to agent policy in activate? method"</span>) |
2676 | +63: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> |
2677 | +64: <span class="ruby-keyword kw">end</span> |
2678 | +65: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span> |
2679 | +66: <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">"Loading agent #{agentname} failed: #{e}"</span>) |
2680 | +67: <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-node">"#{agentname}_agent"</span>) |
2681 | +68: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> |
2682 | +69: <span class="ruby-keyword kw">end</span> |
2683 | +70: <span class="ruby-keyword kw">end</span> |
2684 | </pre> |
2685 | </div> |
2686 | </div> |
2687 | </div> |
2688 | |
2689 | - <div id="method-M000260" class="method-detail"> |
2690 | - <a name="M000260"></a> |
2691 | + <div id="method-M000310" class="method-detail"> |
2692 | + <a name="M000310"></a> |
2693 | |
2694 | <div class="method-heading"> |
2695 | - <a href="#M000260" class="method-signature"> |
2696 | + <a href="#M000310" class="method-signature"> |
2697 | <span class="method-name">loadagents</span><span class="method-args">()</span> |
2698 | </a> |
2699 | </div> |
2700 | @@ -385,31 +487,25 @@ |
2701 | Loads all agents from disk |
2702 | </p> |
2703 | <p><a class="source-toggle" href="#" |
2704 | - onclick="toggleCode('M000260-source');return false;">[Source]</a></p> |
2705 | - <div class="method-source-code" id="M000260-source"> |
2706 | + onclick="toggleCode('M000310-source');return false;">[Source]</a></p> |
2707 | + <div class="method-source-code" id="M000310-source"> |
2708 | <pre> |
2709 | - <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 15</span> |
2710 | -15: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">loadagents</span> |
2711 | -16: <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">"Reloading all agents from disk"</span>) |
2712 | -17: |
2713 | -18: <span class="ruby-comment cmt"># We're loading all agents so just nuke all the old agents and unsubscribe</span> |
2714 | -19: <span class="ruby-ivar">@@agents</span>.<span class="ruby-identifier">each_key</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">agent</span><span class="ruby-operator">|</span> |
2715 | -20: <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">delete</span> <span class="ruby-node">"#{agent}_agent"</span> |
2716 | -21: <span class="ruby-constant">Util</span>.<span class="ruby-identifier">unsubscribe</span>(<span class="ruby-constant">Util</span>.<span class="ruby-identifier">make_target</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">:command</span>)) |
2717 | -22: <span class="ruby-keyword kw">end</span> |
2718 | -23: |
2719 | -24: <span class="ruby-ivar">@@agents</span> = {} |
2720 | -25: |
2721 | -26: <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">libdir</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">libdir</span><span class="ruby-operator">|</span> |
2722 | -27: <span class="ruby-identifier">agentdir</span> = <span class="ruby-node">"#{libdir}/mcollective/agent"</span> |
2723 | -28: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">agentdir</span>) |
2724 | + <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 25</span> |
2725 | +25: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">loadagents</span> |
2726 | +26: <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">"Reloading all agents from disk"</span>) |
2727 | +27: |
2728 | +28: <span class="ruby-identifier">clear!</span> |
2729 | 29: |
2730 | -30: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">agentdir</span>).<span class="ruby-identifier">grep</span>(<span class="ruby-regexp re">/\.rb$/</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">agent</span><span class="ruby-operator">|</span> |
2731 | -31: <span class="ruby-identifier">agentname</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-value str">".rb"</span>) |
2732 | -32: <span class="ruby-identifier">loadagent</span>(<span class="ruby-identifier">agentname</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-node">"#{agentname}_agent"</span>) |
2733 | -33: <span class="ruby-keyword kw">end</span> |
2734 | -34: <span class="ruby-keyword kw">end</span> |
2735 | -35: <span class="ruby-keyword kw">end</span> |
2736 | +30: <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">libdir</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">libdir</span><span class="ruby-operator">|</span> |
2737 | +31: <span class="ruby-identifier">agentdir</span> = <span class="ruby-node">"#{libdir}/mcollective/agent"</span> |
2738 | +32: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">agentdir</span>) |
2739 | +33: |
2740 | +34: <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">agentdir</span>).<span class="ruby-identifier">grep</span>(<span class="ruby-regexp re">/\.rb$/</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">agent</span><span class="ruby-operator">|</span> |
2741 | +35: <span class="ruby-identifier">agentname</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-value str">".rb"</span>) |
2742 | +36: <span class="ruby-identifier">loadagent</span>(<span class="ruby-identifier">agentname</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-node">"#{agentname}_agent"</span>) |
2743 | +37: <span class="ruby-keyword kw">end</span> |
2744 | +38: <span class="ruby-keyword kw">end</span> |
2745 | +39: <span class="ruby-keyword kw">end</span> |
2746 | </pre> |
2747 | </div> |
2748 | </div> |
2749 | |
2750 | === removed directory 'doc/classes/MCollective/Application' |
2751 | === modified file 'doc/classes/MCollective/Application.html' |
2752 | --- doc/classes/MCollective/Application.html 2011-11-09 18:12:27 +0000 |
2753 | +++ doc/classes/MCollective/Application.html 2012-06-06 17:53:29 +0000 |
2754 | @@ -65,9 +65,7 @@ |
2755 | <tr class="top-aligned-row"> |
2756 | <td><strong>Parent:</strong></td> |
2757 | <td> |
2758 | - <a href="../Object.html"> |
2759 | Object |
2760 | - </a> |
2761 | </td> |
2762 | </tr> |
2763 | </table> |
2764 | @@ -88,24 +86,31 @@ |
2765 | <h3 class="section-bar">Methods</h3> |
2766 | |
2767 | <div class="name-list"> |
2768 | - <a href="#M000271">[]</a> |
2769 | - <a href="#M000270">[]=</a> |
2770 | - <a href="#M000282">application_cli_arguments</a> |
2771 | - <a href="#M000280">application_description</a> |
2772 | - <a href="#M000283">application_failure</a> |
2773 | - <a href="#M000269">application_options</a> |
2774 | - <a href="#M000279">application_parse_options</a> |
2775 | - <a href="#M000281">application_usage</a> |
2776 | - <a href="#M000276">configuration</a> |
2777 | - <a href="#M000272">description</a> |
2778 | - <a href="#M000275">intialize_application_options</a> |
2779 | - <a href="#M000285">main</a> |
2780 | - <a href="#M000274">option</a> |
2781 | - <a href="#M000277">options</a> |
2782 | - <a href="#M000286">rpcclient</a> |
2783 | - <a href="#M000284">run</a> |
2784 | - <a href="#M000273">usage</a> |
2785 | - <a href="#M000278">validate_option</a> |
2786 | + <a href="#M000285">[]</a> |
2787 | + <a href="#M000284">[]=</a> |
2788 | + <a href="#M000300">application_cli_arguments</a> |
2789 | + <a href="#M000298">application_description</a> |
2790 | + <a href="#M000301">application_failure</a> |
2791 | + <a href="#M000283">application_options</a> |
2792 | + <a href="#M000297">application_options</a> |
2793 | + <a href="#M000295">application_parse_options</a> |
2794 | + <a href="#M000299">application_usage</a> |
2795 | + <a href="#M000294">clioptions</a> |
2796 | + <a href="#M000291">configuration</a> |
2797 | + <a href="#M000286">description</a> |
2798 | + <a href="#M000304">disconnect</a> |
2799 | + <a href="#M000288">exclude_argument_sections</a> |
2800 | + <a href="#M000306">halt</a> |
2801 | + <a href="#M000302">help</a> |
2802 | + <a href="#M000290">intialize_application_options</a> |
2803 | + <a href="#M000305">main</a> |
2804 | + <a href="#M000289">option</a> |
2805 | + <a href="#M000292">options</a> |
2806 | + <a href="#M000307">rpcclient</a> |
2807 | + <a href="#M000303">run</a> |
2808 | + <a href="#M000287">usage</a> |
2809 | + <a href="#M000296">validate_cli_options</a> |
2810 | + <a href="#M000293">validate_option</a> |
2811 | </div> |
2812 | </div> |
2813 | |
2814 | @@ -123,18 +128,6 @@ |
2815 | |
2816 | <div id="section"> |
2817 | |
2818 | - <div id="class-list"> |
2819 | - <h3 class="section-bar">Classes and Modules</h3> |
2820 | - |
2821 | - Class <a href="Application/Controller.html" class="link">MCollective::Application::Controller</a><br /> |
2822 | -Class <a href="Application/Facts.html" class="link">MCollective::Application::Facts</a><br /> |
2823 | -Class <a href="Application/Find.html" class="link">MCollective::Application::Find</a><br /> |
2824 | -Class <a href="Application/Help.html" class="link">MCollective::Application::Help</a><br /> |
2825 | -Class <a href="Application/Inventory.html" class="link">MCollective::Application::Inventory</a><br /> |
2826 | -Class <a href="Application/Ping.html" class="link">MCollective::Application::Ping</a><br /> |
2827 | -Class <a href="Application/Rpc.html" class="link">MCollective::Application::Rpc</a><br /> |
2828 | - |
2829 | - </div> |
2830 | |
2831 | |
2832 | |
2833 | @@ -146,152 +139,183 @@ |
2834 | <div id="methods"> |
2835 | <h3 class="section-bar">Public Class methods</h3> |
2836 | |
2837 | - <div id="method-M000271" class="method-detail"> |
2838 | - <a name="M000271"></a> |
2839 | + <div id="method-M000285" class="method-detail"> |
2840 | + <a name="M000285"></a> |
2841 | |
2842 | <div class="method-heading"> |
2843 | - <a href="#M000271" class="method-signature"> |
2844 | + <a href="#M000285" class="method-signature"> |
2845 | <span class="method-name">[]</span><span class="method-args">(option)</span> |
2846 | </a> |
2847 | </div> |
2848 | |
2849 | <div class="method-description"> |
2850 | <p> |
2851 | -retrieves a specific <a href="Application.html#M000274">option</a> |
2852 | +retrieves a specific <a href="Application.html#M000289">option</a> |
2853 | </p> |
2854 | <p><a class="source-toggle" href="#" |
2855 | - onclick="toggleCode('M000271-source');return false;">[Source]</a></p> |
2856 | - <div class="method-source-code" id="M000271-source"> |
2857 | + onclick="toggleCode('M000285-source');return false;">[Source]</a></p> |
2858 | + <div class="method-source-code" id="M000285-source"> |
2859 | <pre> |
2860 | <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 20</span> |
2861 | -20: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">option</span>) |
2862 | -21: <span class="ruby-identifier">intialize_application_options</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@application_options</span> |
2863 | -22: <span class="ruby-ivar">@application_options</span>[<span class="ruby-identifier">option</span>] |
2864 | -23: <span class="ruby-keyword kw">end</span> |
2865 | +20: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">option</span>) |
2866 | +21: <span class="ruby-identifier">intialize_application_options</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@application_options</span> |
2867 | +22: <span class="ruby-ivar">@application_options</span>[<span class="ruby-identifier">option</span>] |
2868 | +23: <span class="ruby-keyword kw">end</span> |
2869 | </pre> |
2870 | </div> |
2871 | </div> |
2872 | </div> |
2873 | |
2874 | - <div id="method-M000270" class="method-detail"> |
2875 | - <a name="M000270"></a> |
2876 | + <div id="method-M000284" class="method-detail"> |
2877 | + <a name="M000284"></a> |
2878 | |
2879 | <div class="method-heading"> |
2880 | - <a href="#M000270" class="method-signature"> |
2881 | + <a href="#M000284" class="method-signature"> |
2882 | <span class="method-name">[]=</span><span class="method-args">(option, value)</span> |
2883 | </a> |
2884 | </div> |
2885 | |
2886 | <div class="method-description"> |
2887 | <p> |
2888 | -set an <a href="Application.html#M000274">option</a> in the <a |
2889 | -href="Application.html#M000277">options</a> hash |
2890 | +set an <a href="Application.html#M000289">option</a> in the <a |
2891 | +href="Application.html#M000292">options</a> hash |
2892 | </p> |
2893 | <p><a class="source-toggle" href="#" |
2894 | - onclick="toggleCode('M000270-source');return false;">[Source]</a></p> |
2895 | - <div class="method-source-code" id="M000270-source"> |
2896 | + onclick="toggleCode('M000284-source');return false;">[Source]</a></p> |
2897 | + <div class="method-source-code" id="M000284-source"> |
2898 | <pre> |
2899 | <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 14</span> |
2900 | -14: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">option</span>, <span class="ruby-identifier">value</span>) |
2901 | -15: <span class="ruby-identifier">intialize_application_options</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@application_options</span> |
2902 | -16: <span class="ruby-ivar">@application_options</span>[<span class="ruby-identifier">option</span>] = <span class="ruby-identifier">value</span> |
2903 | -17: <span class="ruby-keyword kw">end</span> |
2904 | +14: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">option</span>, <span class="ruby-identifier">value</span>) |
2905 | +15: <span class="ruby-identifier">intialize_application_options</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@application_options</span> |
2906 | +16: <span class="ruby-ivar">@application_options</span>[<span class="ruby-identifier">option</span>] = <span class="ruby-identifier">value</span> |
2907 | +17: <span class="ruby-keyword kw">end</span> |
2908 | </pre> |
2909 | </div> |
2910 | </div> |
2911 | </div> |
2912 | |
2913 | - <div id="method-M000269" class="method-detail"> |
2914 | - <a name="M000269"></a> |
2915 | + <div id="method-M000283" class="method-detail"> |
2916 | + <a name="M000283"></a> |
2917 | |
2918 | <div class="method-heading"> |
2919 | - <a href="#M000269" class="method-signature"> |
2920 | + <a href="#M000283" class="method-signature"> |
2921 | <span class="method-name">application_options</span><span class="method-args">()</span> |
2922 | </a> |
2923 | </div> |
2924 | |
2925 | <div class="method-description"> |
2926 | <p> |
2927 | -Intialize a blank set of <a href="Application.html#M000277">options</a> if |
2928 | +Intialize a blank set of <a href="Application.html#M000292">options</a> if |
2929 | its the first time used else returns active <a |
2930 | -href="Application.html#M000277">options</a> |
2931 | +href="Application.html#M000292">options</a> |
2932 | </p> |
2933 | <p><a class="source-toggle" href="#" |
2934 | - onclick="toggleCode('M000269-source');return false;">[Source]</a></p> |
2935 | - <div class="method-source-code" id="M000269-source"> |
2936 | + onclick="toggleCode('M000283-source');return false;">[Source]</a></p> |
2937 | + <div class="method-source-code" id="M000283-source"> |
2938 | <pre> |
2939 | <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 8</span> |
2940 | - 8: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">application_options</span> |
2941 | - 9: <span class="ruby-identifier">intialize_application_options</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@application_options</span> |
2942 | -10: <span class="ruby-ivar">@application_options</span> |
2943 | -11: <span class="ruby-keyword kw">end</span> |
2944 | + 8: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">application_options</span> |
2945 | + 9: <span class="ruby-identifier">intialize_application_options</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@application_options</span> |
2946 | +10: <span class="ruby-ivar">@application_options</span> |
2947 | +11: <span class="ruby-keyword kw">end</span> |
2948 | </pre> |
2949 | </div> |
2950 | </div> |
2951 | </div> |
2952 | |
2953 | - <div id="method-M000272" class="method-detail"> |
2954 | - <a name="M000272"></a> |
2955 | + <div id="method-M000286" class="method-detail"> |
2956 | + <a name="M000286"></a> |
2957 | |
2958 | <div class="method-heading"> |
2959 | - <a href="#M000272" class="method-signature"> |
2960 | + <a href="#M000286" class="method-signature"> |
2961 | <span class="method-name">description</span><span class="method-args">(descr)</span> |
2962 | </a> |
2963 | </div> |
2964 | |
2965 | <div class="method-description"> |
2966 | <p> |
2967 | -Sets the application <a href="Application.html#M000272">description</a>, |
2968 | -there can be only one <a href="Application.html#M000272">description</a> |
2969 | +Sets the application <a href="Application.html#M000286">description</a>, |
2970 | +there can be only one <a href="Application.html#M000286">description</a> |
2971 | per application so multiple calls will just change the <a |
2972 | -href="Application.html#M000272">description</a> |
2973 | +href="Application.html#M000286">description</a> |
2974 | </p> |
2975 | <p><a class="source-toggle" href="#" |
2976 | - onclick="toggleCode('M000272-source');return false;">[Source]</a></p> |
2977 | - <div class="method-source-code" id="M000272-source"> |
2978 | + onclick="toggleCode('M000286-source');return false;">[Source]</a></p> |
2979 | + <div class="method-source-code" id="M000286-source"> |
2980 | <pre> |
2981 | <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 28</span> |
2982 | -28: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">description</span>(<span class="ruby-identifier">descr</span>) |
2983 | -29: <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">:description</span>] = <span class="ruby-identifier">descr</span> |
2984 | -30: <span class="ruby-keyword kw">end</span> |
2985 | -</pre> |
2986 | - </div> |
2987 | - </div> |
2988 | - </div> |
2989 | - |
2990 | - <div id="method-M000275" class="method-detail"> |
2991 | - <a name="M000275"></a> |
2992 | - |
2993 | - <div class="method-heading"> |
2994 | - <a href="#M000275" class="method-signature"> |
2995 | +28: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">description</span>(<span class="ruby-identifier">descr</span>) |
2996 | +29: <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">:description</span>] = <span class="ruby-identifier">descr</span> |
2997 | +30: <span class="ruby-keyword kw">end</span> |
2998 | +</pre> |
2999 | + </div> |
3000 | + </div> |
3001 | + </div> |
3002 | + |
3003 | + <div id="method-M000288" class="method-detail"> |
3004 | + <a name="M000288"></a> |
3005 | + |
3006 | + <div class="method-heading"> |
3007 | + <a href="#M000288" class="method-signature"> |
3008 | + <span class="method-name">exclude_argument_sections</span><span class="method-args">(*sections)</span> |
3009 | + </a> |
3010 | + </div> |
3011 | + |
3012 | + <div class="method-description"> |
3013 | + <p><a class="source-toggle" href="#" |
3014 | + onclick="toggleCode('M000288-source');return false;">[Source]</a></p> |
3015 | + <div class="method-source-code" id="M000288-source"> |
3016 | +<pre> |
3017 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 38</span> |
3018 | +38: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exclude_argument_sections</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">sections</span>) |
3019 | +39: <span class="ruby-identifier">sections</span> = [<span class="ruby-identifier">sections</span>].<span class="ruby-identifier">flatten</span> |
3020 | +40: |
3021 | +41: <span class="ruby-identifier">sections</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> |
3022 | +42: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Unknown CLI argument section #{s}"</span> <span class="ruby-keyword kw">unless</span> [<span class="ruby-value str">"rpc"</span>, <span class="ruby-value str">"common"</span>, <span class="ruby-value str">"filter"</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">s</span>) |
3023 | +43: <span class="ruby-keyword kw">end</span> |
3024 | +44: |
3025 | +45: <span class="ruby-identifier">intialize_application_options</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@application_options</span> |
3026 | +46: <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">:exclude_arg_sections</span>] = <span class="ruby-identifier">sections</span> |
3027 | +47: <span class="ruby-keyword kw">end</span> |
3028 | +</pre> |
3029 | + </div> |
3030 | + </div> |
3031 | + </div> |
3032 | + |
3033 | + <div id="method-M000290" class="method-detail"> |
3034 | + <a name="M000290"></a> |
3035 | + |
3036 | + <div class="method-heading"> |
3037 | + <a href="#M000290" class="method-signature"> |
3038 | <span class="method-name">intialize_application_options</span><span class="method-args">()</span> |
3039 | </a> |
3040 | </div> |
3041 | |
3042 | <div class="method-description"> |
3043 | <p> |
3044 | -Creates an empty set of <a href="Application.html#M000277">options</a> |
3045 | +Creates an empty set of <a href="Application.html#M000292">options</a> |
3046 | </p> |
3047 | <p><a class="source-toggle" href="#" |
3048 | - onclick="toggleCode('M000275-source');return false;">[Source]</a></p> |
3049 | - <div class="method-source-code" id="M000275-source"> |
3050 | + onclick="toggleCode('M000290-source');return false;">[Source]</a></p> |
3051 | + <div class="method-source-code" id="M000290-source"> |
3052 | <pre> |
3053 | - <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 68</span> |
3054 | -68: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">intialize_application_options</span> |
3055 | -69: <span class="ruby-ivar">@application_options</span> = {<span class="ruby-identifier">:description</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>, |
3056 | -70: <span class="ruby-identifier">:usage</span> =<span class="ruby-operator">></span> [], |
3057 | -71: <span class="ruby-identifier">:cli_arguments</span> =<span class="ruby-operator">></span> []} |
3058 | -72: <span class="ruby-keyword kw">end</span> |
3059 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 79</span> |
3060 | +79: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">intialize_application_options</span> |
3061 | +80: <span class="ruby-ivar">@application_options</span> = {<span class="ruby-identifier">:description</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>, |
3062 | +81: <span class="ruby-identifier">:usage</span> =<span class="ruby-operator">></span> [], |
3063 | +82: <span class="ruby-identifier">:cli_arguments</span> =<span class="ruby-operator">></span> [], |
3064 | +83: <span class="ruby-identifier">:exclude_arg_sections</span> =<span class="ruby-operator">></span> []} |
3065 | +84: <span class="ruby-keyword kw">end</span> |
3066 | </pre> |
3067 | </div> |
3068 | </div> |
3069 | </div> |
3070 | |
3071 | - <div id="method-M000274" class="method-detail"> |
3072 | - <a name="M000274"></a> |
3073 | + <div id="method-M000289" class="method-detail"> |
3074 | + <a name="M000289"></a> |
3075 | |
3076 | <div class="method-heading"> |
3077 | - <a href="#M000274" class="method-signature"> |
3078 | + <a href="#M000289" class="method-signature"> |
3079 | <span class="method-name">option</span><span class="method-args">(name, arguments)</span> |
3080 | </a> |
3081 | </div> |
3082 | @@ -299,7 +323,7 @@ |
3083 | <div class="method-description"> |
3084 | <p> |
3085 | Wrapper to create command line <a |
3086 | -href="Application.html#M000277">options</a> |
3087 | +href="Application.html#M000292">options</a> |
3088 | </p> |
3089 | <pre> |
3090 | - name: varaible name that will be used to access the option value |
3091 | @@ -312,58 +336,59 @@ |
3092 | the supplied value |
3093 | |
3094 | option :foo, |
3095 | - :description => "The foo option" |
3096 | - :arguments => ["--foo ARG"] |
3097 | + :description => "The foo option" |
3098 | + :arguments => ["--foo ARG"] |
3099 | </pre> |
3100 | <p> |
3101 | after this the value supplied will be in <a |
3102 | -href="Application.html#M000276">configuration</a>[:foo] |
3103 | +href="Application.html#M000291">configuration</a>[:foo] |
3104 | </p> |
3105 | <p><a class="source-toggle" href="#" |
3106 | - onclick="toggleCode('M000274-source');return false;">[Source]</a></p> |
3107 | - <div class="method-source-code" id="M000274-source"> |
3108 | + onclick="toggleCode('M000289-source');return false;">[Source]</a></p> |
3109 | + <div class="method-source-code" id="M000289-source"> |
3110 | <pre> |
3111 | - <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 54</span> |
3112 | -54: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">option</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">arguments</span>) |
3113 | -55: <span class="ruby-identifier">opt</span> = {<span class="ruby-identifier">:name</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">name</span>, |
3114 | -56: <span class="ruby-identifier">:description</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>, |
3115 | -57: <span class="ruby-identifier">:arguments</span> =<span class="ruby-operator">></span> [], |
3116 | -58: <span class="ruby-identifier">:type</span> =<span class="ruby-operator">></span> <span class="ruby-constant">String</span>, |
3117 | -59: <span class="ruby-identifier">:required</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">false</span>, |
3118 | -60: <span class="ruby-identifier">:validate</span> =<span class="ruby-operator">></span> <span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> { <span class="ruby-keyword kw">true</span> }} |
3119 | -61: |
3120 | -62: <span class="ruby-identifier">arguments</span>.<span class="ruby-identifier">each_pair</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">opt</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">v</span>} |
3121 | -63: |
3122 | -64: <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">:cli_arguments</span>] <span class="ruby-operator"><<</span> <span class="ruby-identifier">opt</span> |
3123 | -65: <span class="ruby-keyword kw">end</span> |
3124 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 65</span> |
3125 | +65: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">option</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">arguments</span>) |
3126 | +66: <span class="ruby-identifier">opt</span> = {<span class="ruby-identifier">:name</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">name</span>, |
3127 | +67: <span class="ruby-identifier">:description</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">nil</span>, |
3128 | +68: <span class="ruby-identifier">:arguments</span> =<span class="ruby-operator">></span> [], |
3129 | +69: <span class="ruby-identifier">:type</span> =<span class="ruby-operator">></span> <span class="ruby-constant">String</span>, |
3130 | +70: <span class="ruby-identifier">:required</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">false</span>, |
3131 | +71: <span class="ruby-identifier">:validate</span> =<span class="ruby-operator">></span> <span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> { <span class="ruby-keyword kw">true</span> }} |
3132 | +72: |
3133 | +73: <span class="ruby-identifier">arguments</span>.<span class="ruby-identifier">each_pair</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">opt</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">v</span>} |
3134 | +74: |
3135 | +75: <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">:cli_arguments</span>] <span class="ruby-operator"><<</span> <span class="ruby-identifier">opt</span> |
3136 | +76: <span class="ruby-keyword kw">end</span> |
3137 | </pre> |
3138 | </div> |
3139 | </div> |
3140 | </div> |
3141 | |
3142 | - <div id="method-M000273" class="method-detail"> |
3143 | - <a name="M000273"></a> |
3144 | + <div id="method-M000287" class="method-detail"> |
3145 | + <a name="M000287"></a> |
3146 | |
3147 | <div class="method-heading"> |
3148 | - <a href="#M000273" class="method-signature"> |
3149 | + <a href="#M000287" class="method-signature"> |
3150 | <span class="method-name">usage</span><span class="method-args">(usage)</span> |
3151 | </a> |
3152 | </div> |
3153 | |
3154 | <div class="method-description"> |
3155 | <p> |
3156 | -Supplies <a href="Application.html#M000273">usage</a> information, calling |
3157 | +Supplies <a href="Application.html#M000287">usage</a> information, calling |
3158 | multiple times will create multiple <a |
3159 | -href="Application.html#M000273">usage</a> lines in —help output |
3160 | +href="Application.html#M000287">usage</a> lines in —<a |
3161 | +href="Application.html#M000302">help</a> output |
3162 | </p> |
3163 | <p><a class="source-toggle" href="#" |
3164 | - onclick="toggleCode('M000273-source');return false;">[Source]</a></p> |
3165 | - <div class="method-source-code" id="M000273-source"> |
3166 | + onclick="toggleCode('M000287-source');return false;">[Source]</a></p> |
3167 | + <div class="method-source-code" id="M000287-source"> |
3168 | <pre> |
3169 | <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 34</span> |
3170 | -34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">usage</span>(<span class="ruby-identifier">usage</span>) |
3171 | -35: <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">:usage</span>] <span class="ruby-operator"><<</span> <span class="ruby-identifier">usage</span> |
3172 | -36: <span class="ruby-keyword kw">end</span> |
3173 | +34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">usage</span>(<span class="ruby-identifier">usage</span>) |
3174 | +35: <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">:usage</span>] <span class="ruby-operator"><<</span> <span class="ruby-identifier">usage</span> |
3175 | +36: <span class="ruby-keyword kw">end</span> |
3176 | </pre> |
3177 | </div> |
3178 | </div> |
3179 | @@ -371,11 +396,11 @@ |
3180 | |
3181 | <h3 class="section-bar">Public Instance methods</h3> |
3182 | |
3183 | - <div id="method-M000282" class="method-detail"> |
3184 | - <a name="M000282"></a> |
3185 | + <div id="method-M000300" class="method-detail"> |
3186 | + <a name="M000300"></a> |
3187 | |
3188 | <div class="method-heading"> |
3189 | - <a href="#M000282" class="method-signature"> |
3190 | + <a href="#M000300" class="method-signature"> |
3191 | <span class="method-name">application_cli_arguments</span><span class="method-args">()</span> |
3192 | </a> |
3193 | </div> |
3194 | @@ -385,23 +410,23 @@ |
3195 | Returns an array of all the arguments built using calls to optin |
3196 | </p> |
3197 | <p><a class="source-toggle" href="#" |
3198 | - onclick="toggleCode('M000282-source');return false;">[Source]</a></p> |
3199 | - <div class="method-source-code" id="M000282-source"> |
3200 | + onclick="toggleCode('M000300-source');return false;">[Source]</a></p> |
3201 | + <div class="method-source-code" id="M000300-source"> |
3202 | <pre> |
3203 | - <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 202</span> |
3204 | -202: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">application_cli_arguments</span> |
3205 | -203: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">application_options</span>[<span class="ruby-identifier">:cli_arguments</span>] |
3206 | -204: <span class="ruby-keyword kw">end</span> |
3207 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 245</span> |
3208 | +245: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">application_cli_arguments</span> |
3209 | +246: <span class="ruby-identifier">application_options</span>[<span class="ruby-identifier">:cli_arguments</span>] |
3210 | +247: <span class="ruby-keyword kw">end</span> |
3211 | </pre> |
3212 | </div> |
3213 | </div> |
3214 | </div> |
3215 | |
3216 | - <div id="method-M000280" class="method-detail"> |
3217 | - <a name="M000280"></a> |
3218 | + <div id="method-M000298" class="method-detail"> |
3219 | + <a name="M000298"></a> |
3220 | |
3221 | <div class="method-heading"> |
3222 | - <a href="#M000280" class="method-signature"> |
3223 | + <a href="#M000298" class="method-signature"> |
3224 | <span class="method-name">application_description</span><span class="method-args">()</span> |
3225 | </a> |
3226 | </div> |
3227 | @@ -409,27 +434,27 @@ |
3228 | <div class="method-description"> |
3229 | <p> |
3230 | Retrieve the current application <a |
3231 | -href="Application.html#M000272">description</a> |
3232 | +href="Application.html#M000286">description</a> |
3233 | </p> |
3234 | <p><a class="source-toggle" href="#" |
3235 | - onclick="toggleCode('M000280-source');return false;">[Source]</a></p> |
3236 | - <div class="method-source-code" id="M000280-source"> |
3237 | + onclick="toggleCode('M000298-source');return false;">[Source]</a></p> |
3238 | + <div class="method-source-code" id="M000298-source"> |
3239 | <pre> |
3240 | - <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 189</span> |
3241 | -189: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">application_description</span> |
3242 | -190: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">application_options</span>[<span class="ruby-identifier">:description</span>] |
3243 | -191: <span class="ruby-keyword kw">end</span> |
3244 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 232</span> |
3245 | +232: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">application_description</span> |
3246 | +233: <span class="ruby-identifier">application_options</span>[<span class="ruby-identifier">:description</span>] |
3247 | +234: <span class="ruby-keyword kw">end</span> |
3248 | </pre> |
3249 | </div> |
3250 | </div> |
3251 | </div> |
3252 | |
3253 | - <div id="method-M000283" class="method-detail"> |
3254 | - <a name="M000283"></a> |
3255 | + <div id="method-M000301" class="method-detail"> |
3256 | + <a name="M000301"></a> |
3257 | |
3258 | <div class="method-heading"> |
3259 | - <a href="#M000283" class="method-signature"> |
3260 | - <span class="method-name">application_failure</span><span class="method-args">(e)</span> |
3261 | + <a href="#M000301" class="method-signature"> |
3262 | + <span class="method-name">application_failure</span><span class="method-args">(e, err_dest=STDERR)</span> |
3263 | </a> |
3264 | </div> |
3265 | |
3266 | @@ -439,203 +464,372 @@ |
3267 | will log backtraces if its in verbose mode only |
3268 | </p> |
3269 | <p><a class="source-toggle" href="#" |
3270 | - onclick="toggleCode('M000283-source');return false;">[Source]</a></p> |
3271 | - <div class="method-source-code" id="M000283-source"> |
3272 | -<pre> |
3273 | - <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 208</span> |
3274 | -208: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">application_failure</span>(<span class="ruby-identifier">e</span>) |
3275 | -209: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"#{$0} failed to run: #{e} (#{e.class})"</span> |
3276 | -210: |
3277 | -211: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span> |
3278 | -212: <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span> <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"\tfrom #{l}"</span>} <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:verbose</span>] |
3279 | -213: <span class="ruby-keyword kw">else</span> |
3280 | -214: <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span> <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"\tfrom #{l}"</span>} |
3281 | -215: <span class="ruby-keyword kw">end</span> |
3282 | -216: |
3283 | -217: <span class="ruby-constant">MCollective</span><span class="ruby-operator">::</span><span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">"connector_plugin"</span>].<span class="ruby-identifier">disconnect</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">true</span> |
3284 | -218: |
3285 | -219: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span> |
3286 | -220: <span class="ruby-keyword kw">end</span> |
3287 | -</pre> |
3288 | - </div> |
3289 | - </div> |
3290 | - </div> |
3291 | - |
3292 | - <div id="method-M000279" class="method-detail"> |
3293 | - <a name="M000279"></a> |
3294 | - |
3295 | - <div class="method-heading"> |
3296 | - <a href="#M000279" class="method-signature"> |
3297 | - <span class="method-name">application_parse_options</span><span class="method-args">()</span> |
3298 | + onclick="toggleCode('M000301-source');return false;">[Source]</a></p> |
3299 | + <div class="method-source-code" id="M000301-source"> |
3300 | +<pre> |
3301 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 251</span> |
3302 | +251: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">application_failure</span>(<span class="ruby-identifier">e</span>, <span class="ruby-identifier">err_dest</span>=<span class="ruby-constant">STDERR</span>) |
3303 | +252: <span class="ruby-comment cmt"># peole can use exit() anywhere and not get nasty backtraces as a result</span> |
3304 | +253: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">SystemExit</span>) |
3305 | +254: <span class="ruby-identifier">disconnect</span> |
3306 | +255: <span class="ruby-identifier">raise</span>(<span class="ruby-identifier">e</span>) |
3307 | +256: <span class="ruby-keyword kw">end</span> |
3308 | +257: |
3309 | +258: <span class="ruby-identifier">err_dest</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"#{$0} failed to run: #{e} (#{e.class})"</span> |
3310 | +259: |
3311 | +260: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:verbose</span>] |
3312 | +261: <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span> <span class="ruby-identifier">err_dest</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"\tfrom #{l}"</span>} |
3313 | +262: <span class="ruby-keyword kw">end</span> |
3314 | +263: |
3315 | +264: <span class="ruby-identifier">disconnect</span> |
3316 | +265: |
3317 | +266: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span> |
3318 | +267: <span class="ruby-keyword kw">end</span> |
3319 | +</pre> |
3320 | + </div> |
3321 | + </div> |
3322 | + </div> |
3323 | + |
3324 | + <div id="method-M000297" class="method-detail"> |
3325 | + <a name="M000297"></a> |
3326 | + |
3327 | + <div class="method-heading"> |
3328 | + <a href="#M000297" class="method-signature"> |
3329 | + <span class="method-name">application_options</span><span class="method-args">()</span> |
3330 | + </a> |
3331 | + </div> |
3332 | + |
3333 | + <div class="method-description"> |
3334 | + <p> |
3335 | +Retrieves the full hash of application <a |
3336 | +href="Application.html#M000292">options</a> |
3337 | +</p> |
3338 | + <p><a class="source-toggle" href="#" |
3339 | + onclick="toggleCode('M000297-source');return false;">[Source]</a></p> |
3340 | + <div class="method-source-code" id="M000297-source"> |
3341 | +<pre> |
3342 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 227</span> |
3343 | +227: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">application_options</span> |
3344 | +228: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">application_options</span> |
3345 | +229: <span class="ruby-keyword kw">end</span> |
3346 | +</pre> |
3347 | + </div> |
3348 | + </div> |
3349 | + </div> |
3350 | + |
3351 | + <div id="method-M000295" class="method-detail"> |
3352 | + <a name="M000295"></a> |
3353 | + |
3354 | + <div class="method-heading"> |
3355 | + <a href="#M000295" class="method-signature"> |
3356 | + <span class="method-name">application_parse_options</span><span class="method-args">(help=false)</span> |
3357 | </a> |
3358 | </div> |
3359 | |
3360 | <div class="method-description"> |
3361 | <p> |
3362 | Builds an ObjectParser config, parse the CLI <a |
3363 | -href="Application.html#M000277">options</a> and validates based on the <a |
3364 | -href="Application.html#M000274">option</a> config |
3365 | +href="Application.html#M000292">options</a> and validates based on the <a |
3366 | +href="Application.html#M000289">option</a> config |
3367 | </p> |
3368 | <p><a class="source-toggle" href="#" |
3369 | - onclick="toggleCode('M000279-source');return false;">[Source]</a></p> |
3370 | - <div class="method-source-code" id="M000279-source"> |
3371 | + onclick="toggleCode('M000295-source');return false;">[Source]</a></p> |
3372 | + <div class="method-source-code" id="M000295-source"> |
3373 | <pre> |
3374 | - <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 99</span> |
3375 | - 99: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">application_parse_options</span> |
3376 | -100: <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">rpcoptions</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">parser</span>, <span class="ruby-identifier">options</span><span class="ruby-operator">|</span> |
3377 | -101: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">define_head</span> <span class="ruby-identifier">application_description</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">application_description</span> |
3378 | -102: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">banner</span> = <span class="ruby-value str">""</span> |
3379 | -103: |
3380 | -104: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">application_usage</span> |
3381 | -105: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">separator</span> <span class="ruby-value str">""</span> |
3382 | -106: |
3383 | -107: <span class="ruby-identifier">application_usage</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">u</span><span class="ruby-operator">|</span> |
3384 | -108: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">separator</span> <span class="ruby-node">"Usage: #{u}"</span> |
3385 | -109: <span class="ruby-keyword kw">end</span> |
3386 | -110: |
3387 | -111: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">separator</span> <span class="ruby-value str">""</span> |
3388 | -112: <span class="ruby-keyword kw">end</span> |
3389 | -113: |
3390 | -114: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">define_tail</span> <span class="ruby-value str">""</span> |
3391 | -115: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">define_tail</span> <span class="ruby-node">"The Marionette Collective #{MCollective.version}"</span> |
3392 | -116: |
3393 | -117: |
3394 | -118: <span class="ruby-identifier">application_cli_arguments</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">carg</span><span class="ruby-operator">|</span> |
3395 | -119: <span class="ruby-identifier">opts_array</span> = [] |
3396 | -120: |
3397 | -121: <span class="ruby-identifier">opts_array</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">:on</span> |
3398 | -122: |
3399 | -123: <span class="ruby-comment cmt"># if a default is set from the application set it up front</span> |
3400 | -124: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">carg</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:default</span>) |
3401 | -125: <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>]] = <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:default</span>] |
3402 | -126: <span class="ruby-keyword kw">end</span> |
3403 | -127: |
3404 | -128: <span class="ruby-comment cmt"># :arguments are multiple possible ones</span> |
3405 | -129: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:arguments</span>].<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>) |
3406 | -130: <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:arguments</span>].<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">opts_array</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">a</span>} |
3407 | -131: <span class="ruby-keyword kw">else</span> |
3408 | -132: <span class="ruby-identifier">opts_array</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:arguments</span>] |
3409 | -133: <span class="ruby-keyword kw">end</span> |
3410 | -134: |
3411 | -135: <span class="ruby-comment cmt"># type was given and its not one of our special types, just pass it onto optparse</span> |
3412 | -136: <span class="ruby-identifier">opts_array</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:type</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:type</span>] <span class="ruby-keyword kw">and</span> <span class="ruby-operator">!</span> [<span class="ruby-identifier">:bool</span>, <span class="ruby-identifier">:array</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:type</span>]) |
3413 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 135</span> |
3414 | +135: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">application_parse_options</span>(<span class="ruby-identifier">help</span>=<span class="ruby-keyword kw">false</span>) |
3415 | +136: <span class="ruby-ivar">@options</span> <span class="ruby-operator">||=</span> {<span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">false</span>} |
3416 | 137: |
3417 | -138: <span class="ruby-identifier">opts_array</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:description</span>] |
3418 | -139: |
3419 | -140: <span class="ruby-comment cmt"># Handle our special types else just rely on the optparser to handle the types</span> |
3420 | -141: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:type</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">:bool</span> |
3421 | -142: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">send</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">opts_array</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> |
3422 | -143: <span class="ruby-identifier">validate_option</span>(<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:validate</span>], <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>], <span class="ruby-identifier">v</span>) |
3423 | +138: <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">clioptions</span>(<span class="ruby-identifier">help</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">parser</span>, <span class="ruby-identifier">options</span><span class="ruby-operator">|</span> |
3424 | +139: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">define_head</span> <span class="ruby-identifier">application_description</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">application_description</span> |
3425 | +140: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">banner</span> = <span class="ruby-value str">""</span> |
3426 | +141: |
3427 | +142: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">application_usage</span> |
3428 | +143: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">separator</span> <span class="ruby-value str">""</span> |
3429 | 144: |
3430 | -145: <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>]] = <span class="ruby-keyword kw">true</span> |
3431 | -146: <span class="ruby-keyword kw">end</span> |
3432 | -147: |
3433 | -148: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:type</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">:array</span> |
3434 | -149: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">send</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">opts_array</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> |
3435 | -150: <span class="ruby-identifier">validate_option</span>(<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:validate</span>], <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>], <span class="ruby-identifier">v</span>) |
3436 | +145: <span class="ruby-identifier">application_usage</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">u</span><span class="ruby-operator">|</span> |
3437 | +146: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">separator</span> <span class="ruby-node">"Usage: #{u}"</span> |
3438 | +147: <span class="ruby-keyword kw">end</span> |
3439 | +148: |
3440 | +149: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">separator</span> <span class="ruby-value str">""</span> |
3441 | +150: <span class="ruby-keyword kw">end</span> |
3442 | 151: |
3443 | -152: <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>]] = [] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>]) |
3444 | -153: <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>]] <span class="ruby-operator"><<</span> <span class="ruby-identifier">v</span> |
3445 | -154: <span class="ruby-keyword kw">end</span> |
3446 | +152: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">define_tail</span> <span class="ruby-value str">""</span> |
3447 | +153: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">define_tail</span> <span class="ruby-node">"The Marionette Collective #{MCollective.version}"</span> |
3448 | +154: |
3449 | 155: |
3450 | -156: <span class="ruby-keyword kw">else</span> |
3451 | -157: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">send</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">opts_array</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> |
3452 | -158: <span class="ruby-identifier">validate_option</span>(<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:validate</span>], <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>], <span class="ruby-identifier">v</span>) |
3453 | -159: |
3454 | -160: <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>]] = <span class="ruby-identifier">v</span> |
3455 | -161: <span class="ruby-keyword kw">end</span> |
3456 | -162: <span class="ruby-keyword kw">end</span> |
3457 | -163: <span class="ruby-keyword kw">end</span> |
3458 | -164: <span class="ruby-keyword kw">end</span> |
3459 | +156: <span class="ruby-identifier">application_cli_arguments</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">carg</span><span class="ruby-operator">|</span> |
3460 | +157: <span class="ruby-identifier">opts_array</span> = [] |
3461 | +158: |
3462 | +159: <span class="ruby-identifier">opts_array</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">:on</span> |
3463 | +160: |
3464 | +161: <span class="ruby-comment cmt"># if a default is set from the application set it up front</span> |
3465 | +162: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">carg</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:default</span>) |
3466 | +163: <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>]] = <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:default</span>] |
3467 | +164: <span class="ruby-keyword kw">end</span> |
3468 | 165: |
3469 | -166: <span class="ruby-comment cmt"># Check all required parameters were set</span> |
3470 | -167: <span class="ruby-identifier">validation_passed</span> = <span class="ruby-keyword kw">true</span> |
3471 | -168: <span class="ruby-identifier">application_cli_arguments</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">carg</span><span class="ruby-operator">|</span> |
3472 | -169: <span class="ruby-comment cmt"># Check for required arguments</span> |
3473 | -170: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:required</span>] |
3474 | -171: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">configuration</span>[ <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>] ] |
3475 | -172: <span class="ruby-identifier">validation_passed</span> = <span class="ruby-keyword kw">false</span> |
3476 | -173: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"The #{carg[:name]} option is mandatory"</span> |
3477 | -174: <span class="ruby-keyword kw">end</span> |
3478 | -175: <span class="ruby-keyword kw">end</span> |
3479 | -176: <span class="ruby-keyword kw">end</span> |
3480 | +166: <span class="ruby-comment cmt"># :arguments are multiple possible ones</span> |
3481 | +167: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:arguments</span>].<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>) |
3482 | +168: <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:arguments</span>].<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">opts_array</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">a</span>} |
3483 | +169: <span class="ruby-keyword kw">else</span> |
3484 | +170: <span class="ruby-identifier">opts_array</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:arguments</span>] |
3485 | +171: <span class="ruby-keyword kw">end</span> |
3486 | +172: |
3487 | +173: <span class="ruby-comment cmt"># type was given and its not one of our special types, just pass it onto optparse</span> |
3488 | +174: <span class="ruby-identifier">opts_array</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:type</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:type</span>] <span class="ruby-keyword kw">and</span> <span class="ruby-operator">!</span> [<span class="ruby-identifier">:bool</span>, <span class="ruby-identifier">:array</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:type</span>]) |
3489 | +175: |
3490 | +176: <span class="ruby-identifier">opts_array</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:description</span>] |
3491 | 177: |
3492 | -178: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">validation_passed</span> |
3493 | -179: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">"\nPlease run with --help for detailed help"</span> |
3494 | -180: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span> |
3495 | -181: <span class="ruby-keyword kw">end</span> |
3496 | +178: <span class="ruby-comment cmt"># Handle our special types else just rely on the optparser to handle the types</span> |
3497 | +179: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:type</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">:bool</span> |
3498 | +180: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">send</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">opts_array</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> |
3499 | +181: <span class="ruby-identifier">validate_option</span>(<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:validate</span>], <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>], <span class="ruby-identifier">v</span>) |
3500 | 182: |
3501 | -183: <span class="ruby-identifier">post_option_parser</span>(<span class="ruby-identifier">configuration</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:post_option_parser</span>) |
3502 | -184: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span> |
3503 | -185: <span class="ruby-identifier">application_failure</span>(<span class="ruby-identifier">e</span>) |
3504 | -186: <span class="ruby-keyword kw">end</span> |
3505 | +183: <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>]] = <span class="ruby-keyword kw">true</span> |
3506 | +184: <span class="ruby-keyword kw">end</span> |
3507 | +185: |
3508 | +186: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:type</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">:array</span> |
3509 | +187: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">send</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">opts_array</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> |
3510 | +188: <span class="ruby-identifier">validate_option</span>(<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:validate</span>], <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>], <span class="ruby-identifier">v</span>) |
3511 | +189: |
3512 | +190: <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>]] = [] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>]) |
3513 | +191: <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>]] <span class="ruby-operator"><<</span> <span class="ruby-identifier">v</span> |
3514 | +192: <span class="ruby-keyword kw">end</span> |
3515 | +193: |
3516 | +194: <span class="ruby-keyword kw">else</span> |
3517 | +195: <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">send</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">opts_array</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> |
3518 | +196: <span class="ruby-identifier">validate_option</span>(<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:validate</span>], <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>], <span class="ruby-identifier">v</span>) |
3519 | +197: |
3520 | +198: <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>]] = <span class="ruby-identifier">v</span> |
3521 | +199: <span class="ruby-keyword kw">end</span> |
3522 | +200: <span class="ruby-keyword kw">end</span> |
3523 | +201: <span class="ruby-keyword kw">end</span> |
3524 | +202: <span class="ruby-keyword kw">end</span> |
3525 | +203: <span class="ruby-keyword kw">end</span> |
3526 | </pre> |
3527 | </div> |
3528 | </div> |
3529 | </div> |
3530 | |
3531 | - <div id="method-M000281" class="method-detail"> |
3532 | - <a name="M000281"></a> |
3533 | + <div id="method-M000299" class="method-detail"> |
3534 | + <a name="M000299"></a> |
3535 | |
3536 | <div class="method-heading"> |
3537 | - <a href="#M000281" class="method-signature"> |
3538 | + <a href="#M000299" class="method-signature"> |
3539 | <span class="method-name">application_usage</span><span class="method-args">()</span> |
3540 | </a> |
3541 | </div> |
3542 | |
3543 | <div class="method-description"> |
3544 | <p> |
3545 | -Return the current <a href="Application.html#M000273">usage</a> text false |
3546 | +Return the current <a href="Application.html#M000287">usage</a> text false |
3547 | if nothing is set |
3548 | </p> |
3549 | <p><a class="source-toggle" href="#" |
3550 | - onclick="toggleCode('M000281-source');return false;">[Source]</a></p> |
3551 | - <div class="method-source-code" id="M000281-source"> |
3552 | -<pre> |
3553 | - <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 194</span> |
3554 | -194: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">application_usage</span> |
3555 | -195: <span class="ruby-identifier">usage</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">application_options</span>[<span class="ruby-identifier">:usage</span>] |
3556 | -196: |
3557 | -197: <span class="ruby-identifier">usage</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">false</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">usage</span> |
3558 | -198: <span class="ruby-keyword kw">end</span> |
3559 | -</pre> |
3560 | - </div> |
3561 | - </div> |
3562 | - </div> |
3563 | - |
3564 | - <div id="method-M000276" class="method-detail"> |
3565 | - <a name="M000276"></a> |
3566 | - |
3567 | - <div class="method-heading"> |
3568 | - <a href="#M000276" class="method-signature"> |
3569 | + onclick="toggleCode('M000299-source');return false;">[Source]</a></p> |
3570 | + <div class="method-source-code" id="M000299-source"> |
3571 | +<pre> |
3572 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 237</span> |
3573 | +237: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">application_usage</span> |
3574 | +238: <span class="ruby-identifier">usage</span> = <span class="ruby-identifier">application_options</span>[<span class="ruby-identifier">:usage</span>] |
3575 | +239: |
3576 | +240: <span class="ruby-identifier">usage</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">false</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">usage</span> |
3577 | +241: <span class="ruby-keyword kw">end</span> |
3578 | +</pre> |
3579 | + </div> |
3580 | + </div> |
3581 | + </div> |
3582 | + |
3583 | + <div id="method-M000294" class="method-detail"> |
3584 | + <a name="M000294"></a> |
3585 | + |
3586 | + <div class="method-heading"> |
3587 | + <a href="#M000294" class="method-signature"> |
3588 | + <span class="method-name">clioptions</span><span class="method-args">(help) {|parser, options| ...}</span> |
3589 | + </a> |
3590 | + </div> |
3591 | + |
3592 | + <div class="method-description"> |
3593 | + <p> |
3594 | +Creates a standard <a href="Application.html#M000292">options</a> hash, |
3595 | +pass in a block to add extra headings etc see <a |
3596 | +href="Optionparser.html">Optionparser</a> |
3597 | +</p> |
3598 | + <p><a class="source-toggle" href="#" |
3599 | + onclick="toggleCode('M000294-source');return false;">[Source]</a></p> |
3600 | + <div class="method-source-code" id="M000294-source"> |
3601 | +<pre> |
3602 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 111</span> |
3603 | +111: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clioptions</span>(<span class="ruby-identifier">help</span>) |
3604 | +112: <span class="ruby-identifier">oparser</span> = <span class="ruby-constant">Optionparser</span>.<span class="ruby-identifier">new</span>({<span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">:progress_bar</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">true</span>}, <span class="ruby-value str">"filter"</span>, <span class="ruby-identifier">application_options</span>[<span class="ruby-identifier">:exclude_arg_sections</span>]) |
3605 | +113: |
3606 | +114: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">oparser</span>.<span class="ruby-identifier">parse</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">parser</span>, <span class="ruby-identifier">options</span><span class="ruby-operator">|</span> |
3607 | +115: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span> |
3608 | +116: <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">parser</span>, <span class="ruby-identifier">options</span>) |
3609 | +117: <span class="ruby-keyword kw">end</span> |
3610 | +118: |
3611 | +119: <span class="ruby-constant">RPC</span><span class="ruby-operator">::</span><span class="ruby-constant">Helpers</span>.<span class="ruby-identifier">add_simplerpc_options</span>(<span class="ruby-identifier">parser</span>, <span class="ruby-identifier">options</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">application_options</span>[<span class="ruby-identifier">:exclude_arg_sections</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-value str">"rpc"</span>) |
3612 | +120: <span class="ruby-keyword kw">end</span> |
3613 | +121: |
3614 | +122: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">oparser</span>.<span class="ruby-identifier">parser</span>.<span class="ruby-identifier">help</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">help</span> |
3615 | +123: |
3616 | +124: <span class="ruby-identifier">validate_cli_options</span> |
3617 | +125: |
3618 | +126: <span class="ruby-identifier">post_option_parser</span>(<span class="ruby-identifier">configuration</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:post_option_parser</span>) |
3619 | +127: |
3620 | +128: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">options</span> |
3621 | +129: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span> |
3622 | +130: <span class="ruby-identifier">application_failure</span>(<span class="ruby-identifier">e</span>) |
3623 | +131: <span class="ruby-keyword kw">end</span> |
3624 | +</pre> |
3625 | + </div> |
3626 | + </div> |
3627 | + </div> |
3628 | + |
3629 | + <div id="method-M000291" class="method-detail"> |
3630 | + <a name="M000291"></a> |
3631 | + |
3632 | + <div class="method-heading"> |
3633 | + <a href="#M000291" class="method-signature"> |
3634 | <span class="method-name">configuration</span><span class="method-args">()</span> |
3635 | </a> |
3636 | </div> |
3637 | |
3638 | <div class="method-description"> |
3639 | <p> |
3640 | -The application <a href="Application.html#M000276">configuration</a> built |
3641 | +The application <a href="Application.html#M000291">configuration</a> built |
3642 | from CLI arguments |
3643 | </p> |
3644 | <p><a class="source-toggle" href="#" |
3645 | - onclick="toggleCode('M000276-source');return false;">[Source]</a></p> |
3646 | - <div class="method-source-code" id="M000276-source"> |
3647 | -<pre> |
3648 | - <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 76</span> |
3649 | -76: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configuration</span> |
3650 | -77: <span class="ruby-ivar">@application_configuration</span> <span class="ruby-operator">||=</span> {} |
3651 | -78: <span class="ruby-ivar">@application_configuration</span> |
3652 | -79: <span class="ruby-keyword kw">end</span> |
3653 | -</pre> |
3654 | - </div> |
3655 | - </div> |
3656 | - </div> |
3657 | - |
3658 | - <div id="method-M000285" class="method-detail"> |
3659 | - <a name="M000285"></a> |
3660 | - |
3661 | - <div class="method-heading"> |
3662 | - <a href="#M000285" class="method-signature"> |
3663 | + onclick="toggleCode('M000291-source');return false;">[Source]</a></p> |
3664 | + <div class="method-source-code" id="M000291-source"> |
3665 | +<pre> |
3666 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 88</span> |
3667 | +88: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configuration</span> |
3668 | +89: <span class="ruby-ivar">@application_configuration</span> <span class="ruby-operator">||=</span> {} |
3669 | +90: <span class="ruby-ivar">@application_configuration</span> |
3670 | +91: <span class="ruby-keyword kw">end</span> |
3671 | +</pre> |
3672 | + </div> |
3673 | + </div> |
3674 | + </div> |
3675 | + |
3676 | + <div id="method-M000304" class="method-detail"> |
3677 | + <a name="M000304"></a> |
3678 | + |
3679 | + <div class="method-heading"> |
3680 | + <a href="#M000304" class="method-signature"> |
3681 | + <span class="method-name">disconnect</span><span class="method-args">()</span> |
3682 | + </a> |
3683 | + </div> |
3684 | + |
3685 | + <div class="method-description"> |
3686 | + <p><a class="source-toggle" href="#" |
3687 | + onclick="toggleCode('M000304-source');return false;">[Source]</a></p> |
3688 | + <div class="method-source-code" id="M000304-source"> |
3689 | +<pre> |
3690 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 291</span> |
3691 | +291: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">disconnect</span> |
3692 | +292: <span class="ruby-constant">MCollective</span><span class="ruby-operator">::</span><span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">"connector_plugin"</span>].<span class="ruby-identifier">disconnect</span> |
3693 | +293: <span class="ruby-keyword kw">rescue</span> |
3694 | +294: <span class="ruby-keyword kw">end</span> |
3695 | +</pre> |
3696 | + </div> |
3697 | + </div> |
3698 | + </div> |
3699 | + |
3700 | + <div id="method-M000306" class="method-detail"> |
3701 | + <a name="M000306"></a> |
3702 | + |
3703 | + <div class="method-heading"> |
3704 | + <a href="#M000306" class="method-signature"> |
3705 | + <span class="method-name">halt</span><span class="method-args">(stats)</span> |
3706 | + </a> |
3707 | + </div> |
3708 | + |
3709 | + <div class="method-description"> |
3710 | + <p> |
3711 | +A helper that creates a consistent exit code for applications by looking at |
3712 | +an instance of <a href="RPC/Stats.html">MCollective::RPC::Stats</a> |
3713 | +</p> |
3714 | +<p> |
3715 | +Exit with 0 if nodes were discovered and all passed Exit with 0 if no |
3716 | +discovery were done and > 0 responses were received Exit with 1 if no |
3717 | +nodes were discovered Exit with 2 if nodes were discovered but some <a |
3718 | +href="RPC.html">RPC</a> requests failed Exit with 3 if nodes were |
3719 | +discovered, but not responses receivedif Exit with 4 if no discovery were |
3720 | +done and no responses were received |
3721 | +</p> |
3722 | + <p><a class="source-toggle" href="#" |
3723 | + onclick="toggleCode('M000306-source');return false;">[Source]</a></p> |
3724 | + <div class="method-source-code" id="M000306-source"> |
3725 | +<pre> |
3726 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 312</span> |
3727 | +312: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">halt</span>(<span class="ruby-identifier">stats</span>) |
3728 | +313: <span class="ruby-identifier">request_stats</span> = {<span class="ruby-identifier">:discoverytime</span> =<span class="ruby-operator">></span> <span class="ruby-value">0</span>, |
3729 | +314: <span class="ruby-identifier">:discovered</span> =<span class="ruby-operator">></span> <span class="ruby-value">0</span>, |
3730 | +315: <span class="ruby-identifier">:failcount</span> =<span class="ruby-operator">></span> <span class="ruby-value">0</span>}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">stats</span>.<span class="ruby-identifier">to_hash</span>) |
3731 | +316: |
3732 | +317: <span class="ruby-comment cmt"># was discovery done?</span> |
3733 | +318: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request_stats</span>[<span class="ruby-identifier">:discoverytime</span>] <span class="ruby-operator">!=</span> <span class="ruby-value">0</span> |
3734 | +319: <span class="ruby-comment cmt"># was any nodes discovered</span> |
3735 | +320: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request_stats</span>[<span class="ruby-identifier">:discovered</span>] <span class="ruby-operator">==</span> <span class="ruby-value">0</span> |
3736 | +321: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span> |
3737 | +322: |
3738 | +323: <span class="ruby-comment cmt"># nodes were discovered, did we get responses</span> |
3739 | +324: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">request_stats</span>[<span class="ruby-identifier">:responses</span>] <span class="ruby-operator">==</span> <span class="ruby-value">0</span> |
3740 | +325: <span class="ruby-identifier">exit</span> <span class="ruby-value">3</span> |
3741 | +326: |
3742 | +327: <span class="ruby-keyword kw">else</span> |
3743 | +328: <span class="ruby-comment cmt"># we got responses and discovery was done, no failures</span> |
3744 | +329: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request_stats</span>[<span class="ruby-identifier">:failcount</span>] <span class="ruby-operator">==</span> <span class="ruby-value">0</span> |
3745 | +330: <span class="ruby-identifier">exit</span> <span class="ruby-value">0</span> |
3746 | +331: <span class="ruby-keyword kw">else</span> |
3747 | +332: <span class="ruby-identifier">exit</span> <span class="ruby-value">2</span> |
3748 | +333: <span class="ruby-keyword kw">end</span> |
3749 | +334: <span class="ruby-keyword kw">end</span> |
3750 | +335: <span class="ruby-keyword kw">else</span> |
3751 | +336: <span class="ruby-comment cmt"># discovery wasnt done and we got no responses</span> |
3752 | +337: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request_stats</span>[<span class="ruby-identifier">:responses</span>] <span class="ruby-operator">==</span> <span class="ruby-value">0</span> |
3753 | +338: <span class="ruby-identifier">exit</span> <span class="ruby-value">4</span> |
3754 | +339: <span class="ruby-keyword kw">else</span> |
3755 | +340: <span class="ruby-identifier">exit</span> <span class="ruby-value">0</span> |
3756 | +341: <span class="ruby-keyword kw">end</span> |
3757 | +342: <span class="ruby-keyword kw">end</span> |
3758 | +343: <span class="ruby-keyword kw">end</span> |
3759 | +</pre> |
3760 | + </div> |
3761 | + </div> |
3762 | + </div> |
3763 | + |
3764 | + <div id="method-M000302" class="method-detail"> |
3765 | + <a name="M000302"></a> |
3766 | + |
3767 | + <div class="method-heading"> |
3768 | + <a href="#M000302" class="method-signature"> |
3769 | + <span class="method-name">help</span><span class="method-args">()</span> |
3770 | + </a> |
3771 | + </div> |
3772 | + |
3773 | + <div class="method-description"> |
3774 | + <p><a class="source-toggle" href="#" |
3775 | + onclick="toggleCode('M000302-source');return false;">[Source]</a></p> |
3776 | + <div class="method-source-code" id="M000302-source"> |
3777 | +<pre> |
3778 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 269</span> |
3779 | +269: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">help</span> |
3780 | +270: <span class="ruby-identifier">application_parse_options</span>(<span class="ruby-keyword kw">true</span>) |
3781 | +271: <span class="ruby-keyword kw">end</span> |
3782 | +</pre> |
3783 | + </div> |
3784 | + </div> |
3785 | + </div> |
3786 | + |
3787 | + <div id="method-M000305" class="method-detail"> |
3788 | + <a name="M000305"></a> |
3789 | + |
3790 | + <div class="method-heading"> |
3791 | + <a href="#M000305" class="method-signature"> |
3792 | <span class="method-name">main</span><span class="method-args">()</span> |
3793 | </a> |
3794 | </div> |
3795 | @@ -643,130 +837,170 @@ |
3796 | <div class="method-description"> |
3797 | <p> |
3798 | Fake abstract class that logs if the user tries to use an application |
3799 | -without supplying a <a href="Application.html#M000285">main</a> override |
3800 | +without supplying a <a href="Application.html#M000305">main</a> override |
3801 | method. |
3802 | </p> |
3803 | <p><a class="source-toggle" href="#" |
3804 | - onclick="toggleCode('M000285-source');return false;">[Source]</a></p> |
3805 | - <div class="method-source-code" id="M000285-source"> |
3806 | + onclick="toggleCode('M000305-source');return false;">[Source]</a></p> |
3807 | + <div class="method-source-code" id="M000305-source"> |
3808 | <pre> |
3809 | - <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 242</span> |
3810 | -242: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">main</span> |
3811 | -243: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">"Applications need to supply a 'main' method"</span> |
3812 | -244: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span> |
3813 | -245: <span class="ruby-keyword kw">end</span> |
3814 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 298</span> |
3815 | +298: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">main</span> |
3816 | +299: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">"Applications need to supply a 'main' method"</span> |
3817 | +300: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span> |
3818 | +301: <span class="ruby-keyword kw">end</span> |
3819 | </pre> |
3820 | </div> |
3821 | </div> |
3822 | </div> |
3823 | |
3824 | - <div id="method-M000277" class="method-detail"> |
3825 | - <a name="M000277"></a> |
3826 | + <div id="method-M000292" class="method-detail"> |
3827 | + <a name="M000292"></a> |
3828 | |
3829 | <div class="method-heading"> |
3830 | - <a href="#M000277" class="method-signature"> |
3831 | + <a href="#M000292" class="method-signature"> |
3832 | <span class="method-name">options</span><span class="method-args">()</span> |
3833 | </a> |
3834 | </div> |
3835 | |
3836 | <div class="method-description"> |
3837 | <p> |
3838 | -The active <a href="Application.html#M000277">options</a> hash used for |
3839 | -MC::Client and other <a href="Application.html#M000276">configuration</a> |
3840 | +The active <a href="Application.html#M000292">options</a> hash used for |
3841 | +MC::Client and other <a href="Application.html#M000291">configuration</a> |
3842 | </p> |
3843 | <p><a class="source-toggle" href="#" |
3844 | - onclick="toggleCode('M000277-source');return false;">[Source]</a></p> |
3845 | - <div class="method-source-code" id="M000277-source"> |
3846 | + onclick="toggleCode('M000292-source');return false;">[Source]</a></p> |
3847 | + <div class="method-source-code" id="M000292-source"> |
3848 | <pre> |
3849 | - <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 82</span> |
3850 | -82: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">options</span> |
3851 | -83: <span class="ruby-ivar">@options</span> |
3852 | -84: <span class="ruby-keyword kw">end</span> |
3853 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 94</span> |
3854 | +94: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">options</span> |
3855 | +95: <span class="ruby-ivar">@options</span> |
3856 | +96: <span class="ruby-keyword kw">end</span> |
3857 | </pre> |
3858 | </div> |
3859 | </div> |
3860 | </div> |
3861 | |
3862 | - <div id="method-M000286" class="method-detail"> |
3863 | - <a name="M000286"></a> |
3864 | + <div id="method-M000307" class="method-detail"> |
3865 | + <a name="M000307"></a> |
3866 | |
3867 | <div class="method-heading"> |
3868 | - <a href="#M000286" class="method-signature"> |
3869 | + <a href="#M000307" class="method-signature"> |
3870 | <span class="method-name">rpcclient</span><span class="method-args">(agent, flags = {})</span> |
3871 | </a> |
3872 | </div> |
3873 | |
3874 | <div class="method-description"> |
3875 | <p> |
3876 | -Wrapper around <a href="RPC.html#M000082">MC::RPC#rpcclient</a> that |
3877 | -forcably supplies our <a href="Application.html#M000277">options</a> hash |
3878 | +Wrapper around <a href="RPC.html#M000070">MC::RPC#rpcclient</a> that |
3879 | +forcably supplies our <a href="Application.html#M000292">options</a> hash |
3880 | if someone forgets to pass in <a |
3881 | -href="Application.html#M000277">options</a> in an application the filters |
3882 | -and other cli <a href="Application.html#M000277">options</a> wouldnt take |
3883 | +href="Application.html#M000292">options</a> in an application the filters |
3884 | +and other cli <a href="Application.html#M000292">options</a> wouldnt take |
3885 | effect which could have a disasterous outcome |
3886 | </p> |
3887 | <p><a class="source-toggle" href="#" |
3888 | - onclick="toggleCode('M000286-source');return false;">[Source]</a></p> |
3889 | - <div class="method-source-code" id="M000286-source"> |
3890 | + onclick="toggleCode('M000307-source');return false;">[Source]</a></p> |
3891 | + <div class="method-source-code" id="M000307-source"> |
3892 | <pre> |
3893 | - <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 250</span> |
3894 | -250: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rpcclient</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">flags</span> = {}) |
3895 | -251: <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:options</span>] = <span class="ruby-identifier">options</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:options</span>) |
3896 | -252: |
3897 | -253: <span class="ruby-keyword kw">super</span> |
3898 | -254: <span class="ruby-keyword kw">end</span> |
3899 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 348</span> |
3900 | +348: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rpcclient</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">flags</span> = {}) |
3901 | +349: <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:options</span>] = <span class="ruby-identifier">options</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:options</span>) |
3902 | +350: |
3903 | +351: <span class="ruby-keyword kw">super</span> |
3904 | +352: <span class="ruby-keyword kw">end</span> |
3905 | </pre> |
3906 | </div> |
3907 | </div> |
3908 | </div> |
3909 | |
3910 | - <div id="method-M000284" class="method-detail"> |
3911 | - <a name="M000284"></a> |
3912 | + <div id="method-M000303" class="method-detail"> |
3913 | + <a name="M000303"></a> |
3914 | |
3915 | <div class="method-heading"> |
3916 | - <a href="#M000284" class="method-signature"> |
3917 | + <a href="#M000303" class="method-signature"> |
3918 | <span class="method-name">run</span><span class="method-args">()</span> |
3919 | </a> |
3920 | </div> |
3921 | |
3922 | <div class="method-description"> |
3923 | <p> |
3924 | -The <a href="Application.html#M000285">main</a> logic loop, builds up the |
3925 | -<a href="Application.html#M000277">options</a>, validate <a |
3926 | -href="Application.html#M000276">configuration</a> and calls the <a |
3927 | -href="Application.html#M000285">main</a> as supplied by the user. |
3928 | +The <a href="Application.html#M000305">main</a> logic loop, builds up the |
3929 | +<a href="Application.html#M000292">options</a>, validate <a |
3930 | +href="Application.html#M000291">configuration</a> and calls the <a |
3931 | +href="Application.html#M000305">main</a> as supplied by the user. |
3932 | Disconnects when done and pass any exception onto the <a |
3933 | -href="Application.html#M000283">application_failure</a> helper |
3934 | +href="Application.html#M000301">application_failure</a> helper |
3935 | </p> |
3936 | <p><a class="source-toggle" href="#" |
3937 | - onclick="toggleCode('M000284-source');return false;">[Source]</a></p> |
3938 | - <div class="method-source-code" id="M000284-source"> |
3939 | -<pre> |
3940 | - <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 225</span> |
3941 | -225: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span> |
3942 | -226: <span class="ruby-identifier">application_parse_options</span> |
3943 | -227: |
3944 | -228: <span class="ruby-identifier">validate_configuration</span>(<span class="ruby-identifier">configuration</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:validate_configuration</span>) |
3945 | -229: |
3946 | -230: <span class="ruby-identifier">main</span> |
3947 | -231: |
3948 | -232: <span class="ruby-constant">MCollective</span><span class="ruby-operator">::</span><span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">"connector_plugin"</span>].<span class="ruby-identifier">disconnect</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">true</span> |
3949 | -233: |
3950 | -234: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SystemExit</span> |
3951 | -235: <span class="ruby-identifier">raise</span> |
3952 | -236: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span> |
3953 | -237: <span class="ruby-identifier">application_failure</span>(<span class="ruby-identifier">e</span>) |
3954 | -238: <span class="ruby-keyword kw">end</span> |
3955 | -</pre> |
3956 | - </div> |
3957 | - </div> |
3958 | - </div> |
3959 | - |
3960 | - <div id="method-M000278" class="method-detail"> |
3961 | - <a name="M000278"></a> |
3962 | - |
3963 | - <div class="method-heading"> |
3964 | - <a href="#M000278" class="method-signature"> |
3965 | + onclick="toggleCode('M000303-source');return false;">[Source]</a></p> |
3966 | + <div class="method-source-code" id="M000303-source"> |
3967 | +<pre> |
3968 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 276</span> |
3969 | +276: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span> |
3970 | +277: <span class="ruby-identifier">application_parse_options</span> |
3971 | +278: |
3972 | +279: <span class="ruby-identifier">validate_configuration</span>(<span class="ruby-identifier">configuration</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:validate_configuration</span>) |
3973 | +280: |
3974 | +281: <span class="ruby-constant">Util</span>.<span class="ruby-identifier">setup_windows_sleeper</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">windows?</span> |
3975 | +282: |
3976 | +283: <span class="ruby-identifier">main</span> |
3977 | +284: |
3978 | +285: <span class="ruby-identifier">disconnect</span> |
3979 | +286: |
3980 | +287: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span> |
3981 | +288: <span class="ruby-identifier">application_failure</span>(<span class="ruby-identifier">e</span>) |
3982 | +289: <span class="ruby-keyword kw">end</span> |
3983 | +</pre> |
3984 | + </div> |
3985 | + </div> |
3986 | + </div> |
3987 | + |
3988 | + <div id="method-M000296" class="method-detail"> |
3989 | + <a name="M000296"></a> |
3990 | + |
3991 | + <div class="method-heading"> |
3992 | + <a href="#M000296" class="method-signature"> |
3993 | + <span class="method-name">validate_cli_options</span><span class="method-args">()</span> |
3994 | + </a> |
3995 | + </div> |
3996 | + |
3997 | + <div class="method-description"> |
3998 | + <p><a class="source-toggle" href="#" |
3999 | + onclick="toggleCode('M000296-source');return false;">[Source]</a></p> |
4000 | + <div class="method-source-code" id="M000296-source"> |
4001 | +<pre> |
4002 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 205</span> |
4003 | +205: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_cli_options</span> |
4004 | +206: <span class="ruby-comment cmt"># Check all required parameters were set</span> |
4005 | +207: <span class="ruby-identifier">validation_passed</span> = <span class="ruby-keyword kw">true</span> |
4006 | +208: <span class="ruby-identifier">application_cli_arguments</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">carg</span><span class="ruby-operator">|</span> |
4007 | +209: <span class="ruby-comment cmt"># Check for required arguments</span> |
4008 | +210: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:required</span>] |
4009 | +211: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">configuration</span>[ <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>] ] |
4010 | +212: <span class="ruby-identifier">validation_passed</span> = <span class="ruby-keyword kw">false</span> |
4011 | +213: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"The #{carg[:name]} option is mandatory"</span> |
4012 | +214: <span class="ruby-keyword kw">end</span> |
4013 | +215: <span class="ruby-keyword kw">end</span> |
4014 | +216: <span class="ruby-keyword kw">end</span> |
4015 | +217: |
4016 | +218: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">validation_passed</span> |
4017 | +219: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">"\nPlease run with --help for detailed help"</span> |
4018 | +220: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span> |
4019 | +221: <span class="ruby-keyword kw">end</span> |
4020 | +222: |
4021 | +223: |
4022 | +224: <span class="ruby-keyword kw">end</span> |
4023 | +</pre> |
4024 | + </div> |
4025 | + </div> |
4026 | + </div> |
4027 | + |
4028 | + <div id="method-M000293" class="method-detail"> |
4029 | + <a name="M000293"></a> |
4030 | + |
4031 | + <div class="method-heading"> |
4032 | + <a href="#M000293" class="method-signature"> |
4033 | <span class="method-name">validate_option</span><span class="method-args">(blk, name, value)</span> |
4034 | </a> |
4035 | </div> |
4036 | @@ -774,22 +1008,22 @@ |
4037 | <div class="method-description"> |
4038 | <p> |
4039 | Calls the supplied block in an <a |
4040 | -href="Application.html#M000274">option</a> for validation, an error raised |
4041 | +href="Application.html#M000289">option</a> for validation, an error raised |
4042 | will log to STDERR and exit the application |
4043 | </p> |
4044 | <p><a class="source-toggle" href="#" |
4045 | - onclick="toggleCode('M000278-source');return false;">[Source]</a></p> |
4046 | - <div class="method-source-code" id="M000278-source"> |
4047 | + onclick="toggleCode('M000293-source');return false;">[Source]</a></p> |
4048 | + <div class="method-source-code" id="M000293-source"> |
4049 | <pre> |
4050 | - <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 88</span> |
4051 | -88: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_option</span>(<span class="ruby-identifier">blk</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>) |
4052 | -89: <span class="ruby-identifier">validation_result</span> = <span class="ruby-identifier">blk</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">value</span>) |
4053 | -90: |
4054 | -91: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">validation_result</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">true</span> |
4055 | -92: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"Validation of #{name} failed: #{validation_result}"</span> |
4056 | -93: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span> |
4057 | -94: <span class="ruby-keyword kw">end</span> |
4058 | -95: <span class="ruby-keyword kw">end</span> |
4059 | + <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 100</span> |
4060 | +100: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_option</span>(<span class="ruby-identifier">blk</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>) |
4061 | +101: <span class="ruby-identifier">validation_result</span> = <span class="ruby-identifier">blk</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">value</span>) |
4062 | +102: |
4063 | +103: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">validation_result</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">true</span> |
4064 | +104: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"Validation of #{name} failed: #{validation_result}"</span> |
4065 | +105: <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span> |
4066 | +106: <span class="ruby-keyword kw">end</span> |
4067 | +107: <span class="ruby-keyword kw">end</span> |
4068 | </pre> |
4069 | </div> |
4070 | </div> |
4071 | |
4072 | === removed file 'doc/classes/MCollective/Application/Controller.html' |
4073 | --- doc/classes/MCollective/Application/Controller.html 2011-11-09 18:12:27 +0000 |
4074 | +++ doc/classes/MCollective/Application/Controller.html 1970-01-01 00:00:00 +0000 |
4075 | @@ -1,270 +0,0 @@ |
4076 | -<?xml version="1.0" encoding="iso-8859-1"?> |
4077 | -<!DOCTYPE html |
4078 | - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
4079 | - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
4080 | - |
4081 | -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4082 | -<head> |
4083 | - <title>Class: MCollective::Application::Controller</title> |
4084 | - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
4085 | - <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
4086 | - <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> |
4087 | - <script type="text/javascript"> |
4088 | - // <![CDATA[ |
4089 | - |
4090 | - function popupCode( url ) { |
4091 | - window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") |
4092 | - } |
4093 | - |
4094 | - function toggleCode( id ) { |
4095 | - if ( document.getElementById ) |
4096 | - elem = document.getElementById( id ); |
4097 | - else if ( document.all ) |
4098 | - elem = eval( "document.all." + id ); |
4099 | - else |
4100 | - return false; |
4101 | - |
4102 | - elemStyle = elem.style; |
4103 | - |
4104 | - if ( elemStyle.display != "block" ) { |
4105 | - elemStyle.display = "block" |
4106 | - } else { |
4107 | - elemStyle.display = "none" |
4108 | - } |
4109 | - |
4110 | - return true; |
4111 | - } |
4112 | - |
4113 | - // Make codeblocks hidden by default |
4114 | - document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) |
4115 | - |
4116 | - // ]]> |
4117 | - </script> |
4118 | - |
4119 | -</head> |
4120 | -<body> |
4121 | - |
4122 | - |
4123 | - |
4124 | - <div id="classHeader"> |
4125 | - <table class="header-table"> |
4126 | - <tr class="top-aligned-row"> |
4127 | - <td><strong>Class</strong></td> |
4128 | - <td class="class-name-in-header">MCollective::Application::Controller</td> |
4129 | - </tr> |
4130 | - <tr class="top-aligned-row"> |
4131 | - <td><strong>In:</strong></td> |
4132 | - <td> |
4133 | - <a href="../../../files/plugins/mcollective/application/controller_rb.html"> |
4134 | - plugins/mcollective/application/controller.rb |
4135 | - </a> |
4136 | - <br /> |
4137 | - </td> |
4138 | - </tr> |
4139 | - |
4140 | - <tr class="top-aligned-row"> |
4141 | - <td><strong>Parent:</strong></td> |
4142 | - <td> |
4143 | - Application |
4144 | - </td> |
4145 | - </tr> |
4146 | - </table> |
4147 | - </div> |
4148 | - <!-- banner header --> |
4149 | - |
4150 | - <div id="bodyContent"> |
4151 | - |
4152 | - |
4153 | - |
4154 | - <div id="contextContent"> |
4155 | - |
4156 | - |
4157 | - |
4158 | - </div> |
4159 | - |
4160 | - <div id="method-list"> |
4161 | - <h3 class="section-bar">Methods</h3> |
4162 | - |
4163 | - <div class="name-list"> |
4164 | - <a href="#M000313">main</a> |
4165 | - <a href="#M000311">post_option_parser</a> |
4166 | - <a href="#M000310">print_statistics</a> |
4167 | - <a href="#M000312">validate_configuration</a> |
4168 | - </div> |
4169 | - </div> |
4170 | - |
4171 | - </div> |
4172 | - |
4173 | - |
4174 | - <!-- if includes --> |
4175 | - |
4176 | - <div id="section"> |
4177 | - |
4178 | - |
4179 | - |
4180 | - |
4181 | - |
4182 | - |
4183 | - |
4184 | - |
4185 | - <!-- if method_list --> |
4186 | - <div id="methods"> |
4187 | - <h3 class="section-bar">Public Instance methods</h3> |
4188 | - |
4189 | - <div id="method-M000313" class="method-detail"> |
4190 | - <a name="M000313"></a> |
4191 | - |
4192 | - <div class="method-heading"> |
4193 | - <a href="#M000313" class="method-signature"> |
4194 | - <span class="method-name">main</span><span class="method-args">()</span> |
4195 | - </a> |
4196 | - </div> |
4197 | - |
4198 | - <div class="method-description"> |
4199 | - <p><a class="source-toggle" href="#" |
4200 | - onclick="toggleCode('M000313-source');return false;">[Source]</a></p> |
4201 | - <div class="method-source-code" id="M000313-source"> |
4202 | -<pre> |
4203 | - <span class="ruby-comment cmt"># File plugins/mcollective/application/controller.rb, line 53</span> |
4204 | -53: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">main</span> |
4205 | -54: <span class="ruby-identifier">client</span> = <span class="ruby-constant">MCollective</span><span class="ruby-operator">::</span><span class="ruby-constant">Client</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:config</span>]) |
4206 | -55: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">options</span> = <span class="ruby-identifier">options</span> |
4207 | -56: |
4208 | -57: <span class="ruby-identifier">counter</span> = <span class="ruby-value">0</span> |
4209 | -58: |
4210 | -59: <span class="ruby-identifier">command</span> = <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:command</span>] |
4211 | -60: <span class="ruby-identifier">command</span> <span class="ruby-operator">+=</span> <span class="ruby-node">" #{configuration[:argument]}"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:argument</span>] |
4212 | -61: |
4213 | -62: <span class="ruby-identifier">statistics</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">discovered_req</span>(<span class="ruby-identifier">command</span>, <span class="ruby-value str">'mcollective'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">response</span><span class="ruby-operator">|</span> |
4214 | -63: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">response</span> |
4215 | -64: |
4216 | -65: <span class="ruby-identifier">counter</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> |
4217 | -66: |
4218 | -67: <span class="ruby-identifier">sender</span> = <span class="ruby-identifier">response</span>[<span class="ruby-identifier">:senderid</span>] |
4219 | -68: <span class="ruby-identifier">body</span> = <span class="ruby-identifier">response</span>[<span class="ruby-identifier">:body</span>] |
4220 | -69: |
4221 | -70: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">command</span> |
4222 | -71: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/^stats$/</span> |
4223 | -72: <span class="ruby-identifier">print_statistics</span>(<span class="ruby-identifier">sender</span>, <span class="ruby-identifier">body</span>[<span class="ruby-identifier">:stats</span>]) |
4224 | -73: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/^reload_agent(?:.+)/</span> |
4225 | -74: <span class="ruby-identifier">printf</span>(<span class="ruby-value str">"%40s> %s\n"</span>, <span class="ruby-identifier">sender</span>, <span class="ruby-identifier">body</span>) |
4226 | -75: <span class="ruby-keyword kw">else</span> |
4227 | -76: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:verbose</span>] |
4228 | -77: <span class="ruby-identifier">puts</span> <span class="ruby-node">"#{sender}>"</span> |
4229 | -78: <span class="ruby-identifier">pp</span> <span class="ruby-identifier">body</span> |
4230 | -79: <span class="ruby-keyword kw">else</span> |
4231 | -80: <span class="ruby-identifier">puts</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">counter</span> <span class="ruby-operator">%</span> <span class="ruby-value">4</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> |
4232 | -81: <span class="ruby-identifier">print</span> <span class="ruby-node">"#{sender} "</span> |
4233 | -82: <span class="ruby-keyword kw">end</span> |
4234 | -83: <span class="ruby-keyword kw">end</span> |
4235 | -84: <span class="ruby-keyword kw">end</span> |
4236 | -85: |
4237 | -86: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">disconnect</span> |
4238 | -87: |
4239 | -88: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">display_stats</span>(<span class="ruby-identifier">statistics</span>, <span class="ruby-keyword kw">false</span>, <span class="ruby-value str">"mcollectived controller summary"</span>) |
4240 | -89: <span class="ruby-keyword kw">end</span> |
4241 | -</pre> |
4242 | - </div> |
4243 | - </div> |
4244 | - </div> |
4245 | - |
4246 | - <div id="method-M000311" class="method-detail"> |
4247 | - <a name="M000311"></a> |
4248 | - |
4249 | - <div class="method-heading"> |
4250 | - <a href="#M000311" class="method-signature"> |
4251 | - <span class="method-name">post_option_parser</span><span class="method-args">(configuration)</span> |
4252 | - </a> |
4253 | - </div> |
4254 | - |
4255 | - <div class="method-description"> |
4256 | - <p><a class="source-toggle" href="#" |
4257 | - onclick="toggleCode('M000311-source');return false;">[Source]</a></p> |
4258 | - <div class="method-source-code" id="M000311-source"> |
4259 | -<pre> |
4260 | - <span class="ruby-comment cmt"># File plugins/mcollective/application/controller.rb, line 31</span> |
4261 | -31: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">post_option_parser</span>(<span class="ruby-identifier">configuration</span>) |
4262 | -32: <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:command</span>] = <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">shift</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span> |
4263 | -33: <span class="ruby-keyword kw">end</span> |
4264 | -</pre> |
4265 | - </div> |
4266 | - </div> |
4267 | - </div> |
4268 | - |
4269 | - <div id="method-M000310" class="method-detail"> |
4270 | - <a name="M000310"></a> |
4271 | - |
4272 | - <div class="method-heading"> |
4273 | - <a href="#M000310" class="method-signature"> |
4274 | - <span class="method-name">print_statistics</span><span class="method-args">(sender, statistics)</span> |
4275 | - </a> |
4276 | - </div> |
4277 | - |
4278 | - <div class="method-description"> |
4279 | - <p><a class="source-toggle" href="#" |
4280 | - onclick="toggleCode('M000310-source');return false;">[Source]</a></p> |
4281 | - <div class="method-source-code" id="M000310-source"> |
4282 | -<pre> |
4283 | - <span class="ruby-comment cmt"># File plugins/mcollective/application/controller.rb, line 23</span> |
4284 | -23: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print_statistics</span>(<span class="ruby-identifier">sender</span>, <span class="ruby-identifier">statistics</span>) |
4285 | -24: <span class="ruby-identifier">printf</span>(<span class="ruby-value str">"%40s> total=%d, replies=%d, valid=%d, invalid=%d, "</span> <span class="ruby-operator">+</span> |
4286 | -25: <span class="ruby-value str">"filtered=%d, passed=%d\n"</span>, <span class="ruby-identifier">sender</span>, |
4287 | -26: <span class="ruby-identifier">statistics</span>[<span class="ruby-identifier">:total</span>], <span class="ruby-identifier">statistics</span>[<span class="ruby-identifier">:replies</span>], |
4288 | -27: <span class="ruby-identifier">statistics</span>[<span class="ruby-identifier">:validated</span>], <span class="ruby-identifier">statistics</span>[<span class="ruby-identifier">:unvalidated</span>], |
4289 | -28: <span class="ruby-identifier">statistics</span>[<span class="ruby-identifier">:filtered</span>], <span class="ruby-identifier">statistics</span>[<span class="ruby-identifier">:passed</span>]) |
4290 | -29: <span class="ruby-keyword kw">end</span> |
4291 | -</pre> |
4292 | - </div> |
4293 | - </div> |
4294 | - </div> |
4295 | - |
4296 | - <div id="method-M000312" class="method-detail"> |
4297 | - <a name="M000312"></a> |
4298 | - |
4299 | - <div class="method-heading"> |
4300 | - <a href="#M000312" class="method-signature"> |
4301 | - <span class="method-name">validate_configuration</span><span class="method-args">(configuration)</span> |
4302 | - </a> |
4303 | - </div> |
4304 | - |
4305 | - <div class="method-description"> |
4306 | - <p><a class="source-toggle" href="#" |
4307 | - onclick="toggleCode('M000312-source');return false;">[Source]</a></p> |
4308 | - <div class="method-source-code" id="M000312-source"> |
4309 | -<pre> |
4310 | - <span class="ruby-comment cmt"># File plugins/mcollective/application/controller.rb, line 35</span> |
4311 | -35: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_configuration</span>(<span class="ruby-identifier">configuration</span>) |
4312 | -36: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:command</span>) |
4313 | -37: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Please specify a command and optional arguments"</span> |
4314 | -38: <span class="ruby-keyword kw">end</span> |
4315 | -39: |
4316 | -40: <span class="ruby-comment cmt">#</span> |
4317 | -41: <span class="ruby-comment cmt"># When asked to restart an agent we need to make sure that</span> |
4318 | -42: <span class="ruby-comment cmt"># we have this agent name and set appropriate filters ...</span> |
4319 | -43: <span class="ruby-comment cmt">#</span> |
4320 | -44: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:command</span>].<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/^reload_agent$/</span>) |
4321 | -45: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:argument</span>) |
4322 | -46: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Please specify an agent name to reload with --argument"</span> |
4323 | -47: <span class="ruby-keyword kw">end</span> |
4324 | -48: |
4325 | -49: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:filter</span>][<span class="ruby-value str">'agent'</span>] <span class="ruby-operator"><<</span> <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:argument</span>] |
4326 | -50: <span class="ruby-keyword kw">end</span> |
4327 | -51: <span class="ruby-keyword kw">end</span> |
4328 | -</pre> |
4329 | - </div> |
4330 | - </div> |
4331 | - </div> |
4332 | - |
4333 | - |
4334 | - </div> |
4335 | - |
4336 | - |
4337 | - </div> |
4338 | - |
4339 | - |
4340 | -<div id="validator-badges"> |
4341 | - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> |
4342 | -</div> |
4343 | - |
4344 | -</body> |
4345 | -</html> |
4346 | \ No newline at end of file |
4347 | |
4348 | === removed file 'doc/classes/MCollective/Application/Facts.html' |
4349 | --- doc/classes/MCollective/Application/Facts.html 2011-11-09 18:12:27 +0000 |
4350 | +++ doc/classes/MCollective/Application/Facts.html 1970-01-01 00:00:00 +0000 |
4351 | @@ -1,252 +0,0 @@ |
4352 | -<?xml version="1.0" encoding="iso-8859-1"?> |
4353 | -<!DOCTYPE html |
4354 | - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
4355 | - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
4356 | - |
4357 | -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4358 | -<head> |
4359 | - <title>Class: MCollective::Application::Facts</title> |
4360 | - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
4361 | - <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
4362 | - <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> |
4363 | - <script type="text/javascript"> |
4364 | - // <![CDATA[ |
4365 | - |
4366 | - function popupCode( url ) { |
4367 | - window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") |
4368 | - } |
4369 | - |
4370 | - function toggleCode( id ) { |
4371 | - if ( document.getElementById ) |
4372 | - elem = document.getElementById( id ); |
4373 | - else if ( document.all ) |
4374 | - elem = eval( "document.all." + id ); |
4375 | - else |
4376 | - return false; |
4377 | - |
4378 | - elemStyle = elem.style; |
4379 | - |
4380 | - if ( elemStyle.display != "block" ) { |
4381 | - elemStyle.display = "block" |
4382 | - } else { |
4383 | - elemStyle.display = "none" |
4384 | - } |
4385 | - |
4386 | - return true; |
4387 | - } |
4388 | - |
4389 | - // Make codeblocks hidden by default |
4390 | - document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) |
4391 | - |
4392 | - // ]]> |
4393 | - </script> |
4394 | - |
4395 | -</head> |
4396 | -<body> |
4397 | - |
4398 | - |
4399 | - |
4400 | - <div id="classHeader"> |
4401 | - <table class="header-table"> |
4402 | - <tr class="top-aligned-row"> |
4403 | - <td><strong>Class</strong></td> |
4404 | - <td class="class-name-in-header">MCollective::Application::Facts</td> |
4405 | - </tr> |
4406 | - <tr class="top-aligned-row"> |
4407 | - <td><strong>In:</strong></td> |
4408 | - <td> |
4409 | - <a href="../../../files/plugins/mcollective/application/facts_rb.html"> |
4410 | - plugins/mcollective/application/facts.rb |
4411 | - </a> |
4412 | - <br /> |
4413 | - </td> |
4414 | - </tr> |
4415 | - |
4416 | - <tr class="top-aligned-row"> |
4417 | - <td><strong>Parent:</strong></td> |
4418 | - <td> |
4419 | - <a href="../Application.html"> |
4420 | - MCollective::Application |
4421 | - </a> |
4422 | - </td> |
4423 | - </tr> |
4424 | - </table> |
4425 | - </div> |
4426 | - <!-- banner header --> |
4427 | - |
4428 | - <div id="bodyContent"> |
4429 | - |
4430 | - |
4431 | - |
4432 | - <div id="contextContent"> |
4433 | - |
4434 | - |
4435 | - |
4436 | - </div> |
4437 | - |
4438 | - <div id="method-list"> |
4439 | - <h3 class="section-bar">Methods</h3> |
4440 | - |
4441 | - <div class="name-list"> |
4442 | - <a href="#M000319">main</a> |
4443 | - <a href="#M000316">post_option_parser</a> |
4444 | - <a href="#M000318">show_single_fact_report</a> |
4445 | - <a href="#M000317">validate_configuration</a> |
4446 | - </div> |
4447 | - </div> |
4448 | - |
4449 | - </div> |
4450 | - |
4451 | - |
4452 | - <!-- if includes --> |
4453 | - |
4454 | - <div id="section"> |
4455 | - |
4456 | - |
4457 | - |
4458 | - |
4459 | - |
4460 | - |
4461 | - |
4462 | - |
4463 | - <!-- if method_list --> |
4464 | - <div id="methods"> |
4465 | - <h3 class="section-bar">Public Instance methods</h3> |
4466 | - |
4467 | - <div id="method-M000319" class="method-detail"> |
4468 | - <a name="M000319"></a> |
4469 | - |
4470 | - <div class="method-heading"> |
4471 | - <a href="#M000319" class="method-signature"> |
4472 | - <span class="method-name">main</span><span class="method-args">()</span> |
4473 | - </a> |
4474 | - </div> |
4475 | - |
4476 | - <div class="method-description"> |
4477 | - <p><a class="source-toggle" href="#" |
4478 | - onclick="toggleCode('M000319-source');return false;">[Source]</a></p> |
4479 | - <div class="method-source-code" id="M000319-source"> |
4480 | -<pre> |
4481 | - <span class="ruby-comment cmt"># File plugins/mcollective/application/facts.rb, line 30</span> |
4482 | -30: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">main</span> |
4483 | -31: <span class="ruby-identifier">rpcutil</span> = <span class="ruby-identifier">rpcclient</span>(<span class="ruby-value str">"rpcutil"</span>) |
4484 | -32: <span class="ruby-identifier">rpcutil</span>.<span class="ruby-identifier">progress</span> = <span class="ruby-keyword kw">false</span> |
4485 | -33: |
4486 | -34: <span class="ruby-identifier">facts</span> = {} |
4487 | -35: |
4488 | -36: <span class="ruby-identifier">rpcutil</span>.<span class="ruby-identifier">get_fact</span>(<span class="ruby-identifier">:fact</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:fact</span>]) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">resp</span><span class="ruby-operator">|</span> |
4489 | -37: <span class="ruby-keyword kw">begin</span> |
4490 | -38: <span class="ruby-identifier">value</span> = <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:data</span>][<span class="ruby-identifier">:value</span>] |
4491 | -39: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span> |
4492 | -40: <span class="ruby-identifier">facts</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">value</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">facts</span>[<span class="ruby-identifier">value</span>] <span class="ruby-operator"><<</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:senderid</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">facts</span>[<span class="ruby-identifier">value</span>] = [ <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:senderid</span>] ] |
4493 | -41: <span class="ruby-keyword kw">end</span> |
4494 | -42: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span> |
4495 | -43: <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"Could not parse facts for #{resp[:senderid]}: #{e.class}: #{e}"</span> |
4496 | -44: <span class="ruby-keyword kw">end</span> |
4497 | -45: <span class="ruby-keyword kw">end</span> |
4498 | -46: |
4499 | -47: <span class="ruby-identifier">show_single_fact_report</span>(<span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:fact</span>], <span class="ruby-identifier">facts</span>, <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:verbose</span>]) |
4500 | -48: |
4501 | -49: <span class="ruby-identifier">printrpcstats</span> |
4502 | -50: <span class="ruby-keyword kw">end</span> |
4503 | -</pre> |
4504 | - </div> |
4505 | - </div> |
4506 | - </div> |
4507 | - |
4508 | - <div id="method-M000316" class="method-detail"> |
4509 | - <a name="M000316"></a> |
4510 | - |
4511 | - <div class="method-heading"> |
4512 | - <a href="#M000316" class="method-signature"> |
4513 | - <span class="method-name">post_option_parser</span><span class="method-args">(configuration)</span> |
4514 | - </a> |
4515 | - </div> |
4516 | - |
4517 | - <div class="method-description"> |
4518 | - <p><a class="source-toggle" href="#" |
4519 | - onclick="toggleCode('M000316-source');return false;">[Source]</a></p> |
4520 | - <div class="method-source-code" id="M000316-source"> |
4521 | -<pre> |
4522 | - <span class="ruby-comment cmt"># File plugins/mcollective/application/facts.rb, line 4</span> |
4523 | -4: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">post_option_parser</span>(<span class="ruby-identifier">configuration</span>) |
4524 | -5: <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:fact</span>] = <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">shift</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span> |
4525 | -6: <span class="ruby-keyword kw">end</span> |
4526 | -</pre> |
4527 | - </div> |
4528 | - </div> |
4529 | - </div> |
4530 | - |
4531 | - <div id="method-M000318" class="method-detail"> |
4532 | - <a name="M000318"></a> |
4533 | - |
4534 | - <div class="method-heading"> |
4535 | - <a href="#M000318" class="method-signature"> |
4536 | - <span class="method-name">show_single_fact_report</span><span class="method-args">(fact, facts, verbose=false)</span> |
4537 | - </a> |
4538 | - </div> |
4539 | - |
4540 | - <div class="method-description"> |
4541 | - <p><a class="source-toggle" href="#" |
4542 | - onclick="toggleCode('M000318-source');return false;">[Source]</a></p> |
4543 | - <div class="method-source-code" id="M000318-source"> |
4544 | -<pre> |
4545 | - <span class="ruby-comment cmt"># File plugins/mcollective/application/facts.rb, line 12</span> |
4546 | -12: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_single_fact_report</span>(<span class="ruby-identifier">fact</span>, <span class="ruby-identifier">facts</span>, <span class="ruby-identifier">verbose</span>=<span class="ruby-keyword kw">false</span>) |
4547 | -13: <span class="ruby-identifier">puts</span>(<span class="ruby-node">"Report for fact: #{fact}\n\n"</span>) |
4548 | -14: |
4549 | -15: <span class="ruby-identifier">facts</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> |
4550 | -16: <span class="ruby-identifier">printf</span>(<span class="ruby-value str">" %-40sfound %d times\n"</span>, <span class="ruby-identifier">k</span>, <span class="ruby-identifier">facts</span>[<span class="ruby-identifier">k</span>].<span class="ruby-identifier">size</span>) |
4551 | -17: |
4552 | -18: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">verbose</span> |
4553 | -19: <span class="ruby-identifier">puts</span> |
4554 | -20: |
4555 | -21: <span class="ruby-identifier">facts</span>[<span class="ruby-identifier">k</span>].<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> |
4556 | -22: <span class="ruby-identifier">puts</span>(<span class="ruby-node">" #{f}"</span>) |
4557 | -23: <span class="ruby-keyword kw">end</span> |
4558 | -24: |
4559 | -25: <span class="ruby-identifier">puts</span> |
4560 | -26: <span class="ruby-keyword kw">end</span> |
4561 | -27: <span class="ruby-keyword kw">end</span> |
4562 | -28: <span class="ruby-keyword kw">end</span> |
4563 | -</pre> |
4564 | - </div> |
4565 | - </div> |
4566 | - </div> |
4567 | - |
4568 | - <div id="method-M000317" class="method-detail"> |
4569 | - <a name="M000317"></a> |
4570 | - |
4571 | - <div class="method-heading"> |
4572 | - <a href="#M000317" class="method-signature"> |
4573 | - <span class="method-name">validate_configuration</span><span class="method-args">(configuration)</span> |
4574 | - </a> |
4575 | - </div> |
4576 | - |
4577 | - <div class="method-description"> |
4578 | - <p><a class="source-toggle" href="#" |
4579 | - onclick="toggleCode('M000317-source');return false;">[Source]</a></p> |
4580 | - <div class="method-source-code" id="M000317-source"> |
4581 | -<pre> |
4582 | - <span class="ruby-comment cmt"># File plugins/mcollective/application/facts.rb, line 8</span> |
4583 | - 8: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_configuration</span>(<span class="ruby-identifier">configuration</span>) |
4584 | - 9: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Please specify a fact to report for"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:fact</span>) |
4585 | -10: <span class="ruby-keyword kw">end</span> |
4586 | -</pre> |
4587 | - </div> |
4588 | - </div> |
4589 | - </div> |
4590 | - |
4591 | - |
4592 | - </div> |
4593 | - |
4594 | - |
4595 | - </div> |
4596 | - |
4597 | - |
4598 | -<div id="validator-badges"> |
4599 | - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> |
4600 | -</div> |
4601 | - |
4602 | -</body> |
4603 | -</html> |
4604 | \ No newline at end of file |
4605 | |
4606 | === removed file 'doc/classes/MCollective/Application/Find.html' |
4607 | --- doc/classes/MCollective/Application/Find.html 2011-11-09 18:12:27 +0000 |
4608 | +++ doc/classes/MCollective/Application/Find.html 1970-01-01 00:00:00 +0000 |
4609 | @@ -1,155 +0,0 @@ |
4610 | -<?xml version="1.0" encoding="iso-8859-1"?> |
4611 | -<!DOCTYPE html |
4612 | - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
4613 | - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
4614 | - |
4615 | -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4616 | -<head> |
4617 | - <title>Class: MCollective::Application::Find</title> |
4618 | - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
4619 | - <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
4620 | - <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> |
4621 | - <script type="text/javascript"> |
4622 | - // <![CDATA[ |
4623 | - |
4624 | - function popupCode( url ) { |
4625 | - window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") |
4626 | - } |
4627 | - |
4628 | - function toggleCode( id ) { |
4629 | - if ( document.getElementById ) |
4630 | - elem = document.getElementById( id ); |
4631 | - else if ( document.all ) |
4632 | - elem = eval( "document.all." + id ); |
4633 | - else |
4634 | - return false; |
4635 | - |
4636 | - elemStyle = elem.style; |
4637 | - |
4638 | - if ( elemStyle.display != "block" ) { |
4639 | - elemStyle.display = "block" |
4640 | - } else { |
4641 | - elemStyle.display = "none" |
4642 | - } |
4643 | - |
4644 | - return true; |
4645 | - } |
4646 | - |
4647 | - // Make codeblocks hidden by default |
4648 | - document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) |
4649 | - |
4650 | - // ]]> |
4651 | - </script> |
4652 | - |
4653 | -</head> |
4654 | -<body> |
4655 | - |
4656 | - |
4657 | - |
4658 | - <div id="classHeader"> |
4659 | - <table class="header-table"> |
4660 | - <tr class="top-aligned-row"> |
4661 | - <td><strong>Class</strong></td> |
4662 | - <td class="class-name-in-header">MCollective::Application::Find</td> |
4663 | - </tr> |
4664 | - <tr class="top-aligned-row"> |
4665 | - <td><strong>In:</strong></td> |
4666 | - <td> |
4667 | - <a href="../../../files/plugins/mcollective/application/find_rb.html"> |
4668 | - plugins/mcollective/application/find.rb |
4669 | - </a> |
4670 | - <br /> |
4671 | - </td> |
4672 | - </tr> |
4673 | - |
4674 | - <tr class="top-aligned-row"> |
4675 | - <td><strong>Parent:</strong></td> |
4676 | - <td> |
4677 | - <a href="../Application.html"> |
4678 | - MCollective::Application |
4679 | - </a> |
4680 | - </td> |
4681 | - </tr> |
4682 | - </table> |
4683 | - </div> |
4684 | - <!-- banner header --> |
4685 | - |
4686 | - <div id="bodyContent"> |
4687 | - |
4688 | - |
4689 | - |
4690 | - <div id="contextContent"> |
4691 | - |
4692 | - |
4693 | - |
4694 | - </div> |
4695 | - |
4696 | - <div id="method-list"> |
4697 | - <h3 class="section-bar">Methods</h3> |
4698 | - |
4699 | - <div class="name-list"> |
4700 | - <a href="#M000314">main</a> |
4701 | - </div> |
4702 | - </div> |
4703 | - |
4704 | - </div> |
4705 | - |
4706 | - |
4707 | - <!-- if includes --> |
4708 | - |
4709 | - <div id="section"> |
4710 | - |
4711 | - |
4712 | - |
4713 | - |
4714 | - |
4715 | - |
4716 | - |
4717 | - |
4718 | - <!-- if method_list --> |
4719 | - <div id="methods"> |
4720 | - <h3 class="section-bar">Public Instance methods</h3> |
4721 | - |
4722 | - <div id="method-M000314" class="method-detail"> |
4723 | - <a name="M000314"></a> |
4724 | - |
4725 | - <div class="method-heading"> |
4726 | - <a href="#M000314" class="method-signature"> |
4727 | - <span class="method-name">main</span><span class="method-args">()</span> |
4728 | - </a> |
4729 | - </div> |
4730 | - |
4731 | - <div class="method-description"> |
4732 | - <p><a class="source-toggle" href="#" |
4733 | - onclick="toggleCode('M000314-source');return false;">[Source]</a></p> |
4734 | - <div class="method-source-code" id="M000314-source"> |
4735 | -<pre> |
4736 | - <span class="ruby-comment cmt"># File plugins/mcollective/application/find.rb, line 4</span> |
4737 | - 4: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">main</span> |
4738 | - 5: <span class="ruby-identifier">client</span> = <span class="ruby-constant">MCollective</span><span class="ruby-operator">::</span><span class="ruby-constant">Client</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:config</span>]) |
4739 | - 6: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">options</span> = <span class="ruby-identifier">options</span> |
4740 | - 7: |
4741 | - 8: <span class="ruby-identifier">stats</span> = <span class="ruby-identifier">client</span>.<span class="ruby-identifier">req</span>(<span class="ruby-value str">"ping"</span>, <span class="ruby-value str">"discovery"</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">resp</span><span class="ruby-operator">|</span> |
4742 | - 9: <span class="ruby-identifier">puts</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:senderid</span>] |
4743 | -10: <span class="ruby-keyword kw">end</span> |
4744 | -11: |
4745 | -12: <span class="ruby-identifier">client</span>.<span class="ruby-identifier">display_stats</span>(<span class="ruby-identifier">stats</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:verbose</span>] |
4746 | -13: <span class="ruby-keyword kw">end</span> |
4747 | -</pre> |
4748 | - </div> |
4749 | - </div> |
4750 | - </div> |
4751 | - |
4752 | - |
4753 | - </div> |
4754 | - |
4755 | - |
4756 | - </div> |
4757 | - |
4758 | - |
4759 | -<div id="validator-badges"> |
4760 | - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> |
4761 | -</div> |
4762 | - |
4763 | -</body> |
4764 | -</html> |
4765 | \ No newline at end of file |
4766 | |
4767 | === removed file 'doc/classes/MCollective/Application/Help.html' |
4768 | --- doc/classes/MCollective/Application/Help.html 2011-11-09 18:12:27 +0000 |
4769 | +++ doc/classes/MCollective/Application/Help.html 1970-01-01 00:00:00 +0000 |
4770 | @@ -1,182 +0,0 @@ |
4771 | -<?xml version="1.0" encoding="iso-8859-1"?> |
4772 | -<!DOCTYPE html |
4773 | - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
4774 | - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
4775 | - |
4776 | -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4777 | -<head> |
4778 | - <title>Class: MCollective::Application::Help</title> |
4779 | - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
4780 | - <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
4781 | - <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> |
4782 | - <script type="text/javascript"> |
4783 | - // <![CDATA[ |
4784 | - |
4785 | - function popupCode( url ) { |
4786 | - window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") |
4787 | - } |
4788 | - |
4789 | - function toggleCode( id ) { |
4790 | - if ( document.getElementById ) |
4791 | - elem = document.getElementById( id ); |
4792 | - else if ( document.all ) |
4793 | - elem = eval( "document.all." + id ); |
4794 | - else |
4795 | - return false; |
4796 | - |
4797 | - elemStyle = elem.style; |
4798 | - |
4799 | - if ( elemStyle.display != "block" ) { |
4800 | - elemStyle.display = "block" |
4801 | - } else { |
4802 | - elemStyle.display = "none" |
4803 | - } |
4804 | - |
4805 | - return true; |
4806 | - } |
4807 | - |
4808 | - // Make codeblocks hidden by default |
4809 | - document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) |
4810 | - |
4811 | - // ]]> |
4812 | - </script> |
4813 | - |
4814 | -</head> |
4815 | -<body> |
4816 | - |
4817 | - |
4818 | - |
4819 | - <div id="classHeader"> |
4820 | - <table class="header-table"> |
4821 | - <tr class="top-aligned-row"> |
4822 | - <td><strong>Class</strong></td> |
4823 | - <td class="class-name-in-header">MCollective::Application::Help</td> |
4824 | - </tr> |
4825 | - <tr class="top-aligned-row"> |
4826 | - <td><strong>In:</strong></td> |
4827 | - <td> |
4828 | - <a href="../../../files/plugins/mcollective/application/help_rb.html"> |
4829 | - plugins/mcollective/application/help.rb |
4830 | - </a> |
4831 | - <br /> |
4832 | - </td> |
4833 | - </tr> |
4834 | - |
4835 | - <tr class="top-aligned-row"> |
4836 | - <td><strong>Parent:</strong></td> |
4837 | - <td> |
4838 | - Application |
4839 | - </td> |
4840 | - </tr> |
4841 | - </table> |
4842 | - </div> |
4843 | - <!-- banner header --> |
4844 | - |
4845 | - <div id="bodyContent"> |
4846 | - |
4847 | - |
4848 | - |
4849 | - <div id="contextContent"> |
4850 | - |
4851 | - |
4852 | - |
4853 | - </div> |
4854 | - |
4855 | - <div id="method-list"> |
4856 | - <h3 class="section-bar">Methods</h3> |
4857 | - |
4858 | - <div class="name-list"> |
4859 | - <a href="#M000288">main</a> |
4860 | - <a href="#M000287">post_option_parser</a> |
4861 | - </div> |
4862 | - </div> |
4863 | - |
4864 | - </div> |
4865 | - |
4866 | - |
4867 | - <!-- if includes --> |
4868 | - |
4869 | - <div id="section"> |
4870 | - |
4871 | - |
4872 | - |
4873 | - |
4874 | - |
4875 | - |
4876 | - |
4877 | - |
4878 | - <!-- if method_list --> |
4879 | - <div id="methods"> |
4880 | - <h3 class="section-bar">Public Instance methods</h3> |
4881 | - |
4882 | - <div id="method-M000288" class="method-detail"> |
4883 | - <a name="M000288"></a> |
4884 | - |
4885 | - <div class="method-heading"> |
4886 | - <a href="#M000288" class="method-signature"> |
4887 | - <span class="method-name">main</span><span class="method-args">()</span> |
4888 | - </a> |
4889 | - </div> |
4890 | - |
4891 | - <div class="method-description"> |
4892 | - <p><a class="source-toggle" href="#" |
4893 | - onclick="toggleCode('M000288-source');return false;">[Source]</a></p> |
4894 | - <div class="method-source-code" id="M000288-source"> |
4895 | -<pre> |
4896 | - <span class="ruby-comment cmt"># File plugins/mcollective/application/help.rb, line 10</span> |
4897 | -10: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">main</span> |
4898 | -11: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">configuration</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:agent</span>) |
4899 | -12: <span class="ruby-identifier">ddl</span> = <span class="ruby-constant">MCollective</span><span class="ruby-operator">::</span><span class="ruby-constant">RPC</span><span class="ruby-operator">::</span><span class="ruby-constant">DDL</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:agent</span>]) |
4900 | -13: <span class="ruby-identifier">puts</span> <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">help</span>(<span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">rpchelptemplate</span>) |
4901 | -14: <span class="ruby-keyword kw">else</span> |
4902 | -15: <span class="ruby-identifier">puts</span> <span class="ruby-node">"The Marionette Collective version #{MCollective.version}"</span> |
4903 | -16: <span class="ruby-identifier">puts</span> |
4904 | -17: |
4905 | -18: <span class="ruby-constant">Applications</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">app</span><span class="ruby-operator">|</span> |
4906 | -19: <span class="ruby-identifier">puts</span> <span class="ruby-value str">" %-15s %s"</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">app</span>, <span class="ruby-constant">Applications</span>[<span class="ruby-identifier">app</span>].<span class="ruby-identifier">application_description</span>] |
4907 | -20: <span class="ruby-keyword kw">end</span> |
4908 | -21: |
4909 | -22: <span class="ruby-identifier">puts</span> |
4910 | -23: <span class="ruby-keyword kw">end</span> |
4911 | -24: <span class="ruby-keyword kw">end</span> |
4912 | -</pre> |
4913 | - </div> |
4914 | - </div> |
4915 | - </div> |
4916 | - |
4917 | - <div id="method-M000287" class="method-detail"> |
4918 | - <a name="M000287"></a> |
4919 | - |
4920 | - <div class="method-heading"> |
4921 | - <a href="#M000287" class="method-signature"> |
4922 | - <span class="method-name">post_option_parser</span><span class="method-args">(configuration)</span> |
4923 | - </a> |
4924 | - </div> |
4925 | - |
4926 | - <div class="method-description"> |
4927 | - <p><a class="source-toggle" href="#" |
4928 | - onclick="toggleCode('M000287-source');return false;">[Source]</a></p> |
4929 | - <div class="method-source-code" id="M000287-source"> |
4930 | -<pre> |
4931 | - <span class="ruby-comment cmt"># File plugins/mcollective/application/help.rb, line 6</span> |
4932 | -6: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">post_option_parser</span>(<span class="ruby-identifier">configuration</span>) |
4933 | -7: <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:agent</span>] = <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">shift</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span> |
4934 | -8: <span class="ruby-keyword kw">end</span> |
4935 | -</pre> |
4936 | - </div> |
4937 | - </div> |
4938 | - </div> |
4939 | - |
4940 | - |
4941 | - </div> |
4942 | - |
4943 | - |
4944 | - </div> |
4945 | - |
4946 | - |
4947 | -<div id="validator-badges"> |
4948 | - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> |
4949 | -</div> |
4950 | - |
4951 | -</body> |
4952 | -</html> |
4953 | \ No newline at end of file |
4954 | |
4955 | === removed file 'doc/classes/MCollective/Application/Inventory.html' |
4956 | --- doc/classes/MCollective/Application/Inventory.html 2011-11-09 18:12:27 +0000 |
4957 | +++ doc/classes/MCollective/Application/Inventory.html 1970-01-01 00:00:00 +0000 |
4958 | @@ -1,798 +0,0 @@ |
4959 | -<?xml version="1.0" encoding="iso-8859-1"?> |
4960 | -<!DOCTYPE html |
4961 | - PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
4962 | - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
4963 | - |
4964 | -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
4965 | -<head> |
4966 | - <title>Class: MCollective::Application::Inventory</title> |
4967 | - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
4968 | - <meta http-equiv="Content-Script-Type" content="text/javascript" /> |
4969 | - <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" /> |
4970 | - <script type="text/javascript"> |
4971 | - // <![CDATA[ |
4972 | - |
4973 | - function popupCode( url ) { |
4974 | - window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") |
4975 | - } |
4976 | - |
4977 | - function toggleCode( id ) { |
4978 | - if ( document.getElementById ) |
4979 | - elem = document.getElementById( id ); |
4980 | - else if ( document.all ) |
4981 | - elem = eval( "document.all." + id ); |
4982 | - else |
4983 | - return false; |
4984 | - |
4985 | - elemStyle = elem.style; |
4986 | - |
4987 | - if ( elemStyle.display != "block" ) { |
4988 | - elemStyle.display = "block" |
4989 | - } else { |
4990 | - elemStyle.display = "none" |
4991 | - } |
4992 | - |
4993 | - return true; |
4994 | - } |
4995 | - |
4996 | - // Make codeblocks hidden by default |
4997 | - document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) |
4998 | - |
4999 | - // ]]> |
5000 | - </script> |
Thanks for the merge. The debian/changelog ommitted the changes in 1.2.1+dfsg- 2ubuntu1. I then diffed the package against the version in Debian, and discovered the following undocumented changes: mcollective- client. config is added mcollective- client. templates is added mcollective- middleware. postinst is added mcollective- middleware. postrm is added patches/ drop-init- script. patch patches/ nodaemonize. server. patch
* debian/
* debian/
* debian/
* debian/
* debian/
* debian/
Can you update debian/changelog for the above? That will make it much easier to know what was changed and to review in the future. Thanks!