Update version according to OSCI-856
authorDmitry Burmistrov <dburmistrov@mirantis.com>
Fri, 8 Nov 2013 13:11:47 +0000 (17:11 +0400)
committerDmitry Burmistrov <dburmistrov@mirantis.com>
Fri, 8 Nov 2013 13:11:47 +0000 (17:11 +0400)
460 files changed:
README [deleted file]
Rakefile [deleted file]
bin/mcollectived
debian/changelog
debian/control
debian/mcollective-common.dirs [new file with mode: 0644]
debian/mcollective-common.install
debian/mcollective.init [changed mode: 0755->0644]
debian/patches/conffile.dpatch [changed mode: 0755->0644]
debian/patches/initlsb.dpatch [changed mode: 0755->0644]
debian/patches/makefile.dpatch [changed mode: 0755->0644]
debian/patches/pluginsdir.dpatch [changed mode: 0755->0644]
debian/rules
doc/.do-not-remove [deleted file]
doc/classes/Array.html [new file with mode: 0644]
doc/classes/Dir.html [new file with mode: 0644]
doc/classes/MCollective.html [new file with mode: 0644]
doc/classes/MCollective/Agent.html [new file with mode: 0644]
doc/classes/MCollective/Agents.html [new file with mode: 0644]
doc/classes/MCollective/Aggregate.html [new file with mode: 0644]
doc/classes/MCollective/Aggregate/Base.html [new file with mode: 0644]
doc/classes/MCollective/Aggregate/Result.html [new file with mode: 0644]
doc/classes/MCollective/Aggregate/Result/Base.html [new file with mode: 0644]
doc/classes/MCollective/Aggregate/Result/CollectionResult.html [new file with mode: 0644]
doc/classes/MCollective/Aggregate/Result/NumericResult.html [new file with mode: 0644]
doc/classes/MCollective/Application.html [new file with mode: 0644]
doc/classes/MCollective/Applications.html [new file with mode: 0644]
doc/classes/MCollective/Cache.html [new file with mode: 0644]
doc/classes/MCollective/Client.html [new file with mode: 0644]
doc/classes/MCollective/CodedError.html [new file with mode: 0644]
doc/classes/MCollective/Config.html [new file with mode: 0644]
doc/classes/MCollective/Connector.html [new file with mode: 0644]
doc/classes/MCollective/Connector/Base.html [new file with mode: 0644]
doc/classes/MCollective/DDL.html [new file with mode: 0644]
doc/classes/MCollective/DDL/AgentDDL.html [new file with mode: 0644]
doc/classes/MCollective/DDL/Base.html [new file with mode: 0644]
doc/classes/MCollective/DDL/DataDDL.html [new file with mode: 0644]
doc/classes/MCollective/DDL/DiscoveryDDL.html [new file with mode: 0644]
doc/classes/MCollective/DDL/ValidatorDDL.html [new file with mode: 0644]
doc/classes/MCollective/DDLValidationError.html [new file with mode: 0644]
doc/classes/MCollective/Data.html [new file with mode: 0644]
doc/classes/MCollective/Data/Base.html [new file with mode: 0644]
doc/classes/MCollective/Data/Result.html [new file with mode: 0644]
doc/classes/MCollective/Discovery.html [new file with mode: 0644]
doc/classes/MCollective/Facts.html [new file with mode: 0644]
doc/classes/MCollective/Facts/Base.html [new file with mode: 0644]
doc/classes/MCollective/Generators.html [new file with mode: 0644]
doc/classes/MCollective/Generators/AgentGenerator.html [new file with mode: 0644]
doc/classes/MCollective/Generators/Base.html [new file with mode: 0644]
doc/classes/MCollective/Generators/DataGenerator.html [new file with mode: 0644]
doc/classes/MCollective/InvalidRPCData.html [new file with mode: 0644]
doc/classes/MCollective/Log.html [new file with mode: 0644]
doc/classes/MCollective/Logger.html [new file with mode: 0644]
doc/classes/MCollective/Logger/Base.html [new file with mode: 0644]
doc/classes/MCollective/Logger/Console_logger.html [new file with mode: 0644]
doc/classes/MCollective/Logger/File_logger.html [new file with mode: 0644]
doc/classes/MCollective/Logger/Syslog_logger.html [new file with mode: 0644]
doc/classes/MCollective/Matcher.html [new file with mode: 0644]
doc/classes/MCollective/Matcher/Parser.html [new file with mode: 0644]
doc/classes/MCollective/Matcher/Scanner.html [new file with mode: 0644]
doc/classes/MCollective/Message.html [new file with mode: 0644]
doc/classes/MCollective/MissingRPCData.html [new file with mode: 0644]
doc/classes/MCollective/MsgDoesNotMatchRequestID.html [new file with mode: 0644]
doc/classes/MCollective/MsgTTLExpired.html [new file with mode: 0644]
doc/classes/MCollective/NotTargettedAtUs.html [new file with mode: 0644]
doc/classes/MCollective/Optionparser.html [new file with mode: 0644]
doc/classes/MCollective/PluginManager.html [new file with mode: 0644]
doc/classes/MCollective/PluginPackager.html [new file with mode: 0644]
doc/classes/MCollective/PluginPackager/AgentDefinition.html [new file with mode: 0644]
doc/classes/MCollective/PluginPackager/StandardDefinition.html [new file with mode: 0644]
doc/classes/MCollective/RPC.html [new file with mode: 0644]
doc/classes/MCollective/RPC/ActionRunner.html [new file with mode: 0644]
doc/classes/MCollective/RPC/Agent.html [new file with mode: 0644]
doc/classes/MCollective/RPC/Audit.html [new file with mode: 0644]
doc/classes/MCollective/RPC/Client.html [new file with mode: 0644]
doc/classes/MCollective/RPC/Helpers.html [new file with mode: 0644]
doc/classes/MCollective/RPC/Progress.html [new file with mode: 0644]
doc/classes/MCollective/RPC/Reply.html [new file with mode: 0644]
doc/classes/MCollective/RPC/Request.html [new file with mode: 0644]
doc/classes/MCollective/RPC/Result.html [new file with mode: 0644]
doc/classes/MCollective/RPC/Stats.html [new file with mode: 0644]
doc/classes/MCollective/RPCAborted.html [new file with mode: 0644]
doc/classes/MCollective/RPCError.html [new file with mode: 0644]
doc/classes/MCollective/Registration.html [new file with mode: 0644]
doc/classes/MCollective/Registration/Base.html [new file with mode: 0644]
doc/classes/MCollective/Runner.html [new file with mode: 0644]
doc/classes/MCollective/RunnerStats.html [new file with mode: 0644]
doc/classes/MCollective/SSL.html [new file with mode: 0644]
doc/classes/MCollective/Security.html [new file with mode: 0644]
doc/classes/MCollective/Security/Base.html [new file with mode: 0644]
doc/classes/MCollective/SecurityValidationFailed.html [new file with mode: 0644]
doc/classes/MCollective/Shell.html [new file with mode: 0644]
doc/classes/MCollective/Translatable.html [new file with mode: 0644]
doc/classes/MCollective/UnixDaemon.html [new file with mode: 0644]
doc/classes/MCollective/UnknownRPCAction.html [new file with mode: 0644]
doc/classes/MCollective/UnknownRPCError.html [new file with mode: 0644]
doc/classes/MCollective/Util.html [new file with mode: 0644]
doc/classes/MCollective/Validator.html [new file with mode: 0644]
doc/classes/MCollective/ValidatorError.html [new file with mode: 0644]
doc/classes/MCollective/WindowsDaemon.html [new file with mode: 0644]
doc/classes/String.html [new file with mode: 0644]
doc/classes/Symbol.html [new file with mode: 0644]
doc/created.rid [new file with mode: 0644]
doc/files/install_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/agent_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/agents_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/aggregate/base_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/aggregate/result/base_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/aggregate/result/collection_result_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/aggregate/result/numeric_result_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/aggregate/result_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/aggregate_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/application_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/applications_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/cache_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/client_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/config_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/connector/base_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/connector_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/data/base_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/data/result_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/data_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/ddl/agentddl_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/ddl/base_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/ddl/dataddl_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/ddl/discoveryddl_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/ddl/validatorddl_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/ddl_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/discovery_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/exception_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/facts/base_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/facts_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/generators/agent_generator_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/generators/base_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/generators/data_generator_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/generators_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/log_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/logger/base_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/logger/console_logger_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/logger/file_logger_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/logger/syslog_logger_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/logger_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/matcher/parser_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/matcher/scanner_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/matcher_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/message_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/monkey_patches_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/optionparser_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/pluginmanager_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/pluginpackager/agent_definition_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/pluginpackager/standard_definition_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/pluginpackager_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/registration/base_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/registration_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/rpc/actionrunner_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/rpc/agent_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/rpc/audit_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/rpc/client_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/rpc/helpers_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/rpc/progress_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/rpc/reply_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/rpc/request_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/rpc/result_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/rpc/stats_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/rpc_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/runner_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/runnerstats_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/security/base_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/security_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/shell_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/ssl_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/translatable_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/unix_daemon_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/util_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/validator_rb.html [new file with mode: 0644]
doc/files/lib/mcollective/windows_daemon_rb.html [new file with mode: 0644]
doc/files/lib/mcollective_rb.html [new file with mode: 0644]
doc/fr_class_index.html [new file with mode: 0644]
doc/fr_file_index.html [new file with mode: 0644]
doc/fr_method_index.html [new file with mode: 0644]
doc/index.html [new file with mode: 0644]
doc/rdoc-style.css [new file with mode: 0644]
ext/Makefile.debian [new file with mode: 0644]
ext/activemq/examples/multi-broker/broker1-activemq.xml
ext/activemq/examples/multi-broker/broker2-activemq.xml
ext/activemq/examples/multi-broker/broker3-activemq.xml
ext/activemq/examples/single-broker/activemq.xml
ext/debian/control
ext/debian/mcollective-common.dirs [new file with mode: 0644]
ext/debian/mcollective-common.install
ext/debian/patches/makefile.dpatch
ext/debian/rules
ext/osx/bldmacpkg
ext/redhat/mcollective.spec
ext/windows/daemon.bat [new file with mode: 0644]
lib/mcollective.rb
lib/mcollective/client.rb
lib/mcollective/config.rb
lib/mcollective/data/result.rb
lib/mcollective/ddl/base.rb
lib/mcollective/locales/en.yml
lib/mcollective/log.rb
lib/mcollective/matcher.rb
lib/mcollective/message.rb
lib/mcollective/optionparser.rb
lib/mcollective/pluginpackager.rb
lib/mcollective/pluginpackager/agent_definition.rb
lib/mcollective/pluginpackager/standard_definition.rb
lib/mcollective/rpc/agent.rb
lib/mcollective/rpc/client.rb
lib/mcollective/rpc/reply.rb
lib/mcollective/shell.rb
lib/mcollective/util.rb
lib/mcollective/windows_daemon.rb
mcollective.init [changed mode: 0644->0755]
plugins/mcollective/agent/rpcutil.ddl
plugins/mcollective/agent/rpcutil.rb
plugins/mcollective/aggregate/average.ddl [new file with mode: 0644]
plugins/mcollective/aggregate/sum.ddl [new file with mode: 0644]
plugins/mcollective/aggregate/summary.ddl [new file with mode: 0644]
plugins/mcollective/application/doc.rb
plugins/mcollective/application/plugin.rb
plugins/mcollective/application/rpc.rb
plugins/mcollective/connector/activemq.rb
plugins/mcollective/connector/rabbitmq.rb
plugins/mcollective/discovery/flatfile.rb
plugins/mcollective/discovery/stdin.ddl [new file with mode: 0644]
plugins/mcollective/discovery/stdin.rb [new file with mode: 0644]
plugins/mcollective/pluginpackager/debpackage_packager.rb
plugins/mcollective/pluginpackager/ospackage_packager.rb
plugins/mcollective/pluginpackager/rpmpackage_packager.rb
plugins/mcollective/pluginpackager/templates/debian/changelog.erb
plugins/mcollective/pluginpackager/templates/debian/control.erb
plugins/mcollective/pluginpackager/templates/redhat/rpm_spec.erb
spec/Rakefile [deleted file]
spec/fixtures/application/test.rb [deleted file]
spec/fixtures/test-cert.pem [deleted file]
spec/fixtures/test-private.pem [deleted file]
spec/fixtures/test-public.pem [deleted file]
spec/fixtures/util/1.in [deleted file]
spec/fixtures/util/1.out [deleted file]
spec/fixtures/util/2.in [deleted file]
spec/fixtures/util/2.out [deleted file]
spec/fixtures/util/3.in [deleted file]
spec/fixtures/util/3.out [deleted file]
spec/fixtures/util/4.in [deleted file]
spec/fixtures/util/4.out [deleted file]
spec/matchers/exception_matchers.rb [deleted file]
spec/monkey_patches/instance_variable_defined.rb [deleted file]
spec/spec.opts [deleted file]
spec/spec_helper.rb [deleted file]
spec/unit/agents_spec.rb [deleted file]
spec/unit/aggregate/base_spec.rb [deleted file]
spec/unit/aggregate/result/base_spec.rb [deleted file]
spec/unit/aggregate/result/collection_result_spec.rb [deleted file]
spec/unit/aggregate/result/numeric_result_spec.rb [deleted file]
spec/unit/aggregate_spec.rb [deleted file]
spec/unit/application_spec.rb [deleted file]
spec/unit/applications_spec.rb [deleted file]
spec/unit/array_spec.rb [deleted file]
spec/unit/cache_spec.rb [deleted file]
spec/unit/client_spec.rb [deleted file]
spec/unit/config_spec.rb [deleted file]
spec/unit/data/base_spec.rb [deleted file]
spec/unit/data/result_spec.rb [deleted file]
spec/unit/data_spec.rb [deleted file]
spec/unit/ddl/agentddl_spec.rb [deleted file]
spec/unit/ddl/base_spec.rb [deleted file]
spec/unit/ddl/dataddl_spec.rb [deleted file]
spec/unit/ddl/discoveryddl_spec.rb [deleted file]
spec/unit/ddl_spec.rb [deleted file]
spec/unit/discovery_spec.rb [deleted file]
spec/unit/facts/base_spec.rb [deleted file]
spec/unit/facts_spec.rb [deleted file]
spec/unit/generators/agent_generator_spec.rb [deleted file]
spec/unit/generators/base_spec.rb [deleted file]
spec/unit/generators/data_generator_spec.rb [deleted file]
spec/unit/generators/snippets/agent_ddl [deleted file]
spec/unit/generators/snippets/data_ddl [deleted file]
spec/unit/log_spec.rb [deleted file]
spec/unit/logger/base_spec.rb [deleted file]
spec/unit/logger/console_logger_spec.rb [deleted file]
spec/unit/logger/syslog_logger_spec.rb [deleted file]
spec/unit/matcher/parser_spec.rb [deleted file]
spec/unit/matcher/scanner_spec.rb [deleted file]
spec/unit/matcher_spec.rb [deleted file]
spec/unit/message_spec.rb [deleted file]
spec/unit/optionparser_spec.rb [deleted file]
spec/unit/pluginmanager_spec.rb [deleted file]
spec/unit/pluginpackager/agent_definition_spec.rb [deleted file]
spec/unit/pluginpackager/standard_definition_spec.rb [deleted file]
spec/unit/pluginpackager_spec.rb [deleted file]
spec/unit/plugins/mcollective/aggregate/average_spec.rb [deleted file]
spec/unit/plugins/mcollective/aggregate/sum_spec.rb [deleted file]
spec/unit/plugins/mcollective/aggregate/summary_spec.rb [deleted file]
spec/unit/plugins/mcollective/connector/activemq_spec.rb [deleted file]
spec/unit/plugins/mcollective/connector/rabbitmq_spec.rb [deleted file]
spec/unit/plugins/mcollective/data/agent_data_spec.rb [deleted file]
spec/unit/plugins/mcollective/data/fstat_data_spec.rb [deleted file]
spec/unit/plugins/mcollective/discovery/flatfile_spec.rb [deleted file]
spec/unit/plugins/mcollective/discovery/mc_spec.rb [deleted file]
spec/unit/plugins/mcollective/packagers/debpackage_packager_spec.rb [deleted file]
spec/unit/plugins/mcollective/packagers/ospackage_spec.rb [deleted file]
spec/unit/plugins/mcollective/packagers/rpmpackage_packager_spec.rb [deleted file]
spec/unit/plugins/mcollective/security/psk_spec.rb [deleted file]
spec/unit/plugins/mcollective/validator/array_validator_spec.rb [deleted file]
spec/unit/plugins/mcollective/validator/ipv4address_validator_spec.rb [deleted file]
spec/unit/plugins/mcollective/validator/ipv6address_validator_spec.rb [deleted file]
spec/unit/plugins/mcollective/validator/length_validator_spec.rb [deleted file]
spec/unit/plugins/mcollective/validator/regex_validator_spec.rb [deleted file]
spec/unit/plugins/mcollective/validator/shellsafe_validator_spec.rb [deleted file]
spec/unit/plugins/mcollective/validator/typecheck_validator_spec.rb [deleted file]
spec/unit/registration/base_spec.rb [deleted file]
spec/unit/rpc/actionrunner_spec.rb [deleted file]
spec/unit/rpc/agent_spec.rb [deleted file]
spec/unit/rpc/client_spec.rb [deleted file]
spec/unit/rpc/helpers_spec.rb [deleted file]
spec/unit/rpc/reply_spec.rb [deleted file]
spec/unit/rpc/request_spec.rb [deleted file]
spec/unit/rpc/result_spec.rb [deleted file]
spec/unit/rpc/stats_spec.rb [deleted file]
spec/unit/rpc_spec.rb [deleted file]
spec/unit/runnerstats_spec.rb [deleted file]
spec/unit/security/base_spec.rb [deleted file]
spec/unit/shell_spec.rb [deleted file]
spec/unit/ssl_spec.rb [deleted file]
spec/unit/string_spec.rb [deleted file]
spec/unit/symbol_spec.rb [deleted file]
spec/unit/unix_daemon_spec.rb [deleted file]
spec/unit/util_spec.rb [deleted file]
spec/unit/validator_spec.rb [deleted file]
spec/unit/vendor_spec.rb [deleted file]
spec/unit/windows_daemon_spec.rb [deleted file]
spec/windows_spec.opts [deleted file]
website/_includes/main_menu.html [deleted file]
website/blueprint/ie.css [deleted file]
website/blueprint/plugins/buttons/icons/cross.png [deleted file]
website/blueprint/plugins/buttons/icons/key.png [deleted file]
website/blueprint/plugins/buttons/icons/tick.png [deleted file]
website/blueprint/plugins/buttons/readme.txt [deleted file]
website/blueprint/plugins/buttons/screen.css [deleted file]
website/blueprint/plugins/fancy-type/readme.txt [deleted file]
website/blueprint/plugins/fancy-type/screen.css [deleted file]
website/blueprint/plugins/link-icons/icons/doc.png [deleted file]
website/blueprint/plugins/link-icons/icons/email.png [deleted file]
website/blueprint/plugins/link-icons/icons/external.png [deleted file]
website/blueprint/plugins/link-icons/icons/feed.png [deleted file]
website/blueprint/plugins/link-icons/icons/im.png [deleted file]
website/blueprint/plugins/link-icons/icons/pdf.png [deleted file]
website/blueprint/plugins/link-icons/icons/visited.png [deleted file]
website/blueprint/plugins/link-icons/icons/xls.png [deleted file]
website/blueprint/plugins/link-icons/readme.txt [deleted file]
website/blueprint/plugins/link-icons/screen.css [deleted file]
website/blueprint/plugins/rtl/readme.txt [deleted file]
website/blueprint/plugins/rtl/screen.css [deleted file]
website/blueprint/print.css [deleted file]
website/blueprint/screen.css [deleted file]
website/blueprint/src/forms.css [deleted file]
website/blueprint/src/grid.css [deleted file]
website/blueprint/src/grid.png [deleted file]
website/blueprint/src/ie.css [deleted file]
website/blueprint/src/print.css [deleted file]
website/blueprint/src/reset.css [deleted file]
website/blueprint/src/typography.css [deleted file]
website/changelog.md [deleted file]
website/configure/server.md [deleted file]
website/deploy/middleware/activemq.md [deleted file]
website/deploy/middleware/activemq_keystores.md [deleted file]
website/ec2demo.md [deleted file]
website/images/activemq-multi-locations.png [deleted file]
website/images/mcollective-aaa.png [deleted file]
website/images/mcollective/li.png [deleted file]
website/images/message-flow-diagram.png [deleted file]
website/images/subcollectives-collectives.png [deleted file]
website/images/subcollectives-impact.png [deleted file]
website/images/subcollectives-multiple-middleware.png [deleted file]
website/index.md [deleted file]
website/messages/PLMC1.md [deleted file]
website/messages/PLMC10.md [deleted file]
website/messages/PLMC11.md [deleted file]
website/messages/PLMC12.md [deleted file]
website/messages/PLMC13.md [deleted file]
website/messages/PLMC14.md [deleted file]
website/messages/PLMC15.md [deleted file]
website/messages/PLMC16.md [deleted file]
website/messages/PLMC17.md [deleted file]
website/messages/PLMC18.md [deleted file]
website/messages/PLMC19.md [deleted file]
website/messages/PLMC2.md [deleted file]
website/messages/PLMC20.md [deleted file]
website/messages/PLMC21.md [deleted file]
website/messages/PLMC22.md [deleted file]
website/messages/PLMC23.md [deleted file]
website/messages/PLMC24.md [deleted file]
website/messages/PLMC25.md [deleted file]
website/messages/PLMC26.md [deleted file]
website/messages/PLMC27.md [deleted file]
website/messages/PLMC28.md [deleted file]
website/messages/PLMC29.md [deleted file]
website/messages/PLMC3.md [deleted file]
website/messages/PLMC30.md [deleted file]
website/messages/PLMC31.md [deleted file]
website/messages/PLMC32.md [deleted file]
website/messages/PLMC33.md [deleted file]
website/messages/PLMC34.md [deleted file]
website/messages/PLMC35.md [deleted file]
website/messages/PLMC36.md [deleted file]
website/messages/PLMC37.md [deleted file]
website/messages/PLMC38.md [deleted file]
website/messages/PLMC39.md [deleted file]
website/messages/PLMC4.md [deleted file]
website/messages/PLMC5.md [deleted file]
website/messages/PLMC6.md [deleted file]
website/messages/PLMC7.md [deleted file]
website/messages/PLMC8.md [deleted file]
website/messages/PLMC9.md [deleted file]
website/reference/basic/basic_agent_and_client.md [deleted file]
website/reference/basic/basic_cli_usage.md [deleted file]
website/reference/basic/configuration.md [deleted file]
website/reference/basic/daemon.md [deleted file]
website/reference/basic/gettingstarted.md [deleted file]
website/reference/basic/gettingstarted_debian.md [deleted file]
website/reference/basic/gettingstarted_redhat.md [deleted file]
website/reference/basic/messageflow.md [deleted file]
website/reference/basic/messageformat.md [deleted file]
website/reference/basic/subcollectives.md [deleted file]
website/reference/development/ec2_demo.md [deleted file]
website/reference/development/releasetasks.md [deleted file]
website/reference/index.md [deleted file]
website/reference/integration/activemq_clusters.md [deleted file]
website/reference/integration/activemq_security.md [deleted file]
website/reference/integration/activemq_ssl.md [deleted file]
website/reference/integration/chef.md [deleted file]
website/reference/integration/puppet.md [deleted file]
website/reference/plugins/aggregate.md [deleted file]
website/reference/plugins/application.md [deleted file]
website/reference/plugins/connector_activemq.md [deleted file]
website/reference/plugins/connector_rabbitmq.md [deleted file]
website/reference/plugins/connector_stomp.md [deleted file]
website/reference/plugins/data.md [deleted file]
website/reference/plugins/ddl.md [deleted file]
website/reference/plugins/discovery.md [deleted file]
website/reference/plugins/facts.md [deleted file]
website/reference/plugins/registration.md [deleted file]
website/reference/plugins/rpcutil.md [deleted file]
website/reference/plugins/security_aes.md [deleted file]
website/reference/plugins/security_ssl.md [deleted file]
website/reference/plugins/validator.md [deleted file]
website/reference/ui/filters.md [deleted file]
website/reference/ui/nodereports.md [deleted file]
website/releasenotes.md [deleted file]
website/screencasts.md [deleted file]
website/security.md [deleted file]
website/simplerpc/agents.md [deleted file]
website/simplerpc/auditing.md [deleted file]
website/simplerpc/authorization.md [deleted file]
website/simplerpc/clients.md [deleted file]
website/simplerpc/index.md [deleted file]
website/simplerpc/messageformat.md [deleted file]
website/terminology.md [deleted file]

diff --git a/README b/README
deleted file mode 100644 (file)
index 8db05de..0000000
--- a/README
+++ /dev/null
@@ -1,6 +0,0 @@
-The Marionette Collective
-=========================
-
-The Marionette Collective aka. mcollective is a framework to build server orchestration or parallel job execution systems.
-
-For full information, wikis, ticketing and downloads please see http://marionette-collective.org/
diff --git a/Rakefile b/Rakefile
deleted file mode 100644 (file)
index 4a6f8f9..0000000
--- a/Rakefile
+++ /dev/null
@@ -1,240 +0,0 @@
-# Rakefile to build a project using HUDSON
-
-begin
-  require 'rdoc/task'
-rescue LoadError
-  require 'rake/rdoctask'
-end
-
-require 'rake/packagetask'
-require 'rake/clean'
-require 'find'
-require 'rubygems/package_task'
-
-PROJ_DOC_TITLE = "The Marionette Collective"
-PROJ_VERSION = "2.3.1"
-PROJ_RELEASE = "2"
-PROJ_NAME = "mcollective"
-PROJ_RPM_NAMES = [PROJ_NAME]
-PROJ_FILES = ["#{PROJ_NAME}.init", "COPYING", "doc", "etc", "lib", "plugins", "ext", "bin"]
-PROJ_FILES.concat(Dir.glob("mc-*"))
-RDOC_EXCLUDES = ["mcollective/vendor", "spec", "ext", "website", "plugins"]
-
-ENV["RPM_VERSION"] ? CURRENT_VERSION = ENV["RPM_VERSION"] : CURRENT_VERSION = PROJ_VERSION
-ENV["BUILD_NUMBER"] ? CURRENT_RELEASE = ENV["BUILD_NUMBER"] : CURRENT_RELEASE = PROJ_RELEASE
-ENV["DEB_DISTRIBUTION"] ? PKG_DEB_DISTRIBUTION = ENV["DEB_DISTRIBUTION"] : PKG_DEB_DISTRIBUTION = "unstable"
-
-CLEAN.include(["build", "doc"])
-
-def announce(msg='')
-  STDERR.puts "================"
-  STDERR.puts msg
-  STDERR.puts "================"
-end
-
-def init
-  FileUtils.mkdir("build") unless File.exist?("build")
-end
-
-def safe_system *args
-  raise RuntimeError, "Failed: #{args.join(' ')}" unless system *args
-end
-
-spec = Gem::Specification.new do |s|
-  s.name = "mcollective-client"
-  s.version = PROJ_VERSION
-  s.author = "R.I.Pienaar"
-  s.email = "rip@puppetlabs.com"
-  s.homepage = "https://docs.puppetlabs.com/mcollective/"
-  s.summary = "Client libraries for The Marionette Collective"
-  s.description = "Client libraries for the mcollective Application Server"
-  s.files = FileList["{bin,lib}/**/*"].to_a
-  s.require_path = "lib"
-  s.test_files = FileList["spec/**/*"].to_a
-  s.has_rdoc = true
-  s.executables = "mco"
-  s.default_executable = "mco"
-  s.add_dependency "systemu"
-  s.add_dependency "json"
-  s.add_dependency "stomp"
-  s.add_dependency "i18n"
-
-  excluded_files = ["bin/mcollectived", "lib/mcollective/runner.rb", "lib/mcollective/vendor/json", "lib/mcollective/vendor/systemu", "lib/mcollective/vendor/i18n", "lib/mcollective/vendor/load"]
-
-  excluded_files.each do |file|
-    s.files.delete_if {|f| f.match(/^#{file}/)}
-  end
-end
-
-Gem::PackageTask.new(spec) do |pkg|
-  pkg.need_tar = false
-  pkg.need_zip = false
-  pkg.package_dir = "build"
-end
-
-desc "Build documentation, tar balls and rpms"
-task :default => [:clean, :doc, :package]
-
-# task for building docs
-rd = Rake::RDocTask.new(:doc) { |rdoc|
-  rdoc.rdoc_dir = 'doc'
-  rdoc.title    = "#{PROJ_DOC_TITLE} version #{CURRENT_VERSION}"
-  rdoc.options << '--line-numbers' << '--main' << 'MCollective'
-
-  RDOC_EXCLUDES.each do |ext|
-    rdoc.options << '--exclude' << ext
-  end
-}
-
-desc "Run spec tests"
-task :test do
-    sh "cd spec;rake"
-end
-
-desc "Create a tarball for this release"
-task :package => [:clean, :doc] do
-  announce "Creating #{PROJ_NAME}-#{CURRENT_VERSION}.tgz"
-
-  FileUtils.mkdir_p("build/#{PROJ_NAME}-#{CURRENT_VERSION}")
-  safe_system("cp -R #{PROJ_FILES.join(' ')} build/#{PROJ_NAME}-#{CURRENT_VERSION}")
-
-  announce "Setting MCollective.version to #{CURRENT_VERSION}"
-  safe_system("cd build/#{PROJ_NAME}-#{CURRENT_VERSION}/lib && sed -i -e s/@DEVELOPMENT_VERSION@/#{CURRENT_VERSION}/ mcollective.rb")
-
-  safe_system("cd build && tar --exclude .svn -cvzf #{PROJ_NAME}-#{CURRENT_VERSION}.tgz #{PROJ_NAME}-#{CURRENT_VERSION}")
-end
-
-desc "Creates the website as a tarball"
-task :website => [:clean] do
-  FileUtils.mkdir_p("build/marionette-collective.org/html")
-
-  Dir.chdir("website") do
-    safe_system("jekyll ../build/marionette-collective.org/html")
-  end
-
-  unless File.exist?("build/marionette-collective.org/html/index.html")
-    raise "Failed to build website"
-  end
-
-  Dir.chdir("build") do
-    safe_system("tar -cvzf marionette-collective-org-#{Time.now.to_i}.tgz marionette-collective.org")
-  end
-end
-
-desc "Creates a RPM"
-task :rpm => [:clean, :doc, :package] do
-  announce("Building RPM for #{PROJ_NAME}-#{CURRENT_VERSION}-#{CURRENT_RELEASE}")
-
-  sourcedir = `rpm --eval '%_sourcedir'`.chomp
-  specsdir = `rpm --eval '%_specdir'`.chomp
-  srpmsdir = `rpm --eval '%_srcrpmdir'`.chomp
-  rpmdir = `rpm --eval '%_rpmdir'`.chomp
-  rpmdist = ''
-
-  `which lsb_release`
-  if $?.success?
-    lsbdistrel = `lsb_release -r -s | cut -d . -f1`.chomp
-    lsbdistro = `lsb_release -i -s`.chomp
-    case lsbdistro
-    when 'CentOS'
-      rpmdist = ".el#{lsbdistrel}"
-    when 'Fedora'
-      rpmdist = ".fc#{lsbdistrel}"
-    end
-  end
-
-  `which rpmbuild-md5`
-  rpmcmd = $?.success? ? 'rpmbuild-md5' : 'rpmbuild'
-
-  safe_system %{cp build/#{PROJ_NAME}-#{CURRENT_VERSION}.tgz #{sourcedir}}
-  safe_system %{cat ext/redhat/#{PROJ_NAME}.spec|sed -e s/%{rpm_release}/#{CURRENT_RELEASE}/g | sed -e s/%{version}/#{CURRENT_VERSION}/g > #{specsdir}/#{PROJ_NAME}.spec}
-
-  if ENV['SIGNED'] == '1'
-    safe_system %{#{rpmcmd} --sign -D 'version #{CURRENT_VERSION}' -D 'rpm_release #{CURRENT_RELEASE}' -D 'dist #{rpmdist}' -D 'use_lsb 0' -ba #{specsdir}/#{PROJ_NAME}.spec}
-  else
-    safe_system %{#{rpmcmd} -D 'version #{CURRENT_VERSION}' -D 'rpm_release #{CURRENT_RELEASE}' -D 'dist #{rpmdist}' -D 'use_lsb 0' -ba #{specsdir}/#{PROJ_NAME}.spec}
-  end
-
-  safe_system %{cp #{srpmsdir}/#{PROJ_NAME}-#{CURRENT_VERSION}-#{CURRENT_RELEASE}*.src.rpm build/}
-
-  safe_system %{cp #{rpmdir}/*/#{PROJ_NAME}*-#{CURRENT_VERSION}-#{CURRENT_RELEASE}*.rpm build/}
-end
-
-desc "Create the .debs"
-task :deb => [:clean, :doc, :package] do
-  announce("Building debian packages")
-
-  FileUtils.mkdir_p("build/deb")
-  Dir.chdir("build/deb") do
-    safe_system %{tar -xzf ../#{PROJ_NAME}-#{CURRENT_VERSION}.tgz}
-    safe_system %{cp ../#{PROJ_NAME}-#{CURRENT_VERSION}.tgz #{PROJ_NAME}_#{CURRENT_VERSION}.orig.tar.gz}
-
-    Dir.chdir("#{PROJ_NAME}-#{CURRENT_VERSION}") do
-      safe_system %{cp -R ext/debian .}
-      safe_system %{cp -R ext/debian/mcollective.init .}
-      safe_system %{cp -R ext/Makefile .}
-
-      File.open("debian/changelog", "w") do |f|
-        f.puts("mcollective (#{CURRENT_VERSION}-#{CURRENT_RELEASE}) #{PKG_DEB_DISTRIBUTION}; urgency=low")
-        f.puts
-        f.puts("  * Automated release for #{CURRENT_VERSION}-#{CURRENT_RELEASE} by rake deb")
-        f.puts
-        f.puts("    See http://marionette-collective.org/releasenotes.html for full details")
-        f.puts
-        f.puts(" -- The Marionette Collective <mcollective-dev@googlegroups.com>  #{Time.new.strftime('%a, %d %b %Y %H:%M:%S %z')}")
-      end
-
-      if ENV['SIGNED'] == '1'
-        if ENV['SIGNWITH']
-          safe_system %{debuild -i -k#{ENV['SIGNWITH']}}
-        else
-          safe_system %{debuild -i}
-        end
-      else
-        safe_system %{debuild -i -us -uc}
-      end
-    end
-
-    safe_system %{cp *.deb *.dsc *.diff.gz *.orig.tar.gz *.changes ..}
-  end
-end
-
-desc "Update the website error code reference based on current local"
-task :update_msgweb do
-  mcollective_dir = File.join(File.dirname(__FILE__))
-
-  $:.insert(0, File.join(mcollective_dir, "lib"))
-
-  require 'mcollective'
-
-  messages = YAML.load_file(File.join(mcollective_dir, "lib", "mcollective", "locales", "en.yml"))
-
-  webdir = File.join(mcollective_dir, "website", "messages")
-
-  I18n.load_path = Dir[File.join(mcollective_dir, "lib", "mcollective", "locales", "*.yml")]
-  I18n.locale = :en
-
-  messages["en"].keys.each do |msg_code|
-    md_file = File.join(webdir, "#{msg_code}.md")
-
-    puts "....writing %s" % md_file
-
-    File.open(md_file, "w") do |md|
-      md.puts "---"
-      md.puts "layout: default"
-      md.puts "title: Message detail for %s" % msg_code
-      md.puts "toc: false"
-      md.puts "---"
-      md.puts
-      md.puts "Example Message"
-      md.puts "---------------"
-      md.puts
-      md.puts "    %s" % (MCollective::Util.t("%s.example" % msg_code, :raise => true) rescue MCollective::Util.t("%s.pattern" % msg_code))
-      md.puts
-      md.puts "Additional Information"
-      md.puts "----------------------"
-      md.puts
-      md.puts MCollective::Util.t("%s.expanded" % msg_code, :raise => true)
-    end
-  end
-end
index 4f0d1d8f056ccb7cc7667e751308ed3c1402a9d2..186387753351d01b509186550fd60febfb403d15 100755 (executable)
@@ -9,7 +9,11 @@ opts = GetoptLong.new(
   [ '--pidfile', '-p', GetoptLong::REQUIRED_ARGUMENT]
 )
 
-configfile = "/etc/mcollective/server.cfg"
+if MCollective::Util.windows?
+  configfile = File.join(MCollective::Util.windows_prefix, "etc", "server.cfg")
+else
+  configfile = "/etc/mcollective/server.cfg"
+end
 pid = ""
 
 opts.each do |opt, arg|
index 9eece1df5d950e149829243da4576d0450e40713..7b3c123f74f6c37b8afbfc0d8e7a8860219e4943 100644 (file)
@@ -1,5 +1,7 @@
-mcollective (2.3.1-0mira2) precise; urgency=low
+mcollective (2.3.2-1) unstable; urgency=low
 
-  * Initial deb package release
+  * Automated release for 2.3.2-1 by rake deb
 
- -- Mirantis Product <product@mirantis.com>  Mon, 19 Aug 2013 14:42:18 +0400
+    See http://marionette-collective.org/releasenotes.html for full details
+
+ -- The Marionette Collective <mcollective-dev@googlegroups.com>  Fri, 08 Nov 2013 12:58:34 +0000
index 7a0ada2954e0c31b5421f9d795db183e97b2a178..3d59c8bdf8586ea0d99390e90ab4290b2fc52103 100644 (file)
@@ -24,19 +24,19 @@ Package: mcollective-common
 Replaces: mcollective (<< 2.0.0-1)
 Breaks: mcollective (<< 2.0.0-1), mcollective-client (<< 2.0.0-1)
 Architecture: all
-Depends: ruby (>= 1.8.1) , rubygems
+Depends: ruby (>= 1.8.1) , rubygems, ruby-stomp | libstomp-ruby
 Description: build server orchestration or parallel job execution systems
  The Marionette Collective aka. mcollective is a framework 
  to build server orchestration or parallel job execution systems.
  .
  Common files for mcollective packages.
 
-#Package: mcollective-doc
-#Architecture: all
-#Section: doc
-#Description: Documentation for mcollective
-# The Marionette Collective aka. mcollective is a framework 
-# to build server orchestration or parallel job execution systems.
-# .
-# Documentation package.
+Package: mcollective-doc
+Architecture: all
+Section: doc
+Description: Documentation for mcollective
+ The Marionette Collective aka. mcollective is a framework 
+ to build server orchestration or parallel job execution systems.
+ .
+ Documentation package.
 
diff --git a/debian/mcollective-common.dirs b/debian/mcollective-common.dirs
new file mode 100644 (file)
index 0000000..2b54b99
--- /dev/null
@@ -0,0 +1 @@
+usr/lib/ruby/vendor_ruby
index 058fa884bbd42208d8b5934459ad69c77aaba22f..5919349ab3825e725f23e9bdd33952ac7d5b71fb 100644 (file)
@@ -1,4 +1,4 @@
-usr/lib/ruby/1.8/* usr/lib/ruby/1.8/
+usr/lib/ruby/vendor_ruby/* usr/lib/ruby/vendor_ruby/
 etc/mcollective/*.erb etc/mcollective
 usr/share/mcollective/plugins/mcollective/agent usr/share/mcollective/plugins/mcollective
 usr/share/mcollective/plugins/mcollective/audit usr/share/mcollective/plugins/mcollective
old mode 100755 (executable)
new mode 100644 (file)
index 6b02d0b..f599f4a
@@ -24,11 +24,11 @@ uid=`id -u`
 
 
 # PID directory
-pidfile="/var/run/mcollective.pid"
+pidfile="/var/run/mcollectived.pid"
 
 name="mcollective"
 mcollectived=/usr/sbin/mcollectived
-daemonopts="--config=/etc/mcollective/server.cfg"
+daemonopts="--pid=${pidfile}  --config=/etc/mcollective/server.cfg"
 
 
 # Source function library.
@@ -41,30 +41,22 @@ then
     exit 5
 fi
 
+# create pid file if it does not exist
+[ ! -f ${pidfile} ] && { touch ${pidfile} ; }
+
 # See how we were called.
 case "$1" in
     start)
         echo "Starting daemon: " $name
         # start the program
-       if [ -f $pidfile ]; then
-               if [ -f $(cat /proc/$(cat $pidfile)/exe > /dev/null) ] ; then
-                       echo MCollective appears to be running
-                       exit 1
-               else
-                       /sbin/start-stop-daemon --start -b --quiet --oknodo -m --pidfile $pidfile --exec $mcollectived -- $daemonopts
-               [ $? = 0 ] && { exit 0 ; } || { exit 1 ; }
-               fi
-       else
-               /sbin/start-stop-daemon --start -b --quiet --oknodo -m --pidfile $pidfile --exec $mcollectived -- $daemonopts
-       fi
+        start-stop-daemon -S -p ${pidfile} --oknodo -q -a ${mcollectived} -- ${daemonopts}
+        [ $? = 0 ] && { exit 0 ; } || { exit 1 ; }
         log_success_msg "mcollective started"
+        touch $lock
         ;;
     stop)
         echo "Stopping daemon: " $name
-        /sbin/start-stop-daemon --stop -q --pidfile $pidfile
-       if [ -f $pidfile ]; then
-               rm -f $pidfile
-       fi
+        start-stop-daemon -K -R 5 -s "TERM" --oknodo -q -p ${pidfile}
         [ $? = 0 ] && { exit 0 ; } || { exit 1 ; }
         log_success_msg "mcollective stopped"
         ;;
@@ -75,6 +67,14 @@ case "$1" in
         $0 start
         [ $? = 0 ] && { echo "mcollective restarted" ; exit 0 ; }
         ;;
+    condrestart)
+        if [ -f $lock ]; then
+            $0 stop
+            # avoid race
+            sleep 2
+            $0 start
+        fi
+        ;;
     status)
         status_of_proc -p ${pidfile} ${mcollectived} ${name} && exit 0 || exit $?
         ;;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 08ee958..afdb45e
@@ -23,8 +23,8 @@ diff -urNad mcollective-0.4.1~/Makefile mcollective-0.4.1/Makefile
 +      cp mcollectived.rb $(DESTDIR)/usr/sbin/mcollectived
 +
 +install-lib:
-+      install -d $(DESTDIR)/usr/lib/ruby/1.8/
-+      cp -a lib/* $(DESTDIR)/usr/lib/ruby/1.8/
++      install -d $(DESTDIR)/usr/lib/ruby/vendor_ruby/
++      cp -a lib/* $(DESTDIR)/usr/lib/ruby/vendor_ruby/
 +
 +install-conf:
 +      install -d $(DESTDIR)/etc/mcollective/
@@ -42,7 +42,7 @@ diff -urNad mcollective-0.4.1~/Makefile mcollective-0.4.1/Makefile
 +
 +uninstall:
 +      rm -f $(DESTDIR)/usr/sbin/mcollectived
-+      rm -rf $(DESTDIR)/usr/lib/ruby/1.8/mcollective*
++      rm -rf $(DESTDIR)/usr/lib/ruby/vendor_ruby/mcollective*
 +      rm -rf $(DESTDIR)/usr/share/mcollective
 +      rm -rf $(DESTDIR)/etc/mcollective
 +
old mode 100755 (executable)
new mode 100644 (file)
index 2551380d51c7fb4e16acabf394710d3765aa9f74..966ff75c2f3f1624c2b2095dd2078a7f0654e2fd 100755 (executable)
@@ -6,7 +6,7 @@ DEB_MAKE_INSTALL_TARGET  := install DESTDIR=$(CURDIR)/debian/tmp
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/rules/dpatch.mk
 include /usr/share/cdbs/1/class/makefile.mk
-DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) make -f ext/Makefile -C $(DEB_BUILDDIR)
+DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) make -f ext/Makefile.debian -C $(DEB_BUILDDIR)
 
 install/mcollective::
        mv $(CURDIR)/debian/tmp/etc/mcollective/server.cfg.dist $(CURDIR)/debian/tmp/etc/mcollective/server.cfg
diff --git a/doc/.do-not-remove b/doc/.do-not-remove
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/doc/classes/Array.html b/doc/classes/Array.html
new file mode 100644 (file)
index 0000000..4cdc19f
--- /dev/null
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: Array</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">Array</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../files/lib/mcollective/monkey_patches_rb.html">
+                lib/mcollective/monkey_patches.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+a method # that walks an array in groups, pass a block to call the block on
+each sub array
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000013">in_groups_of</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000013" class="method-detail">
+        <a name="M000013"></a>
+
+        <div class="method-heading">
+          <a href="#M000013" class="method-signature">
+          <span class="method-name">in_groups_of</span><span class="method-args">(chunk_size, padded_with=nil) {|a| ...}</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000013-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/monkey_patches.rb, line 29</span>
+29:   <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">&amp;</span><span class="ruby-identifier">block</span>)
+30:     <span class="ruby-identifier">arr</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">clone</span>
+31: 
+32:     <span class="ruby-comment cmt"># how many to add</span>
+33:     <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>)
+34: 
+35:     <span class="ruby-comment cmt"># pad at the end</span>
+36:     <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>
+37: 
+38:     <span class="ruby-comment cmt"># how many chunks we'll make</span>
+39:     <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>
+40: 
+41:     <span class="ruby-comment cmt"># make that many arrays</span>
+42:     <span class="ruby-identifier">result</span> = []
+43:     <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">&lt;&lt;</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>]}
+44: 
+45:     <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
+46:       <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>
+47:         <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">arity</span>
+48:           <span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span>
+49:             <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">a</span>)
+50:           <span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span>
+51:             <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>))
+52:           <span class="ruby-keyword kw">else</span>
+53:             <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Expected 1 or 2 arguments, got #{block.arity}&quot;</span>
+54:         <span class="ruby-keyword kw">end</span>
+55:       <span class="ruby-keyword kw">end</span>
+56:     <span class="ruby-keyword kw">else</span>
+57:       <span class="ruby-identifier">result</span>
+58:     <span class="ruby-keyword kw">end</span>
+59:   <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/Dir.html b/doc/classes/Dir.html
new file mode 100644 (file)
index 0000000..eed0ecf
--- /dev/null
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: Dir</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">Dir</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../files/lib/mcollective/monkey_patches_rb.html">
+                lib/mcollective/monkey_patches.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000011">mktmpdir</a>&nbsp;&nbsp;
+      <a href="#M000012">tmpdir</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000011" class="method-detail">
+        <a name="M000011"></a>
+
+        <div class="method-heading">
+          <a href="#M000011" class="method-signature">
+          <span class="method-name">mktmpdir</span><span class="method-args">(prefix_suffix=nil, tmpdir=nil) {|path| ...}</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000011-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/monkey_patches.rb, line 72</span>
+ 72:   <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>)
+ 73:     <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">prefix_suffix</span>
+ 74:     <span class="ruby-keyword kw">when</span> <span class="ruby-keyword kw">nil</span>
+ 75:       <span class="ruby-identifier">prefix</span> = <span class="ruby-value str">&quot;d&quot;</span>
+ 76:       <span class="ruby-identifier">suffix</span> = <span class="ruby-value str">&quot;&quot;</span>
+ 77:     <span class="ruby-keyword kw">when</span> <span class="ruby-constant">String</span>
+ 78:       <span class="ruby-identifier">prefix</span> = <span class="ruby-identifier">prefix_suffix</span>
+ 79:       <span class="ruby-identifier">suffix</span> = <span class="ruby-value str">&quot;&quot;</span>
+ 80:     <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Array</span>
+ 81:       <span class="ruby-identifier">prefix</span> = <span class="ruby-identifier">prefix_suffix</span>[<span class="ruby-value">0</span>]
+ 82:       <span class="ruby-identifier">suffix</span> = <span class="ruby-identifier">prefix_suffix</span>[<span class="ruby-value">1</span>]
+ 83:     <span class="ruby-keyword kw">else</span>
+ 84:       <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;unexpected prefix_suffix: #{prefix_suffix.inspect}&quot;</span>
+ 85:     <span class="ruby-keyword kw">end</span>
+ 86:     <span class="ruby-identifier">tmpdir</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">tmpdir</span>
+ 87:     <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">&quot;%Y%m%d&quot;</span>)
+ 88:     <span class="ruby-identifier">n</span> = <span class="ruby-keyword kw">nil</span>
+ 89:     <span class="ruby-keyword kw">begin</span>
+ 90:       <span class="ruby-identifier">path</span> = <span class="ruby-node">&quot;#{tmpdir}/#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}&quot;</span>
+ 91:       <span class="ruby-identifier">path</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;-#{n}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">n</span>
+ 92:       <span class="ruby-identifier">path</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">suffix</span>
+ 93:       <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">mkdir</span>(<span class="ruby-identifier">path</span>, <span class="ruby-value">0700</span>)
+ 94:     <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EEXIST</span>
+ 95:       <span class="ruby-identifier">n</span> <span class="ruby-operator">||=</span> <span class="ruby-value">0</span>
+ 96:       <span class="ruby-identifier">n</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ 97:       <span class="ruby-keyword kw">retry</span>
+ 98:     <span class="ruby-keyword kw">end</span>
+ 99: 
+100:     <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
+101:       <span class="ruby-keyword kw">begin</span>
+102:         <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">path</span>
+103:       <span class="ruby-keyword kw">ensure</span>
+104:         <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">remove_entry_secure</span> <span class="ruby-identifier">path</span>
+105:       <span class="ruby-keyword kw">end</span>
+106:     <span class="ruby-keyword kw">else</span>
+107:       <span class="ruby-identifier">path</span>
+108:     <span class="ruby-keyword kw">end</span>
+109:   <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000012" class="method-detail">
+        <a name="M000012"></a>
+
+        <div class="method-heading">
+          <a href="#M000012" class="method-signature">
+          <span class="method-name">tmpdir</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000012-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/monkey_patches.rb, line 111</span>
+111:   <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">tmpdir</span>
+112:     <span class="ruby-identifier">tmp</span> = <span class="ruby-value str">'.'</span>
+113:     <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>]
+114:       <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>
+115:         <span class="ruby-identifier">tmp</span> = <span class="ruby-identifier">dir</span>
+116:         <span class="ruby-keyword kw">break</span>
+117:       <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
+118:     <span class="ruby-keyword kw">end</span>
+119:     <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">tmp</span>)
+120:   <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective.html b/doc/classes/MCollective.html
new file mode 100644 (file)
index 0000000..72b7df5
--- /dev/null
@@ -0,0 +1,504 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Module: MCollective</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Module</strong></td>
+          <td class="class-name-in-header">MCollective</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../files/lib/mcollective_rb.html">
+                lib/mcollective.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/application_rb.html">
+                lib/mcollective/application.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/optionparser_rb.html">
+                lib/mcollective/optionparser.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/pluginpackager_rb.html">
+                lib/mcollective/pluginpackager.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/matcher/scanner_rb.html">
+                lib/mcollective/matcher/scanner.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/matcher/parser_rb.html">
+                lib/mcollective/matcher/parser.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/message_rb.html">
+                lib/mcollective/message.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/matcher_rb.html">
+                lib/mcollective/matcher.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/runner_rb.html">
+                lib/mcollective/runner.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/pluginmanager_rb.html">
+                lib/mcollective/pluginmanager.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/security_rb.html">
+                lib/mcollective/security.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/connector_rb.html">
+                lib/mcollective/connector.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/pluginpackager/standard_definition_rb.html">
+                lib/mcollective/pluginpackager/standard_definition.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/pluginpackager/agent_definition_rb.html">
+                lib/mcollective/pluginpackager/agent_definition.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/applications_rb.html">
+                lib/mcollective/applications.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/logger_rb.html">
+                lib/mcollective/logger.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/agents_rb.html">
+                lib/mcollective/agents.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/config_rb.html">
+                lib/mcollective/config.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/log_rb.html">
+                lib/mcollective/log.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/agent_rb.html">
+                lib/mcollective/agent.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/aggregate_rb.html">
+                lib/mcollective/aggregate.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/discovery_rb.html">
+                lib/mcollective/discovery.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/registration/base_rb.html">
+                lib/mcollective/registration/base.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/registration_rb.html">
+                lib/mcollective/registration.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/logger/console_logger_rb.html">
+                lib/mcollective/logger/console_logger.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/logger/base_rb.html">
+                lib/mcollective/logger/base.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/logger/syslog_logger_rb.html">
+                lib/mcollective/logger/syslog_logger.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/logger/file_logger_rb.html">
+                lib/mcollective/logger/file_logger.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/data/base_rb.html">
+                lib/mcollective/data/base.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/data/result_rb.html">
+                lib/mcollective/data/result.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/ssl_rb.html">
+                lib/mcollective/ssl.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/runnerstats_rb.html">
+                lib/mcollective/runnerstats.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/translatable_rb.html">
+                lib/mcollective/translatable.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/generators/base_rb.html">
+                lib/mcollective/generators/base.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/generators/data_generator_rb.html">
+                lib/mcollective/generators/data_generator.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/generators/agent_generator_rb.html">
+                lib/mcollective/generators/agent_generator.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/aggregate/base_rb.html">
+                lib/mcollective/aggregate/base.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/aggregate/result/base_rb.html">
+                lib/mcollective/aggregate/result/base.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/aggregate/result/collection_result_rb.html">
+                lib/mcollective/aggregate/result/collection_result.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/aggregate/result/numeric_result_rb.html">
+                lib/mcollective/aggregate/result/numeric_result.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/aggregate/result_rb.html">
+                lib/mcollective/aggregate/result.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/facts/base_rb.html">
+                lib/mcollective/facts/base.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/ddl/discoveryddl_rb.html">
+                lib/mcollective/ddl/discoveryddl.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/ddl/agentddl_rb.html">
+                lib/mcollective/ddl/agentddl.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/ddl/validatorddl_rb.html">
+                lib/mcollective/ddl/validatorddl.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/ddl/base_rb.html">
+                lib/mcollective/ddl/base.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/ddl/dataddl_rb.html">
+                lib/mcollective/ddl/dataddl.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/util_rb.html">
+                lib/mcollective/util.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/connector/base_rb.html">
+                lib/mcollective/connector/base.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/rpc_rb.html">
+                lib/mcollective/rpc.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/validator_rb.html">
+                lib/mcollective/validator.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/cache_rb.html">
+                lib/mcollective/cache.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/unix_daemon_rb.html">
+                lib/mcollective/unix_daemon.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/windows_daemon_rb.html">
+                lib/mcollective/windows_daemon.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/security/base_rb.html">
+                lib/mcollective/security/base.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/shell_rb.html">
+                lib/mcollective/shell.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/ddl_rb.html">
+                lib/mcollective/ddl.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/rpc/actionrunner_rb.html">
+                lib/mcollective/rpc/actionrunner.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/rpc/reply_rb.html">
+                lib/mcollective/rpc/reply.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/rpc/progress_rb.html">
+                lib/mcollective/rpc/progress.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/rpc/agent_rb.html">
+                lib/mcollective/rpc/agent.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/rpc/request_rb.html">
+                lib/mcollective/rpc/request.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/rpc/audit_rb.html">
+                lib/mcollective/rpc/audit.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/rpc/stats_rb.html">
+                lib/mcollective/rpc/stats.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/rpc/result_rb.html">
+                lib/mcollective/rpc/result.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/rpc/client_rb.html">
+                lib/mcollective/rpc/client.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/rpc/helpers_rb.html">
+                lib/mcollective/rpc/helpers.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/facts_rb.html">
+                lib/mcollective/facts.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/data_rb.html">
+                lib/mcollective/data.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/client_rb.html">
+                lib/mcollective/client.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/exception_rb.html">
+                lib/mcollective/exception.rb
+                </a>
+        <br />
+                <a href="../files/lib/mcollective/generators_rb.html">
+                lib/mcollective/generators.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <h2>The Marionette Collective</h2>
+<p>
+Framework to build and run Systems Administration agents running on a
+publish/subscribe middleware system. The system allows you to treat your
+network as the only true source of the state of your platform via discovery
+agents and allow you to run agents matching discovery criteria.
+</p>
+<p>
+For an overview of the idea behind this and what it enables please see:
+</p>
+<pre>
+  http://www.devco.net/archives/2009/10/18/middleware_for_systems_administration.php
+</pre>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000015">version</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+    <div id="class-list">
+      <h3 class="section-bar">Classes and Modules</h3>
+
+      Module <a href="MCollective/Agent.html" class="link">MCollective::Agent</a><br />
+Module <a href="MCollective/Cache.html" class="link">MCollective::Cache</a><br />
+Module <a href="MCollective/Connector.html" class="link">MCollective::Connector</a><br />
+Module <a href="MCollective/DDL.html" class="link">MCollective::DDL</a><br />
+Module <a href="MCollective/Data.html" class="link">MCollective::Data</a><br />
+Module <a href="MCollective/Facts.html" class="link">MCollective::Facts</a><br />
+Module <a href="MCollective/Generators.html" class="link">MCollective::Generators</a><br />
+Module <a href="MCollective/Logger.html" class="link">MCollective::Logger</a><br />
+Module <a href="MCollective/Matcher.html" class="link">MCollective::Matcher</a><br />
+Module <a href="MCollective/PluginManager.html" class="link">MCollective::PluginManager</a><br />
+Module <a href="MCollective/PluginPackager.html" class="link">MCollective::PluginPackager</a><br />
+Module <a href="MCollective/RPC.html" class="link">MCollective::RPC</a><br />
+Module <a href="MCollective/Registration.html" class="link">MCollective::Registration</a><br />
+Module <a href="MCollective/Security.html" class="link">MCollective::Security</a><br />
+Module <a href="MCollective/Translatable.html" class="link">MCollective::Translatable</a><br />
+Module <a href="MCollective/Util.html" class="link">MCollective::Util</a><br />
+Module <a href="MCollective/Validator.html" class="link">MCollective::Validator</a><br />
+Class <a href="MCollective/Agents.html" class="link">MCollective::Agents</a><br />
+Class <a href="MCollective/Aggregate.html" class="link">MCollective::Aggregate</a><br />
+Class <a href="MCollective/Application.html" class="link">MCollective::Application</a><br />
+Class <a href="MCollective/Applications.html" class="link">MCollective::Applications</a><br />
+Class <a href="MCollective/Client.html" class="link">MCollective::Client</a><br />
+Class <a href="MCollective/CodedError.html" class="link">MCollective::CodedError</a><br />
+Class <a href="MCollective/Config.html" class="link">MCollective::Config</a><br />
+Class <a href="MCollective/DDLValidationError.html" class="link">MCollective::DDLValidationError</a><br />
+Class <a href="MCollective/Discovery.html" class="link">MCollective::Discovery</a><br />
+Class <a href="MCollective/InvalidRPCData.html" class="link">MCollective::InvalidRPCData</a><br />
+Class <a href="MCollective/Log.html" class="link">MCollective::Log</a><br />
+Class <a href="MCollective/Message.html" class="link">MCollective::Message</a><br />
+Class <a href="MCollective/MissingRPCData.html" class="link">MCollective::MissingRPCData</a><br />
+Class <a href="MCollective/MsgDoesNotMatchRequestID.html" class="link">MCollective::MsgDoesNotMatchRequestID</a><br />
+Class <a href="MCollective/MsgTTLExpired.html" class="link">MCollective::MsgTTLExpired</a><br />
+Class <a href="MCollective/NotTargettedAtUs.html" class="link">MCollective::NotTargettedAtUs</a><br />
+Class <a href="MCollective/Optionparser.html" class="link">MCollective::Optionparser</a><br />
+Class <a href="MCollective/RPCAborted.html" class="link">MCollective::RPCAborted</a><br />
+Class <a href="MCollective/RPCError.html" class="link">MCollective::RPCError</a><br />
+Class <a href="MCollective/Runner.html" class="link">MCollective::Runner</a><br />
+Class <a href="MCollective/RunnerStats.html" class="link">MCollective::RunnerStats</a><br />
+Class <a href="MCollective/SSL.html" class="link">MCollective::SSL</a><br />
+Class <a href="MCollective/SecurityValidationFailed.html" class="link">MCollective::SecurityValidationFailed</a><br />
+Class <a href="MCollective/Shell.html" class="link">MCollective::Shell</a><br />
+Class <a href="MCollective/UnixDaemon.html" class="link">MCollective::UnixDaemon</a><br />
+Class <a href="MCollective/UnknownRPCAction.html" class="link">MCollective::UnknownRPCAction</a><br />
+Class <a href="MCollective/UnknownRPCError.html" class="link">MCollective::UnknownRPCError</a><br />
+Class <a href="MCollective/ValidatorError.html" class="link">MCollective::ValidatorError</a><br />
+Class <a href="MCollective/WindowsDaemon.html" class="link">MCollective::WindowsDaemon</a><br />
+
+    </div>
+
+    <div id="constants-list">
+      <h3 class="section-bar">Constants</h3>
+
+      <div class="name-list">
+        <table summary="Constants">
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">VERSION</td>
+          <td>=</td>
+          <td class="context-item-value">&quot;@DEVELOPMENT_VERSION@&quot;</td>
+        </tr>
+        </table>
+      </div>
+    </div>
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000015" class="method-detail">
+        <a name="M000015"></a>
+
+        <div class="method-heading">
+          <a href="#M000015" class="method-signature">
+          <span class="method-name">version</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000015-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective.rb, line 65</span>
+65:   <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">version</span>
+66:     <span class="ruby-constant">VERSION</span>
+67:   <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Agent.html b/doc/classes/MCollective/Agent.html
new file mode 100644 (file)
index 0000000..8e794cd
--- /dev/null
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Module: MCollective::Agent</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Module</strong></td>
+          <td class="class-name-in-header">MCollective::Agent</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/agent_rb.html">
+                lib/mcollective/agent.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Agents.html b/doc/classes/MCollective/Agents.html
new file mode 100644 (file)
index 0000000..82db7b4
--- /dev/null
@@ -0,0 +1,493 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Agents</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Agents</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/agents_rb.html">
+                lib/mcollective/agents.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+A collection of agents, loads them, reloads them and dispatches messages to
+them. It uses the <a href="PluginManager.html">PluginManager</a> to store,
+load and manage instances of plugins.
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000487">activate_agent?</a>&nbsp;&nbsp;
+      <a href="#M000491">agentlist</a>&nbsp;&nbsp;
+      <a href="#M000486">class_for_agent</a>&nbsp;&nbsp;
+      <a href="#M000483">clear!</a>&nbsp;&nbsp;
+      <a href="#M000490">dispatch</a>&nbsp;&nbsp;
+      <a href="#M000488">findagentfile</a>&nbsp;&nbsp;
+      <a href="#M000489">include?</a>&nbsp;&nbsp;
+      <a href="#M000485">loadagent</a>&nbsp;&nbsp;
+      <a href="#M000484">loadagents</a>&nbsp;&nbsp;
+      <a href="#M000482">new</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000491" class="method-detail">
+        <a name="M000491"></a>
+
+        <div class="method-heading">
+          <a href="#M000491" class="method-signature">
+          <span class="method-name">agentlist</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Get a list of agents that we have
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000491-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000491-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 145</span>
+145:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">agentlist</span>
+146:       <span class="ruby-ivar">@@agents</span>.<span class="ruby-identifier">keys</span>
+147:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000482" class="method-detail">
+        <a name="M000482"></a>
+
+        <div class="method-heading">
+          <a href="#M000482" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(agents = {})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000482-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000482-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 5</span>
+ 5:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">agents</span> = {})
+ 6:       <span class="ruby-ivar">@config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>
+ 7:       <span class="ruby-identifier">raise</span> (<span class="ruby-value str">&quot;Configuration has not been loaded, can't load agents&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">configured</span>
+ 8: 
+ 9:       <span class="ruby-ivar">@@agents</span> = <span class="ruby-identifier">agents</span>
+10: 
+11:       <span class="ruby-identifier">loadagents</span>
+12:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000487" class="method-detail">
+        <a name="M000487"></a>
+
+        <div class="method-heading">
+          <a href="#M000487" class="method-signature">
+          <span class="method-name">activate_agent?</span><span class="method-args">(agent)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Checks if a plugin should be activated by calling activate? on it if it
+responds to that method else always activate it
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000487-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000487-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 85</span>
+85:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">activate_agent?</span>(<span class="ruby-identifier">agent</span>)
+86:       <span class="ruby-identifier">klass</span> = <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-value str">&quot;MCollective&quot;</span>).<span class="ruby-identifier">const_get</span>(<span class="ruby-value str">&quot;Agent&quot;</span>).<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">agent</span>.<span class="ruby-identifier">capitalize</span>)
+87: 
+88:       <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">&quot;activate?&quot;</span>)
+89:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">activate?</span>
+90:       <span class="ruby-keyword kw">else</span>
+91:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;#{klass} does not have an activate? method, activating as default&quot;</span>)
+92:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
+93:       <span class="ruby-keyword kw">end</span>
+94:     <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+95:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">warn</span>(<span class="ruby-node">&quot;Agent activation check for #{agent} failed: #{e.class}: #{e}&quot;</span>)
+96:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
+97:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000486" class="method-detail">
+        <a name="M000486"></a>
+
+        <div class="method-heading">
+          <a href="#M000486" class="method-signature">
+          <span class="method-name">class_for_agent</span><span class="method-args">(agent)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Builds a class name string given a <a href="Agent.html">Agent</a> name
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000486-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000486-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 78</span>
+78:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">class_for_agent</span>(<span class="ruby-identifier">agent</span>)
+79:       <span class="ruby-node">&quot;MCollective::Agent::#{agent.capitalize}&quot;</span>
+80:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000483" class="method-detail">
+        <a name="M000483"></a>
+
+        <div class="method-heading">
+          <a href="#M000483" class="method-signature">
+          <span class="method-name">clear!</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Deletes all agents
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000483-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000483-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 15</span>
+15:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear!</span>
+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>
+17:         <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">delete</span> <span class="ruby-node">&quot;#{agent}_agent&quot;</span>
+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>))
+19:       <span class="ruby-keyword kw">end</span>
+20: 
+21:       <span class="ruby-ivar">@@agents</span> = {}
+22:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000490" class="method-detail">
+        <a name="M000490"></a>
+
+        <div class="method-heading">
+          <a href="#M000490" class="method-signature">
+          <span class="method-name">dispatch</span><span class="method-args">(request, connection) {|replies| ...}</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Dispatches a message to an agent, accepts a block that will get run if
+there are any replies to process from the agent
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000490-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000490-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 118</span>
+118:     <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>)
+119:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Dispatching a message to agent #{request.agent}&quot;</span>)
+120: 
+121:       <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
+122:         <span class="ruby-keyword kw">begin</span>
+123:           <span class="ruby-identifier">agent</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-node">&quot;#{request.agent}_agent&quot;</span>]
+124: 
+125:           <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>
+126:             <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>)
+127: 
+128:             <span class="ruby-comment cmt"># Agents can decide if they wish to reply or not,</span>
+129:             <span class="ruby-comment cmt"># returning nil will mean nothing goes back to the</span>
+130:             <span class="ruby-comment cmt"># requestor</span>
+131:             <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>
+132:               <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">replies</span>)
+133:             <span class="ruby-keyword kw">end</span>
+134:           <span class="ruby-keyword kw">end</span>
+135:         <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">&gt;</span> <span class="ruby-identifier">e</span>
+136:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">warn</span>(<span class="ruby-node">&quot;Timeout while handling message for #{request.agent}&quot;</span>)
+137:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+138:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">&quot;Execution of #{request.agent} failed: #{e}&quot;</span>)
+139:           <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">&quot;\n\t\t&quot;</span>))
+140:         <span class="ruby-keyword kw">end</span>
+141:       <span class="ruby-keyword kw">end</span>
+142:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000488" class="method-detail">
+        <a name="M000488"></a>
+
+        <div class="method-heading">
+          <a href="#M000488" class="method-signature">
+          <span class="method-name">findagentfile</span><span class="method-args">(agentname)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+searches the libdirs for agents
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000488-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000488-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 100</span>
+100:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">findagentfile</span>(<span class="ruby-identifier">agentname</span>)
+101:       <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>
+102:         <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">&quot;mcollective&quot;</span>, <span class="ruby-value str">&quot;agent&quot;</span>, <span class="ruby-node">&quot;#{agentname}.rb&quot;</span>])
+103:         <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>)
+104:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Found #{agentname} at #{agentfile}&quot;</span>)
+105:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">agentfile</span>
+106:         <span class="ruby-keyword kw">end</span>
+107:       <span class="ruby-keyword kw">end</span>
+108:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
+109:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000489" class="method-detail">
+        <a name="M000489"></a>
+
+        <div class="method-heading">
+          <a href="#M000489" class="method-signature">
+          <span class="method-name">include?</span><span class="method-args">(agentname)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Determines if we have an agent with a certain name
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000489-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000489-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 112</span>
+112:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">include?</span>(<span class="ruby-identifier">agentname</span>)
+113:       <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-node">&quot;#{agentname}_agent&quot;</span>)
+114:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000485" class="method-detail">
+        <a name="M000485"></a>
+
+        <div class="method-heading">
+          <a href="#M000485" class="method-signature">
+          <span class="method-name">loadagent</span><span class="method-args">(agentname)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Loads a specified agent from disk if available
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000485-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000485-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 42</span>
+42:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">loadagent</span>(<span class="ruby-identifier">agentname</span>)
+43:       <span class="ruby-identifier">agentfile</span> = <span class="ruby-identifier">findagentfile</span>(<span class="ruby-identifier">agentname</span>)
+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>
+45:       <span class="ruby-identifier">classname</span> = <span class="ruby-identifier">class_for_agent</span>(<span class="ruby-identifier">agentname</span>)
+46: 
+47:       <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-node">&quot;#{agentname}_agent&quot;</span>)
+48: 
+49:       <span class="ruby-keyword kw">begin</span>
+50:         <span class="ruby-identifier">single_instance</span> = [<span class="ruby-value str">&quot;registration&quot;</span>, <span class="ruby-value str">&quot;discovery&quot;</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">agentname</span>)
+51: 
+52:         <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">loadclass</span>(<span class="ruby-identifier">classname</span>)
+53: 
+54:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">activate_agent?</span>(<span class="ruby-identifier">agentname</span>)
+55:           <span class="ruby-constant">PluginManager</span> <span class="ruby-operator">&lt;&lt;</span> {<span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;#{agentname}_agent&quot;</span>, <span class="ruby-identifier">:class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">classname</span>, <span class="ruby-identifier">:single_instance</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">single_instance</span>}
+56: 
+57:           <span class="ruby-comment cmt"># Attempt to instantiate the agent once so any validation and hooks get run</span>
+58:           <span class="ruby-comment cmt"># this does a basic sanity check on the agent as a whole, if this fails it</span>
+59:           <span class="ruby-comment cmt"># will be removed from the plugin list</span>
+60:           <span class="ruby-constant">PluginManager</span>[<span class="ruby-node">&quot;#{agentname}_agent&quot;</span>]
+61: 
+62:           <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>)
+63: 
+64:           <span class="ruby-ivar">@@agents</span>[<span class="ruby-identifier">agentname</span>] = {<span class="ruby-identifier">:file</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">agentfile</span>}
+65:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
+66:         <span class="ruby-keyword kw">else</span>
+67:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Not activating agent #{agentname} due to agent policy in activate? method&quot;</span>)
+68:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
+69:         <span class="ruby-keyword kw">end</span>
+70:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+71:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">&quot;Loading agent #{agentname} failed: #{e}&quot;</span>)
+72:         <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-node">&quot;#{agentname}_agent&quot;</span>)
+73:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
+74:       <span class="ruby-keyword kw">end</span>
+75:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000484" class="method-detail">
+        <a name="M000484"></a>
+
+        <div class="method-heading">
+          <a href="#M000484" class="method-signature">
+          <span class="method-name">loadagents</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Loads all agents from disk
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000484-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000484-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/agents.rb, line 25</span>
+25:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">loadagents</span>
+26:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Reloading all agents from disk&quot;</span>)
+27: 
+28:       <span class="ruby-identifier">clear!</span>
+29: 
+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>
+31:         <span class="ruby-identifier">agentdir</span> = <span class="ruby-node">&quot;#{libdir}/mcollective/agent&quot;</span>
+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>)
+33: 
+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>
+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">&quot;.rb&quot;</span>)
+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">&quot;#{agentname}_agent&quot;</span>)
+37:         <span class="ruby-keyword kw">end</span>
+38:       <span class="ruby-keyword kw">end</span>
+39:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Aggregate.html b/doc/classes/MCollective/Aggregate.html
new file mode 100644 (file)
index 0000000..ca31632
--- /dev/null
@@ -0,0 +1,390 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Aggregate</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Aggregate</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/aggregate_rb.html">
+                lib/mcollective/aggregate.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/aggregate/base_rb.html">
+                lib/mcollective/aggregate/base.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/aggregate/result/base_rb.html">
+                lib/mcollective/aggregate/result/base.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/aggregate/result/collection_result_rb.html">
+                lib/mcollective/aggregate/result/collection_result.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/aggregate/result/numeric_result_rb.html">
+                lib/mcollective/aggregate/result/numeric_result.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/aggregate/result_rb.html">
+                lib/mcollective/aggregate/result.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000412">call_functions</a>&nbsp;&nbsp;
+      <a href="#M000411">contains_output?</a>&nbsp;&nbsp;
+      <a href="#M000410">create_functions</a>&nbsp;&nbsp;
+      <a href="#M000414">load_function</a>&nbsp;&nbsp;
+      <a href="#M000409">new</a>&nbsp;&nbsp;
+      <a href="#M000413">summarize</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+    <div id="class-list">
+      <h3 class="section-bar">Classes and Modules</h3>
+
+      Module <a href="Aggregate/Result.html" class="link">MCollective::Aggregate::Result</a><br />
+Class <a href="Aggregate/Base.html" class="link">MCollective::Aggregate::Base</a><br />
+
+    </div>
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">action</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">ddl</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">failed</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">functions</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000409" class="method-detail">
+        <a name="M000409"></a>
+
+        <div class="method-heading">
+          <a href="#M000409" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(ddl)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000409-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000409-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/aggregate.rb, line 8</span>
+ 8:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">ddl</span>)
+ 9:       <span class="ruby-ivar">@functions</span> = []
+10:       <span class="ruby-ivar">@ddl</span> = <span class="ruby-identifier">ddl</span>
+11:       <span class="ruby-ivar">@action</span> = <span class="ruby-identifier">ddl</span>[<span class="ruby-identifier">:action</span>]
+12:       <span class="ruby-ivar">@failed</span> = []
+13: 
+14:       <span class="ruby-identifier">create_functions</span>
+15:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000412" class="method-detail">
+        <a name="M000412"></a>
+
+        <div class="method-heading">
+          <a href="#M000412" class="method-signature">
+          <span class="method-name">call_functions</span><span class="method-args">(reply)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Call all the appropriate functions with the reply data received from <a
+href="RPC/Client.html">RPC::Client</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000412-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000412-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/aggregate.rb, line 45</span>
+45:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call_functions</span>(<span class="ruby-identifier">reply</span>)
+46:       <span class="ruby-ivar">@functions</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">function</span><span class="ruby-operator">|</span>
+47:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Calling aggregate function #{function} for result&quot;</span>)
+48:         <span class="ruby-keyword kw">begin</span>
+49:           <span class="ruby-identifier">function</span>.<span class="ruby-identifier">process_result</span>(<span class="ruby-identifier">reply</span>[<span class="ruby-identifier">:data</span>][<span class="ruby-identifier">function</span>.<span class="ruby-identifier">output_name</span>], <span class="ruby-identifier">reply</span>)
+50:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+51:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">&quot;Could not process aggregate function for '#{function.output_name}'. #{e.to_s}&quot;</span>)
+52:           <span class="ruby-ivar">@failed</span> <span class="ruby-operator">&lt;&lt;</span> {<span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">function</span>.<span class="ruby-identifier">output_name</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:process_result</span>}
+53:           <span class="ruby-ivar">@functions</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">function</span>)
+54:         <span class="ruby-keyword kw">end</span>
+55:       <span class="ruby-keyword kw">end</span>
+56:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000411" class="method-detail">
+        <a name="M000411"></a>
+
+        <div class="method-heading">
+          <a href="#M000411" class="method-signature">
+          <span class="method-name">contains_output?</span><span class="method-args">(output)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Check if the function param is defined as an output for the action in the
+ddl
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000411-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000411-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/aggregate.rb, line 40</span>
+40:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">contains_output?</span>(<span class="ruby-identifier">output</span>)
+41:       <span class="ruby-ivar">@ddl</span>[<span class="ruby-identifier">:output</span>].<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">output</span>)
+42:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000410" class="method-detail">
+        <a name="M000410"></a>
+
+        <div class="method-heading">
+          <a href="#M000410" class="method-signature">
+          <span class="method-name">create_functions</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Creates instances of the <a href="Aggregate.html">Aggregate</a> functions
+and stores them in the function array. All aggregate call and <a
+href="Aggregate.html#M000413">summarize</a> method calls operate on these
+function as a batch.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000410-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000410-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/aggregate.rb, line 19</span>
+19:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_functions</span>
+20:       <span class="ruby-ivar">@ddl</span>[<span class="ruby-identifier">:aggregate</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">agg</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
+21:         <span class="ruby-identifier">output</span> = <span class="ruby-identifier">agg</span>[<span class="ruby-identifier">:args</span>][<span class="ruby-value">0</span>]
+22: 
+23:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">contains_output?</span>(<span class="ruby-identifier">output</span>)
+24:           <span class="ruby-identifier">arguments</span> = <span class="ruby-identifier">agg</span>[<span class="ruby-identifier">:args</span>][<span class="ruby-value">1</span>]
+25:           <span class="ruby-identifier">format</span> = (<span class="ruby-identifier">arguments</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:format</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">arguments</span>) <span class="ruby-operator">||</span> <span class="ruby-keyword kw">nil</span>
+26:           <span class="ruby-keyword kw">begin</span>
+27:             <span class="ruby-ivar">@functions</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">load_function</span>(<span class="ruby-identifier">agg</span>[<span class="ruby-identifier">:function</span>]).<span class="ruby-identifier">new</span>(<span class="ruby-identifier">output</span>, <span class="ruby-identifier">arguments</span>, <span class="ruby-identifier">format</span>, <span class="ruby-ivar">@action</span>)
+28:           <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+29:             <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">&quot;Cannot create aggregate function '#{output}'. #{e.to_s}&quot;</span>)
+30:             <span class="ruby-ivar">@failed</span> <span class="ruby-operator">&lt;&lt;</span> {<span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">output</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:startup</span>}
+31:           <span class="ruby-keyword kw">end</span>
+32:         <span class="ruby-keyword kw">else</span>
+33:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">&quot;Cannot create aggregate function '#{output}'. '#{output}' has not been specified as a valid ddl output.&quot;</span>)
+34:           <span class="ruby-ivar">@failed</span> <span class="ruby-operator">&lt;&lt;</span> {<span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">output</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:create</span>}
+35:         <span class="ruby-keyword kw">end</span>
+36:       <span class="ruby-keyword kw">end</span>
+37:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000414" class="method-detail">
+        <a name="M000414"></a>
+
+        <div class="method-heading">
+          <a href="#M000414" class="method-signature">
+          <span class="method-name">load_function</span><span class="method-args">(function_name)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Loads function from disk for use
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000414-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000414-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/aggregate.rb, line 76</span>
+76:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_function</span>(<span class="ruby-identifier">function_name</span>)
+77:       <span class="ruby-identifier">function_name</span> = <span class="ruby-identifier">function_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">capitalize</span>
+78: 
+79:       <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">loadclass</span>(<span class="ruby-node">&quot;MCollective::Aggregate::#{function_name}&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">Aggregate</span>.<span class="ruby-identifier">const_defined?</span>(<span class="ruby-identifier">function_name</span>)
+80:       <span class="ruby-constant">Aggregate</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">function_name</span>)
+81:     <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span>
+82:       <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Aggregate function file '#{function_name.downcase}.rb' cannot be loaded&quot;</span>
+83:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000413" class="method-detail">
+        <a name="M000413"></a>
+
+        <div class="method-heading">
+          <a href="#M000413" class="method-signature">
+          <span class="method-name">summarize</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Finalizes the function returning a result object
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000413-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000413-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/aggregate.rb, line 59</span>
+59:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">summarize</span>
+60:       <span class="ruby-identifier">summary</span> = <span class="ruby-ivar">@functions</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">function</span><span class="ruby-operator">|</span>
+61:         <span class="ruby-keyword kw">begin</span>
+62:           <span class="ruby-identifier">function</span>.<span class="ruby-identifier">summarize</span>
+63:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+64:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">&quot;Could not summarize aggregate result for '#{function.output_name}'. #{e.to_s}&quot;</span>)
+65:           <span class="ruby-ivar">@failed</span> <span class="ruby-operator">&lt;&lt;</span> {<span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">function</span>.<span class="ruby-identifier">output_name</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:summarize</span>}
+66:           <span class="ruby-keyword kw">nil</span>
+67:         <span class="ruby-keyword kw">end</span>
+68:       <span class="ruby-keyword kw">end</span>
+69: 
+70:       <span class="ruby-identifier">summary</span>.<span class="ruby-identifier">reject</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">nil?</span>}.<span class="ruby-identifier">sort</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span><span class="ruby-operator">|</span>
+71:         <span class="ruby-identifier">x</span>.<span class="ruby-identifier">result</span>[<span class="ruby-identifier">:output</span>] <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">y</span>.<span class="ruby-identifier">result</span>[<span class="ruby-identifier">:output</span>]
+72:       <span class="ruby-keyword kw">end</span>
+73:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Aggregate/Base.html b/doc/classes/MCollective/Aggregate/Base.html
new file mode 100644 (file)
index 0000000..dec3501
--- /dev/null
@@ -0,0 +1,251 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Aggregate::Base</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Aggregate::Base</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/aggregate/base_rb.html">
+                lib/mcollective/aggregate/base.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000420">new</a>&nbsp;&nbsp;
+      <a href="#M000422">result_class</a>&nbsp;&nbsp;
+      <a href="#M000421">summarize</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">action</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">aggregate_format</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">arguments</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">name</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">output_name</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">result</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000420" class="method-detail">
+        <a name="M000420"></a>
+
+        <div class="method-heading">
+          <a href="#M000420" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(output_name, arguments, aggregate_format, action)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000420-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000420-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/aggregate/base.rb, line 6</span>
+ 6:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">output_name</span>, <span class="ruby-identifier">arguments</span>, <span class="ruby-identifier">aggregate_format</span>, <span class="ruby-identifier">action</span>)
+ 7:         <span class="ruby-ivar">@name</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>
+ 8:         <span class="ruby-ivar">@output_name</span> = <span class="ruby-identifier">output_name</span>
+ 9: 
+10:         <span class="ruby-comment cmt"># Any additional arguments passed in the ddl after the output field will</span>
+11:         <span class="ruby-comment cmt"># be stored in the arguments array which can be used in the function</span>
+12:         <span class="ruby-ivar">@arguments</span> = <span class="ruby-identifier">arguments</span>
+13:         <span class="ruby-ivar">@aggregate_format</span> = <span class="ruby-identifier">aggregate_format</span>
+14:         <span class="ruby-ivar">@action</span> = <span class="ruby-identifier">action</span>
+15:         <span class="ruby-ivar">@result</span> = {<span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">:output</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">output_name</span>}
+16: 
+17:         <span class="ruby-identifier">startup_hook</span>
+18:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000422" class="method-detail">
+        <a name="M000422"></a>
+
+        <div class="method-heading">
+          <a href="#M000422" class="method-signature">
+          <span class="method-name">result_class</span><span class="method-args">(type)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000422-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000422-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/aggregate/base.rb, line 35</span>
+35:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">result_class</span>(<span class="ruby-identifier">type</span>)
+36:         <span class="ruby-constant">Result</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-node">&quot;#{type.to_s.capitalize}Result&quot;</span>)
+37:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000421" class="method-detail">
+        <a name="M000421"></a>
+
+        <div class="method-heading">
+          <a href="#M000421" class="method-signature">
+          <span class="method-name">summarize</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Stops execution of the function and returns a specific ResultObject,
+aggregate functions will most likely override this but this is the simplest
+case so we might as well default to that
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000421-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000421-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/aggregate/base.rb, line 29</span>
+29:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">summarize</span>
+30:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Result type is not set while trying to summarize aggregate function results&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@result</span>[<span class="ruby-identifier">:type</span>]
+31: 
+32:         <span class="ruby-identifier">result_class</span>(<span class="ruby-ivar">@result</span>[<span class="ruby-identifier">:type</span>]).<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@result</span>, <span class="ruby-ivar">@aggregate_format</span>, <span class="ruby-ivar">@action</span>)
+33:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Aggregate/Result.html b/doc/classes/MCollective/Aggregate/Result.html
new file mode 100644 (file)
index 0000000..0ab933a
--- /dev/null
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Module: MCollective::Aggregate::Result</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Module</strong></td>
+          <td class="class-name-in-header">MCollective::Aggregate::Result</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/aggregate/result/base_rb.html">
+                lib/mcollective/aggregate/result/base.rb
+                </a>
+        <br />
+                <a href="../../../files/lib/mcollective/aggregate/result/collection_result_rb.html">
+                lib/mcollective/aggregate/result/collection_result.rb
+                </a>
+        <br />
+                <a href="../../../files/lib/mcollective/aggregate/result/numeric_result_rb.html">
+                lib/mcollective/aggregate/result/numeric_result.rb
+                </a>
+        <br />
+                <a href="../../../files/lib/mcollective/aggregate/result_rb.html">
+                lib/mcollective/aggregate/result.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+    <div id="class-list">
+      <h3 class="section-bar">Classes and Modules</h3>
+
+      Class <a href="Result/Base.html" class="link">MCollective::Aggregate::Result::Base</a><br />
+Class <a href="Result/CollectionResult.html" class="link">MCollective::Aggregate::Result::CollectionResult</a><br />
+Class <a href="Result/NumericResult.html" class="link">MCollective::Aggregate::Result::NumericResult</a><br />
+
+    </div>
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Aggregate/Result/Base.html b/doc/classes/MCollective/Aggregate/Result/Base.html
new file mode 100644 (file)
index 0000000..fa2bcda
--- /dev/null
@@ -0,0 +1,223 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Aggregate::Result::Base</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Aggregate::Result::Base</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../../files/lib/mcollective/aggregate/result/base_rb.html">
+                lib/mcollective/aggregate/result/base.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000416">new</a>&nbsp;&nbsp;
+      <a href="#M000418">result_type</a>&nbsp;&nbsp;
+      <a href="#M000417">to_s</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">action</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">aggregate_format</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">result</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000416" class="method-detail">
+        <a name="M000416"></a>
+
+        <div class="method-heading">
+          <a href="#M000416" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(result, aggregate_format, action)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000416-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000416-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/aggregate/result/base.rb, line 7</span>
+ 7:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">result</span>, <span class="ruby-identifier">aggregate_format</span>, <span class="ruby-identifier">action</span>)
+ 8:           <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;No aggregate_format defined in ddl or aggregate function&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">aggregate_format</span>
+ 9: 
+10:           <span class="ruby-ivar">@result</span> = <span class="ruby-identifier">result</span>
+11:           <span class="ruby-ivar">@aggregate_format</span> = <span class="ruby-identifier">aggregate_format</span>
+12:           <span class="ruby-ivar">@action</span> = <span class="ruby-identifier">action</span>
+13:         <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000418" class="method-detail">
+        <a name="M000418"></a>
+
+        <div class="method-heading">
+          <a href="#M000418" class="method-signature">
+          <span class="method-name">result_type</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000418-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000418-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/aggregate/result/base.rb, line 19</span>
+19:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">result_type</span>
+20:           <span class="ruby-ivar">@result</span>[<span class="ruby-identifier">:type</span>]
+21:         <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000417" class="method-detail">
+        <a name="M000417"></a>
+
+        <div class="method-heading">
+          <a href="#M000417" class="method-signature">
+          <span class="method-name">to_s</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000417-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000417-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/aggregate/result/base.rb, line 15</span>
+15:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
+16:           <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;'to_s' method not implemented for result class '#{self.class}'&quot;</span>
+17:         <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Aggregate/Result/CollectionResult.html b/doc/classes/MCollective/Aggregate/Result/CollectionResult.html
new file mode 100644 (file)
index 0000000..6436817
--- /dev/null
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Aggregate::Result::CollectionResult</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Aggregate::Result::CollectionResult</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../../files/lib/mcollective/aggregate/result/collection_result_rb.html">
+                lib/mcollective/aggregate/result/collection_result.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                <a href="Base.html">
+                Base
+               </a>
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000415">to_s</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000415" class="method-detail">
+        <a name="M000415"></a>
+
+        <div class="method-heading">
+          <a href="#M000415" class="method-signature">
+          <span class="method-name">to_s</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000415-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000415-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/aggregate/result/collection_result.rb, line 5</span>
+ 5:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
+ 6:           <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@result</span>[<span class="ruby-identifier">:value</span>].<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-keyword kw">nil</span>)
+ 7: 
+ 8:           <span class="ruby-identifier">result</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>
+ 9: 
+10:           <span class="ruby-ivar">@result</span>[<span class="ruby-identifier">:value</span>].<span class="ruby-identifier">sort</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span>,<span class="ruby-identifier">y</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">y</span>[<span class="ruby-value">1</span>]}.<span class="ruby-identifier">reverse</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
+11:             <span class="ruby-identifier">result</span>.<span class="ruby-identifier">puts</span> <span class="ruby-ivar">@aggregate_format</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">value</span>[<span class="ruby-value">0</span>], <span class="ruby-identifier">value</span>[<span class="ruby-value">1</span>]]
+12:           <span class="ruby-keyword kw">end</span>
+13: 
+14:           <span class="ruby-identifier">result</span>.<span class="ruby-identifier">string</span>.<span class="ruby-identifier">chomp</span>
+15:         <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Aggregate/Result/NumericResult.html b/doc/classes/MCollective/Aggregate/Result/NumericResult.html
new file mode 100644 (file)
index 0000000..448005d
--- /dev/null
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Aggregate::Result::NumericResult</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Aggregate::Result::NumericResult</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../../files/lib/mcollective/aggregate/result/numeric_result_rb.html">
+                lib/mcollective/aggregate/result/numeric_result.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                <a href="Base.html">
+                Base
+               </a>
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000419">to_s</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000419" class="method-detail">
+        <a name="M000419"></a>
+
+        <div class="method-heading">
+          <a href="#M000419" class="method-signature">
+          <span class="method-name">to_s</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000419-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000419-source">
+<pre>
+   <span class="ruby-comment cmt"># File lib/mcollective/aggregate/result/numeric_result.rb, line 5</span>
+5:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
+6:           <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@result</span>[<span class="ruby-identifier">:value</span>].<span class="ruby-identifier">nil?</span>
+7: 
+8:           <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@aggregate_format</span> <span class="ruby-operator">%</span> <span class="ruby-ivar">@result</span>[<span class="ruby-identifier">:value</span>]
+9:         <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Application.html b/doc/classes/MCollective/Application.html
new file mode 100644 (file)
index 0000000..7e02d82
--- /dev/null
@@ -0,0 +1,1069 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Application</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Application</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/application_rb.html">
+                lib/mcollective/application.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000347">[]</a>&nbsp;&nbsp;
+      <a href="#M000346">[]=</a>&nbsp;&nbsp;
+      <a href="#M000362">application_cli_arguments</a>&nbsp;&nbsp;
+      <a href="#M000360">application_description</a>&nbsp;&nbsp;
+      <a href="#M000363">application_failure</a>&nbsp;&nbsp;
+      <a href="#M000345">application_options</a>&nbsp;&nbsp;
+      <a href="#M000359">application_options</a>&nbsp;&nbsp;
+      <a href="#M000357">application_parse_options</a>&nbsp;&nbsp;
+      <a href="#M000361">application_usage</a>&nbsp;&nbsp;
+      <a href="#M000356">clioptions</a>&nbsp;&nbsp;
+      <a href="#M000353">configuration</a>&nbsp;&nbsp;
+      <a href="#M000348">description</a>&nbsp;&nbsp;
+      <a href="#M000366">disconnect</a>&nbsp;&nbsp;
+      <a href="#M000350">exclude_argument_sections</a>&nbsp;&nbsp;
+      <a href="#M000369">halt</a>&nbsp;&nbsp;
+      <a href="#M000368">halt_code</a>&nbsp;&nbsp;
+      <a href="#M000364">help</a>&nbsp;&nbsp;
+      <a href="#M000352">intialize_application_options</a>&nbsp;&nbsp;
+      <a href="#M000367">main</a>&nbsp;&nbsp;
+      <a href="#M000351">option</a>&nbsp;&nbsp;
+      <a href="#M000354">options</a>&nbsp;&nbsp;
+      <a href="#M000370">rpcclient</a>&nbsp;&nbsp;
+      <a href="#M000365">run</a>&nbsp;&nbsp;
+      <a href="#M000349">usage</a>&nbsp;&nbsp;
+      <a href="#M000358">validate_cli_options</a>&nbsp;&nbsp;
+      <a href="#M000355">validate_option</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+    <div id="includes">
+      <h3 class="section-bar">Included Modules</h3>
+
+      <div id="includes-list">
+        <span class="include-name"><a href="RPC.html">RPC</a></span>
+      </div>
+    </div>
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000347" class="method-detail">
+        <a name="M000347"></a>
+
+        <div class="method-heading">
+          <a href="#M000347" class="method-signature">
+          <span class="method-name">[]</span><span class="method-args">(option)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+retrieves a specific <a href="Application.html#M000351">option</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000347-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000347-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 20</span>
+20:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">option</span>)
+21:         <span class="ruby-identifier">intialize_application_options</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@application_options</span>
+22:         <span class="ruby-ivar">@application_options</span>[<span class="ruby-identifier">option</span>]
+23:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000346" class="method-detail">
+        <a name="M000346"></a>
+
+        <div class="method-heading">
+          <a href="#M000346" class="method-signature">
+          <span class="method-name">[]=</span><span class="method-args">(option, value)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+set an <a href="Application.html#M000351">option</a> in the <a
+href="Application.html#M000354">options</a> hash
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000346-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000346-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 14</span>
+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>)
+15:         <span class="ruby-identifier">intialize_application_options</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@application_options</span>
+16:         <span class="ruby-ivar">@application_options</span>[<span class="ruby-identifier">option</span>] = <span class="ruby-identifier">value</span>
+17:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000345" class="method-detail">
+        <a name="M000345"></a>
+
+        <div class="method-heading">
+          <a href="#M000345" class="method-signature">
+          <span class="method-name">application_options</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Intialize a blank set of <a href="Application.html#M000354">options</a> if
+its the first time used else returns active <a
+href="Application.html#M000354">options</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000345-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000345-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 8</span>
+ 8:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">application_options</span>
+ 9:         <span class="ruby-identifier">intialize_application_options</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@application_options</span>
+10:         <span class="ruby-ivar">@application_options</span>
+11:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000348" class="method-detail">
+        <a name="M000348"></a>
+
+        <div class="method-heading">
+          <a href="#M000348" class="method-signature">
+          <span class="method-name">description</span><span class="method-args">(descr)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Sets the application <a href="Application.html#M000348">description</a>,
+there can be only one <a href="Application.html#M000348">description</a>
+per application so multiple calls will just change the <a
+href="Application.html#M000348">description</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000348-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000348-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 28</span>
+28:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">description</span>(<span class="ruby-identifier">descr</span>)
+29:         <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">:description</span>] = <span class="ruby-identifier">descr</span>
+30:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000350" class="method-detail">
+        <a name="M000350"></a>
+
+        <div class="method-heading">
+          <a href="#M000350" class="method-signature">
+          <span class="method-name">exclude_argument_sections</span><span class="method-args">(*sections)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000350-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000350-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 38</span>
+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>)
+39:         <span class="ruby-identifier">sections</span> = [<span class="ruby-identifier">sections</span>].<span class="ruby-identifier">flatten</span>
+40: 
+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>
+42:           <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unknown CLI argument section #{s}&quot;</span> <span class="ruby-keyword kw">unless</span> [<span class="ruby-value str">&quot;rpc&quot;</span>, <span class="ruby-value str">&quot;common&quot;</span>, <span class="ruby-value str">&quot;filter&quot;</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">s</span>)
+43:         <span class="ruby-keyword kw">end</span>
+44: 
+45:         <span class="ruby-identifier">intialize_application_options</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@application_options</span>
+46:         <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">:exclude_arg_sections</span>] = <span class="ruby-identifier">sections</span>
+47:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000352" class="method-detail">
+        <a name="M000352"></a>
+
+        <div class="method-heading">
+          <a href="#M000352" class="method-signature">
+          <span class="method-name">intialize_application_options</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Creates an empty set of <a href="Application.html#M000354">options</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000352-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000352-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 79</span>
+79:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">intialize_application_options</span>
+80:         <span class="ruby-ivar">@application_options</span> = {<span class="ruby-identifier">:description</span>          =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>,
+81:                                 <span class="ruby-identifier">:usage</span>                =<span class="ruby-operator">&gt;</span> [],
+82:                                 <span class="ruby-identifier">:cli_arguments</span>        =<span class="ruby-operator">&gt;</span> [],
+83:                                 <span class="ruby-identifier">:exclude_arg_sections</span> =<span class="ruby-operator">&gt;</span> []}
+84:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000351" class="method-detail">
+        <a name="M000351"></a>
+
+        <div class="method-heading">
+          <a href="#M000351" class="method-signature">
+          <span class="method-name">option</span><span class="method-args">(name, arguments)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Wrapper to create command line <a
+href="Application.html#M000354">options</a>
+</p>
+<pre>
+ - name: varaible name that will be used to access the option value
+ - description: textual info shown in --help
+ - arguments: a list of possible arguments that can be used
+   to activate this option
+ - type: a data type that ObjectParser understand of :bool or :array
+ - required: true or false if this option has to be supplied
+ - validate: a proc that will be called with the value used to validate
+   the supplied value
+
+  option :foo,
+         :description =&gt; &quot;The foo option&quot;
+         :arguments   =&gt; [&quot;--foo ARG&quot;]
+</pre>
+<p>
+after this the value supplied will be in <a
+href="Application.html#M000353">configuration</a>[:foo]
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000351-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000351-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 65</span>
+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>)
+66:         <span class="ruby-identifier">opt</span> = {<span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">name</span>,
+67:                <span class="ruby-identifier">:description</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>,
+68:                <span class="ruby-identifier">:arguments</span> =<span class="ruby-operator">&gt;</span> [],
+69:                <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">String</span>,
+70:                <span class="ruby-identifier">:required</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>,
+71:                <span class="ruby-identifier">:validate</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Proc</span>.<span class="ruby-identifier">new</span> { <span class="ruby-keyword kw">true</span> }}
+72: 
+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>}
+74: 
+75:         <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">:cli_arguments</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">opt</span>
+76:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000349" class="method-detail">
+        <a name="M000349"></a>
+
+        <div class="method-heading">
+          <a href="#M000349" class="method-signature">
+          <span class="method-name">usage</span><span class="method-args">(usage)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Supplies <a href="Application.html#M000349">usage</a> information, calling
+multiple times will create multiple <a
+href="Application.html#M000349">usage</a> lines in &#8212;<a
+href="Application.html#M000364">help</a> output
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000349-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000349-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 34</span>
+34:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">usage</span>(<span class="ruby-identifier">usage</span>)
+35:         <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">:usage</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">usage</span>
+36:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000362" class="method-detail">
+        <a name="M000362"></a>
+
+        <div class="method-heading">
+          <a href="#M000362" class="method-signature">
+          <span class="method-name">application_cli_arguments</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns an array of all the arguments built using calls to optin
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000362-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000362-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 247</span>
+247:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">application_cli_arguments</span>
+248:       <span class="ruby-identifier">application_options</span>[<span class="ruby-identifier">:cli_arguments</span>]
+249:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000360" class="method-detail">
+        <a name="M000360"></a>
+
+        <div class="method-heading">
+          <a href="#M000360" class="method-signature">
+          <span class="method-name">application_description</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Retrieve the current application <a
+href="Application.html#M000348">description</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000360-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000360-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 234</span>
+234:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">application_description</span>
+235:       <span class="ruby-identifier">application_options</span>[<span class="ruby-identifier">:description</span>]
+236:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000363" class="method-detail">
+        <a name="M000363"></a>
+
+        <div class="method-heading">
+          <a href="#M000363" class="method-signature">
+          <span class="method-name">application_failure</span><span class="method-args">(e, err_dest=STDERR)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Handles failure, if we&#8216;re far enough in the initialization phase it
+will log backtraces if its in verbose mode only
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000363-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000363-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 253</span>
+253:     <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>)
+254:       <span class="ruby-comment cmt"># peole can use exit() anywhere and not get nasty backtraces as a result</span>
+255:       <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>)
+256:         <span class="ruby-identifier">disconnect</span>
+257:         <span class="ruby-identifier">raise</span>(<span class="ruby-identifier">e</span>)
+258:       <span class="ruby-keyword kw">end</span>
+259: 
+260:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">CodedError</span>)
+261:         <span class="ruby-identifier">err_dest</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;\nThe %s application failed to run: %s: %s\n&quot;</span> <span class="ruby-operator">%</span> [ <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:bold</span>, <span class="ruby-identifier">$0</span>), <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:bold</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">code</span>), <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:red</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>)]
+262: 
+263:         <span class="ruby-identifier">err_dest</span>.<span class="ruby-identifier">puts</span>
+264:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:verbose</span>]
+265:           <span class="ruby-identifier">err_dest</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Use the 'mco doc %s' command for details about this error&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">code</span>
+266:         <span class="ruby-keyword kw">else</span>
+267:           <span class="ruby-identifier">err_dest</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Use the 'mco doc %s' command for details about this error, use -v for full error backtrace details&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">code</span>
+268:         <span class="ruby-keyword kw">end</span>
+269:       <span class="ruby-keyword kw">else</span>
+270:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:verbose</span>]
+271:           <span class="ruby-identifier">err_dest</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;\nThe %s application failed to run: %s\n&quot;</span> <span class="ruby-operator">%</span> [ <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:bold</span>, <span class="ruby-identifier">$0</span>), <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:red</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>)]
+272:         <span class="ruby-keyword kw">else</span>
+273:           <span class="ruby-identifier">err_dest</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;\nThe %s application failed to run, use -v for full error backtrace details: %s\n&quot;</span> <span class="ruby-operator">%</span> [ <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:bold</span>, <span class="ruby-identifier">$0</span>), <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:red</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>)]
+274:         <span class="ruby-keyword kw">end</span>
+275:       <span class="ruby-keyword kw">end</span>
+276: 
+277:       <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>]
+278:         <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:red</span>, <span class="ruby-value str">&quot;  &lt;----&quot;</span>)
+279:         <span class="ruby-identifier">err_dest</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;\n%s %s&quot;</span> <span class="ruby-operator">%</span> [ <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:red</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>), <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:bold</span>, <span class="ruby-node">&quot;(#{e.class.to_s})&quot;</span>)]
+280:         <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">&quot;\tfrom #{l}&quot;</span>}
+281:       <span class="ruby-keyword kw">end</span>
+282: 
+283:       <span class="ruby-identifier">disconnect</span>
+284: 
+285:       <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
+286:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000359" class="method-detail">
+        <a name="M000359"></a>
+
+        <div class="method-heading">
+          <a href="#M000359" class="method-signature">
+          <span class="method-name">application_options</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Retrieves the full hash of application <a
+href="Application.html#M000354">options</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000359-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000359-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 229</span>
+229:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">application_options</span>
+230:       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">application_options</span>
+231:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000357" class="method-detail">
+        <a name="M000357"></a>
+
+        <div class="method-heading">
+          <a href="#M000357" class="method-signature">
+          <span class="method-name">application_parse_options</span><span class="method-args">(help=false)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Builds an ObjectParser config, parse the CLI <a
+href="Application.html#M000354">options</a> and validates based on the <a
+href="Application.html#M000351">option</a> config
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000357-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000357-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 135</span>
+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>)
+136:       <span class="ruby-ivar">@options</span> <span class="ruby-operator">||=</span> {<span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>}
+137: 
+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>
+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>
+140:         <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">banner</span> = <span class="ruby-value str">&quot;&quot;</span>
+141: 
+142:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">application_usage</span>
+143:           <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">separator</span> <span class="ruby-value str">&quot;&quot;</span>
+144: 
+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>
+146:             <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">separator</span> <span class="ruby-node">&quot;Usage: #{u}&quot;</span>
+147:           <span class="ruby-keyword kw">end</span>
+148: 
+149:           <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">separator</span> <span class="ruby-value str">&quot;&quot;</span>
+150:         <span class="ruby-keyword kw">end</span>
+151: 
+152:         <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">separator</span> <span class="ruby-value str">&quot;Application Options&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">application_cli_arguments</span>.<span class="ruby-identifier">empty?</span>
+153: 
+154:         <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">define_tail</span> <span class="ruby-value str">&quot;&quot;</span>
+155:         <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">define_tail</span> <span class="ruby-node">&quot;The Marionette Collective #{MCollective.version}&quot;</span>
+156: 
+157: 
+158:         <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>
+159:           <span class="ruby-identifier">opts_array</span> = []
+160: 
+161:           <span class="ruby-identifier">opts_array</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">:on</span>
+162: 
+163:           <span class="ruby-comment cmt"># if a default is set from the application set it up front</span>
+164:           <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>)
+165:             <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>]
+166:           <span class="ruby-keyword kw">end</span>
+167: 
+168:           <span class="ruby-comment cmt"># :arguments are multiple possible ones</span>
+169:           <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>)
+170:             <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">&lt;&lt;</span> <span class="ruby-identifier">a</span>}
+171:           <span class="ruby-keyword kw">else</span>
+172:             <span class="ruby-identifier">opts_array</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:arguments</span>]
+173:           <span class="ruby-keyword kw">end</span>
+174: 
+175:           <span class="ruby-comment cmt"># type was given and its not one of our special types, just pass it onto optparse</span>
+176:           <span class="ruby-identifier">opts_array</span> <span class="ruby-operator">&lt;&lt;</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-operator">&amp;&amp;</span> <span class="ruby-operator">!</span>[<span class="ruby-identifier">:boolean</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>])
+177: 
+178:           <span class="ruby-identifier">opts_array</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:description</span>]
+179: 
+180:           <span class="ruby-comment cmt"># Handle our special types else just rely on the optparser to handle the types</span>
+181:           <span class="ruby-keyword kw">if</span> [<span class="ruby-identifier">:bool</span>, <span class="ruby-identifier">:boolean</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:type</span>])
+182:             <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>
+183:               <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>)
+184: 
+185:               <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>]] = <span class="ruby-identifier">v</span>
+186:             <span class="ruby-keyword kw">end</span>
+187: 
+188:           <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>
+189:             <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>
+190:               <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>)
+191: 
+192:               <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>])
+193:               <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>]] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">v</span>
+194:             <span class="ruby-keyword kw">end</span>
+195: 
+196:           <span class="ruby-keyword kw">else</span>
+197:             <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>
+198:               <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>)
+199: 
+200:               <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:name</span>]] = <span class="ruby-identifier">v</span>
+201:             <span class="ruby-keyword kw">end</span>
+202:           <span class="ruby-keyword kw">end</span>
+203:         <span class="ruby-keyword kw">end</span>
+204:       <span class="ruby-keyword kw">end</span>
+205:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000361" class="method-detail">
+        <a name="M000361"></a>
+
+        <div class="method-heading">
+          <a href="#M000361" class="method-signature">
+          <span class="method-name">application_usage</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Return the current <a href="Application.html#M000349">usage</a> text false
+if nothing is set
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000361-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000361-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 239</span>
+239:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">application_usage</span>
+240:       <span class="ruby-identifier">usage</span> = <span class="ruby-identifier">application_options</span>[<span class="ruby-identifier">:usage</span>]
+241: 
+242:       <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>
+243:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000356" class="method-detail">
+        <a name="M000356"></a>
+
+        <div class="method-heading">
+          <a href="#M000356" class="method-signature">
+          <span class="method-name">clioptions</span><span class="method-args">(help) {|parser, options| ...}</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Creates a standard <a href="Application.html#M000354">options</a> hash,
+pass in a block to add extra headings etc see <a
+href="Optionparser.html">Optionparser</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000356-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000356-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 111</span>
+111:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clioptions</span>(<span class="ruby-identifier">help</span>)
+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">&gt;</span> <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">:progress_bar</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>}, <span class="ruby-value str">&quot;filter&quot;</span>, <span class="ruby-identifier">application_options</span>[<span class="ruby-identifier">:exclude_arg_sections</span>])
+113: 
+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>
+115:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
+116:           <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">parser</span>, <span class="ruby-identifier">options</span>)
+117:         <span class="ruby-keyword kw">end</span>
+118: 
+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">&quot;rpc&quot;</span>)
+120:       <span class="ruby-keyword kw">end</span>
+121: 
+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>
+123: 
+124:       <span class="ruby-identifier">validate_cli_options</span>
+125: 
+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>)
+127: 
+128:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">options</span>
+129:     <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+130:       <span class="ruby-identifier">application_failure</span>(<span class="ruby-identifier">e</span>)
+131:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000353" class="method-detail">
+        <a name="M000353"></a>
+
+        <div class="method-heading">
+          <a href="#M000353" class="method-signature">
+          <span class="method-name">configuration</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+The application <a href="Application.html#M000353">configuration</a> built
+from CLI arguments
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000353-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000353-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 88</span>
+88:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configuration</span>
+89:       <span class="ruby-ivar">@application_configuration</span> <span class="ruby-operator">||=</span> {}
+90:       <span class="ruby-ivar">@application_configuration</span>
+91:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000366" class="method-detail">
+        <a name="M000366"></a>
+
+        <div class="method-heading">
+          <a href="#M000366" class="method-signature">
+          <span class="method-name">disconnect</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000366-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000366-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 310</span>
+310:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">disconnect</span>
+311:       <span class="ruby-constant">MCollective</span><span class="ruby-operator">::</span><span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;connector_plugin&quot;</span>].<span class="ruby-identifier">disconnect</span>
+312:     <span class="ruby-keyword kw">rescue</span>
+313:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000369" class="method-detail">
+        <a name="M000369"></a>
+
+        <div class="method-heading">
+          <a href="#M000369" class="method-signature">
+          <span class="method-name">halt</span><span class="method-args">(stats)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+A helper that creates a consistent exit code for applications by looking at
+an instance of <a href="RPC/Stats.html">MCollective::RPC::Stats</a>
+</p>
+<p>
+Exit with 0 if nodes were discovered and all passed Exit with 0 if no
+discovery were done and &gt; 0 responses were received, all ok Exit with 1
+if no nodes were discovered Exit with 2 if nodes were discovered but some
+<a href="RPC.html">RPC</a> requests failed Exit with 3 if nodes were
+discovered, but no responses received Exit with 4 if no discovery were done
+and no responses were received
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000369-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000369-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 345</span>
+345:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">halt</span>(<span class="ruby-identifier">stats</span>)
+346:       <span class="ruby-identifier">exit</span>(<span class="ruby-identifier">halt_code</span>(<span class="ruby-identifier">stats</span>))
+347:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000368" class="method-detail">
+        <a name="M000368"></a>
+
+        <div class="method-heading">
+          <a href="#M000368" class="method-signature">
+          <span class="method-name">halt_code</span><span class="method-args">(stats)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000368-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000368-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 322</span>
+322:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">halt_code</span>(<span class="ruby-identifier">stats</span>)
+323:       <span class="ruby-identifier">request_stats</span> = {<span class="ruby-identifier">:discoverytime</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>,
+324:                        <span class="ruby-identifier">:discovered</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>,
+325:                        <span class="ruby-identifier">:okcount</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>,
+326:                        <span class="ruby-identifier">:failcount</span> =<span class="ruby-operator">&gt;</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>)
+327: 
+328:       <span class="ruby-keyword kw">return</span> <span class="ruby-value">4</span> <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> <span class="ruby-operator">&amp;&amp;</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>
+329:       <span class="ruby-keyword kw">return</span> <span class="ruby-value">3</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request_stats</span>[<span class="ruby-identifier">:discovered</span>] <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-operator">&amp;&amp;</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>
+330:       <span class="ruby-keyword kw">return</span> <span class="ruby-value">2</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request_stats</span>[<span class="ruby-identifier">:discovered</span>] <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">request_stats</span>[<span class="ruby-identifier">:failcount</span>] <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
+331:       <span class="ruby-keyword kw">return</span> <span class="ruby-value">1</span> <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>
+332:       <span class="ruby-keyword kw">return</span> <span class="ruby-value">0</span> <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> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">request_stats</span>[<span class="ruby-identifier">:discovered</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">request_stats</span>[<span class="ruby-identifier">:okcount</span>]
+333:       <span class="ruby-keyword kw">return</span> <span class="ruby-value">0</span> <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-identifier">request_stats</span>[<span class="ruby-identifier">:okcount</span>]
+334:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000364" class="method-detail">
+        <a name="M000364"></a>
+
+        <div class="method-heading">
+          <a href="#M000364" class="method-signature">
+          <span class="method-name">help</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000364-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000364-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 288</span>
+288:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">help</span>
+289:       <span class="ruby-identifier">application_parse_options</span>(<span class="ruby-keyword kw">true</span>)
+290:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000367" class="method-detail">
+        <a name="M000367"></a>
+
+        <div class="method-heading">
+          <a href="#M000367" class="method-signature">
+          <span class="method-name">main</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Fake abstract class that logs if the user tries to use an application
+without supplying a <a href="Application.html#M000367">main</a> override
+method.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000367-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000367-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 317</span>
+317:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">main</span>
+318:       <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Applications need to supply a 'main' method&quot;</span>
+319:       <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
+320:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000354" class="method-detail">
+        <a name="M000354"></a>
+
+        <div class="method-heading">
+          <a href="#M000354" class="method-signature">
+          <span class="method-name">options</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+The active <a href="Application.html#M000354">options</a> hash used for
+MC::Client and other <a href="Application.html#M000353">configuration</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000354-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000354-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 94</span>
+94:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">options</span>
+95:       <span class="ruby-ivar">@options</span>
+96:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000370" class="method-detail">
+        <a name="M000370"></a>
+
+        <div class="method-heading">
+          <a href="#M000370" class="method-signature">
+          <span class="method-name">rpcclient</span><span class="method-args">(agent, flags = {})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Wrapper around <a href="RPC.html#M000037">MC::RPC#rpcclient</a> that
+forcably supplies our <a href="Application.html#M000354">options</a> hash
+if someone forgets to pass in <a
+href="Application.html#M000354">options</a> in an application the filters
+and other cli <a href="Application.html#M000354">options</a> wouldnt take
+effect which could have a disasterous outcome
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000370-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000370-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 352</span>
+352:     <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> = {})
+353:       <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>)
+354:       <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:exit_on_failure</span>] = <span class="ruby-keyword kw">false</span>
+355: 
+356:       <span class="ruby-keyword kw">super</span>
+357:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000365" class="method-detail">
+        <a name="M000365"></a>
+
+        <div class="method-heading">
+          <a href="#M000365" class="method-signature">
+          <span class="method-name">run</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+The <a href="Application.html#M000367">main</a> logic loop, builds up the
+<a href="Application.html#M000354">options</a>, validate <a
+href="Application.html#M000353">configuration</a> and calls the <a
+href="Application.html#M000367">main</a> as supplied by the user.
+Disconnects when done and pass any exception onto the <a
+href="Application.html#M000363">application_failure</a> helper
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000365-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000365-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 295</span>
+295:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>
+296:       <span class="ruby-identifier">application_parse_options</span>
+297: 
+298:       <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>)
+299: 
+300:       <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>
+301: 
+302:       <span class="ruby-identifier">main</span>
+303: 
+304:       <span class="ruby-identifier">disconnect</span>
+305: 
+306:     <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+307:       <span class="ruby-identifier">application_failure</span>(<span class="ruby-identifier">e</span>)
+308:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000358" class="method-detail">
+        <a name="M000358"></a>
+
+        <div class="method-heading">
+          <a href="#M000358" class="method-signature">
+          <span class="method-name">validate_cli_options</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000358-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000358-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 207</span>
+207:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_cli_options</span>
+208:       <span class="ruby-comment cmt"># Check all required parameters were set</span>
+209:       <span class="ruby-identifier">validation_passed</span> = <span class="ruby-keyword kw">true</span>
+210:       <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>
+211:         <span class="ruby-comment cmt"># Check for required arguments</span>
+212:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">carg</span>[<span class="ruby-identifier">:required</span>]
+213:           <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>] ]
+214:             <span class="ruby-identifier">validation_passed</span> = <span class="ruby-keyword kw">false</span>
+215:             <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;The #{carg[:name]} option is mandatory&quot;</span>
+216:           <span class="ruby-keyword kw">end</span>
+217:         <span class="ruby-keyword kw">end</span>
+218:       <span class="ruby-keyword kw">end</span>
+219: 
+220:       <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">validation_passed</span>
+221:         <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;\nPlease run with --help for detailed help&quot;</span>
+222:         <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
+223:       <span class="ruby-keyword kw">end</span>
+224: 
+225: 
+226:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000355" class="method-detail">
+        <a name="M000355"></a>
+
+        <div class="method-heading">
+          <a href="#M000355" class="method-signature">
+          <span class="method-name">validate_option</span><span class="method-args">(blk, name, value)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Calls the supplied block in an <a
+href="Application.html#M000351">option</a> for validation, an error raised
+will log to STDERR and exit the application
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000355-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000355-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/application.rb, line 100</span>
+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>)
+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>)
+102: 
+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>
+104:         <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Validation of #{name} failed: #{validation_result}&quot;</span>
+105:         <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
+106:       <span class="ruby-keyword kw">end</span>
+107:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Applications.html b/doc/classes/MCollective/Applications.html
new file mode 100644 (file)
index 0000000..09f0299
--- /dev/null
@@ -0,0 +1,381 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Applications</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Applications</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/applications_rb.html">
+                lib/mcollective/applications.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000425">[]</a>&nbsp;&nbsp;
+      <a href="#M000429">filter_extra_options</a>&nbsp;&nbsp;
+      <a href="#M000428">list</a>&nbsp;&nbsp;
+      <a href="#M000427">load_application</a>&nbsp;&nbsp;
+      <a href="#M000430">load_config</a>&nbsp;&nbsp;
+      <a href="#M000426">run</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000425" class="method-detail">
+        <a name="M000425"></a>
+
+        <div class="method-heading">
+          <a href="#M000425" class="method-signature">
+          <span class="method-name">[]</span><span class="method-args">(appname)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000425-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000425-source">
+<pre>
+   <span class="ruby-comment cmt"># File lib/mcollective/applications.rb, line 3</span>
+3:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-operator">[]</span>(<span class="ruby-identifier">appname</span>)
+4:       <span class="ruby-identifier">load_application</span>(<span class="ruby-identifier">appname</span>)
+5:       <span class="ruby-constant">PluginManager</span>[<span class="ruby-node">&quot;#{appname}_application&quot;</span>]
+6:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000429" class="method-detail">
+        <a name="M000429"></a>
+
+        <div class="method-heading">
+          <a href="#M000429" class="method-signature">
+          <span class="method-name">filter_extra_options</span><span class="method-args">(opts)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Filters a string of opts out using Shellwords keeping only things related
+to &#8212;config and -c
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000429-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000429-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/applications.rb, line 49</span>
+49:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">filter_extra_options</span>(<span class="ruby-identifier">opts</span>)
+50:       <span class="ruby-identifier">res</span> = <span class="ruby-value str">&quot;&quot;</span>
+51:       <span class="ruby-identifier">words</span> = <span class="ruby-constant">Shellwords</span>.<span class="ruby-identifier">shellwords</span>(<span class="ruby-identifier">opts</span>)
+52:       <span class="ruby-identifier">words</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">word</span>,<span class="ruby-identifier">idx</span><span class="ruby-operator">|</span>
+53:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">word</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;-c&quot;</span>
+54:           <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;--config=#{words[idx + 1]}&quot;</span>
+55:         <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">word</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;--config&quot;</span>
+56:           <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;--config=#{words[idx + 1]}&quot;</span>
+57:         <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">word</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\-c=/</span>
+58:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">word</span>
+59:         <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">word</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\-\-config=/</span>
+60:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">word</span>
+61:         <span class="ruby-keyword kw">end</span>
+62:       <span class="ruby-keyword kw">end</span>
+63: 
+64:       <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;&quot;</span>
+65:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000428" class="method-detail">
+        <a name="M000428"></a>
+
+        <div class="method-heading">
+          <a href="#M000428" class="method-signature">
+          <span class="method-name">list</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns an array of applications found in the lib dirs
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000428-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000428-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/applications.rb, line 36</span>
+36:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">list</span>
+37:       <span class="ruby-identifier">load_config</span>
+38: 
+39:       <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">find</span>(<span class="ruby-value str">&quot;application&quot;</span>)
+40:     <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SystemExit</span>
+41:       <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
+42:     <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+43:       <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Failed to generate application list: #{e.class}: #{e}&quot;</span>
+44:       <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
+45:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000427" class="method-detail">
+        <a name="M000427"></a>
+
+        <div class="method-heading">
+          <a href="#M000427" class="method-signature">
+          <span class="method-name">load_application</span><span class="method-args">(appname)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000427-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000427-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/applications.rb, line 26</span>
+26:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load_application</span>(<span class="ruby-identifier">appname</span>)
+27:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-node">&quot;#{appname}_application&quot;</span>)
+28: 
+29:       <span class="ruby-identifier">load_config</span>
+30: 
+31:       <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">loadclass</span> <span class="ruby-node">&quot;MCollective::Application::#{appname.capitalize}&quot;</span>
+32:       <span class="ruby-constant">PluginManager</span> <span class="ruby-operator">&lt;&lt;</span> {<span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;#{appname}_application&quot;</span>, <span class="ruby-identifier">:class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;MCollective::Application::#{appname.capitalize}&quot;</span>}
+33:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000430" class="method-detail">
+        <a name="M000430"></a>
+
+        <div class="method-heading">
+          <a href="#M000430" class="method-signature">
+          <span class="method-name">load_config</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+We need to know the config file in order to know the libdir so that we can
+find applications.
+</p>
+<p>
+The problem is the CLI might be stuffed with options only the app in the
+libdir might understand so we have a chicken and egg situation.
+</p>
+<p>
+We&#8216;re parsing and filtering MCOLLECTIVE_EXTRA_OPTS removing all but
+config related options and parsing the options looking just for the config
+file.
+</p>
+<p>
+We&#8216;re handling failures gracefully and finally restoring the ARG and
+MCOLLECTIVE_EXTRA_OPTS to the state they were before we started parsing.
+</p>
+<p>
+This is mostly a hack, when we&#8216;re redoing how config works this stuff
+should be made less sucky
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000430-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000430-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/applications.rb, line 84</span>
+ 84:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load_config</span>
+ 85:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">configured</span>
+ 86: 
+ 87:       <span class="ruby-identifier">original_argv</span> = <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">clone</span>
+ 88:       <span class="ruby-identifier">original_extra_opts</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;MCOLLECTIVE_EXTRA_OPTS&quot;</span>].<span class="ruby-identifier">clone</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
+ 89:       <span class="ruby-identifier">configfile</span> = <span class="ruby-keyword kw">nil</span>
+ 90: 
+ 91:       <span class="ruby-identifier">parser</span> = <span class="ruby-constant">OptionParser</span>.<span class="ruby-identifier">new</span>
+ 92:       <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">&quot;--config CONFIG&quot;</span>, <span class="ruby-value str">&quot;-c&quot;</span>, <span class="ruby-value str">&quot;Config file&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
+ 93:         <span class="ruby-identifier">configfile</span> = <span class="ruby-identifier">f</span>
+ 94:       <span class="ruby-keyword kw">end</span>
+ 95: 
+ 96:       <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">program_name</span> = <span class="ruby-identifier">$0</span>
+ 97: 
+ 98:       <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">&quot;--help&quot;</span>)
+ 99: 
+100:       <span class="ruby-comment cmt"># avoid option parsers own internal version handling that sux</span>
+101:       <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">&quot;-v&quot;</span>, <span class="ruby-value str">&quot;--verbose&quot;</span>)
+102: 
+103:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">original_extra_opts</span>
+104:         <span class="ruby-keyword kw">begin</span>
+105:           <span class="ruby-comment cmt"># optparse will parse the whole ENV in one go and refuse</span>
+106:           <span class="ruby-comment cmt"># to play along with the retry trick I do below so in</span>
+107:           <span class="ruby-comment cmt"># order to handle unknown options properly I parse out</span>
+108:           <span class="ruby-comment cmt"># only -c and --config deleting everything else and</span>
+109:           <span class="ruby-comment cmt"># then restore the environment variable later when I</span>
+110:           <span class="ruby-comment cmt"># am done with it</span>
+111:           <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;MCOLLECTIVE_EXTRA_OPTS&quot;</span>] = <span class="ruby-identifier">filter_extra_options</span>(<span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;MCOLLECTIVE_EXTRA_OPTS&quot;</span>].<span class="ruby-identifier">clone</span>)
+112:           <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">environment</span>(<span class="ruby-value str">&quot;MCOLLECTIVE_EXTRA_OPTS&quot;</span>)
+113:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+114:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">&quot;Failed to parse MCOLLECTIVE_EXTRA_OPTS: #{e}&quot;</span>)
+115:         <span class="ruby-keyword kw">end</span>
+116: 
+117:         <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;MCOLLECTIVE_EXTRA_OPTS&quot;</span>] = <span class="ruby-identifier">original_extra_opts</span>.<span class="ruby-identifier">clone</span>
+118:       <span class="ruby-keyword kw">end</span>
+119: 
+120:       <span class="ruby-keyword kw">begin</span>
+121:         <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">parse!</span>
+122:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">OptionParser</span><span class="ruby-operator">::</span><span class="ruby-constant">InvalidOption</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+123:         <span class="ruby-keyword kw">retry</span>
+124:       <span class="ruby-keyword kw">end</span>
+125: 
+126:       <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">clear</span>
+127:       <span class="ruby-identifier">original_argv</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-constant">ARGV</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">a</span>}
+128: 
+129:       <span class="ruby-identifier">configfile</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">config_file_for_user</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">configfile</span>
+130: 
+131:       <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">loadconfig</span>(<span class="ruby-identifier">configfile</span>)
+132:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000426" class="method-detail">
+        <a name="M000426"></a>
+
+        <div class="method-heading">
+          <a href="#M000426" class="method-signature">
+          <span class="method-name">run</span><span class="method-args">(appname)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000426-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000426-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/applications.rb, line 8</span>
+ 8:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">run</span>(<span class="ruby-identifier">appname</span>)
+ 9:       <span class="ruby-identifier">load_config</span>
+10: 
+11:       <span class="ruby-keyword kw">begin</span>
+12:         <span class="ruby-identifier">load_application</span>(<span class="ruby-identifier">appname</span>)
+13:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+14:         <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:red</span>, <span class="ruby-value str">&quot;  &lt;----&quot;</span>)
+15:         <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Application '#{appname}' failed to load:&quot;</span>
+16:         <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span>
+17:         <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:red</span>, <span class="ruby-node">&quot;   #{e} (#{e.class})&quot;</span>)
+18:         <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span>
+19:         <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;       %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n       &quot;</span>)]
+20:         <span class="ruby-identifier">exit</span> <span class="ruby-value">1</span>
+21:       <span class="ruby-keyword kw">end</span>
+22: 
+23:       <span class="ruby-constant">PluginManager</span>[<span class="ruby-node">&quot;#{appname}_application&quot;</span>].<span class="ruby-identifier">run</span>
+24:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Cache.html b/doc/classes/MCollective/Cache.html
new file mode 100644 (file)
index 0000000..f3880fe
--- /dev/null
@@ -0,0 +1,438 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Module: MCollective::Cache</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Module</strong></td>
+          <td class="class-name-in-header">MCollective::Cache</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/cache_rb.html">
+                lib/mcollective/cache.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+A class to manage a number of named caches. Each cache can have a unique
+timeout for keys in it and each cache has an independent Mutex protecting
+access to it.
+</p>
+<p>
+This cache is <a href="Cache.html#M000272">setup</a> early in the process
+of loading the mcollective libraries, before any threads are created etc
+making it suitable as a cross thread cache or just a store for Mutexes you
+need to use across threads like in an <a href="Agent.html">Agent</a> or
+something.
+</p>
+<pre>
+   # sets up a new cache, noop if it already exist
+   Cache.setup(:ddl, 600)
+   =&gt; true
+
+   # writes an item to the :ddl cache, this item will
+   # be valid on the cache for 600 seconds
+   Cache.write(:ddl, :something, &quot;value&quot;)
+   =&gt; &quot;value&quot;
+
+   # reads from the cache, read failures due to non existing
+   # data or expired data will raise an exception
+   Cache.read(:ddl, :something)
+   =&gt; &quot;value&quot;
+
+   # time left till expiry, raises if nothing is found
+   Cache.ttl(:ddl, :something)
+   =&gt; 500
+
+   # forcibly evict something from the cache
+   Cache.invalidate!(:ddl, :something)
+   =&gt; &quot;value&quot;
+
+   # deletes an entire named cache and its mutexes
+   Cache.delete!(:ddl)
+   =&gt; true
+
+   # you can also just use this cache as a global mutex store
+   Cache.setup(:mylock)
+
+   Cache.synchronize(:mylock) do
+     do_something()
+   end
+</pre>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000273">check_cache!</a>&nbsp;&nbsp;
+      <a href="#M000275">delete!</a>&nbsp;&nbsp;
+      <a href="#M000274">has_cache?</a>&nbsp;&nbsp;
+      <a href="#M000280">invalidate!</a>&nbsp;&nbsp;
+      <a href="#M000277">read</a>&nbsp;&nbsp;
+      <a href="#M000272">setup</a>&nbsp;&nbsp;
+      <a href="#M000279">synchronize</a>&nbsp;&nbsp;
+      <a href="#M000278">ttl</a>&nbsp;&nbsp;
+      <a href="#M000276">write</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000273" class="method-detail">
+        <a name="M000273"></a>
+
+        <div class="method-heading">
+          <a href="#M000273" class="method-signature">
+          <span class="method-name">check_cache!</span><span class="method-args">(cache_name)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000273-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000273-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/cache.rb, line 70</span>
+70:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">check_cache!</span>(<span class="ruby-identifier">cache_name</span>)
+71:       <span class="ruby-identifier">raise_code</span>(<span class="ruby-identifier">:PLMC13</span>, <span class="ruby-value str">&quot;Could not find a cache called '%{cache_name}'&quot;</span>, <span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:cache_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">cache_name</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">has_cache?</span>(<span class="ruby-identifier">cache_name</span>)
+72:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000275" class="method-detail">
+        <a name="M000275"></a>
+
+        <div class="method-heading">
+          <a href="#M000275" class="method-signature">
+          <span class="method-name">delete!</span><span class="method-args">(cache_name)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000275-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000275-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/cache.rb, line 80</span>
+80:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">delete!</span>(<span class="ruby-identifier">cache_name</span>)
+81:       <span class="ruby-identifier">check_cache!</span>(<span class="ruby-identifier">cache_name</span>)
+82: 
+83:       <span class="ruby-ivar">@locks_mutex</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
+84:         <span class="ruby-ivar">@cache_locks</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">cache_name</span>)
+85:         <span class="ruby-ivar">@cache</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">cache_name</span>)
+86:       <span class="ruby-keyword kw">end</span>
+87: 
+88:       <span class="ruby-keyword kw">true</span>
+89:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000274" class="method-detail">
+        <a name="M000274"></a>
+
+        <div class="method-heading">
+          <a href="#M000274" class="method-signature">
+          <span class="method-name">has_cache?</span><span class="method-args">(cache_name)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000274-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000274-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/cache.rb, line 74</span>
+74:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">has_cache?</span>(<span class="ruby-identifier">cache_name</span>)
+75:       <span class="ruby-ivar">@locks_mutex</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
+76:         <span class="ruby-ivar">@cache</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">cache_name</span>)
+77:       <span class="ruby-keyword kw">end</span>
+78:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000280" class="method-detail">
+        <a name="M000280"></a>
+
+        <div class="method-heading">
+          <a href="#M000280" class="method-signature">
+          <span class="method-name">invalidate!</span><span class="method-args">(cache_name, key)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000280-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000280-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/cache.rb, line 139</span>
+139:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">invalidate!</span>(<span class="ruby-identifier">cache_name</span>, <span class="ruby-identifier">key</span>)
+140:       <span class="ruby-identifier">check_cache!</span>(<span class="ruby-identifier">cache_name</span>)
+141: 
+142:       <span class="ruby-ivar">@cache_locks</span>[<span class="ruby-identifier">cache_name</span>].<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
+143:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@cache</span>[<span class="ruby-identifier">cache_name</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>)
+144: 
+145:         <span class="ruby-ivar">@cache</span>[<span class="ruby-identifier">cache_name</span>].<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
+146:       <span class="ruby-keyword kw">end</span>
+147:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000277" class="method-detail">
+        <a name="M000277"></a>
+
+        <div class="method-heading">
+          <a href="#M000277" class="method-signature">
+          <span class="method-name">read</span><span class="method-args">(cache_name, key)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000277-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000277-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/cache.rb, line 103</span>
+103:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">cache_name</span>, <span class="ruby-identifier">key</span>)
+104:       <span class="ruby-identifier">check_cache!</span>(<span class="ruby-identifier">cache_name</span>)
+105: 
+106:       <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">ttl</span>(<span class="ruby-identifier">cache_name</span>, <span class="ruby-identifier">key</span>) <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
+107:         <span class="ruby-identifier">raise_code</span>(<span class="ruby-identifier">:PLMC11</span>, <span class="ruby-value str">&quot;Cache expired on '%{cache_name}' key '%{item}'&quot;</span>, <span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:cache_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">cache_name</span>, <span class="ruby-identifier">:item</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">key</span>)
+108:       <span class="ruby-keyword kw">end</span>
+109: 
+110:       <span class="ruby-identifier">log_code</span>(<span class="ruby-identifier">:PLMC12</span>, <span class="ruby-value str">&quot;Cache hit on '%{cache_name}' key '%{item}'&quot;</span>, <span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:cache_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">cache_name</span>, <span class="ruby-identifier">:item</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">key</span>)
+111: 
+112:       <span class="ruby-ivar">@cache_locks</span>[<span class="ruby-identifier">cache_name</span>].<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
+113:         <span class="ruby-ivar">@cache</span>[<span class="ruby-identifier">cache_name</span>][<span class="ruby-identifier">key</span>][<span class="ruby-identifier">:value</span>]
+114:       <span class="ruby-keyword kw">end</span>
+115:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000272" class="method-detail">
+        <a name="M000272"></a>
+
+        <div class="method-heading">
+          <a href="#M000272" class="method-signature">
+          <span class="method-name">setup</span><span class="method-args">(cache_name, ttl=300)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000272-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000272-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/cache.rb, line 56</span>
+56:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">setup</span>(<span class="ruby-identifier">cache_name</span>, <span class="ruby-identifier">ttl</span>=<span class="ruby-value">300</span>)
+57:       <span class="ruby-ivar">@locks_mutex</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
+58:         <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@cache_locks</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">cache_name</span>)
+59: 
+60:         <span class="ruby-ivar">@cache_locks</span>[<span class="ruby-identifier">cache_name</span>] = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
+61: 
+62:         <span class="ruby-ivar">@cache_locks</span>[<span class="ruby-identifier">cache_name</span>].<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
+63:           <span class="ruby-ivar">@cache</span>[<span class="ruby-identifier">cache_name</span>] = {<span class="ruby-identifier">:max_age</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Float</span>(<span class="ruby-identifier">ttl</span>)}
+64:         <span class="ruby-keyword kw">end</span>
+65:       <span class="ruby-keyword kw">end</span>
+66: 
+67:       <span class="ruby-keyword kw">true</span>
+68:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000279" class="method-detail">
+        <a name="M000279"></a>
+
+        <div class="method-heading">
+          <a href="#M000279" class="method-signature">
+          <span class="method-name">synchronize</span><span class="method-args">(cache_name) {|| ...}</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000279-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000279-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/cache.rb, line 129</span>
+129:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">synchronize</span>(<span class="ruby-identifier">cache_name</span>)
+130:       <span class="ruby-identifier">check_cache!</span>(<span class="ruby-identifier">cache_name</span>)
+131: 
+132:       <span class="ruby-identifier">raise_code</span>(<span class="ruby-identifier">:PLMC14</span>, <span class="ruby-value str">&quot;No block supplied to synchronize on cache '%{cache_name}'&quot;</span>, <span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:cache_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">cache_name</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block_given?</span>
+133: 
+134:       <span class="ruby-ivar">@cache_locks</span>[<span class="ruby-identifier">cache_name</span>].<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
+135:         <span class="ruby-keyword kw">yield</span>
+136:       <span class="ruby-keyword kw">end</span>
+137:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000278" class="method-detail">
+        <a name="M000278"></a>
+
+        <div class="method-heading">
+          <a href="#M000278" class="method-signature">
+          <span class="method-name">ttl</span><span class="method-args">(cache_name, key)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000278-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000278-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/cache.rb, line 117</span>
+117:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ttl</span>(<span class="ruby-identifier">cache_name</span>, <span class="ruby-identifier">key</span>)
+118:       <span class="ruby-identifier">check_cache!</span>(<span class="ruby-identifier">cache_name</span>)
+119: 
+120:       <span class="ruby-ivar">@cache_locks</span>[<span class="ruby-identifier">cache_name</span>].<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
+121:         <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@cache</span>[<span class="ruby-identifier">cache_name</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>)
+122:           <span class="ruby-identifier">raise_code</span>(<span class="ruby-identifier">:PLMC15</span>, <span class="ruby-value str">&quot;No item called '%{item}' for cache '%{cache_name}'&quot;</span>, <span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:cache_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">cache_name</span>, <span class="ruby-identifier">:item</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">key</span>)
+123:         <span class="ruby-keyword kw">end</span>
+124: 
+125:         <span class="ruby-ivar">@cache</span>[<span class="ruby-identifier">cache_name</span>][<span class="ruby-identifier">:max_age</span>] <span class="ruby-operator">-</span> (<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@cache</span>[<span class="ruby-identifier">cache_name</span>][<span class="ruby-identifier">key</span>][<span class="ruby-identifier">:cache_create_time</span>])
+126:       <span class="ruby-keyword kw">end</span>
+127:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000276" class="method-detail">
+        <a name="M000276"></a>
+
+        <div class="method-heading">
+          <a href="#M000276" class="method-signature">
+          <span class="method-name">write</span><span class="method-args">(cache_name, key, value)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000276-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000276-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/cache.rb, line 91</span>
+ 91:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">cache_name</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
+ 92:       <span class="ruby-identifier">check_cache!</span>(<span class="ruby-identifier">cache_name</span>)
+ 93: 
+ 94:       <span class="ruby-ivar">@cache_locks</span>[<span class="ruby-identifier">cache_name</span>].<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
+ 95:         <span class="ruby-ivar">@cache</span>[<span class="ruby-identifier">cache_name</span>][<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> {}
+ 96:         <span class="ruby-ivar">@cache</span>[<span class="ruby-identifier">cache_name</span>][<span class="ruby-identifier">key</span>][<span class="ruby-identifier">:cache_create_time</span>] = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
+ 97:         <span class="ruby-ivar">@cache</span>[<span class="ruby-identifier">cache_name</span>][<span class="ruby-identifier">key</span>][<span class="ruby-identifier">:value</span>] = <span class="ruby-identifier">value</span>
+ 98:       <span class="ruby-keyword kw">end</span>
+ 99: 
+100:       <span class="ruby-identifier">value</span>
+101:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Client.html b/doc/classes/MCollective/Client.html
new file mode 100644 (file)
index 0000000..14106d0
--- /dev/null
@@ -0,0 +1,797 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Client</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Client</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/client_rb.html">
+                lib/mcollective/client.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+Helpers for writing clients that can talk to agents, do discovery and so
+forth
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000457">collective</a>&nbsp;&nbsp;
+      <a href="#M000460">createreq</a>&nbsp;&nbsp;
+      <a href="#M000458">disconnect</a>&nbsp;&nbsp;
+      <a href="#M000464">discover</a>&nbsp;&nbsp;
+      <a href="#M000471">discovered_req</a>&nbsp;&nbsp;
+      <a href="#M000472">display_stats</a>&nbsp;&nbsp;
+      <a href="#M000456">new</a>&nbsp;&nbsp;
+      <a href="#M000463">receive</a>&nbsp;&nbsp;
+      <a href="#M000465">req</a>&nbsp;&nbsp;
+      <a href="#M000459">sendreq</a>&nbsp;&nbsp;
+      <a href="#M000468">start_publisher</a>&nbsp;&nbsp;
+      <a href="#M000469">start_receiver</a>&nbsp;&nbsp;
+      <a href="#M000461">subscribe</a>&nbsp;&nbsp;
+      <a href="#M000467">threaded_req</a>&nbsp;&nbsp;
+      <a href="#M000462">unsubscribe</a>&nbsp;&nbsp;
+      <a href="#M000466">unthreaded_req</a>&nbsp;&nbsp;
+      <a href="#M000470">update_stat</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">discoverer</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">options</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">stats</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000456" class="method-detail">
+        <a name="M000456"></a>
+
+        <div class="method-heading">
+          <a href="#M000456" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(configfile)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000456-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000456-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/client.rb, line 6</span>
+ 6:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">configfile</span>)
+ 7:       <span class="ruby-ivar">@config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>
+ 8:       <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">loadconfig</span>(<span class="ruby-identifier">configfile</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">configured</span>
+ 9: 
+10:       <span class="ruby-ivar">@connection</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;connector_plugin&quot;</span>]
+11:       <span class="ruby-ivar">@security</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;security_plugin&quot;</span>]
+12: 
+13:       <span class="ruby-ivar">@security</span>.<span class="ruby-identifier">initiated_by</span> = <span class="ruby-identifier">:client</span>
+14:       <span class="ruby-ivar">@options</span> = <span class="ruby-keyword kw">nil</span>
+15:       <span class="ruby-ivar">@subscriptions</span> = {}
+16: 
+17:       <span class="ruby-ivar">@discoverer</span> = <span class="ruby-constant">Discovery</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>)
+18:       <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">connect</span>
+19:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000457" class="method-detail">
+        <a name="M000457"></a>
+
+        <div class="method-heading">
+          <a href="#M000457" class="method-signature">
+          <span class="method-name">collective</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns the configured main <a href="Client.html#M000457">collective</a> if
+no specific <a href="Client.html#M000457">collective</a> is specified as
+options
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000457-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000457-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/client.rb, line 23</span>
+23:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">collective</span>
+24:       <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:collective</span>].<span class="ruby-identifier">nil?</span>
+25:         <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">main_collective</span>
+26:       <span class="ruby-keyword kw">else</span>
+27:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:collective</span>]
+28:       <span class="ruby-keyword kw">end</span>
+29:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000460" class="method-detail">
+        <a name="M000460"></a>
+
+        <div class="method-heading">
+          <a href="#M000460" class="method-signature">
+          <span class="method-name">createreq</span><span class="method-args">(msg, agent, filter ={})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000460-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000460-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/client.rb, line 48</span>
+48:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">createreq</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">agent</span>, <span class="ruby-identifier">filter</span> ={})
+49:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">msg</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Message</span>)
+50:         <span class="ruby-identifier">request</span> = <span class="ruby-identifier">msg</span>
+51:         <span class="ruby-identifier">agent</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">agent</span>
+52:       <span class="ruby-keyword kw">else</span>
+53:         <span class="ruby-identifier">ttl</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:ttl</span>] <span class="ruby-operator">||</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">ttl</span>
+54:         <span class="ruby-identifier">request</span> = <span class="ruby-constant">Message</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-keyword kw">nil</span>, {<span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">agent</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:request</span>, <span class="ruby-identifier">:collective</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">collective</span>, <span class="ruby-identifier">:filter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">filter</span>, <span class="ruby-identifier">:ttl</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">ttl</span>})
+55:         <span class="ruby-identifier">request</span>.<span class="ruby-identifier">reply_to</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:reply_to</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:reply_to</span>]
+56:       <span class="ruby-keyword kw">end</span>
+57: 
+58:       <span class="ruby-identifier">request</span>.<span class="ruby-identifier">encode!</span>
+59:       <span class="ruby-identifier">subscribe</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">:reply</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">reply_to</span>
+60:       <span class="ruby-identifier">request</span>
+61:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000458" class="method-detail">
+        <a name="M000458"></a>
+
+        <div class="method-heading">
+          <a href="#M000458" class="method-signature">
+          <span class="method-name">disconnect</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Disconnects cleanly from the middleware
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000458-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000458-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/client.rb, line 32</span>
+32:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">disconnect</span>
+33:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Disconnecting from the middleware&quot;</span>)
+34:       <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">disconnect</span>
+35:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000464" class="method-detail">
+        <a name="M000464"></a>
+
+        <div class="method-heading">
+          <a href="#M000464" class="method-signature">
+          <span class="method-name">discover</span><span class="method-args">(filter, timeout, limit=0)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Performs a discovery of nodes matching the filter passed returns an array
+of nodes
+</p>
+<p>
+An integer limit can be supplied this will have the effect of the discovery
+being cancelled soon as it reached the requested limit of hosts
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000464-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000464-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/client.rb, line 117</span>
+117:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discover</span>(<span class="ruby-identifier">filter</span>, <span class="ruby-identifier">timeout</span>, <span class="ruby-identifier">limit</span>=<span class="ruby-value">0</span>)
+118:       <span class="ruby-identifier">discovered</span> = <span class="ruby-ivar">@discoverer</span>.<span class="ruby-identifier">discover</span>(<span class="ruby-identifier">filter</span>, <span class="ruby-identifier">timeout</span>, <span class="ruby-identifier">limit</span>)
+119:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000471" class="method-detail">
+        <a name="M000471"></a>
+
+        <div class="method-heading">
+          <a href="#M000471" class="method-signature">
+          <span class="method-name">discovered_req</span><span class="method-args">(body, agent, options=false)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000471-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000471-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/client.rb, line 233</span>
+233:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discovered_req</span>(<span class="ruby-identifier">body</span>, <span class="ruby-identifier">agent</span>, <span class="ruby-identifier">options</span>=<span class="ruby-keyword kw">false</span>)
+234:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Client#discovered_req has been removed, please port your agent and client to the SimpleRPC framework&quot;</span>
+235:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000472" class="method-detail">
+        <a name="M000472"></a>
+
+        <div class="method-heading">
+          <a href="#M000472" class="method-signature">
+          <span class="method-name">display_stats</span><span class="method-args">(stats, options=false, caption=&quot;stomp call summary&quot;)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Prints out the stats returns from <a href="Client.html#M000465">req</a> and
+<a href="Client.html#M000471">discovered_req</a> in a nice way
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000472-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000472-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/client.rb, line 238</span>
+238:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">display_stats</span>(<span class="ruby-identifier">stats</span>, <span class="ruby-identifier">options</span>=<span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">caption</span>=<span class="ruby-value str">&quot;stomp call summary&quot;</span>)
+239:       <span class="ruby-identifier">options</span> = <span class="ruby-ivar">@options</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">options</span>
+240: 
+241:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:verbose</span>]
+242:         <span class="ruby-identifier">puts</span>(<span class="ruby-node">&quot;\n---- #{caption} ----&quot;</span>)
+243: 
+244:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:discovered</span>]
+245:           <span class="ruby-identifier">puts</span>(<span class="ruby-node">&quot;           Nodes: #{stats[:discovered]} / #{stats[:responses]}&quot;</span>)
+246:         <span class="ruby-keyword kw">else</span>
+247:           <span class="ruby-identifier">puts</span>(<span class="ruby-node">&quot;           Nodes: #{stats[:responses]}&quot;</span>)
+248:         <span class="ruby-keyword kw">end</span>
+249: 
+250:         <span class="ruby-identifier">printf</span>(<span class="ruby-value str">&quot;      Start Time: %s\n&quot;</span>, <span class="ruby-constant">Time</span>.<span class="ruby-identifier">at</span>(<span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:starttime</span>]))
+251:         <span class="ruby-identifier">printf</span>(<span class="ruby-value str">&quot;  Discovery Time: %.2fms\n&quot;</span>, <span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:discoverytime</span>] <span class="ruby-operator">*</span> <span class="ruby-value">1000</span>)
+252:         <span class="ruby-identifier">printf</span>(<span class="ruby-value str">&quot;      Agent Time: %.2fms\n&quot;</span>, <span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:blocktime</span>] <span class="ruby-operator">*</span> <span class="ruby-value">1000</span>)
+253:         <span class="ruby-identifier">printf</span>(<span class="ruby-value str">&quot;      Total Time: %.2fms\n&quot;</span>, <span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:totaltime</span>] <span class="ruby-operator">*</span> <span class="ruby-value">1000</span>)
+254: 
+255:       <span class="ruby-keyword kw">else</span>
+256:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:discovered</span>]
+257:           <span class="ruby-identifier">printf</span>(<span class="ruby-value str">&quot;\nFinished processing %d / %d hosts in %.2f ms\n\n&quot;</span>, <span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:responses</span>], <span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:discovered</span>], <span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:blocktime</span>] <span class="ruby-operator">*</span> <span class="ruby-value">1000</span>)
+258:         <span class="ruby-keyword kw">else</span>
+259:           <span class="ruby-identifier">printf</span>(<span class="ruby-value str">&quot;\nFinished processing %d hosts in %.2f ms\n\n&quot;</span>, <span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:responses</span>], <span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:blocktime</span>] <span class="ruby-operator">*</span> <span class="ruby-value">1000</span>)
+260:         <span class="ruby-keyword kw">end</span>
+261:       <span class="ruby-keyword kw">end</span>
+262: 
+263:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:noresponsefrom</span>].<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
+264:         <span class="ruby-identifier">puts</span>(<span class="ruby-value str">&quot;\nNo response from:\n&quot;</span>)
+265: 
+266:         <span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:noresponsefrom</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
+267:           <span class="ruby-identifier">puts</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">c</span> <span class="ruby-operator">%</span> <span class="ruby-value">4</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
+268:           <span class="ruby-identifier">printf</span>(<span class="ruby-value str">&quot;%30s&quot;</span>, <span class="ruby-identifier">c</span>)
+269:         <span class="ruby-keyword kw">end</span>
+270: 
+271:         <span class="ruby-identifier">puts</span>
+272:       <span class="ruby-keyword kw">end</span>
+273:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000463" class="method-detail">
+        <a name="M000463"></a>
+
+        <div class="method-heading">
+          <a href="#M000463" class="method-signature">
+          <span class="method-name">receive</span><span class="method-args">(requestid = nil)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Blocking call that waits for ever for a message to arrive.
+</p>
+<p>
+If you give it a requestid this means you&#8216;ve previously send a
+request with that ID and now you just want replies that matches that id, in
+that case the current connection will just ignore all messages not directed
+at it and keep waiting for more till it finds a matching message.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000463-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000463-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/client.rb, line 88</span>
+ 88:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">receive</span>(<span class="ruby-identifier">requestid</span> = <span class="ruby-keyword kw">nil</span>)
+ 89:       <span class="ruby-identifier">reply</span> = <span class="ruby-keyword kw">nil</span>
+ 90: 
+ 91:       <span class="ruby-keyword kw">begin</span>
+ 92:         <span class="ruby-identifier">reply</span> = <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">receive</span>
+ 93:         <span class="ruby-identifier">reply</span>.<span class="ruby-identifier">type</span> = <span class="ruby-identifier">:reply</span>
+ 94:         <span class="ruby-identifier">reply</span>.<span class="ruby-identifier">expected_msgid</span> = <span class="ruby-identifier">requestid</span>
+ 95: 
+ 96:         <span class="ruby-identifier">reply</span>.<span class="ruby-identifier">decode!</span>
+ 97:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">reply</span>.<span class="ruby-identifier">requestid</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">requestid</span>
+ 98:           <span class="ruby-identifier">raise</span>(<span class="ruby-constant">MsgDoesNotMatchRequestID</span>, <span class="ruby-node">&quot;Message reqid #{reply.requestid} does not match our reqid #{requestid}&quot;</span>)
+ 99:         <span class="ruby-keyword kw">end</span>
+100:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SecurityValidationFailed</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+101:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">warn</span>(<span class="ruby-value str">&quot;Ignoring a message that did not pass security validations&quot;</span>)
+102:         <span class="ruby-keyword kw">retry</span>
+103:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">MsgDoesNotMatchRequestID</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+104:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Ignoring a message for some other client : #{e.message}&quot;</span>)
+105:         <span class="ruby-keyword kw">retry</span>
+106:       <span class="ruby-keyword kw">end</span>
+107: 
+108:       <span class="ruby-identifier">reply</span>
+109:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000465" class="method-detail">
+        <a name="M000465"></a>
+
+        <div class="method-heading">
+          <a href="#M000465" class="method-signature">
+          <span class="method-name">req</span><span class="method-args">(body, agent=nil, options=false, waitfor=0, &amp;block)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Send a request, performs the passed block for each response
+</p>
+<p>
+times = <a href="Client.html#M000465">req</a>(&quot;status&quot;,
+&quot;mcollectived&quot;, options, client) {|resp|
+</p>
+<pre>
+  pp resp
+</pre>
+<p>
+}
+</p>
+<p>
+It returns a hash of times and timeouts for discovery and total run is
+taken from the options hash which in turn is generally built using <a
+href="Optionparser.html">MCollective::Optionparser</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000465-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000465-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/client.rb, line 129</span>
+129:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">req</span>(<span class="ruby-identifier">body</span>, <span class="ruby-identifier">agent</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">options</span>=<span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">waitfor</span>=<span class="ruby-value">0</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+130:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">body</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Message</span>)
+131:         <span class="ruby-identifier">agent</span> = <span class="ruby-identifier">body</span>.<span class="ruby-identifier">agent</span>
+132:         <span class="ruby-identifier">waitfor</span> = <span class="ruby-identifier">body</span>.<span class="ruby-identifier">discovered_hosts</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">||</span> <span class="ruby-value">0</span>
+133:         <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">body</span>.<span class="ruby-identifier">options</span>
+134:       <span class="ruby-keyword kw">end</span>
+135: 
+136:       <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>
+137:       <span class="ruby-identifier">threaded</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:threaded</span>]
+138:       <span class="ruby-identifier">timeout</span> = <span class="ruby-ivar">@discoverer</span>.<span class="ruby-identifier">discovery_timeout</span>(<span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:timeout</span>], <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:filter</span>])
+139:       <span class="ruby-identifier">request</span> = <span class="ruby-identifier">createreq</span>(<span class="ruby-identifier">body</span>, <span class="ruby-identifier">agent</span>, <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:filter</span>])
+140:       <span class="ruby-identifier">publish_timeout</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:publish_timeout</span>]
+141:       <span class="ruby-identifier">stat</span> = {<span class="ruby-identifier">:starttime</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_f</span>, <span class="ruby-identifier">:discoverytime</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>, <span class="ruby-identifier">:blocktime</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>, <span class="ruby-identifier">:totaltime</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>}
+142:       <span class="ruby-constant">STDOUT</span>.<span class="ruby-identifier">sync</span> = <span class="ruby-keyword kw">true</span>
+143:       <span class="ruby-identifier">hosts_responded</span> = <span class="ruby-value">0</span>
+144: 
+145: 
+146:       <span class="ruby-keyword kw">begin</span>
+147:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">threaded</span>
+148:           <span class="ruby-identifier">hosts_responded</span> = <span class="ruby-identifier">threaded_req</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">publish_timeout</span>, <span class="ruby-identifier">timeout</span>, <span class="ruby-identifier">waitfor</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+149:         <span class="ruby-keyword kw">else</span>
+150:           <span class="ruby-identifier">hosts_responded</span> = <span class="ruby-identifier">unthreaded_req</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">publish_timeout</span>, <span class="ruby-identifier">timeout</span>, <span class="ruby-identifier">waitfor</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+151:         <span class="ruby-keyword kw">end</span>
+152:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Interrupt</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+153:       <span class="ruby-keyword kw">ensure</span>
+154:         <span class="ruby-identifier">unsubscribe</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">:reply</span>)
+155:       <span class="ruby-keyword kw">end</span>
+156: 
+157:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">update_stat</span>(<span class="ruby-identifier">stat</span>, <span class="ruby-identifier">hosts_responded</span>, <span class="ruby-identifier">request</span>.<span class="ruby-identifier">requestid</span>)
+158:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000459" class="method-detail">
+        <a name="M000459"></a>
+
+        <div class="method-heading">
+          <a href="#M000459" class="method-signature">
+          <span class="method-name">sendreq</span><span class="method-args">(msg, agent, filter = {})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Sends a request and returns the generated request id, doesn&#8216;t wait
+for responses and doesn&#8216;t execute any passed in code blocks for
+responses
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000459-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000459-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/client.rb, line 39</span>
+39:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sendreq</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">agent</span>, <span class="ruby-identifier">filter</span> = {})
+40:       <span class="ruby-identifier">request</span> = <span class="ruby-identifier">createreq</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">agent</span>, <span class="ruby-identifier">filter</span>)
+41: 
+42:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Sending request #{request.requestid} to the #{request.agent} agent with ttl #{request.ttl} in collective #{request.collective}&quot;</span>)
+43: 
+44:       <span class="ruby-identifier">request</span>.<span class="ruby-identifier">publish</span>
+45:       <span class="ruby-identifier">request</span>.<span class="ruby-identifier">requestid</span>
+46:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000468" class="method-detail">
+        <a name="M000468"></a>
+
+        <div class="method-heading">
+          <a href="#M000468" class="method-signature">
+          <span class="method-name">start_publisher</span><span class="method-args">(request, publish_timeout)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Starts the request publishing routine
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000468-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000468-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/client.rb, line 191</span>
+191:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start_publisher</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">publish_timeout</span>)
+192:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Starting publishing with publish timeout of #{publish_timeout}&quot;</span>)
+193:       <span class="ruby-keyword kw">begin</span>
+194:         <span class="ruby-constant">Timeout</span>.<span class="ruby-identifier">timeout</span>(<span class="ruby-identifier">publish_timeout</span>) <span class="ruby-keyword kw">do</span>
+195:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Sending request #{request.requestid} to the #{request.agent} agent with ttl #{request.ttl} in collective #{request.collective}&quot;</span>)
+196:           <span class="ruby-identifier">request</span>.<span class="ruby-identifier">publish</span>
+197:         <span class="ruby-keyword kw">end</span>
+198:       <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">&gt;</span> <span class="ruby-identifier">e</span>
+199:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">warn</span>(<span class="ruby-value str">&quot;Could not publish all messages. Publishing timed out.&quot;</span>)
+200:       <span class="ruby-keyword kw">end</span>
+201:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000469" class="method-detail">
+        <a name="M000469"></a>
+
+        <div class="method-heading">
+          <a href="#M000469" class="method-signature">
+          <span class="method-name">start_receiver</span><span class="method-args">(requestid, waitfor, timeout) {|resp.payload| ...}</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Starts the response receiver routine Expected to return the amount of
+received responses.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000469-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000469-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/client.rb, line 205</span>
+205:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start_receiver</span>(<span class="ruby-identifier">requestid</span>, <span class="ruby-identifier">waitfor</span>, <span class="ruby-identifier">timeout</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+206:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Starting response receiver with timeout of #{timeout}&quot;</span>)
+207:       <span class="ruby-identifier">hosts_responded</span> = <span class="ruby-value">0</span>
+208:       <span class="ruby-keyword kw">begin</span>
+209:         <span class="ruby-constant">Timeout</span>.<span class="ruby-identifier">timeout</span>(<span class="ruby-identifier">timeout</span>) <span class="ruby-keyword kw">do</span>
+210:           <span class="ruby-keyword kw">begin</span>
+211:             <span class="ruby-identifier">resp</span> = <span class="ruby-identifier">receive</span>(<span class="ruby-identifier">requestid</span>)
+212:             <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">payload</span>
+213:             <span class="ruby-identifier">hosts_responded</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+214:           <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">while</span> (<span class="ruby-identifier">waitfor</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">hosts_responded</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">waitfor</span>)
+215:         <span class="ruby-keyword kw">end</span>
+216:       <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">&gt;</span> <span class="ruby-identifier">e</span>
+217:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">warn</span>(<span class="ruby-node">&quot;Could not receive all responses. Expected : #{waitfor}. Received : #{hosts_responded}&quot;</span>)
+218:       <span class="ruby-keyword kw">end</span>
+219: 
+220:       <span class="ruby-identifier">hosts_responded</span>
+221:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000461" class="method-detail">
+        <a name="M000461"></a>
+
+        <div class="method-heading">
+          <a href="#M000461" class="method-signature">
+          <span class="method-name">subscribe</span><span class="method-args">(agent, type)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000461-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000461-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/client.rb, line 63</span>
+63:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">subscribe</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">type</span>)
+64:       <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@subscriptions</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">agent</span>)
+65:         <span class="ruby-identifier">subscription</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">make_subscriptions</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">collective</span>)
+66:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Subscribing to #{type} target for agent #{agent}&quot;</span>)
+67: 
+68:         <span class="ruby-constant">Util</span>.<span class="ruby-identifier">subscribe</span>(<span class="ruby-identifier">subscription</span>)
+69:         <span class="ruby-ivar">@subscriptions</span>[<span class="ruby-identifier">agent</span>] = <span class="ruby-value">1</span>
+70:       <span class="ruby-keyword kw">end</span>
+71:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000467" class="method-detail">
+        <a name="M000467"></a>
+
+        <div class="method-heading">
+          <a href="#M000467" class="method-signature">
+          <span class="method-name">threaded_req</span><span class="method-args">(request, publish_timeout, timeout, waitfor, &amp;block)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Starts the client receiver and publisher in threads. This is activated when
+the &#8216;threader_client&#8217; configuration option is set.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000467-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000467-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/client.rb, line 170</span>
+170:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">threaded_req</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">publish_timeout</span>, <span class="ruby-identifier">timeout</span>, <span class="ruby-identifier">waitfor</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+171:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Starting threaded client&quot;</span>)
+172:       <span class="ruby-identifier">publisher</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
+173:         <span class="ruby-identifier">start_publisher</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">publish_timeout</span>)
+174:       <span class="ruby-keyword kw">end</span>
+175: 
+176:       <span class="ruby-comment cmt"># When the client is threaded we add the publishing timeout to</span>
+177:       <span class="ruby-comment cmt"># the agent timeout so that the receiver doesn't time out before</span>
+178:       <span class="ruby-comment cmt"># publishing has finished in cases where publish_timeout &gt;= timeout.</span>
+179:       <span class="ruby-identifier">total_timeout</span> = <span class="ruby-identifier">publish_timeout</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">timeout</span>
+180:       <span class="ruby-identifier">hosts_responded</span> = <span class="ruby-value">0</span>
+181: 
+182:       <span class="ruby-identifier">receiver</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
+183:         <span class="ruby-identifier">hosts_responded</span> = <span class="ruby-identifier">start_receiver</span>(<span class="ruby-identifier">request</span>.<span class="ruby-identifier">requestid</span>, <span class="ruby-identifier">waitfor</span>, <span class="ruby-identifier">total_timeout</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+184:       <span class="ruby-keyword kw">end</span>
+185: 
+186:       <span class="ruby-identifier">receiver</span>.<span class="ruby-identifier">join</span>
+187:       <span class="ruby-identifier">hosts_responded</span>
+188:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000462" class="method-detail">
+        <a name="M000462"></a>
+
+        <div class="method-heading">
+          <a href="#M000462" class="method-signature">
+          <span class="method-name">unsubscribe</span><span class="method-args">(agent, type)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000462-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000462-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/client.rb, line 73</span>
+73:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unsubscribe</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">type</span>)
+74:       <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@subscriptions</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">agent</span>)
+75:         <span class="ruby-identifier">subscription</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">make_subscriptions</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">collective</span>)
+76:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Unsubscribing #{type} target for #{agent}&quot;</span>)
+77: 
+78:         <span class="ruby-constant">Util</span>.<span class="ruby-identifier">unsubscribe</span>(<span class="ruby-identifier">subscription</span>)
+79:         <span class="ruby-ivar">@subscriptions</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">agent</span>)
+80:       <span class="ruby-keyword kw">end</span>
+81:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000466" class="method-detail">
+        <a name="M000466"></a>
+
+        <div class="method-heading">
+          <a href="#M000466" class="method-signature">
+          <span class="method-name">unthreaded_req</span><span class="method-args">(request, publish_timeout, timeout, waitfor, &amp;block)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Starts the client receiver and publisher unthreaded. This is the default
+client behaviour.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000466-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000466-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/client.rb, line 162</span>
+162:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unthreaded_req</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">publish_timeout</span>, <span class="ruby-identifier">timeout</span>, <span class="ruby-identifier">waitfor</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+163:       <span class="ruby-identifier">start_publisher</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">publish_timeout</span>)
+164:       <span class="ruby-identifier">start_receiver</span>(<span class="ruby-identifier">request</span>.<span class="ruby-identifier">requestid</span>, <span class="ruby-identifier">waitfor</span>, <span class="ruby-identifier">timeout</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+165:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000470" class="method-detail">
+        <a name="M000470"></a>
+
+        <div class="method-heading">
+          <a href="#M000470" class="method-signature">
+          <span class="method-name">update_stat</span><span class="method-args">(stat, hosts_responded, requestid)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000470-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000470-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/client.rb, line 223</span>
+223:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update_stat</span>(<span class="ruby-identifier">stat</span>, <span class="ruby-identifier">hosts_responded</span>, <span class="ruby-identifier">requestid</span>)
+224:       <span class="ruby-identifier">stat</span>[<span class="ruby-identifier">:totaltime</span>] = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">stat</span>[<span class="ruby-identifier">:starttime</span>]
+225:       <span class="ruby-identifier">stat</span>[<span class="ruby-identifier">:blocktime</span>] = <span class="ruby-identifier">stat</span>[<span class="ruby-identifier">:totaltime</span>] <span class="ruby-operator">-</span> <span class="ruby-identifier">stat</span>[<span class="ruby-identifier">:discoverytime</span>]
+226:       <span class="ruby-identifier">stat</span>[<span class="ruby-identifier">:responses</span>] = <span class="ruby-identifier">hosts_responded</span>
+227:       <span class="ruby-identifier">stat</span>[<span class="ruby-identifier">:noresponsefrom</span>] = []
+228:       <span class="ruby-identifier">stat</span>[<span class="ruby-identifier">:requestid</span>] = <span class="ruby-identifier">requestid</span>
+229: 
+230:       <span class="ruby-ivar">@stats</span> = <span class="ruby-identifier">stat</span>
+231:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/CodedError.html b/doc/classes/MCollective/CodedError.html
new file mode 100644 (file)
index 0000000..ef96da6
--- /dev/null
@@ -0,0 +1,232 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::CodedError</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::CodedError</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/exception_rb.html">
+                lib/mcollective/exception.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                RuntimeError
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000331">log</a>&nbsp;&nbsp;
+      <a href="#M000329">new</a>&nbsp;&nbsp;
+      <a href="#M000330">set_backtrace</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">args</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">code</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">default</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">log_level</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000329" class="method-detail">
+        <a name="M000329"></a>
+
+        <div class="method-heading">
+          <a href="#M000329" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(msgid, default, level=:debug, args={})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000329-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000329-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/exception.rb, line 5</span>
+ 5:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">default</span>, <span class="ruby-identifier">level</span>=<span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">args</span>={})
+ 6:       <span class="ruby-ivar">@code</span> = <span class="ruby-identifier">msgid</span>
+ 7:       <span class="ruby-ivar">@log_level</span> = <span class="ruby-identifier">level</span>
+ 8:       <span class="ruby-ivar">@args</span> = <span class="ruby-identifier">args</span>
+ 9:       <span class="ruby-ivar">@default</span> = <span class="ruby-identifier">default</span>
+10: 
+11:       <span class="ruby-identifier">msg</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">t</span>(<span class="ruby-ivar">@code</span>, {<span class="ruby-identifier">:default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">default</span>}.<span class="ruby-identifier">merge</span>(<span class="ruby-ivar">@args</span>))
+12: 
+13:       <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">msg</span>)
+14:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000331" class="method-detail">
+        <a name="M000331"></a>
+
+        <div class="method-heading">
+          <a href="#M000331" class="method-signature">
+          <span class="method-name">log</span><span class="method-args">(level, log_backtrace=false)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000331-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000331-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/exception.rb, line 21</span>
+21:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log</span>(<span class="ruby-identifier">level</span>, <span class="ruby-identifier">log_backtrace</span>=<span class="ruby-keyword kw">false</span>)
+22:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">logexception</span>(<span class="ruby-ivar">@code</span>, <span class="ruby-identifier">level</span>, <span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">log_backtrace</span>)
+23:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000330" class="method-detail">
+        <a name="M000330"></a>
+
+        <div class="method-heading">
+          <a href="#M000330" class="method-signature">
+          <span class="method-name">set_backtrace</span><span class="method-args">(trace)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000330-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000330-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/exception.rb, line 16</span>
+16:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_backtrace</span>(<span class="ruby-identifier">trace</span>)
+17:       <span class="ruby-keyword kw">super</span>
+18:       <span class="ruby-identifier">log</span>(<span class="ruby-ivar">@log_level</span>)
+19:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Config.html b/doc/classes/MCollective/Config.html
new file mode 100644 (file)
index 0000000..72df346
--- /dev/null
@@ -0,0 +1,612 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Config</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Config</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/config_rb.html">
+                lib/mcollective/config.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+A pretty sucky config class, ripe for refactoring/improving
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000493">loadconfig</a>&nbsp;&nbsp;
+      <a href="#M000492">new</a>&nbsp;&nbsp;
+      <a href="#M000495">read_plugin_config_dir</a>&nbsp;&nbsp;
+      <a href="#M000494">set_config_defaults</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+    <div id="includes">
+      <h3 class="section-bar">Included Modules</h3>
+
+      <div id="includes-list">
+        <span class="include-name">Singleton</span>
+      </div>
+    </div>
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">classesfile</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">collectives</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">color</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">configdir</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">configfile</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">configured</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">connector</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">daemonize</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">daemonize</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">default_discovery_method</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">default_discovery_options</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">direct_addressing</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">direct_addressing_threshold</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">fact_cache_time</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">factsource</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">identity</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">keeplogs</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">libdir</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">logfacility</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">logfile</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">logger_type</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">loglevel</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">main_collective</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">max_log_size</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">mode</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">pluginconf</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">publish_timeout</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">registerinterval</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">registration</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">registration_collective</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">rpcaudit</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">rpcauditprovider</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">rpcauthorization</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">rpcauthprovider</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">rpclimitmethod</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">securityprovider</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">ssl_cipher</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">threaded</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">ttl</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000492" class="method-detail">
+        <a name="M000492"></a>
+
+        <div class="method-heading">
+          <a href="#M000492" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000492-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000492-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/config.rb, line 20</span>
+20:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
+21:       <span class="ruby-ivar">@configured</span> = <span class="ruby-keyword kw">false</span>
+22:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000493" class="method-detail">
+        <a name="M000493"></a>
+
+        <div class="method-heading">
+          <a href="#M000493" class="method-signature">
+          <span class="method-name">loadconfig</span><span class="method-args">(configfile)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000493-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000493-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/config.rb, line 24</span>
+ 24:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">loadconfig</span>(<span class="ruby-identifier">configfile</span>)
+ 25:       <span class="ruby-identifier">set_config_defaults</span>(<span class="ruby-identifier">configfile</span>)
+ 26: 
+ 27:       <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">configfile</span>)
+ 28:         <span class="ruby-constant">File</span>.<span class="ruby-identifier">readlines</span>(<span class="ruby-identifier">configfile</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
+ 29: 
+ 30:           <span class="ruby-comment cmt"># strip blank spaces, tabs etc off the end of all lines</span>
+ 31:           <span class="ruby-identifier">line</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\s*$/</span>, <span class="ruby-value str">&quot;&quot;</span>)
+ 32: 
+ 33:           <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">line</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^#|^$/</span>
+ 34:             <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">line</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/(.+?)\s*=\s*(.+)/</span>)
+ 35:               <span class="ruby-identifier">key</span> = <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">strip</span>
+ 36:               <span class="ruby-identifier">val</span> = <span class="ruby-identifier">$2</span>
+ 37: 
+ 38:               <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">key</span>
+ 39:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;registration&quot;</span>
+ 40:                   <span class="ruby-ivar">@registration</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">capitalize</span>
+ 41:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;registration_collective&quot;</span>
+ 42:                   <span class="ruby-ivar">@registration_collective</span> = <span class="ruby-identifier">val</span>
+ 43:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;registerinterval&quot;</span>
+ 44:                   <span class="ruby-ivar">@registerinterval</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">to_i</span>
+ 45:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;collectives&quot;</span>
+ 46:                   <span class="ruby-ivar">@collectives</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;,&quot;</span>).<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">strip</span>}
+ 47:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;main_collective&quot;</span>
+ 48:                   <span class="ruby-ivar">@main_collective</span> = <span class="ruby-identifier">val</span>
+ 49:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;logfile&quot;</span>
+ 50:                   <span class="ruby-ivar">@logfile</span> = <span class="ruby-identifier">val</span>
+ 51:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;keeplogs&quot;</span>
+ 52:                   <span class="ruby-ivar">@keeplogs</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">to_i</span>
+ 53:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;max_log_size&quot;</span>
+ 54:                   <span class="ruby-ivar">@max_log_size</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">to_i</span>
+ 55:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;loglevel&quot;</span>
+ 56:                   <span class="ruby-ivar">@loglevel</span> = <span class="ruby-identifier">val</span>
+ 57:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;logfacility&quot;</span>
+ 58:                   <span class="ruby-ivar">@logfacility</span> = <span class="ruby-identifier">val</span>
+ 59:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;libdir&quot;</span>
+ 60:                   <span class="ruby-identifier">paths</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">split</span>(<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH_SEPARATOR</span>)
+ 61:                   <span class="ruby-identifier">paths</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span>
+ 62:                     <span class="ruby-identifier">raise</span>(<span class="ruby-value str">&quot;libdir paths should be absolute paths but '%s' is relative&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">path</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">absolute_path?</span>(<span class="ruby-identifier">path</span>)
+ 63: 
+ 64:                     <span class="ruby-ivar">@libdir</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">path</span>
+ 65:                     <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">$LOAD_PATH</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">path</span>)
+ 66:                       <span class="ruby-identifier">$LOAD_PATH</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">path</span>
+ 67:                     <span class="ruby-keyword kw">end</span>
+ 68:                   <span class="ruby-keyword kw">end</span>
+ 69:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;identity&quot;</span>
+ 70:                   <span class="ruby-ivar">@identity</span> = <span class="ruby-identifier">val</span>
+ 71:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;direct_addressing&quot;</span>
+ 72:                   <span class="ruby-ivar">@direct_addressing</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">str_to_bool</span>(<span class="ruby-identifier">val</span>)
+ 73:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;direct_addressing_threshold&quot;</span>
+ 74:                   <span class="ruby-ivar">@direct_addressing_threshold</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">to_i</span>
+ 75:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;color&quot;</span>
+ 76:                   <span class="ruby-ivar">@color</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">str_to_bool</span>(<span class="ruby-identifier">val</span>)
+ 77:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;daemonize&quot;</span>
+ 78:                   <span class="ruby-ivar">@daemonize</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">str_to_bool</span>(<span class="ruby-identifier">val</span>)
+ 79:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;securityprovider&quot;</span>
+ 80:                   <span class="ruby-ivar">@securityprovider</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">capitalize</span>
+ 81:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;factsource&quot;</span>
+ 82:                   <span class="ruby-ivar">@factsource</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">capitalize</span>
+ 83:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;connector&quot;</span>
+ 84:                   <span class="ruby-ivar">@connector</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">capitalize</span>
+ 85:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;classesfile&quot;</span>
+ 86:                   <span class="ruby-ivar">@classesfile</span> = <span class="ruby-identifier">val</span>
+ 87:                 <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/^plugin.(.+)$/</span>
+ 88:                   <span class="ruby-ivar">@pluginconf</span>[<span class="ruby-identifier">$1</span>] = <span class="ruby-identifier">val</span>
+ 89:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;publish_timeout&quot;</span>
+ 90:                   <span class="ruby-ivar">@publish_timeout</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">to_i</span>
+ 91:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;rpcaudit&quot;</span>
+ 92:                   <span class="ruby-ivar">@rpcaudit</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">str_to_bool</span>(<span class="ruby-identifier">val</span>)
+ 93:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;rpcauditprovider&quot;</span>
+ 94:                   <span class="ruby-ivar">@rpcauditprovider</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">capitalize</span>
+ 95:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;rpcauthorization&quot;</span>
+ 96:                   <span class="ruby-ivar">@rpcauthorization</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">str_to_bool</span>(<span class="ruby-identifier">val</span>)
+ 97:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;rpcauthprovider&quot;</span>
+ 98:                   <span class="ruby-ivar">@rpcauthprovider</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">capitalize</span>
+ 99:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;rpclimitmethod&quot;</span>
+100:                   <span class="ruby-ivar">@rpclimitmethod</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">to_sym</span>
+101:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;logger_type&quot;</span>
+102:                   <span class="ruby-ivar">@logger_type</span> = <span class="ruby-identifier">val</span>
+103:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;fact_cache_time&quot;</span>
+104:                   <span class="ruby-ivar">@fact_cache_time</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">to_i</span>
+105:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;ssl_cipher&quot;</span>
+106:                   <span class="ruby-ivar">@ssl_cipher</span> = <span class="ruby-identifier">val</span>
+107:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;threaded&quot;</span>
+108:                   <span class="ruby-ivar">@threaded</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">str_to_bool</span>(<span class="ruby-identifier">val</span>)
+109:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;ttl&quot;</span>
+110:                   <span class="ruby-ivar">@ttl</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">to_i</span>
+111:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;default_discovery_options&quot;</span>
+112:                   <span class="ruby-ivar">@default_discovery_options</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">val</span>
+113:                 <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;default_discovery_method&quot;</span>
+114:                   <span class="ruby-ivar">@default_discovery_method</span> = <span class="ruby-identifier">val</span>
+115:                 <span class="ruby-keyword kw">else</span>
+116:                   <span class="ruby-identifier">raise</span>(<span class="ruby-node">&quot;Unknown config parameter '#{key}'&quot;</span>)
+117:               <span class="ruby-keyword kw">end</span>
+118:             <span class="ruby-keyword kw">end</span>
+119:           <span class="ruby-keyword kw">end</span>
+120:         <span class="ruby-keyword kw">end</span>
+121: 
+122:         <span class="ruby-identifier">raise</span>(<span class="ruby-value str">'The %s config file does not specify a libdir setting, cannot continue'</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">configfile</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@libdir</span>.<span class="ruby-identifier">empty?</span>
+123: 
+124:         <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">load_path</span> = <span class="ruby-constant">Dir</span>[<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>), <span class="ruby-value str">&quot;locales&quot;</span>, <span class="ruby-value str">&quot;*.yml&quot;</span>))]
+125:         <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">locale</span> = <span class="ruby-identifier">:en</span>
+126: 
+127:         <span class="ruby-identifier">read_plugin_config_dir</span>(<span class="ruby-node">&quot;#{@configdir}/plugin.d&quot;</span>)
+128: 
+129:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">'Identities can only match /\w\.\-/'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@identity</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/^[\w\.\-]+$/</span>)
+130: 
+131:         <span class="ruby-ivar">@configured</span> = <span class="ruby-keyword kw">true</span>
+132: 
+133:         <span class="ruby-ivar">@libdir</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">dir</span><span class="ruby-operator">|</span> <span class="ruby-constant">Log</span>.<span class="ruby-identifier">warn</span>(<span class="ruby-node">&quot;Cannot find libdir: #{dir}&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">dir</span>)}
+134: 
+135:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@logger_type</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;syslog&quot;</span>
+136:           <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;The sylog logger is not usable on the Windows platform&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">windows?</span>
+137:         <span class="ruby-keyword kw">end</span>
+138: 
+139:         <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">loadclass</span>(<span class="ruby-node">&quot;Mcollective::Facts::#{@factsource}_facts&quot;</span>)
+140:         <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">loadclass</span>(<span class="ruby-node">&quot;Mcollective::Connector::#{@connector}&quot;</span>)
+141:         <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">loadclass</span>(<span class="ruby-node">&quot;Mcollective::Security::#{@securityprovider}&quot;</span>)
+142:         <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">loadclass</span>(<span class="ruby-node">&quot;Mcollective::Registration::#{@registration}&quot;</span>)
+143:         <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">loadclass</span>(<span class="ruby-node">&quot;Mcollective::Audit::#{@rpcauditprovider}&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@rpcaudit</span>
+144:         <span class="ruby-constant">PluginManager</span> <span class="ruby-operator">&lt;&lt;</span> {<span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;global_stats&quot;</span>, <span class="ruby-identifier">:class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">RunnerStats</span>.<span class="ruby-identifier">new</span>}
+145: 
+146:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">logmsg</span>(<span class="ruby-identifier">:PLMC1</span>, <span class="ruby-value str">&quot;The Marionette Collective version %{version} started by %{name} using config file %{config}&quot;</span>, <span class="ruby-identifier">:info</span>, <span class="ruby-identifier">:version</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">MCollective</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span>, <span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">$0</span>, <span class="ruby-identifier">:config</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">configfile</span>)
+147:       <span class="ruby-keyword kw">else</span>
+148:         <span class="ruby-identifier">raise</span>(<span class="ruby-node">&quot;Cannot find config file '#{configfile}'&quot;</span>)
+149:       <span class="ruby-keyword kw">end</span>
+150:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000495" class="method-detail">
+        <a name="M000495"></a>
+
+        <div class="method-heading">
+          <a href="#M000495" class="method-signature">
+          <span class="method-name">read_plugin_config_dir</span><span class="method-args">(dir)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000495-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000495-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/config.rb, line 192</span>
+192:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read_plugin_config_dir</span>(<span class="ruby-identifier">dir</span>)
+193:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">dir</span>)
+194: 
+195:       <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">dir</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">pluginconfigfile</span><span class="ruby-operator">|</span>
+196:         <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">pluginconfigfile</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^([\w]+).cfg$/</span>
+197: 
+198:         <span class="ruby-identifier">plugin</span> = <span class="ruby-identifier">$1</span>
+199:         <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-node">&quot;#{dir}/#{pluginconfigfile}&quot;</span>, <span class="ruby-value str">&quot;r&quot;</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
+200:           <span class="ruby-comment cmt"># strip blank lines</span>
+201:           <span class="ruby-identifier">line</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\s*$/</span>, <span class="ruby-value str">&quot;&quot;</span>)
+202:           <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">line</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^#|^$/</span>
+203:           <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">line</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/(.+?)\s*=\s*(.+)/</span>)
+204:             <span class="ruby-identifier">key</span> = <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">strip</span>
+205:             <span class="ruby-identifier">val</span> = <span class="ruby-identifier">$2</span>
+206:             <span class="ruby-ivar">@pluginconf</span>[<span class="ruby-node">&quot;#{plugin}.#{key}&quot;</span>] = <span class="ruby-identifier">val</span>
+207:           <span class="ruby-keyword kw">end</span>
+208:         <span class="ruby-keyword kw">end</span>
+209:       <span class="ruby-keyword kw">end</span>
+210:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000494" class="method-detail">
+        <a name="M000494"></a>
+
+        <div class="method-heading">
+          <a href="#M000494" class="method-signature">
+          <span class="method-name">set_config_defaults</span><span class="method-args">(configfile)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000494-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000494-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/config.rb, line 152</span>
+152:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_config_defaults</span>(<span class="ruby-identifier">configfile</span>)
+153:       <span class="ruby-ivar">@stomp</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
+154:       <span class="ruby-ivar">@subscribe</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
+155:       <span class="ruby-ivar">@pluginconf</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
+156:       <span class="ruby-ivar">@connector</span> = <span class="ruby-value str">&quot;activemq&quot;</span>
+157:       <span class="ruby-ivar">@securityprovider</span> = <span class="ruby-value str">&quot;Psk&quot;</span>
+158:       <span class="ruby-ivar">@factsource</span> = <span class="ruby-value str">&quot;Yaml&quot;</span>
+159:       <span class="ruby-ivar">@identity</span> = <span class="ruby-constant">Socket</span>.<span class="ruby-identifier">gethostname</span>
+160:       <span class="ruby-ivar">@registration</span> = <span class="ruby-value str">&quot;Agentlist&quot;</span>
+161:       <span class="ruby-ivar">@registerinterval</span> = <span class="ruby-value">0</span>
+162:       <span class="ruby-ivar">@registration_collective</span> = <span class="ruby-keyword kw">nil</span>
+163:       <span class="ruby-ivar">@classesfile</span> = <span class="ruby-value str">&quot;/var/lib/puppet/state/classes.txt&quot;</span>
+164:       <span class="ruby-ivar">@rpcaudit</span> = <span class="ruby-keyword kw">false</span>
+165:       <span class="ruby-ivar">@rpcauditprovider</span> = <span class="ruby-value str">&quot;&quot;</span>
+166:       <span class="ruby-ivar">@rpcauthorization</span> = <span class="ruby-keyword kw">false</span>
+167:       <span class="ruby-ivar">@rpcauthprovider</span> = <span class="ruby-value str">&quot;&quot;</span>
+168:       <span class="ruby-ivar">@configdir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">configfile</span>)
+169:       <span class="ruby-ivar">@color</span> = <span class="ruby-operator">!</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">windows?</span>
+170:       <span class="ruby-ivar">@configfile</span> = <span class="ruby-identifier">configfile</span>
+171:       <span class="ruby-ivar">@logger_type</span> = <span class="ruby-value str">&quot;file&quot;</span>
+172:       <span class="ruby-ivar">@keeplogs</span> = <span class="ruby-value">5</span>
+173:       <span class="ruby-ivar">@max_log_size</span> = <span class="ruby-value">2097152</span>
+174:       <span class="ruby-ivar">@rpclimitmethod</span> = <span class="ruby-identifier">:first</span>
+175:       <span class="ruby-ivar">@libdir</span> = <span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
+176:       <span class="ruby-ivar">@fact_cache_time</span> = <span class="ruby-value">300</span>
+177:       <span class="ruby-ivar">@loglevel</span> = <span class="ruby-value str">&quot;info&quot;</span>
+178:       <span class="ruby-ivar">@logfacility</span> = <span class="ruby-value str">&quot;user&quot;</span>
+179:       <span class="ruby-ivar">@collectives</span> = [<span class="ruby-value str">&quot;mcollective&quot;</span>]
+180:       <span class="ruby-ivar">@main_collective</span> = <span class="ruby-ivar">@collectives</span>.<span class="ruby-identifier">first</span>
+181:       <span class="ruby-ivar">@ssl_cipher</span> = <span class="ruby-value str">&quot;aes-256-cbc&quot;</span>
+182:       <span class="ruby-ivar">@direct_addressing</span> = <span class="ruby-keyword kw">true</span>
+183:       <span class="ruby-ivar">@direct_addressing_threshold</span> = <span class="ruby-value">10</span>
+184:       <span class="ruby-ivar">@default_discovery_method</span> = <span class="ruby-value str">&quot;mc&quot;</span>
+185:       <span class="ruby-ivar">@default_discovery_options</span> = []
+186:       <span class="ruby-ivar">@ttl</span> = <span class="ruby-value">60</span>
+187:       <span class="ruby-ivar">@mode</span> = <span class="ruby-identifier">:client</span>
+188:       <span class="ruby-ivar">@publish_timeout</span> = <span class="ruby-value">2</span>
+189:       <span class="ruby-ivar">@threaded</span> = <span class="ruby-keyword kw">false</span>
+190:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Connector.html b/doc/classes/MCollective/Connector.html
new file mode 100644 (file)
index 0000000..b644e9d
--- /dev/null
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Module: MCollective::Connector</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Module</strong></td>
+          <td class="class-name-in-header">MCollective::Connector</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/connector_rb.html">
+                lib/mcollective/connector.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/connector/base_rb.html">
+                lib/mcollective/connector/base.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+<a href="Connector.html">Connector</a> plugins handle the communications
+with the middleware, you can provide your own to speak to something other
+than Stomp, your plugins must inherit from <a
+href="Connector/Base.html">MCollective::Connector::Base</a> and should
+provide the following methods:
+</p>
+<p>
+connect - Creates a connection to the middleware, no arguments should get
+its parameters from the config receive - Receive data from the middleware,
+should act like a blocking call only returning if/when data
+</p>
+<pre>
+                was received.  It should get data from all subscribed channels/topics.  Individual messages
+                should be returned as MCollective::Request objects with the payload provided
+</pre>
+<p>
+publish - Takes a target and msg, should send the message to the supplied
+target topic or destination subscribe - Adds a subscription to a specific
+message source unsubscribe - Removes a subscription to a specific message
+source disconnect - Disconnects from the middleware
+</p>
+<p>
+These methods are all that&#8216;s needed for a new connector protocol and
+should hopefully be simple enough to not have tied us to Stomp.
+</p>
+
+    </div>
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+    <div id="class-list">
+      <h3 class="section-bar">Classes and Modules</h3>
+
+      Class <a href="Connector/Base.html" class="link">MCollective::Connector::Base</a><br />
+
+    </div>
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Connector/Base.html b/doc/classes/MCollective/Connector/Base.html
new file mode 100644 (file)
index 0000000..c29115f
--- /dev/null
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Connector::Base</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Connector::Base</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/connector/base_rb.html">
+                lib/mcollective/connector/base.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000328">inherited</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000328" class="method-detail">
+        <a name="M000328"></a>
+
+        <div class="method-heading">
+          <a href="#M000328" class="method-signature">
+          <span class="method-name">inherited</span><span class="method-args">(klass)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000328-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000328-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/connector/base.rb, line 19</span>
+19:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">inherited</span>(<span class="ruby-identifier">klass</span>)
+20:         <span class="ruby-constant">PluginManager</span> <span class="ruby-operator">&lt;&lt;</span> {<span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;connector_plugin&quot;</span>, <span class="ruby-identifier">:class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">to_s</span>}
+21:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/DDL.html b/doc/classes/MCollective/DDL.html
new file mode 100644 (file)
index 0000000..b8d36f6
--- /dev/null
@@ -0,0 +1,387 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Module: MCollective::DDL</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Module</strong></td>
+          <td class="class-name-in-header">MCollective::DDL</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/ddl/discoveryddl_rb.html">
+                lib/mcollective/ddl/discoveryddl.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/ddl/agentddl_rb.html">
+                lib/mcollective/ddl/agentddl.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/ddl/validatorddl_rb.html">
+                lib/mcollective/ddl/validatorddl.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/ddl/base_rb.html">
+                lib/mcollective/ddl/base.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/ddl/dataddl_rb.html">
+                lib/mcollective/ddl/dataddl.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/ddl_rb.html">
+                lib/mcollective/ddl.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+A set of classes that helps create data description language files for
+plugins. You can define meta data, actions, input and output describing the
+behavior of your agent or other plugins
+</p>
+<p>
+<a href="DDL.html">DDL</a> files are used for input validation,
+constructing outputs, producing online help, informing the various display
+routines and so forth.
+</p>
+<p>
+A sample <a href="DDL.html">DDL</a> for an agent be seen below, you&#8216;d
+put this in your agent dir as &lt;agent name&gt;.ddl
+</p>
+<pre>
+   metadata :name        =&gt; &quot;SimpleRPC Service Agent&quot;,
+            :description =&gt; &quot;Agent to manage services using the Puppet service provider&quot;,
+            :author      =&gt; &quot;R.I.Pienaar&quot;,
+            :license     =&gt; &quot;GPLv2&quot;,
+            :version     =&gt; &quot;1.1&quot;,
+            :url         =&gt; &quot;http://mcollective-plugins.googlecode.com/&quot;,
+            :timeout     =&gt; 60
+
+   action &quot;status&quot;, :description =&gt; &quot;Gets the status of a service&quot; do
+      display :always
+
+      input :service,
+            :prompt      =&gt; &quot;Service Name&quot;,
+            :description =&gt; &quot;The service to get the status for&quot;,
+            :type        =&gt; :string,
+            :validation  =&gt; '^[a-zA-Z\-_\d]+$',
+            :optional    =&gt; true,
+            :maxlength   =&gt; 30
+
+      output :status,
+             :description =&gt; &quot;The status of service&quot;,
+             :display_as  =&gt; &quot;Service Status&quot;
+  end
+</pre>
+<p>
+There are now many types of <a href="DDL.html">DDL</a> and ultimately all
+pugins should have <a href="DDL.html">DDL</a> files. The code is organized
+so that any plugin type will magically just work - they will be an instane
+of <a href="DDL/Base.html">Base</a> which has metadata and a few common
+cases.
+</p>
+<p>
+For plugin types that require more specific behaviors they can just add a
+class here that inherits from <a href="DDL/Base.html">Base</a> and add
+their specific behavior.
+</p>
+<p>
+<a href="DDL/Base.html">Base</a> defines a specific behavior for input,
+output and metadata which we&#8216;d like to keep standard across plugin
+types so do not completely override the behavior of input. The methods are
+written that they will gladly store extra content though so you add, do not
+remove. See the <a href="DDL/AgentDDL.html">AgentDDL</a> class for an
+example where agents want a :required argument to be always set.
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000156">load_and_cache</a>&nbsp;&nbsp;
+      <a href="#M000155">new</a>&nbsp;&nbsp;
+      <a href="#M000157">string_to_boolean</a>&nbsp;&nbsp;
+      <a href="#M000158">string_to_number</a>&nbsp;&nbsp;
+      <a href="#M000159">validation_fail!</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+    <div id="class-list">
+      <h3 class="section-bar">Classes and Modules</h3>
+
+      Class <a href="DDL/AgentDDL.html" class="link">MCollective::DDL::AgentDDL</a><br />
+Class <a href="DDL/Base.html" class="link">MCollective::DDL::Base</a><br />
+Class <a href="DDL/DataDDL.html" class="link">MCollective::DDL::DataDDL</a><br />
+Class <a href="DDL/DiscoveryDDL.html" class="link">MCollective::DDL::DiscoveryDDL</a><br />
+Class <a href="DDL/ValidatorDDL.html" class="link">MCollective::DDL::ValidatorDDL</a><br />
+
+    </div>
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000156" class="method-detail">
+        <a name="M000156"></a>
+
+        <div class="method-heading">
+          <a href="#M000156" class="method-signature">
+          <span class="method-name">load_and_cache</span><span class="method-args">(*args)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000156-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000156-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ddl.rb, line 71</span>
+71:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load_and_cache</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
+72:       <span class="ruby-constant">Cache</span>.<span class="ruby-identifier">setup</span>(<span class="ruby-identifier">:ddl</span>, <span class="ruby-value">300</span>)
+73: 
+74:       <span class="ruby-identifier">plugin</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span>
+75:       <span class="ruby-identifier">args</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">type</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">to_s</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">type</span> = <span class="ruby-value str">&quot;agent&quot;</span>
+76:       <span class="ruby-identifier">path</span> = <span class="ruby-value str">&quot;%s/%s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">type</span>, <span class="ruby-identifier">plugin</span>]
+77: 
+78:       <span class="ruby-keyword kw">begin</span>
+79:         <span class="ruby-identifier">ddl</span> = <span class="ruby-constant">Cache</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">:ddl</span>, <span class="ruby-identifier">path</span>)
+80:       <span class="ruby-keyword kw">rescue</span>
+81:         <span class="ruby-keyword kw">begin</span>
+82:           <span class="ruby-identifier">klass</span> = <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-value str">&quot;%sDDL&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">type</span>.<span class="ruby-identifier">capitalize</span>)
+83:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">NameError</span>
+84:           <span class="ruby-identifier">klass</span> = <span class="ruby-constant">Base</span>
+85:         <span class="ruby-keyword kw">end</span>
+86: 
+87:         <span class="ruby-identifier">ddl</span> = <span class="ruby-constant">Cache</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">:ddl</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>))
+88:       <span class="ruby-keyword kw">end</span>
+89: 
+90:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ddl</span>
+91:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000155" class="method-detail">
+        <a name="M000155"></a>
+
+        <div class="method-heading">
+          <a href="#M000155" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(*args, &amp;blk)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+There used to be only one big nasty <a href="DDL.html">DDL</a> class with a
+bunch of mashed together behaviors. It&#8216;s been around for ages and we
+would rather not ask all the users to change their <a
+href="DDL.html#M000155">DDL.new</a> calls to some other factory method that
+would have this exact same behavior.
+</p>
+<p>
+So we override the behavior of <a href="DDL.html#M000155">new</a> which is
+a hugely sucky thing to do but ultimately it&#8216;s what would be least
+disrupting to code out there today. We did though change <a
+href="DDL.html">DDL</a> to a module to make it possibly a little less
+suprising, possibly.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000155-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000155-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ddl.rb, line 67</span>
+67:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
+68:       <span class="ruby-identifier">load_and_cache</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
+69:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000157" class="method-detail">
+        <a name="M000157"></a>
+
+        <div class="method-heading">
+          <a href="#M000157" class="method-signature">
+          <span class="method-name">string_to_boolean</span><span class="method-args">(val)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+As we&#8216;re taking arguments on the command line we need a way to input
+booleans, true on the cli is a string so this method will take the ddl,
+find all arguments that are supposed to be boolean and if they are the
+strings &quot;true&quot;/&quot;yes&quot; or
+&quot;false&quot;/&quot;no&quot; turn them into the matching boolean
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000157-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000157-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ddl.rb, line 98</span>
+ 98:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">string_to_boolean</span>(<span class="ruby-identifier">val</span>)
+ 99:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> [<span class="ruby-value str">&quot;true&quot;</span>, <span class="ruby-value str">&quot;t&quot;</span>, <span class="ruby-value str">&quot;yes&quot;</span>, <span class="ruby-value str">&quot;y&quot;</span>, <span class="ruby-value str">&quot;1&quot;</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">val</span>.<span class="ruby-identifier">downcase</span>)
+100:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> [<span class="ruby-value str">&quot;false&quot;</span>, <span class="ruby-value str">&quot;f&quot;</span>, <span class="ruby-value str">&quot;no&quot;</span>, <span class="ruby-value str">&quot;n&quot;</span>, <span class="ruby-value str">&quot;0&quot;</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">val</span>.<span class="ruby-identifier">downcase</span>)
+101: 
+102:       <span class="ruby-identifier">raise_code</span>(<span class="ruby-identifier">:PLMC17</span>, <span class="ruby-value str">&quot;%{value} does not look like a boolean argument&quot;</span>, <span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">val</span>)
+103:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000158" class="method-detail">
+        <a name="M000158"></a>
+
+        <div class="method-heading">
+          <a href="#M000158" class="method-signature">
+          <span class="method-name">string_to_number</span><span class="method-args">(val)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+a generic string to number function, if a number looks like a float it
+turns it into a float else an int. This is naive but should be sufficient
+for numbers typed on the cli in most cases
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000158-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000158-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ddl.rb, line 108</span>
+108:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">string_to_number</span>(<span class="ruby-identifier">val</span>)
+109:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\d+\.\d+$/</span>
+110:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\d+$/</span>
+111: 
+112:       <span class="ruby-identifier">raise_code</span>(<span class="ruby-identifier">:PLMC16</span>, <span class="ruby-value str">&quot;%{value} does not look like a numeric value&quot;</span>, <span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">val</span>)
+113:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000159" class="method-detail">
+        <a name="M000159"></a>
+
+        <div class="method-heading">
+          <a href="#M000159" class="method-signature">
+          <span class="method-name">validation_fail!</span><span class="method-args">(code, default, level, args={})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Various <a href="DDL.html">DDL</a> implementations will validate and raise
+on error, this is a utility method to correctly setup a <a
+href="DDLValidationError.html">DDLValidationError</a> exceptions and raise
+them
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000159-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000159-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ddl.rb, line 117</span>
+117:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">validation_fail!</span>(<span class="ruby-identifier">code</span>, <span class="ruby-identifier">default</span>, <span class="ruby-identifier">level</span>, <span class="ruby-identifier">args</span>={})
+118:       <span class="ruby-identifier">exception</span> = <span class="ruby-constant">DDLValidationError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">code</span>, <span class="ruby-identifier">default</span>, <span class="ruby-identifier">level</span>, <span class="ruby-identifier">args</span>)
+119:       <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">set_backtrace</span> <span class="ruby-identifier">caller</span>
+120: 
+121:       <span class="ruby-identifier">raise</span> <span class="ruby-identifier">exception</span>
+122:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/DDL/AgentDDL.html b/doc/classes/MCollective/DDL/AgentDDL.html
new file mode 100644 (file)
index 0000000..f2bd1ef
--- /dev/null
@@ -0,0 +1,627 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::DDL::AgentDDL</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::DDL::AgentDDL</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/ddl/agentddl_rb.html">
+                lib/mcollective/ddl/agentddl.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                <a href="Base.html">
+                Base
+               </a>
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+A <a href="../DDL.html">DDL</a> class specific to agent plugins.
+</p>
+<p>
+A full <a href="../DDL.html">DDL</a> can be seen below with all the
+possible bells and whistles present.
+</p>
+<p>
+metadata :name =&gt; &quot;Utilities and Helpers for SimpleRPC <a
+href="../Agents.html">Agents</a>&quot;,
+</p>
+<pre>
+            :description =&gt; &quot;General helpful actions that expose stats and internals to SimpleRPC clients&quot;,
+            :author      =&gt; &quot;R.I.Pienaar &lt;rip@devco.net&gt;&quot;,
+            :license     =&gt; &quot;Apache License, Version 2.0&quot;,
+            :version     =&gt; &quot;1.0&quot;,
+            :url         =&gt; &quot;http://marionette-collective.org/&quot;,
+            :timeout     =&gt; 10
+</pre>
+<p>
+<a href="AgentDDL.html#M000183">action</a> &quot;get_fact&quot;,
+:description =&gt; &quot;Retrieve a single fact from the fact store&quot;
+do
+</p>
+<pre>
+     display :always
+
+     input :fact,
+           :prompt      =&gt; &quot;The name of the fact&quot;,
+           :description =&gt; &quot;The fact to retrieve&quot;,
+           :type        =&gt; :string,
+           :validation  =&gt; '^[\w\-\.]+$',
+           :optional    =&gt; false,
+           :maxlength   =&gt; 40,
+           :default     =&gt; &quot;fqdn&quot;
+
+     output :fact,
+            :description =&gt; &quot;The name of the fact being returned&quot;,
+            :display_as  =&gt; &quot;Fact&quot;
+
+     output :value,
+            :description =&gt; &quot;The value of the fact&quot;,
+            :display_as  =&gt; &quot;Value&quot;,
+            :default     =&gt; &quot;&quot;
+
+    summarize do
+        aggregate summary(:value)
+    end
+</pre>
+<p>
+end
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000183">action</a>&nbsp;&nbsp;
+      <a href="#M000188">action_interface</a>&nbsp;&nbsp;
+      <a href="#M000189">actions</a>&nbsp;&nbsp;
+      <a href="#M000181">aggregate</a>&nbsp;&nbsp;
+      <a href="#M000182">display</a>&nbsp;&nbsp;
+      <a href="#M000179">input</a>&nbsp;&nbsp;
+      <a href="#M000185">is_function?</a>&nbsp;&nbsp;
+      <a href="#M000184">method_missing</a>&nbsp;&nbsp;
+      <a href="#M000178">new</a>&nbsp;&nbsp;
+      <a href="#M000186">set_default_input_arguments</a>&nbsp;&nbsp;
+      <a href="#M000180">summarize</a>&nbsp;&nbsp;
+      <a href="#M000187">validate_rpc_request</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000178" class="method-detail">
+        <a name="M000178"></a>
+
+        <div class="method-heading">
+          <a href="#M000178" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(plugin, plugintype=:agent, loadddl=true)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000178-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000178-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ddl/agentddl.rb, line 41</span>
+41:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">plugin</span>, <span class="ruby-identifier">plugintype</span>=<span class="ruby-identifier">:agent</span>, <span class="ruby-identifier">loadddl</span>=<span class="ruby-keyword kw">true</span>)
+42:         <span class="ruby-ivar">@process_aggregate_functions</span> = <span class="ruby-keyword kw">nil</span>
+43: 
+44:         <span class="ruby-keyword kw">super</span>
+45:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000183" class="method-detail">
+        <a name="M000183"></a>
+
+        <div class="method-heading">
+          <a href="#M000183" class="method-signature">
+          <span class="method-name">action</span><span class="method-args">(name, input, &amp;block)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Creates the definition for an <a href="AgentDDL.html#M000183">action</a>,
+you can nest <a href="AgentDDL.html#M000179">input</a> definitions inside
+the <a href="AgentDDL.html#M000183">action</a> to attach inputs and
+validation to the <a href="AgentDDL.html#M000189">actions</a>
+</p>
+<pre>
+   action &quot;status&quot;, :description =&gt; &quot;Restarts a Service&quot; do
+      display :always
+
+      input  &quot;service&quot;,
+             :prompt      =&gt; &quot;Service Action&quot;,
+             :description =&gt; &quot;The action to perform&quot;,
+             :type        =&gt; :list,
+             :optional    =&gt; true,
+             :list        =&gt; [&quot;start&quot;, &quot;stop&quot;, &quot;restart&quot;, &quot;status&quot;]
+
+      output &quot;status&quot;,
+             :description =&gt; &quot;The status of the service after the action&quot;
+
+   end
+</pre>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000183-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000183-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ddl/agentddl.rb, line 112</span>
+112:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">action</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">input</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+113:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Action needs a :description property&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">input</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:description</span>)
+114: 
+115:         <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@entities</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">name</span>)
+116:           <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">name</span>] = {}
+117:           <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">name</span>][<span class="ruby-identifier">:action</span>] = <span class="ruby-identifier">name</span>
+118:           <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">name</span>][<span class="ruby-identifier">:input</span>] = {}
+119:           <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">name</span>][<span class="ruby-identifier">:output</span>] = {}
+120:           <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">name</span>][<span class="ruby-identifier">:display</span>] = <span class="ruby-identifier">:failed</span>
+121:           <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">name</span>][<span class="ruby-identifier">:description</span>] = <span class="ruby-identifier">input</span>[<span class="ruby-identifier">:description</span>]
+122:         <span class="ruby-keyword kw">end</span>
+123: 
+124:         <span class="ruby-comment cmt"># if a block is passed it might be creating input methods, call it</span>
+125:         <span class="ruby-comment cmt"># we set @current_entity so the input block can know what its talking</span>
+126:         <span class="ruby-comment cmt"># to, this is probably an epic hack, need to improve.</span>
+127:         <span class="ruby-ivar">@current_entity</span> = <span class="ruby-identifier">name</span>
+128:         <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
+129:         <span class="ruby-ivar">@current_entity</span> = <span class="ruby-keyword kw">nil</span>
+130:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000188" class="method-detail">
+        <a name="M000188"></a>
+
+        <div class="method-heading">
+          <a href="#M000188" class="method-signature">
+          <span class="method-name">action_interface</span><span class="method-args">(name)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns the interface for a specific <a
+href="AgentDDL.html#M000183">action</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000188-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000188-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ddl/agentddl.rb, line 198</span>
+198:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">action_interface</span>(<span class="ruby-identifier">name</span>)
+199:         <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">name</span>] <span class="ruby-operator">||</span> {}
+200:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000189" class="method-detail">
+        <a name="M000189"></a>
+
+        <div class="method-heading">
+          <a href="#M000189" class="method-signature">
+          <span class="method-name">actions</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns an array of <a href="AgentDDL.html#M000189">actions</a> this agent
+support
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000189-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000189-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ddl/agentddl.rb, line 203</span>
+203:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">actions</span>
+204:         <span class="ruby-ivar">@entities</span>.<span class="ruby-identifier">keys</span>
+205:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000181" class="method-detail">
+        <a name="M000181"></a>
+
+        <div class="method-heading">
+          <a href="#M000181" class="method-signature">
+          <span class="method-name">aggregate</span><span class="method-args">(function, format = {:format =&gt; nil})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Sets the <a href="AgentDDL.html#M000181">aggregate</a> array for the given
+<a href="AgentDDL.html#M000183">action</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000181-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000181-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ddl/agentddl.rb, line 70</span>
+70:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">aggregate</span>(<span class="ruby-identifier">function</span>, <span class="ruby-identifier">format</span> = {<span class="ruby-identifier">:format</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>})
+71:         <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">validation_fail!</span>(<span class="ruby-identifier">:PLMC28</span>, <span class="ruby-value str">&quot;Formats supplied to aggregation functions should be a hash&quot;</span>, <span class="ruby-identifier">:error</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">format</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
+72:         <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">validation_fail!</span>(<span class="ruby-identifier">:PLMC27</span>, <span class="ruby-value str">&quot;Formats supplied to aggregation functions must have a :format key&quot;</span>, <span class="ruby-identifier">:error</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">format</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:format</span>)
+73:         <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">validation_fail!</span>(<span class="ruby-identifier">:PLMC26</span>, <span class="ruby-value str">&quot;Functions supplied to aggregate should be a hash&quot;</span>, <span class="ruby-identifier">:error</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">function</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
+74: 
+75:         <span class="ruby-keyword kw">unless</span> (<span class="ruby-identifier">function</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:args</span>)) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">function</span>[<span class="ruby-identifier">:args</span>]
+76:           <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">validation_fail!</span>(<span class="ruby-identifier">:PLMC25</span>, <span class="ruby-value str">&quot;aggregate method for action '%{action}' missing a function parameter&quot;</span>, <span class="ruby-identifier">:error</span>, <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">entities</span>[<span class="ruby-ivar">@current_entity</span>][<span class="ruby-identifier">:action</span>])
+77:         <span class="ruby-keyword kw">end</span>
+78: 
+79:         <span class="ruby-identifier">entities</span>[<span class="ruby-ivar">@current_entity</span>][<span class="ruby-identifier">:aggregate</span>] <span class="ruby-operator">||=</span> []
+80:         <span class="ruby-identifier">entities</span>[<span class="ruby-ivar">@current_entity</span>][<span class="ruby-identifier">:aggregate</span>] <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">format</span>[<span class="ruby-identifier">:format</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-value">? </span><span class="ruby-identifier">function</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">function</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">format</span>))
+81:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000182" class="method-detail">
+        <a name="M000182"></a>
+
+        <div class="method-heading">
+          <a href="#M000182" class="method-signature">
+          <span class="method-name">display</span><span class="method-args">(pref)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Sets the <a href="AgentDDL.html#M000182">display</a> preference to either
+:ok, :failed, :flatten or :always operates on <a
+href="AgentDDL.html#M000183">action</a> level
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000182-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000182-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ddl/agentddl.rb, line 85</span>
+85:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">display</span>(<span class="ruby-identifier">pref</span>)
+86:         <span class="ruby-comment cmt"># defaults to old behavior, complain if its supplied and invalid</span>
+87:         <span class="ruby-keyword kw">unless</span> [<span class="ruby-identifier">:ok</span>, <span class="ruby-identifier">:failed</span>, <span class="ruby-identifier">:flatten</span>, <span class="ruby-identifier">:always</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">pref</span>)
+88:           <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Display preference #{pref} is not valid, should be :ok, :failed, :flatten or :always&quot;</span>
+89:         <span class="ruby-keyword kw">end</span>
+90: 
+91:         <span class="ruby-identifier">action</span> = <span class="ruby-ivar">@current_entity</span>
+92:         <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">action</span>][<span class="ruby-identifier">:display</span>] = <span class="ruby-identifier">pref</span>
+93:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000179" class="method-detail">
+        <a name="M000179"></a>
+
+        <div class="method-heading">
+          <a href="#M000179" class="method-signature">
+          <span class="method-name">input</span><span class="method-args">(argument, properties)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000179-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000179-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ddl/agentddl.rb, line 47</span>
+47:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">input</span>(<span class="ruby-identifier">argument</span>, <span class="ruby-identifier">properties</span>)
+48:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Input needs a :optional property&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">properties</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:optional</span>)
+49: 
+50:         <span class="ruby-keyword kw">super</span>
+51:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000185" class="method-detail">
+        <a name="M000185"></a>
+
+        <div class="method-heading">
+          <a href="#M000185" class="method-signature">
+          <span class="method-name">is_function?</span><span class="method-args">(method_name)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Checks if a method name matches a <a
+href="AgentDDL.html#M000181">aggregate</a> plugin. This is used by method
+missing so that we dont greedily assume that every <a
+href="AgentDDL.html#M000184">method_missing</a> call in an agent ddl has
+hit a <a href="AgentDDL.html#M000181">aggregate</a> function.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000185-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000185-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ddl/agentddl.rb, line 146</span>
+146:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">is_function?</span>(<span class="ruby-identifier">method_name</span>)
+147:         <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">find</span>(<span class="ruby-value str">&quot;aggregate&quot;</span>).<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">method_name</span>.<span class="ruby-identifier">to_s</span>)
+148:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000184" class="method-detail">
+        <a name="M000184"></a>
+
+        <div class="method-heading">
+          <a href="#M000184" class="method-signature">
+          <span class="method-name">method_missing</span><span class="method-args">(name, *args, &amp;block)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+If the method name matches a # <a
+href="AgentDDL.html#M000181">aggregate</a> function, we return the function
+with args as a hash. This will only be active if the
+@process_aggregate_functions is set to true which only happens in the <a
+href="AgentDDL.html#M000180">summarize</a> block
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000184-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000184-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ddl/agentddl.rb, line 135</span>
+135:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+136:         <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@process_aggregate_functions</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">is_function?</span>(<span class="ruby-identifier">name</span>)
+137:           <span class="ruby-identifier">raise</span> <span class="ruby-constant">NoMethodError</span>, <span class="ruby-node">&quot;undefined local variable or method `#{name}'&quot;</span>, <span class="ruby-identifier">caller</span>
+138:         <span class="ruby-keyword kw">end</span>
+139: 
+140:         <span class="ruby-keyword kw">return</span> {<span class="ruby-identifier">:function</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">:args</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">args</span>}
+141:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000186" class="method-detail">
+        <a name="M000186"></a>
+
+        <div class="method-heading">
+          <a href="#M000186" class="method-signature">
+          <span class="method-name">set_default_input_arguments</span><span class="method-args">(action, arguments)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+For a given <a href="AgentDDL.html#M000183">action</a> and arguments look
+up the <a href="../DDL.html">DDL</a> interface to that <a
+href="AgentDDL.html#M000183">action</a> and if any arguments in the <a
+href="../DDL.html">DDL</a> have a :default value assign that to any <a
+href="AgentDDL.html#M000179">input</a> that does not have an argument in
+the <a href="AgentDDL.html#M000179">input</a> arguments
+</p>
+<p>
+This is intended to only be called on clients and not on servers as the
+clients should never be able to publish non compliant requests and the
+servers should really not tamper with incoming requests since doing so
+might raise validation errors that were not raised on the client breaking
+our fail-fast approach to <a href="AgentDDL.html#M000179">input</a>
+validation
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000186-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000186-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ddl/agentddl.rb, line 159</span>
+159:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_default_input_arguments</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">arguments</span>)
+160:         <span class="ruby-identifier">input</span> = <span class="ruby-identifier">action_interface</span>(<span class="ruby-identifier">action</span>)[<span class="ruby-identifier">:input</span>]
+161: 
+162:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">input</span>
+163: 
+164:         <span class="ruby-identifier">input</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
+165:           <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">arguments</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">input</span>[<span class="ruby-identifier">key</span>][<span class="ruby-identifier">:default</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">input</span>[<span class="ruby-identifier">key</span>][<span class="ruby-identifier">:optional</span>]
+166:             <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Setting default value for input '%s' to '%s'&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">key</span>, <span class="ruby-identifier">input</span>[<span class="ruby-identifier">key</span>][<span class="ruby-identifier">:default</span>]])
+167:             <span class="ruby-identifier">arguments</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">input</span>[<span class="ruby-identifier">key</span>][<span class="ruby-identifier">:default</span>]
+168:           <span class="ruby-keyword kw">end</span>
+169:         <span class="ruby-keyword kw">end</span>
+170:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000180" class="method-detail">
+        <a name="M000180"></a>
+
+        <div class="method-heading">
+          <a href="#M000180" class="method-signature">
+          <span class="method-name">summarize</span><span class="method-args">(&amp;block)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Calls the <a href="AgentDDL.html#M000180">summarize</a> block defined in
+the ddl. Block will not be called if the ddl is getting processed on the
+server side. This means that <a href="AgentDDL.html#M000181">aggregate</a>
+plugins only have to be present on the client side.
+</p>
+<p>
+The @process_aggregate_functions variable is used by the <a
+href="AgentDDL.html#M000184">method_missing</a> block to determine if it
+should kick in, this way we very tightly control where we activate the <a
+href="AgentDDL.html#M000184">method_missing</a> behavior turning it into a
+noop otherwise to maximise the chance of providing good user feedback
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000180-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000180-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ddl/agentddl.rb, line 61</span>
+61:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">summarize</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+62:         <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">mode</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:server</span>
+63:           <span class="ruby-ivar">@process_aggregate_functions</span> = <span class="ruby-keyword kw">true</span>
+64:           <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>
+65:           <span class="ruby-ivar">@process_aggregate_functions</span> = <span class="ruby-keyword kw">nil</span>
+66:         <span class="ruby-keyword kw">end</span>
+67:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000187" class="method-detail">
+        <a name="M000187"></a>
+
+        <div class="method-heading">
+          <a href="#M000187" class="method-signature">
+          <span class="method-name">validate_rpc_request</span><span class="method-args">(action, arguments)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Helper to use the <a href="../DDL.html">DDL</a> to figure out if the remote
+call to an agent should be allowed based on <a
+href="AgentDDL.html#M000183">action</a> name and inputs.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000187-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000187-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ddl/agentddl.rb, line 174</span>
+174:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_rpc_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">arguments</span>)
+175:         <span class="ruby-comment cmt"># is the action known?</span>
+176:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">actions</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">action</span>)
+177:           <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">validation_fail!</span>(<span class="ruby-identifier">:PLMC29</span>, <span class="ruby-value str">&quot;Attempted to call action %{action} for %{plugin} but it's not declared in the DDL&quot;</span>, <span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">action</span>, <span class="ruby-identifier">:plugin</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@pluginname</span>)
+178:         <span class="ruby-keyword kw">end</span>
+179: 
+180:         <span class="ruby-identifier">input</span> = <span class="ruby-identifier">action_interface</span>(<span class="ruby-identifier">action</span>)[<span class="ruby-identifier">:input</span>] <span class="ruby-operator">||</span> {}
+181: 
+182:         <span class="ruby-identifier">input</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
+183:           <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">input</span>[<span class="ruby-identifier">key</span>][<span class="ruby-identifier">:optional</span>]
+184:             <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">arguments</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>)
+185:               <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">validation_fail!</span>(<span class="ruby-identifier">:PLMC30</span>, <span class="ruby-value str">&quot;Action '%{action}' needs a '%{key}' argument&quot;</span>, <span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">action</span>, <span class="ruby-identifier">:key</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">key</span>)
+186:             <span class="ruby-keyword kw">end</span>
+187:           <span class="ruby-keyword kw">end</span>
+188: 
+189:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">arguments</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>)
+190:             <span class="ruby-identifier">validate_input_argument</span>(<span class="ruby-identifier">input</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">arguments</span>[<span class="ruby-identifier">key</span>])
+191:           <span class="ruby-keyword kw">end</span>
+192:         <span class="ruby-keyword kw">end</span>
+193: 
+194:         <span class="ruby-keyword kw">true</span>
+195:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/DDL/Base.html b/doc/classes/MCollective/DDL/Base.html
new file mode 100644 (file)
index 0000000..0ffb57d
--- /dev/null
@@ -0,0 +1,649 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::DDL::Base</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::DDL::Base</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/ddl/base_rb.html">
+                lib/mcollective/ddl/base.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+The base class for all kinds of <a href="../DDL.html">DDL</a> files. <a
+href="../DDL.html">DDL</a> files when run gets parsed and builds up a hash
+of the basic primitive types, ideally restricted so it can be converted to
+JSON though today there are some Ruby Symbols in them which might be fixed
+laster on.
+</p>
+<p>
+The Hash being built should be stored in @entities, the format is generally
+not prescribed but there&#8216;s a definite feel to how <a
+href="../DDL.html">DDL</a> files look so study the agent and discovery ones
+to see how the structure applies to very different use cases.
+</p>
+<p>
+For every plugin type you should have a single word name - that corresponds
+to the directory in the libdir where these plugins live. If you need
+anything above and beyond &#8216;<a
+href="Base.html#M000177">metadata</a>&#8217; in your plugin <a
+href="../DDL.html">DDL</a> then add a PlugintypeDDL class here and add your
+specific behaviors to those.
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000171">findddlfile</a>&nbsp;&nbsp;
+      <a href="#M000167">help</a>&nbsp;&nbsp;
+      <a href="#M000174">input</a>&nbsp;&nbsp;
+      <a href="#M000170">loadddlfile</a>&nbsp;&nbsp;
+      <a href="#M000177">metadata</a>&nbsp;&nbsp;
+      <a href="#M000166">new</a>&nbsp;&nbsp;
+      <a href="#M000175">output</a>&nbsp;&nbsp;
+      <a href="#M000176">requires</a>&nbsp;&nbsp;
+      <a href="#M000169">template_for_plugintype</a>&nbsp;&nbsp;
+      <a href="#M000168">usage</a>&nbsp;&nbsp;
+      <a href="#M000173">validate_input_argument</a>&nbsp;&nbsp;
+      <a href="#M000172">validate_requirements</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+    <div id="includes">
+      <h3 class="section-bar">Included Modules</h3>
+
+      <div id="includes-list">
+        <span class="include-name"><a href="../Translatable.html">Translatable</a></span>
+      </div>
+    </div>
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">entities</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">meta</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">pluginname</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">plugintype</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">requirements</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">usage</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000166" class="method-detail">
+        <a name="M000166"></a>
+
+        <div class="method-heading">
+          <a href="#M000166" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(plugin, plugintype=:agent, loadddl=true)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000166-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000166-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ddl/base.rb, line 24</span>
+24:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">plugin</span>, <span class="ruby-identifier">plugintype</span>=<span class="ruby-identifier">:agent</span>, <span class="ruby-identifier">loadddl</span>=<span class="ruby-keyword kw">true</span>)
+25:         <span class="ruby-ivar">@entities</span> = {}
+26:         <span class="ruby-ivar">@meta</span> = {}
+27:         <span class="ruby-ivar">@usage</span> = <span class="ruby-value str">&quot;&quot;</span>
+28:         <span class="ruby-ivar">@config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>
+29:         <span class="ruby-ivar">@pluginname</span> = <span class="ruby-identifier">plugin</span>
+30:         <span class="ruby-ivar">@plugintype</span> = <span class="ruby-identifier">plugintype</span>.<span class="ruby-identifier">to_sym</span>
+31:         <span class="ruby-ivar">@requirements</span> = {}
+32: 
+33:         <span class="ruby-identifier">loadddlfile</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">loadddl</span>
+34:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000171" class="method-detail">
+        <a name="M000171"></a>
+
+        <div class="method-heading">
+          <a href="#M000171" class="method-signature">
+          <span class="method-name">findddlfile</span><span class="method-args">(ddlname=nil, ddltype=nil)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000171-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000171-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ddl/base.rb, line 89</span>
+ 89:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">findddlfile</span>(<span class="ruby-identifier">ddlname</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">ddltype</span>=<span class="ruby-keyword kw">nil</span>)
+ 90:         <span class="ruby-identifier">ddlname</span> = <span class="ruby-ivar">@pluginname</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">ddlname</span>
+ 91:         <span class="ruby-identifier">ddltype</span> = <span class="ruby-ivar">@plugintype</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">ddltype</span>
+ 92: 
+ 93:         <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>
+ 94:           <span class="ruby-identifier">ddlfile</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>([<span class="ruby-identifier">libdir</span>, <span class="ruby-value str">&quot;mcollective&quot;</span>, <span class="ruby-identifier">ddltype</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-node">&quot;#{ddlname}.ddl&quot;</span>])
+ 95:           <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">ddlfile</span>)
+ 96:             <span class="ruby-identifier">log_code</span>(<span class="ruby-identifier">:PLMC18</span>, <span class="ruby-value str">&quot;Found %{ddlname} ddl at %{ddlfile}&quot;</span>, <span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:ddlname</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">ddlname</span>, <span class="ruby-identifier">:ddlfile</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">ddlfile</span>)
+ 97:             <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ddlfile</span>
+ 98:           <span class="ruby-keyword kw">end</span>
+ 99:         <span class="ruby-keyword kw">end</span>
+100:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
+101:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000167" class="method-detail">
+        <a name="M000167"></a>
+
+        <div class="method-heading">
+          <a href="#M000167" class="method-signature">
+          <span class="method-name">help</span><span class="method-args">(template=nil)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Generates <a href="Base.html#M000167">help</a> using the template based on
+the data created with <a href="Base.html#M000177">metadata</a> and <a
+href="Base.html#M000174">input</a>.
+</p>
+<p>
+If no template name is provided one will be chosen based on the plugin
+type. If the provided template path is not absolute then the template will
+be loaded either from the config dir and if that does not exist, default to
+/etc/mcollective
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000167-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000167-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ddl/base.rb, line 44</span>
+44:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">help</span>(<span class="ruby-identifier">template</span>=<span class="ruby-keyword kw">nil</span>)
+45:         <span class="ruby-identifier">template</span> = <span class="ruby-identifier">template_for_plugintype</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">template</span>
+46:         <span class="ruby-identifier">template</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">templatepath</span>(<span class="ruby-identifier">template</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">absolute_path?</span>(<span class="ruby-identifier">template</span>)
+47: 
+48:         <span class="ruby-identifier">template</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">template</span>)
+49:         <span class="ruby-identifier">meta</span> = <span class="ruby-ivar">@meta</span>
+50:         <span class="ruby-identifier">entities</span> = <span class="ruby-ivar">@entities</span>
+51: 
+52:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">template</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;metadata-help.erb&quot;</span>
+53:           <span class="ruby-identifier">metadata_template</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">templatepath</span>(<span class="ruby-value str">&quot;metadata-help.erb&quot;</span>)
+54:           <span class="ruby-identifier">metadata_template</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">metadata_template</span>)
+55:           <span class="ruby-identifier">metastring</span> = <span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">metadata_template</span>, <span class="ruby-value">0</span>, <span class="ruby-value str">'%'</span>)
+56:           <span class="ruby-identifier">metastring</span> = <span class="ruby-identifier">metastring</span>.<span class="ruby-identifier">result</span>(<span class="ruby-identifier">binding</span>)
+57:         <span class="ruby-keyword kw">end</span>
+58: 
+59:         <span class="ruby-identifier">erb</span> = <span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">template</span>, <span class="ruby-value">0</span>, <span class="ruby-value str">'%'</span>)
+60:         <span class="ruby-identifier">erb</span>.<span class="ruby-identifier">result</span>(<span class="ruby-identifier">binding</span>)
+61:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000174" class="method-detail">
+        <a name="M000174"></a>
+
+        <div class="method-heading">
+          <a href="#M000174" class="method-signature">
+          <span class="method-name">input</span><span class="method-args">(argument, properties)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Registers an <a href="Base.html#M000174">input</a> argument for a given
+action
+</p>
+<p>
+See the documentation for action for how to use this
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000174-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000174-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ddl/base.rb, line 153</span>
+153:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">input</span>(<span class="ruby-identifier">argument</span>, <span class="ruby-identifier">properties</span>)
+154:         <span class="ruby-identifier">raise_code</span>(<span class="ruby-identifier">:PLMC22</span>, <span class="ruby-value str">&quot;Cannot determine what entity input '%{entity}' belongs to&quot;</span>, <span class="ruby-identifier">:error</span>, <span class="ruby-identifier">:entity</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@current_entity</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@current_entity</span>
+155: 
+156:         <span class="ruby-identifier">entity</span> = <span class="ruby-ivar">@current_entity</span>
+157: 
+158:         [<span class="ruby-identifier">:prompt</span>, <span class="ruby-identifier">:description</span>, <span class="ruby-identifier">:type</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
+159:           <span class="ruby-identifier">raise_code</span>(<span class="ruby-identifier">:PLMC23</span>, <span class="ruby-value str">&quot;Input needs a :%{property} property&quot;</span>, <span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:property</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">arg</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">properties</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">arg</span>)
+160:         <span class="ruby-keyword kw">end</span>
+161: 
+162:         <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">entity</span>][<span class="ruby-identifier">:input</span>][<span class="ruby-identifier">argument</span>] = {<span class="ruby-identifier">:prompt</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:prompt</span>],
+163:                                                <span class="ruby-identifier">:description</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:description</span>],
+164:                                                <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:type</span>],
+165:                                                <span class="ruby-identifier">:default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:default</span>],
+166:                                                <span class="ruby-identifier">:optional</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:optional</span>]}
+167: 
+168:         <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:type</span>]
+169:           <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:string</span>
+170:             <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Input type :string needs a :validation argument&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">properties</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:validation</span>)
+171:             <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Input type :string needs a :maxlength argument&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">properties</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:maxlength</span>)
+172: 
+173:             <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">entity</span>][<span class="ruby-identifier">:input</span>][<span class="ruby-identifier">argument</span>][<span class="ruby-identifier">:validation</span>] = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:validation</span>]
+174:             <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">entity</span>][<span class="ruby-identifier">:input</span>][<span class="ruby-identifier">argument</span>][<span class="ruby-identifier">:maxlength</span>] = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:maxlength</span>]
+175: 
+176:           <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:list</span>
+177:             <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Input type :list needs a :list argument&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">properties</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:list</span>)
+178: 
+179:             <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">entity</span>][<span class="ruby-identifier">:input</span>][<span class="ruby-identifier">argument</span>][<span class="ruby-identifier">:list</span>] = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:list</span>]
+180:         <span class="ruby-keyword kw">end</span>
+181:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000170" class="method-detail">
+        <a name="M000170"></a>
+
+        <div class="method-heading">
+          <a href="#M000170" class="method-signature">
+          <span class="method-name">loadddlfile</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000170-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000170-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ddl/base.rb, line 81</span>
+81:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">loadddlfile</span>
+82:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ddlfile</span> = <span class="ruby-identifier">findddlfile</span>
+83:           <span class="ruby-identifier">instance_eval</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">ddlfile</span>), <span class="ruby-identifier">ddlfile</span>, <span class="ruby-value">1</span>)
+84:         <span class="ruby-keyword kw">else</span>
+85:           <span class="ruby-identifier">raise_code</span>(<span class="ruby-identifier">:PLMC40</span>, <span class="ruby-value str">&quot;Can't find DDL for %{type} plugin '%{name}'&quot;</span>, <span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@plugintype</span>, <span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@pluginname</span>)
+86:         <span class="ruby-keyword kw">end</span>
+87:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000177" class="method-detail">
+        <a name="M000177"></a>
+
+        <div class="method-heading">
+          <a href="#M000177" class="method-signature">
+          <span class="method-name">metadata</span><span class="method-args">(meta)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Registers meta data for the introspection hash
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000177-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000177-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ddl/base.rb, line 215</span>
+215:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">metadata</span>(<span class="ruby-identifier">meta</span>)
+216:         [<span class="ruby-identifier">:name</span>, <span class="ruby-identifier">:description</span>, <span class="ruby-identifier">:author</span>, <span class="ruby-identifier">:license</span>, <span class="ruby-identifier">:version</span>, <span class="ruby-identifier">:url</span>, <span class="ruby-identifier">:timeout</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
+217:           <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Metadata needs a :#{arg} property&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">meta</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">arg</span>)
+218:         <span class="ruby-keyword kw">end</span>
+219: 
+220:         <span class="ruby-ivar">@meta</span> = <span class="ruby-identifier">meta</span>
+221:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000175" class="method-detail">
+        <a name="M000175"></a>
+
+        <div class="method-heading">
+          <a href="#M000175" class="method-signature">
+          <span class="method-name">output</span><span class="method-args">(argument, properties)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Registers an <a href="Base.html#M000175">output</a> argument for a given
+action
+</p>
+<p>
+See the documentation for action for how to use this
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000175-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000175-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ddl/base.rb, line 186</span>
+186:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">output</span>(<span class="ruby-identifier">argument</span>, <span class="ruby-identifier">properties</span>)
+187:         <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Cannot figure out what action input #{argument} belongs to&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@current_entity</span>
+188:         <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Output #{argument} needs a description argument&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">properties</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:description</span>)
+189:         <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Output #{argument} needs a display_as argument&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">properties</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:display_as</span>)
+190: 
+191:         <span class="ruby-identifier">action</span> = <span class="ruby-ivar">@current_entity</span>
+192: 
+193:         <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">action</span>][<span class="ruby-identifier">:output</span>][<span class="ruby-identifier">argument</span>] = {<span class="ruby-identifier">:description</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:description</span>],
+194:                                                 <span class="ruby-identifier">:display_as</span>  =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:display_as</span>],
+195:                                                 <span class="ruby-identifier">:default</span>     =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:default</span>]}
+196:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000176" class="method-detail">
+        <a name="M000176"></a>
+
+        <div class="method-heading">
+          <a href="#M000176" class="method-signature">
+          <span class="method-name">requires</span><span class="method-args">(requirement)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000176-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000176-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ddl/base.rb, line 198</span>
+198:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">requires</span>(<span class="ruby-identifier">requirement</span>)
+199:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Requirement should be a hash in the form :item =&gt; 'requirement'&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">requirement</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
+200: 
+201:         <span class="ruby-identifier">valid_requirements</span> = [<span class="ruby-identifier">:mcollective</span>]
+202: 
+203:         <span class="ruby-identifier">requirement</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
+204:           <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">valid_requirements</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>)
+205:             <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Requirement %s is not a valid requirement, only %s is supported&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">key</span>, <span class="ruby-identifier">valid_requirements</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;, &quot;</span>)]
+206:           <span class="ruby-keyword kw">end</span>
+207: 
+208:           <span class="ruby-ivar">@requirements</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">requirement</span>[<span class="ruby-identifier">key</span>]
+209:         <span class="ruby-keyword kw">end</span>
+210: 
+211:         <span class="ruby-identifier">validate_requirements</span>
+212:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000169" class="method-detail">
+        <a name="M000169"></a>
+
+        <div class="method-heading">
+          <a href="#M000169" class="method-signature">
+          <span class="method-name">template_for_plugintype</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000169-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000169-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ddl/base.rb, line 67</span>
+67:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">template_for_plugintype</span>
+68:         <span class="ruby-keyword kw">case</span> <span class="ruby-ivar">@plugintype</span>
+69:         <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:agent</span>
+70:           <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;rpc-help.erb&quot;</span>
+71:         <span class="ruby-keyword kw">else</span>
+72:           <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-constant">Util</span>.<span class="ruby-identifier">templatepath</span>(<span class="ruby-node">&quot;#{@plugintype}-help.erb&quot;</span>))
+73:             <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;#{@plugintype}-help.erb&quot;</span>
+74:           <span class="ruby-keyword kw">else</span>
+75:             <span class="ruby-comment cmt"># Default help template gets loaded if plugintype-help does not exist.</span>
+76:             <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;metadata-help.erb&quot;</span>
+77:           <span class="ruby-keyword kw">end</span>
+78:         <span class="ruby-keyword kw">end</span>
+79:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000168" class="method-detail">
+        <a name="M000168"></a>
+
+        <div class="method-heading">
+          <a href="#M000168" class="method-signature">
+          <span class="method-name">usage</span><span class="method-args">(usage_text)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000168-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000168-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ddl/base.rb, line 63</span>
+63:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">usage</span>(<span class="ruby-identifier">usage_text</span>)
+64:         <span class="ruby-ivar">@usage</span> = <span class="ruby-identifier">usage_text</span>
+65:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000173" class="method-detail">
+        <a name="M000173"></a>
+
+        <div class="method-heading">
+          <a href="#M000173" class="method-signature">
+          <span class="method-name">validate_input_argument</span><span class="method-args">(input, key, argument)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+validate strings, lists and booleans, we&#8216;ll add more types of
+validators when all the use cases are clear
+</p>
+<p>
+only does validation for arguments actually given, since some might be
+optional. We validate the presense of the argument earlier so this is a
+safe assumption, just to skip them.
+</p>
+<p>
+:string can have maxlength and regex. A maxlength of 0 will bypasss checks
+:list has a array of valid values
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000173-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000173-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ddl/base.rb, line 127</span>
+127:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_input_argument</span>(<span class="ruby-identifier">input</span>, <span class="ruby-identifier">key</span>, <span class="ruby-identifier">argument</span>)
+128:         <span class="ruby-constant">Validator</span>.<span class="ruby-identifier">load_validators</span>
+129: 
+130:         <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">input</span>[<span class="ruby-identifier">key</span>][<span class="ruby-identifier">:type</span>]
+131:         <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:string</span>
+132:           <span class="ruby-constant">Validator</span>.<span class="ruby-identifier">validate</span>(<span class="ruby-identifier">argument</span>, <span class="ruby-identifier">:string</span>)
+133: 
+134:           <span class="ruby-constant">Validator</span>.<span class="ruby-identifier">length</span>(<span class="ruby-identifier">argument</span>, <span class="ruby-identifier">input</span>[<span class="ruby-identifier">key</span>][<span class="ruby-identifier">:maxlength</span>].<span class="ruby-identifier">to_i</span>)
+135: 
+136:           <span class="ruby-constant">Validator</span>.<span class="ruby-identifier">validate</span>(<span class="ruby-identifier">argument</span>, <span class="ruby-identifier">input</span>[<span class="ruby-identifier">key</span>][<span class="ruby-identifier">:validation</span>])
+137: 
+138:         <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:list</span>
+139:           <span class="ruby-constant">Validator</span>.<span class="ruby-identifier">validate</span>(<span class="ruby-identifier">argument</span>, <span class="ruby-identifier">input</span>[<span class="ruby-identifier">key</span>][<span class="ruby-identifier">:list</span>])
+140: 
+141:         <span class="ruby-keyword kw">else</span>
+142:           <span class="ruby-constant">Validator</span>.<span class="ruby-identifier">validate</span>(<span class="ruby-identifier">argument</span>, <span class="ruby-identifier">input</span>[<span class="ruby-identifier">key</span>][<span class="ruby-identifier">:type</span>])
+143:         <span class="ruby-keyword kw">end</span>
+144: 
+145:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
+146:       <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+147:         <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">validation_fail!</span>(<span class="ruby-identifier">:PLMC21</span>, <span class="ruby-value str">&quot;Cannot validate input '%{input}': %{error}&quot;</span>, <span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:input</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">key</span>, <span class="ruby-identifier">:error</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>)
+148:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000172" class="method-detail">
+        <a name="M000172"></a>
+
+        <div class="method-heading">
+          <a href="#M000172" class="method-signature">
+          <span class="method-name">validate_requirements</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000172-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000172-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ddl/base.rb, line 103</span>
+103:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_requirements</span>
+104:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">requirement</span> = <span class="ruby-ivar">@requirements</span>[<span class="ruby-identifier">:mcollective</span>]
+105:           <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">mcollective_version</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;@DEVELOPMENT_VERSION@&quot;</span>
+106:             <span class="ruby-identifier">log_code</span>(<span class="ruby-identifier">:PLMC19</span>, <span class="ruby-value str">&quot;DDL requirements validation being skipped in development&quot;</span>, <span class="ruby-identifier">:warn</span>)
+107:             <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
+108:           <span class="ruby-keyword kw">end</span>
+109: 
+110:           <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">versioncmp</span>(<span class="ruby-constant">Util</span>.<span class="ruby-identifier">mcollective_version</span>, <span class="ruby-identifier">requirement</span>) <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
+111:             <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">validation_fail!</span>(<span class="ruby-identifier">:PLMC20</span>, <span class="ruby-value str">&quot;%{type} plugin '%{name}' requires MCollective version %{requirement} or newer&quot;</span>, <span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@plugintype</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">capitalize</span>, <span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@pluginname</span>, <span class="ruby-identifier">:requirement</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">requirement</span>)
+112:           <span class="ruby-keyword kw">end</span>
+113:         <span class="ruby-keyword kw">end</span>
+114: 
+115:         <span class="ruby-keyword kw">true</span>
+116:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/DDL/DataDDL.html b/doc/classes/MCollective/DDL/DataDDL.html
new file mode 100644 (file)
index 0000000..0d21aa3
--- /dev/null
@@ -0,0 +1,256 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::DDL::DataDDL</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::DDL::DataDDL</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/ddl/dataddl_rb.html">
+                lib/mcollective/ddl/dataddl.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                <a href="Base.html">
+                Base
+               </a>
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+A <a href="../DDL.html">DDL</a> file for the data query plugins.
+</p>
+<p>
+Query plugins can today take only one <a
+href="DataDDL.html#M000161">input</a> by convention in the <a
+href="../DDL.html">DDL</a> that is called :query, otherwise the <a
+href="DataDDL.html#M000161">input</a> is identical to the standard <a
+href="DataDDL.html#M000161">input</a>.
+</p>
+<p>
+metadata :name =&gt; &quot;<a href="../Agent.html">Agent</a>&quot;,
+</p>
+<pre>
+            :description =&gt; &quot;Meta data about installed MColletive Agents&quot;,
+            :author      =&gt; &quot;R.I.Pienaar &lt;rip@devco.net&gt;&quot;,
+            :license     =&gt; &quot;ASL 2.0&quot;,
+            :version     =&gt; &quot;1.0&quot;,
+            :url         =&gt; &quot;http://marionette-collective.org/&quot;,
+            :timeout     =&gt; 1
+</pre>
+<p>
+<a href="DataDDL.html#M000160">dataquery</a> :description =&gt; &quot;<a
+href="../Agent.html">Agent</a> Meta <a href="../Data.html">Data</a>&quot;
+do
+</p>
+<pre>
+    input :query,
+          :prompt =&gt; &quot;Agent Name&quot;,
+          :description =&gt; &quot;Valid agent name&quot;,
+          :type =&gt; :string,
+          :validation =&gt; /^[\w\_]+$/,
+          :maxlength =&gt; 20
+
+    [:license, :timeout, :description, :url, :version, :author].each do |item|
+      output item,
+             :description =&gt; &quot;Agent #{item}&quot;,
+             :display_as =&gt; item.to_s.capitalize
+    end
+</pre>
+<p>
+end
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000160">dataquery</a>&nbsp;&nbsp;
+      <a href="#M000162">dataquery_interface</a>&nbsp;&nbsp;
+      <a href="#M000161">input</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000160" class="method-detail">
+        <a name="M000160"></a>
+
+        <div class="method-heading">
+          <a href="#M000160" class="method-signature">
+          <span class="method-name">dataquery</span><span class="method-args">(input, &amp;block)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000160-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000160-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ddl/dataddl.rb, line 31</span>
+31:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dataquery</span>(<span class="ruby-identifier">input</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+32:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Data queries need a :description&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">input</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:description</span>)
+33:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Data queries can only have one definition&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">:data</span>]
+34: 
+35:         <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">:data</span>]  = {<span class="ruby-identifier">:description</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">input</span>[<span class="ruby-identifier">:description</span>],
+36:                              <span class="ruby-identifier">:input</span> =<span class="ruby-operator">&gt;</span> {},
+37:                              <span class="ruby-identifier">:output</span> =<span class="ruby-operator">&gt;</span> {}}
+38: 
+39:         <span class="ruby-ivar">@current_entity</span> = <span class="ruby-identifier">:data</span>
+40:         <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
+41:         <span class="ruby-ivar">@current_entity</span> = <span class="ruby-keyword kw">nil</span>
+42:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000162" class="method-detail">
+        <a name="M000162"></a>
+
+        <div class="method-heading">
+          <a href="#M000162" class="method-signature">
+          <span class="method-name">dataquery_interface</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns the interface for the data query
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000162-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000162-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ddl/dataddl.rb, line 51</span>
+51:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dataquery_interface</span>
+52:         <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">:data</span>] <span class="ruby-operator">||</span> {}
+53:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000161" class="method-detail">
+        <a name="M000161"></a>
+
+        <div class="method-heading">
+          <a href="#M000161" class="method-signature">
+          <span class="method-name">input</span><span class="method-args">(argument, properties)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000161-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000161-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ddl/dataddl.rb, line 44</span>
+44:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">input</span>(<span class="ruby-identifier">argument</span>, <span class="ruby-identifier">properties</span>)
+45:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;The only valid input name for a data query is 'query'&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">argument</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">:query</span>
+46: 
+47:         <span class="ruby-keyword kw">super</span>
+48:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/DDL/DiscoveryDDL.html b/doc/classes/MCollective/DDL/DiscoveryDDL.html
new file mode 100644 (file)
index 0000000..fab1db6
--- /dev/null
@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::DDL::DiscoveryDDL</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::DDL::DiscoveryDDL</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/ddl/discoveryddl_rb.html">
+                lib/mcollective/ddl/discoveryddl.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                <a href="Base.html">
+                Base
+               </a>
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+<a href="../DDL.html">DDL</a> for <a
+href="DiscoveryDDL.html#M000165">discovery</a> plugins, a full example can
+be seen below
+</p>
+<p>
+metadata :name =&gt; &quot;mc&quot;,
+</p>
+<pre>
+            :description =&gt; &quot;MCollective Broadcast based discovery&quot;,
+            :author      =&gt; &quot;R.I.Pienaar &lt;rip@devco.net&gt;&quot;,
+            :license     =&gt; &quot;ASL 2.0&quot;,
+            :version     =&gt; &quot;0.1&quot;,
+            :url         =&gt; &quot;http://marionette-collective.org/&quot;,
+            :timeout     =&gt; 2
+</pre>
+<p>
+<a href="DiscoveryDDL.html#M000165">discovery</a> do
+</p>
+<pre>
+    capabilities [:classes, :facts, :identity, :agents, :compound]
+</pre>
+<p>
+end
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000164">capabilities</a>&nbsp;&nbsp;
+      <a href="#M000165">discovery</a>&nbsp;&nbsp;
+      <a href="#M000163">discovery_interface</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000164" class="method-detail">
+        <a name="M000164"></a>
+
+        <div class="method-heading">
+          <a href="#M000164" class="method-signature">
+          <span class="method-name">capabilities</span><span class="method-args">(*caps)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+records valid <a href="DiscoveryDDL.html#M000164">capabilities</a> for <a
+href="DiscoveryDDL.html#M000165">discovery</a> plugins
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000164-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000164-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ddl/discoveryddl.rb, line 22</span>
+22:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">capabilities</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">caps</span>)
+23:         <span class="ruby-identifier">caps</span> = [<span class="ruby-identifier">caps</span>].<span class="ruby-identifier">flatten</span>
+24: 
+25:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Discovery plugin capabilities can't be empty&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">caps</span>.<span class="ruby-identifier">empty?</span>
+26: 
+27:         <span class="ruby-identifier">caps</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">cap</span><span class="ruby-operator">|</span>
+28:           <span class="ruby-keyword kw">if</span> [<span class="ruby-identifier">:classes</span>, <span class="ruby-identifier">:facts</span>, <span class="ruby-identifier">:identity</span>, <span class="ruby-identifier">:agents</span>, <span class="ruby-identifier">:compound</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">cap</span>)
+29:             <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">:discovery</span>][<span class="ruby-identifier">:capabilities</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">cap</span>
+30:           <span class="ruby-keyword kw">else</span>
+31:             <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;%s is not a valid capability, valid capabilities are :classes, :facts, :identity, :agents and :compound&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">cap</span>
+32:           <span class="ruby-keyword kw">end</span>
+33:         <span class="ruby-keyword kw">end</span>
+34:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000165" class="method-detail">
+        <a name="M000165"></a>
+
+        <div class="method-heading">
+          <a href="#M000165" class="method-signature">
+          <span class="method-name">discovery</span><span class="method-args">(&amp;block)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Creates the definition for new <a
+href="DiscoveryDDL.html#M000165">discovery</a> plugins
+</p>
+<pre>
+   discovery do
+      capabilities [:classes, :facts, :identity, :agents, :compound]
+   end
+</pre>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000165-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000165-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ddl/discoveryddl.rb, line 41</span>
+41:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discovery</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+42:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Discovery plugins can only have one definition&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">:discovery</span>]
+43: 
+44:         <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">:discovery</span>] = {<span class="ruby-identifier">:capabilities</span> =<span class="ruby-operator">&gt;</span> []}
+45: 
+46:         <span class="ruby-ivar">@current_entity</span> = <span class="ruby-identifier">:discovery</span>
+47:         <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
+48:         <span class="ruby-ivar">@current_entity</span> = <span class="ruby-keyword kw">nil</span>
+49:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000163" class="method-detail">
+        <a name="M000163"></a>
+
+        <div class="method-heading">
+          <a href="#M000163" class="method-signature">
+          <span class="method-name">discovery_interface</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000163-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000163-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ddl/discoveryddl.rb, line 17</span>
+17:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discovery_interface</span>
+18:         <span class="ruby-ivar">@entities</span>[<span class="ruby-identifier">:discovery</span>]
+19:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/DDL/ValidatorDDL.html b/doc/classes/MCollective/DDL/ValidatorDDL.html
new file mode 100644 (file)
index 0000000..f151eb6
--- /dev/null
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::DDL::ValidatorDDL</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::DDL::ValidatorDDL</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/ddl/validatorddl_rb.html">
+                lib/mcollective/ddl/validatorddl.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                <a href="Base.html">
+                Base
+               </a>
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/DDLValidationError.html b/doc/classes/MCollective/DDLValidationError.html
new file mode 100644 (file)
index 0000000..90d4452
--- /dev/null
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::DDLValidationError</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::DDLValidationError</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/exception_rb.html">
+                lib/mcollective/exception.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                <a href="CodedError.html">
+                CodedError
+               </a>
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+Exceptions for the <a href="RPC.html">RPC</a> system
+</p>
+
+    </div>
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Data.html b/doc/classes/MCollective/Data.html
new file mode 100644 (file)
index 0000000..aa7eae9
--- /dev/null
@@ -0,0 +1,381 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Module: MCollective::Data</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Module</strong></td>
+          <td class="class-name-in-header">MCollective::Data</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/data/base_rb.html">
+                lib/mcollective/data/base.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/data/result_rb.html">
+                lib/mcollective/data/result.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/data_rb.html">
+                lib/mcollective/data.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000225">[]</a>&nbsp;&nbsp;
+      <a href="#M000227">ddl</a>&nbsp;&nbsp;
+      <a href="#M000229">ddl_has_output?</a>&nbsp;&nbsp;
+      <a href="#M000230">ddl_transform_input</a>&nbsp;&nbsp;
+      <a href="#M000228">ddl_validate</a>&nbsp;&nbsp;
+      <a href="#M000223">load_data_sources</a>&nbsp;&nbsp;
+      <a href="#M000226">method_missing</a>&nbsp;&nbsp;
+      <a href="#M000224">pluginname</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+    <div id="class-list">
+      <h3 class="section-bar">Classes and Modules</h3>
+
+      Class <a href="Data/Base.html" class="link">MCollective::Data::Base</a><br />
+Class <a href="Data/Result.html" class="link">MCollective::Data::Result</a><br />
+
+    </div>
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000225" class="method-detail">
+        <a name="M000225"></a>
+
+        <div class="method-heading">
+          <a href="#M000225" class="method-signature">
+          <span class="method-name">[]</span><span class="method-args">(plugin)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000225-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000225-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data.rb, line 26</span>
+26:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-operator">[]</span>(<span class="ruby-identifier">plugin</span>)
+27:       <span class="ruby-constant">PluginManager</span>[<span class="ruby-identifier">pluginname</span>(<span class="ruby-identifier">plugin</span>)]
+28:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000227" class="method-detail">
+        <a name="M000227"></a>
+
+        <div class="method-heading">
+          <a href="#M000227" class="method-signature">
+          <span class="method-name">ddl</span><span class="method-args">(plugin)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000227-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000227-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data.rb, line 37</span>
+37:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ddl</span>(<span class="ruby-identifier">plugin</span>)
+38:       <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">pluginname</span>(<span class="ruby-identifier">plugin</span>), <span class="ruby-identifier">:data</span>)
+39:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000229" class="method-detail">
+        <a name="M000229"></a>
+
+        <div class="method-heading">
+          <a href="#M000229" class="method-signature">
+          <span class="method-name">ddl_has_output?</span><span class="method-args">(ddl, output)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000229-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000229-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data.rb, line 62</span>
+62:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ddl_has_output?</span>(<span class="ruby-identifier">ddl</span>, <span class="ruby-identifier">output</span>)
+63:       <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">entities</span>[<span class="ruby-identifier">:data</span>][<span class="ruby-identifier">:output</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">output</span>.<span class="ruby-identifier">to_sym</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">false</span>
+64:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000230" class="method-detail">
+        <a name="M000230"></a>
+
+        <div class="method-heading">
+          <a href="#M000230" class="method-signature">
+          <span class="method-name">ddl_transform_input</span><span class="method-args">(ddl, input)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+For an input where the <a href="DDL.html">DDL</a> requests a boolean or
+some number this will convert the input to the right type where possible
+else just returns the origin input unedited
+</p>
+<p>
+if anything here goes wrong just return the input value this is not really
+the end of the world or anything since all that will happen is that <a
+href="DDL.html">DDL</a> validation will fail and the user will get an
+error, no need to be too defensive here
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000230-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000230-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data.rb, line 74</span>
+74:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ddl_transform_input</span>(<span class="ruby-identifier">ddl</span>, <span class="ruby-identifier">input</span>)
+75:       <span class="ruby-keyword kw">begin</span>
+76:         <span class="ruby-identifier">type</span> = <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">entities</span>[<span class="ruby-identifier">:data</span>][<span class="ruby-identifier">:input</span>][<span class="ruby-identifier">:query</span>][<span class="ruby-identifier">:type</span>]
+77: 
+78:         <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">type</span>
+79:           <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:boolean</span>
+80:             <span class="ruby-keyword kw">return</span> <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">string_to_boolean</span>(<span class="ruby-identifier">input</span>)
+81: 
+82:           <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:number</span>, <span class="ruby-identifier">:integer</span>, <span class="ruby-identifier">:float</span>
+83:             <span class="ruby-keyword kw">return</span> <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">string_to_number</span>(<span class="ruby-identifier">input</span>)
+84:         <span class="ruby-keyword kw">end</span>
+85:       <span class="ruby-keyword kw">rescue</span>
+86:       <span class="ruby-keyword kw">end</span>
+87: 
+88:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">input</span>
+89:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000228" class="method-detail">
+        <a name="M000228"></a>
+
+        <div class="method-heading">
+          <a href="#M000228" class="method-signature">
+          <span class="method-name">ddl_validate</span><span class="method-args">(ddl, argument)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000228-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000228-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data.rb, line 41</span>
+41:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ddl_validate</span>(<span class="ruby-identifier">ddl</span>, <span class="ruby-identifier">argument</span>)
+42:       <span class="ruby-identifier">name</span> = <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">meta</span>[<span class="ruby-identifier">:name</span>]
+43:       <span class="ruby-identifier">query</span> = <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">entities</span>[<span class="ruby-identifier">:data</span>]
+44: 
+45:       <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">validation_fail!</span>(<span class="ruby-identifier">:PLMC31</span>, <span class="ruby-value str">&quot;No dataquery has been defined in the DDL for data plugin '%{plugin}'&quot;</span>, <span class="ruby-identifier">:error</span>, <span class="ruby-identifier">:plugin</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">name</span>)  <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">query</span>
+46: 
+47:       <span class="ruby-identifier">input</span> = <span class="ruby-identifier">query</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">:input</span>, {})
+48:       <span class="ruby-identifier">output</span> = <span class="ruby-identifier">query</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">:output</span>, {})
+49: 
+50:       <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">validation_fail!</span>(<span class="ruby-identifier">:PLMC32</span>, <span class="ruby-value str">&quot;No output has been defined in the DDL for data plugin %{plugin}&quot;</span>, <span class="ruby-identifier">:error</span>, <span class="ruby-identifier">:plugin</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">name</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">output</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">empty?</span>
+51: 
+52:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">input</span>[<span class="ruby-identifier">:query</span>]
+53:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">argument</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">input</span>[<span class="ruby-identifier">:query</span>][<span class="ruby-identifier">:optional</span>]
+54: 
+55:         <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">validate_input_argument</span>(<span class="ruby-identifier">input</span>, <span class="ruby-identifier">:query</span>, <span class="ruby-identifier">argument</span>)
+56:       <span class="ruby-keyword kw">else</span>
+57:         <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">validation_fail!</span>(<span class="ruby-identifier">:PLMC33</span>, <span class="ruby-value str">&quot;No data plugin argument was declared in the '%{plugin}' DDL but an input was supplied&quot;</span>, <span class="ruby-identifier">:error</span>, <span class="ruby-identifier">:plugin</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">name</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">argument</span>
+58:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
+59:       <span class="ruby-keyword kw">end</span>
+60:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000223" class="method-detail">
+        <a name="M000223"></a>
+
+        <div class="method-heading">
+          <a href="#M000223" class="method-signature">
+          <span class="method-name">load_data_sources</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000223-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000223-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data.rb, line 6</span>
+ 6:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load_data_sources</span>
+ 7:       <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">find_and_load</span>(<span class="ruby-value str">&quot;data&quot;</span>)
+ 8: 
+ 9:       <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">grep</span>(<span class="ruby-regexp re">/_data$/</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">plugin</span><span class="ruby-operator">|</span>
+10:         <span class="ruby-keyword kw">begin</span>
+11:           <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">PluginManager</span>[<span class="ruby-identifier">plugin</span>].<span class="ruby-identifier">class</span>.<span class="ruby-identifier">activate?</span>
+12:             <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Disabling data plugin %s due to plugin activation policy&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">plugin</span>)
+13:             <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">plugin</span>)
+14:           <span class="ruby-keyword kw">end</span>
+15:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+16:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Disabling data plugin %s due to exception #{e.class}: #{e}&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">plugin</span>)
+17:           <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">plugin</span>)
+18:         <span class="ruby-keyword kw">end</span>
+19:       <span class="ruby-keyword kw">end</span>
+20:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000226" class="method-detail">
+        <a name="M000226"></a>
+
+        <div class="method-heading">
+          <a href="#M000226" class="method-signature">
+          <span class="method-name">method_missing</span><span class="method-args">(method, *args)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Data.package(&quot;httpd&quot;).architecture
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000226-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000226-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data.rb, line 31</span>
+31:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">method</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
+32:       <span class="ruby-keyword kw">super</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">pluginname</span>(<span class="ruby-identifier">method</span>))
+33: 
+34:       <span class="ruby-constant">PluginManager</span>[<span class="ruby-identifier">pluginname</span>(<span class="ruby-identifier">method</span>)].<span class="ruby-identifier">lookup</span>(<span class="ruby-identifier">args</span>.<span class="ruby-identifier">first</span>)
+35:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000224" class="method-detail">
+        <a name="M000224"></a>
+
+        <div class="method-heading">
+          <a href="#M000224" class="method-signature">
+          <span class="method-name">pluginname</span><span class="method-args">(plugin)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000224-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000224-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data.rb, line 22</span>
+22:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pluginname</span>(<span class="ruby-identifier">plugin</span>)
+23:       <span class="ruby-identifier">plugin</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/_data$/i</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">plugin</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;%s_data&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">plugin</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>
+24:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Data/Base.html b/doc/classes/MCollective/Data/Base.html
new file mode 100644 (file)
index 0000000..5bd7476
--- /dev/null
@@ -0,0 +1,383 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Data::Base</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Data::Base</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/data/base_rb.html">
+                lib/mcollective/data/base.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000243">activate?</a>&nbsp;&nbsp;
+      <a href="#M000242">activate_when</a>&nbsp;&nbsp;
+      <a href="#M000241">ddl_validate</a>&nbsp;&nbsp;
+      <a href="#M000237">inherited</a>&nbsp;&nbsp;
+      <a href="#M000239">lookup</a>&nbsp;&nbsp;
+      <a href="#M000238">new</a>&nbsp;&nbsp;
+      <a href="#M000240">query</a>&nbsp;&nbsp;
+      <a href="#M000244">startup_hook</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">ddl</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">name</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">result</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">timeout</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000243" class="method-detail">
+        <a name="M000243"></a>
+
+        <div class="method-heading">
+          <a href="#M000243" class="method-signature">
+          <span class="method-name">activate?</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Always be active unless a specific block is given with <a
+href="Base.html#M000242">activate_when</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000243-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000243-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data/base.rb, line 60</span>
+60:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">activate?</span>
+61:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
+62:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000242" class="method-detail">
+        <a name="M000242"></a>
+
+        <div class="method-heading">
+          <a href="#M000242" class="method-signature">
+          <span class="method-name">activate_when</span><span class="method-args">(&amp;block)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+<a href="Base.html#M000242">activate_when</a> do
+</p>
+<pre>
+   file.exist?(&quot;/usr/bin/puppet&quot;)
+</pre>
+<p>
+end
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000242-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000242-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data/base.rb, line 53</span>
+53:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">activate_when</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+54:         (<span class="ruby-keyword kw">class</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>).<span class="ruby-identifier">instance_eval</span> <span class="ruby-keyword kw">do</span>
+55:           <span class="ruby-identifier">define_method</span>(<span class="ruby-value str">&quot;activate?&quot;</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+56:         <span class="ruby-keyword kw">end</span>
+57:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000237" class="method-detail">
+        <a name="M000237"></a>
+
+        <div class="method-heading">
+          <a href="#M000237" class="method-signature">
+          <span class="method-name">inherited</span><span class="method-args">(klass)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Register plugins that inherits base
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000237-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000237-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data/base.rb, line 7</span>
+ 7:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">inherited</span>(<span class="ruby-identifier">klass</span>)
+ 8:         <span class="ruby-identifier">type</span> = <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;::&quot;</span>).<span class="ruby-identifier">last</span>.<span class="ruby-identifier">downcase</span>
+ 9: 
+10:         <span class="ruby-constant">PluginManager</span> <span class="ruby-operator">&lt;&lt;</span> {<span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">type</span>, <span class="ruby-identifier">:class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">:single_instance</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>}
+11:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000238" class="method-detail">
+        <a name="M000238"></a>
+
+        <div class="method-heading">
+          <a href="#M000238" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000238-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000238-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data/base.rb, line 13</span>
+13:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
+14:         <span class="ruby-ivar">@name</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;::&quot;</span>).<span class="ruby-identifier">last</span>.<span class="ruby-identifier">downcase</span>
+15:         <span class="ruby-ivar">@ddl</span> = <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@name</span>, <span class="ruby-identifier">:data</span>)
+16:         <span class="ruby-ivar">@result</span> = <span class="ruby-constant">Result</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">dataquery_interface</span>[<span class="ruby-identifier">:output</span>])
+17:         <span class="ruby-ivar">@timeout</span> = <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">meta</span>[<span class="ruby-identifier">:timeout</span>] <span class="ruby-operator">||</span> <span class="ruby-value">1</span>
+18: 
+19:         <span class="ruby-identifier">startup_hook</span>
+20:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000240" class="method-detail">
+        <a name="M000240"></a>
+
+        <div class="method-heading">
+          <a href="#M000240" class="method-signature">
+          <span class="method-name">query</span><span class="method-args">(&amp;block)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000240-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000240-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data/base.rb, line 42</span>
+42:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">query</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+43:         <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">module_eval</span> { <span class="ruby-identifier">define_method</span>(<span class="ruby-value str">&quot;query_data&quot;</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) }
+44:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000241" class="method-detail">
+        <a name="M000241"></a>
+
+        <div class="method-heading">
+          <a href="#M000241" class="method-signature">
+          <span class="method-name">ddl_validate</span><span class="method-args">(what)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000241-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000241-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data/base.rb, line 46</span>
+46:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ddl_validate</span>(<span class="ruby-identifier">what</span>)
+47:         <span class="ruby-constant">Data</span>.<span class="ruby-identifier">ddl_validate</span>(<span class="ruby-ivar">@ddl</span>, <span class="ruby-identifier">what</span>)
+48:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000239" class="method-detail">
+        <a name="M000239"></a>
+
+        <div class="method-heading">
+          <a href="#M000239" class="method-signature">
+          <span class="method-name">lookup</span><span class="method-args">(what)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000239-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000239-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data/base.rb, line 22</span>
+22:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lookup</span>(<span class="ruby-identifier">what</span>)
+23:         <span class="ruby-identifier">ddl_validate</span>(<span class="ruby-identifier">what</span>)
+24: 
+25:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Doing data query %s for '%s'&quot;</span> <span class="ruby-operator">%</span> [ <span class="ruby-ivar">@name</span>, <span class="ruby-identifier">what</span> ])
+26: 
+27:         <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-identifier">timeout</span>(<span class="ruby-ivar">@timeout</span>) <span class="ruby-keyword kw">do</span>
+28:           <span class="ruby-identifier">query_data</span>(<span class="ruby-identifier">what</span>)
+29:         <span class="ruby-keyword kw">end</span>
+30: 
+31:         <span class="ruby-ivar">@result</span>
+32:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>
+33:         <span class="ruby-comment cmt"># Timeout::Error is a inherited from Interrupt which seems a really</span>
+34:         <span class="ruby-comment cmt"># strange choice, making it an equivelant of ^C and such.  Catch it</span>
+35:         <span class="ruby-comment cmt"># and raise something less critical that will not the runner to just</span>
+36:         <span class="ruby-comment cmt"># give up the ghost</span>
+37:         <span class="ruby-identifier">msg</span> = <span class="ruby-value str">&quot;Data plugin %s timed out on query '%s'&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-ivar">@name</span>, <span class="ruby-identifier">what</span>]
+38:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-identifier">msg</span>)
+39:         <span class="ruby-identifier">raise</span> <span class="ruby-constant">MsgTTLExpired</span>, <span class="ruby-identifier">msg</span>
+40:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000244" class="method-detail">
+        <a name="M000244"></a>
+
+        <div class="method-heading">
+          <a href="#M000244" class="method-signature">
+          <span class="method-name">startup_hook</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000244-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000244-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data/base.rb, line 64</span>
+64:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">startup_hook</span>;<span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Data/Result.html b/doc/classes/MCollective/Data/Result.html
new file mode 100644 (file)
index 0000000..56cf4fc
--- /dev/null
@@ -0,0 +1,278 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Data::Result</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Data::Result</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/data/result_rb.html">
+                lib/mcollective/data/result.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000233">[]</a>&nbsp;&nbsp;
+      <a href="#M000234">[]=</a>&nbsp;&nbsp;
+      <a href="#M000232">include?</a>&nbsp;&nbsp;
+      <a href="#M000235">keys</a>&nbsp;&nbsp;
+      <a href="#M000236">method_missing</a>&nbsp;&nbsp;
+      <a href="#M000231">new</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000231" class="method-detail">
+        <a name="M000231"></a>
+
+        <div class="method-heading">
+          <a href="#M000231" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(outputs)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000231-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000231-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data/result.rb, line 9</span>
+ 9:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">outputs</span>)
+10:         <span class="ruby-ivar">@data</span> = {}
+11: 
+12:         <span class="ruby-identifier">outputs</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">output</span><span class="ruby-operator">|</span>
+13:           <span class="ruby-ivar">@data</span>[<span class="ruby-identifier">output</span>] = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">outputs</span>[<span class="ruby-identifier">output</span>].<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">:default</span>, <span class="ruby-keyword kw">nil</span>)))
+14:         <span class="ruby-keyword kw">end</span>
+15:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000233" class="method-detail">
+        <a name="M000233"></a>
+
+        <div class="method-heading">
+          <a href="#M000233" class="method-signature">
+          <span class="method-name">[]</span><span class="method-args">(key)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000233-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000233-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data/result.rb, line 21</span>
+21:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">key</span>)
+22:         <span class="ruby-ivar">@data</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_sym</span>]
+23:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000234" class="method-detail">
+        <a name="M000234"></a>
+
+        <div class="method-heading">
+          <a href="#M000234" class="method-signature">
+          <span class="method-name">[]=</span><span class="method-args">(key, val)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000234-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000234-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data/result.rb, line 25</span>
+25:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>)
+26:         <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Can only store String, Integer, Float or Boolean data but got #{val.class} for key #{key}&quot;</span> <span class="ruby-keyword kw">unless</span> [<span class="ruby-constant">String</span>, <span class="ruby-constant">Fixnum</span>, <span class="ruby-constant">Bignum</span>, <span class="ruby-constant">Float</span>, <span class="ruby-constant">TrueClass</span>, <span class="ruby-constant">FalseClass</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">val</span>.<span class="ruby-identifier">class</span>)
+27: 
+28:         <span class="ruby-ivar">@data</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_sym</span>] = <span class="ruby-identifier">val</span>
+29:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000232" class="method-detail">
+        <a name="M000232"></a>
+
+        <div class="method-heading">
+          <a href="#M000232" class="method-signature">
+          <span class="method-name">include?</span><span class="method-args">(key)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000232-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000232-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data/result.rb, line 17</span>
+17:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>)
+18:         <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_sym</span>)
+19:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000235" class="method-detail">
+        <a name="M000235"></a>
+
+        <div class="method-heading">
+          <a href="#M000235" class="method-signature">
+          <span class="method-name">keys</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000235-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000235-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data/result.rb, line 31</span>
+31:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">keys</span>
+32:         <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">keys</span>
+33:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000236" class="method-detail">
+        <a name="M000236"></a>
+
+        <div class="method-heading">
+          <a href="#M000236" class="method-signature">
+          <span class="method-name">method_missing</span><span class="method-args">(method, *args)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000236-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000236-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/data/result.rb, line 35</span>
+35:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">method</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
+36:         <span class="ruby-identifier">key</span> = <span class="ruby-identifier">method</span>.<span class="ruby-identifier">to_sym</span>
+37: 
+38:         <span class="ruby-identifier">raise</span> <span class="ruby-constant">NoMethodError</span>, <span class="ruby-value str">&quot;undefined local variable or method `%s'&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">key</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>)
+39: 
+40:         <span class="ruby-ivar">@data</span>[<span class="ruby-identifier">key</span>]
+41:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Discovery.html b/doc/classes/MCollective/Discovery.html
new file mode 100644 (file)
index 0000000..bd1690c
--- /dev/null
@@ -0,0 +1,512 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Discovery</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Discovery</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/discovery_rb.html">
+                lib/mcollective/discovery.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000404">check_capabilities</a>&nbsp;&nbsp;
+      <a href="#M000403">ddl</a>&nbsp;&nbsp;
+      <a href="#M000408">discover</a>&nbsp;&nbsp;
+      <a href="#M000402">discovery_class</a>&nbsp;&nbsp;
+      <a href="#M000401">discovery_method</a>&nbsp;&nbsp;
+      <a href="#M000407">discovery_timeout</a>&nbsp;&nbsp;
+      <a href="#M000398">find_known_methods</a>&nbsp;&nbsp;
+      <a href="#M000400">force_direct_mode?</a>&nbsp;&nbsp;
+      <a href="#M000405">force_discovery_method_by_filter</a>&nbsp;&nbsp;
+      <a href="#M000399">has_method?</a>&nbsp;&nbsp;
+      <a href="#M000397">new</a>&nbsp;&nbsp;
+      <a href="#M000406">timeout_for_compound_filter</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000397" class="method-detail">
+        <a name="M000397"></a>
+
+        <div class="method-heading">
+          <a href="#M000397" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(client)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000397-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000397-source">
+<pre>
+   <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 3</span>
+3:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">client</span>)
+4:       <span class="ruby-ivar">@known_methods</span> = <span class="ruby-identifier">find_known_methods</span>
+5:       <span class="ruby-ivar">@default_method</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">default_discovery_method</span>
+6:       <span class="ruby-ivar">@client</span> = <span class="ruby-identifier">client</span>
+7:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000404" class="method-detail">
+        <a name="M000404"></a>
+
+        <div class="method-heading">
+          <a href="#M000404" class="method-signature">
+          <span class="method-name">check_capabilities</span><span class="method-args">(filter)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+<a href="Agent.html">Agent</a> filters are always present no matter what,
+so we cant raise an error if the capabilities suggest the discovery method
+cant do agents we just have to rely on the discovery plugin to not do
+stupid things in the presense of a agent filter
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000404-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000404-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 62</span>
+62:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">check_capabilities</span>(<span class="ruby-identifier">filter</span>)
+63:       <span class="ruby-identifier">capabilities</span> = <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">discovery_interface</span>[<span class="ruby-identifier">:capabilities</span>]
+64: 
+65:       <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">capabilities</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:classes</span>)
+66:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Cannot use class filters while using the '%s' discovery method&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">discovery_method</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">filter</span>[<span class="ruby-value str">&quot;cf_class&quot;</span>].<span class="ruby-identifier">empty?</span>
+67:       <span class="ruby-keyword kw">end</span>
+68: 
+69:       <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">capabilities</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:facts</span>)
+70:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Cannot use fact filters while using the '%s' discovery method&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">discovery_method</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">filter</span>[<span class="ruby-value str">&quot;fact&quot;</span>].<span class="ruby-identifier">empty?</span>
+71:       <span class="ruby-keyword kw">end</span>
+72: 
+73:       <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">capabilities</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:identity</span>)
+74:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Cannot use identity filters while using the '%s' discovery method&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">discovery_method</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">filter</span>[<span class="ruby-value str">&quot;identity&quot;</span>].<span class="ruby-identifier">empty?</span>
+75:       <span class="ruby-keyword kw">end</span>
+76: 
+77:       <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">capabilities</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:compound</span>)
+78:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Cannot use compound filters while using the '%s' discovery method&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">discovery_method</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">filter</span>[<span class="ruby-value str">&quot;compound&quot;</span>].<span class="ruby-identifier">empty?</span>
+79:       <span class="ruby-keyword kw">end</span>
+80:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000403" class="method-detail">
+        <a name="M000403"></a>
+
+        <div class="method-heading">
+          <a href="#M000403" class="method-signature">
+          <span class="method-name">ddl</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000403-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000403-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 47</span>
+47:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ddl</span>
+48:       <span class="ruby-ivar">@ddl</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">discovery_method</span>, <span class="ruby-identifier">:discovery</span>)
+49: 
+50:       <span class="ruby-comment cmt"># if the discovery method got changed we might have an old DDL cached</span>
+51:       <span class="ruby-comment cmt"># this will detect that and reread the correct DDL from disk</span>
+52:       <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">meta</span>[<span class="ruby-identifier">:name</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">discovery_method</span>
+53:         <span class="ruby-ivar">@ddl</span> = <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">discovery_method</span>, <span class="ruby-identifier">:discovery</span>)
+54:       <span class="ruby-keyword kw">end</span>
+55: 
+56:       <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@ddl</span>
+57:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000408" class="method-detail">
+        <a name="M000408"></a>
+
+        <div class="method-heading">
+          <a href="#M000408" class="method-signature">
+          <span class="method-name">discover</span><span class="method-args">(filter, timeout, limit)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000408-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000408-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 127</span>
+127:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discover</span>(<span class="ruby-identifier">filter</span>, <span class="ruby-identifier">timeout</span>, <span class="ruby-identifier">limit</span>)
+128:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Limit has to be an integer&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">limit</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Fixnum</span>)
+129: 
+130:       <span class="ruby-identifier">force_discovery_method_by_filter</span>(<span class="ruby-identifier">filter</span>)
+131: 
+132:       <span class="ruby-identifier">check_capabilities</span>(<span class="ruby-identifier">filter</span>)
+133: 
+134:       <span class="ruby-identifier">discovered</span> = <span class="ruby-identifier">discovery_class</span>.<span class="ruby-identifier">discover</span>(<span class="ruby-identifier">filter</span>, <span class="ruby-identifier">discovery_timeout</span>(<span class="ruby-identifier">timeout</span>, <span class="ruby-identifier">filter</span>), <span class="ruby-identifier">limit</span>, <span class="ruby-ivar">@client</span>)
+135: 
+136:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">limit</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
+137:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">discovered</span>[<span class="ruby-value">0</span>,<span class="ruby-identifier">limit</span>]
+138:       <span class="ruby-keyword kw">else</span>
+139:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">discovered</span>
+140:       <span class="ruby-keyword kw">end</span>
+141:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000402" class="method-detail">
+        <a name="M000402"></a>
+
+        <div class="method-heading">
+          <a href="#M000402" class="method-signature">
+          <span class="method-name">discovery_class</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000402-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000402-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 39</span>
+39:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discovery_class</span>
+40:       <span class="ruby-identifier">method</span> = <span class="ruby-identifier">discovery_method</span>.<span class="ruby-identifier">capitalize</span>
+41: 
+42:       <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">loadclass</span>(<span class="ruby-node">&quot;MCollective::Discovery::#{method}&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">const_defined?</span>(<span class="ruby-identifier">method</span>)
+43: 
+44:       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">method</span>)
+45:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000401" class="method-detail">
+        <a name="M000401"></a>
+
+        <div class="method-heading">
+          <a href="#M000401" class="method-signature">
+          <span class="method-name">discovery_method</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000401-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000401-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 21</span>
+21:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discovery_method</span>
+22:       <span class="ruby-identifier">method</span> = <span class="ruby-value str">&quot;mc&quot;</span>
+23: 
+24:       <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:discovery_method</span>]
+25:         <span class="ruby-identifier">method</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:discovery_method</span>]
+26:       <span class="ruby-keyword kw">else</span>
+27:         <span class="ruby-identifier">method</span> = <span class="ruby-ivar">@default_method</span>
+28:       <span class="ruby-keyword kw">end</span>
+29: 
+30:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Unknown discovery method %s&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">method</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">has_method?</span>(<span class="ruby-identifier">method</span>)
+31: 
+32:       <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">method</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;mc&quot;</span>
+33:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Custom discovery methods require direct addressing mode&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">direct_addressing</span>
+34:       <span class="ruby-keyword kw">end</span>
+35: 
+36:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">method</span>
+37:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000407" class="method-detail">
+        <a name="M000407"></a>
+
+        <div class="method-heading">
+          <a href="#M000407" class="method-signature">
+          <span class="method-name">discovery_timeout</span><span class="method-args">(timeout, filter)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000407-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000407-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 117</span>
+117:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discovery_timeout</span>(<span class="ruby-identifier">timeout</span>, <span class="ruby-identifier">filter</span>)
+118:       <span class="ruby-identifier">timeout</span> = <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">meta</span>[<span class="ruby-identifier">:timeout</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">timeout</span>
+119: 
+120:       <span class="ruby-keyword kw">unless</span> (<span class="ruby-identifier">filter</span>[<span class="ruby-value str">&quot;compound&quot;</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">filter</span>[<span class="ruby-value str">&quot;compound&quot;</span>].<span class="ruby-identifier">empty?</span>)
+121:         <span class="ruby-identifier">timeout</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">timeout_for_compound_filter</span>(<span class="ruby-identifier">filter</span>[<span class="ruby-value str">&quot;compound&quot;</span>])
+122:       <span class="ruby-keyword kw">else</span>
+123:         <span class="ruby-identifier">timeout</span>
+124:       <span class="ruby-keyword kw">end</span>
+125:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000398" class="method-detail">
+        <a name="M000398"></a>
+
+        <div class="method-heading">
+          <a href="#M000398" class="method-signature">
+          <span class="method-name">find_known_methods</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000398-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000398-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 9</span>
+ 9:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">find_known_methods</span>
+10:       <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">find</span>(<span class="ruby-value str">&quot;discovery&quot;</span>)
+11:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000400" class="method-detail">
+        <a name="M000400"></a>
+
+        <div class="method-heading">
+          <a href="#M000400" class="method-signature">
+          <span class="method-name">force_direct_mode?</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000400-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000400-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 17</span>
+17:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">force_direct_mode?</span>
+18:       <span class="ruby-identifier">discovery_method</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">&quot;mc&quot;</span>
+19:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000405" class="method-detail">
+        <a name="M000405"></a>
+
+        <div class="method-heading">
+          <a href="#M000405" class="method-signature">
+          <span class="method-name">force_discovery_method_by_filter</span><span class="method-args">(filter)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+checks if compound filters are used and then forces the &#8216;mc&#8217;
+discovery plugin
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000405-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000405-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 83</span>
+83:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">force_discovery_method_by_filter</span>(<span class="ruby-identifier">filter</span>)
+84:       <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">discovery_method</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;mc&quot;</span>
+85:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">filter</span>[<span class="ruby-value str">&quot;compound&quot;</span>].<span class="ruby-identifier">empty?</span>
+86:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">info</span> <span class="ruby-value str">&quot;Switching to mc discovery method because compound filters are used&quot;</span>
+87:           <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:discovery_method</span>] = <span class="ruby-value str">&quot;mc&quot;</span>
+88: 
+89:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
+90:         <span class="ruby-keyword kw">end</span>
+91:       <span class="ruby-keyword kw">end</span>
+92: 
+93:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
+94:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000399" class="method-detail">
+        <a name="M000399"></a>
+
+        <div class="method-heading">
+          <a href="#M000399" class="method-signature">
+          <span class="method-name">has_method?</span><span class="method-args">(method)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000399-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000399-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 13</span>
+13:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_method?</span>(<span class="ruby-identifier">method</span>)
+14:       <span class="ruby-ivar">@known_methods</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">method</span>)
+15:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000406" class="method-detail">
+        <a name="M000406"></a>
+
+        <div class="method-heading">
+          <a href="#M000406" class="method-signature">
+          <span class="method-name">timeout_for_compound_filter</span><span class="method-args">(compound_filter)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+if a compound filter is specified and it has any function then we read the
+<a href="DDL.html">DDL</a> for each of those plugins and sum up the timeout
+declared in the <a href="DDL.html">DDL</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000406-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000406-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/discovery.rb, line 99</span>
+ 99:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">timeout_for_compound_filter</span>(<span class="ruby-identifier">compound_filter</span>)
+100:       <span class="ruby-keyword kw">return</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">compound_filter</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">compound_filter</span>.<span class="ruby-identifier">empty?</span>
+101: 
+102:       <span class="ruby-identifier">timeout</span> = <span class="ruby-value">0</span>
+103: 
+104:       <span class="ruby-identifier">compound_filter</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">filter</span><span class="ruby-operator">|</span>
+105:         <span class="ruby-identifier">filter</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">statement</span><span class="ruby-operator">|</span>
+106:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">statement</span>[<span class="ruby-value str">&quot;fstatement&quot;</span>]
+107:             <span class="ruby-identifier">pluginname</span> = <span class="ruby-constant">Data</span>.<span class="ruby-identifier">pluginname</span>(<span class="ruby-identifier">statement</span>[<span class="ruby-value str">&quot;fstatement&quot;</span>][<span class="ruby-value str">&quot;name&quot;</span>])
+108:             <span class="ruby-identifier">ddl</span> = <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">pluginname</span>, <span class="ruby-identifier">:data</span>)
+109:             <span class="ruby-identifier">timeout</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">meta</span>[<span class="ruby-identifier">:timeout</span>]
+110:           <span class="ruby-keyword kw">end</span>
+111:         <span class="ruby-keyword kw">end</span>
+112:       <span class="ruby-keyword kw">end</span>
+113: 
+114:       <span class="ruby-identifier">timeout</span>
+115:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Facts.html b/doc/classes/MCollective/Facts.html
new file mode 100644 (file)
index 0000000..5171a69
--- /dev/null
@@ -0,0 +1,237 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Module: MCollective::Facts</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Module</strong></td>
+          <td class="class-name-in-header">MCollective::Facts</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/facts/base_rb.html">
+                lib/mcollective/facts/base.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/facts_rb.html">
+                lib/mcollective/facts.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+This is a class that gives access to the configured fact provider such as
+MCollectives::Facts::Facter that uses Reductive Labs facter
+</p>
+<p>
+The actual provider is pluggable and configurable using the
+&#8216;factsource&#8217; configuration option.
+</p>
+<p>
+To develop a new factsource simply create a class under <a
+href="Facts.html">MCollective::Facts</a>:: and provide the following
+classes:
+</p>
+<pre>
+  self.get_fact(fact)
+  self.has_fact?(fact)
+</pre>
+<p>
+You can also just inherit from <a
+href="Facts/Base.html">MCollective::Facts::Base</a> and provide just the
+</p>
+<pre>
+  self.get_facts
+</pre>
+<p>
+method that should return a hash of facts.
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000018">[]</a>&nbsp;&nbsp;
+      <a href="#M000017">get_fact</a>&nbsp;&nbsp;
+      <a href="#M000016">has_fact?</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+    <div id="class-list">
+      <h3 class="section-bar">Classes and Modules</h3>
+
+      Class <a href="Facts/Base.html" class="link">MCollective::Facts::Base</a><br />
+
+    </div>
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000018" class="method-detail">
+        <a name="M000018"></a>
+
+        <div class="method-heading">
+          <a href="#M000018" class="method-signature">
+          <span class="method-name">[]</span><span class="method-args">(fact)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Get the value of a fact
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000018-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/facts.rb, line 35</span>
+35:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-operator">[]</span>(<span class="ruby-identifier">fact</span>)
+36:       <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;facts_plugin&quot;</span>].<span class="ruby-identifier">get_fact</span>(<span class="ruby-identifier">fact</span>)
+37:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000017" class="method-detail">
+        <a name="M000017"></a>
+
+        <div class="method-heading">
+          <a href="#M000017" class="method-signature">
+          <span class="method-name">get_fact</span><span class="method-args">(fact)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Get the value of a fact
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000017-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/facts.rb, line 30</span>
+30:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get_fact</span>(<span class="ruby-identifier">fact</span>)
+31:       <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;facts_plugin&quot;</span>].<span class="ruby-identifier">get_fact</span>(<span class="ruby-identifier">fact</span>)
+32:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000016" class="method-detail">
+        <a name="M000016"></a>
+
+        <div class="method-heading">
+          <a href="#M000016" class="method-signature">
+          <span class="method-name">has_fact?</span><span class="method-args">(fact, value)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+True if we know of a specific fact else false
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000016-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/facts.rb, line 25</span>
+25:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">has_fact?</span>(<span class="ruby-identifier">fact</span>, <span class="ruby-identifier">value</span>)
+26:       <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;facts_plugin&quot;</span>].<span class="ruby-identifier">get_fact</span>(<span class="ruby-identifier">fact</span>) <span class="ruby-operator">==</span> <span class="ruby-identifier">value</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">true</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">false</span>
+27:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Facts/Base.html b/doc/classes/MCollective/Facts/Base.html
new file mode 100644 (file)
index 0000000..b7998e9
--- /dev/null
@@ -0,0 +1,343 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Facts::Base</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Facts::Base</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/facts/base_rb.html">
+                lib/mcollective/facts/base.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+A base class for fact providers, to make a <a
+href="Base.html#M000019">new</a> fully functional fact provider inherit
+from this and simply provide a self.get_facts method that returns a hash
+like:
+</p>
+<pre>
+ {&quot;foo&quot; =&gt; &quot;bar&quot;,
+  &quot;bar&quot; =&gt; &quot;baz&quot;}
+</pre>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000024">force_reload?</a>&nbsp;&nbsp;
+      <a href="#M000021">get_fact</a>&nbsp;&nbsp;
+      <a href="#M000022">get_facts</a>&nbsp;&nbsp;
+      <a href="#M000023">has_fact?</a>&nbsp;&nbsp;
+      <a href="#M000020">inherited</a>&nbsp;&nbsp;
+      <a href="#M000019">new</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000020" class="method-detail">
+        <a name="M000020"></a>
+
+        <div class="method-heading">
+          <a href="#M000020" class="method-signature">
+          <span class="method-name">inherited</span><span class="method-args">(klass)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Registers <a href="Base.html#M000019">new</a> fact sources into the plugin
+manager
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000020-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/facts/base.rb, line 17</span>
+17:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">inherited</span>(<span class="ruby-identifier">klass</span>)
+18:         <span class="ruby-constant">PluginManager</span> <span class="ruby-operator">&lt;&lt;</span> {<span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;facts_plugin&quot;</span>, <span class="ruby-identifier">:class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">to_s</span>}
+19:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000019" class="method-detail">
+        <a name="M000019"></a>
+
+        <div class="method-heading">
+          <a href="#M000019" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000019-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/facts/base.rb, line 10</span>
+10:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
+11:         <span class="ruby-ivar">@facts</span> = {}
+12:         <span class="ruby-ivar">@last_good_facts</span> = {}
+13:         <span class="ruby-ivar">@last_facts_load</span> = <span class="ruby-value">0</span>
+14:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000024" class="method-detail">
+        <a name="M000024"></a>
+
+        <div class="method-heading">
+          <a href="#M000024" class="method-signature">
+          <span class="method-name">force_reload?</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Plugins can override this to provide forced fact invalidation
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000024-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/facts/base.rb, line 81</span>
+81:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">force_reload?</span>
+82:         <span class="ruby-keyword kw">false</span>
+83:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000021" class="method-detail">
+        <a name="M000021"></a>
+
+        <div class="method-heading">
+          <a href="#M000021" class="method-signature">
+          <span class="method-name">get_fact</span><span class="method-args">(fact=nil)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns the value of a single fact
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000021-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/facts/base.rb, line 22</span>
+22:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_fact</span>(<span class="ruby-identifier">fact</span>=<span class="ruby-keyword kw">nil</span>)
+23:         <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>
+24: 
+25:         <span class="ruby-identifier">cache_time</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">fact_cache_time</span> <span class="ruby-operator">||</span> <span class="ruby-value">300</span>
+26: 
+27:         <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">exclusive</span> <span class="ruby-keyword kw">do</span>
+28:           <span class="ruby-keyword kw">begin</span>
+29:             <span class="ruby-keyword kw">if</span> (<span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@last_facts_load</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">cache_time</span>.<span class="ruby-identifier">to_i</span> ) <span class="ruby-operator">||</span> <span class="ruby-identifier">force_reload?</span>
+30:               <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Resetting facter cache, now: #{Time.now.to_i} last-known-good: #{@last_facts_load}&quot;</span>)
+31: 
+32:               <span class="ruby-identifier">tfacts</span> = <span class="ruby-identifier">load_facts_from_source</span>
+33: 
+34:               <span class="ruby-comment cmt"># Force reset to last known good state on empty facts</span>
+35:               <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Got empty facts&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">tfacts</span>.<span class="ruby-identifier">empty?</span>
+36: 
+37:               <span class="ruby-ivar">@facts</span>.<span class="ruby-identifier">clear</span>
+38: 
+39:               <span class="ruby-identifier">tfacts</span>.<span class="ruby-identifier">each_pair</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>,<span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
+40:                 <span class="ruby-ivar">@facts</span>[<span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_s</span>] = <span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_s</span>
+41:               <span class="ruby-keyword kw">end</span>
+42: 
+43:               <span class="ruby-ivar">@last_good_facts</span> = <span class="ruby-ivar">@facts</span>.<span class="ruby-identifier">clone</span>
+44:               <span class="ruby-ivar">@last_facts_load</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_i</span>
+45:             <span class="ruby-keyword kw">else</span>
+46:               <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Using cached facts now: #{Time.now.to_i} last-known-good: #{@last_facts_load}&quot;</span>)
+47:             <span class="ruby-keyword kw">end</span>
+48:           <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+49:             <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">&quot;Failed to load facts: #{e.class}: #{e}&quot;</span>)
+50: 
+51:             <span class="ruby-comment cmt"># Avoid loops where failing fact loads cause huge CPU</span>
+52:             <span class="ruby-comment cmt"># loops, this way it only retries once every cache_time</span>
+53:             <span class="ruby-comment cmt"># seconds</span>
+54:             <span class="ruby-ivar">@last_facts_load</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_i</span>
+55: 
+56:             <span class="ruby-comment cmt"># Revert to last known good state</span>
+57:             <span class="ruby-ivar">@facts</span> = <span class="ruby-ivar">@last_good_facts</span>.<span class="ruby-identifier">clone</span>
+58:           <span class="ruby-keyword kw">end</span>
+59:         <span class="ruby-keyword kw">end</span>
+60: 
+61: 
+62:         <span class="ruby-comment cmt"># If you do not supply a specific fact all facts will be returned</span>
+63:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fact</span>.<span class="ruby-identifier">nil?</span>
+64:           <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@facts</span>
+65:         <span class="ruby-keyword kw">else</span>
+66:           <span class="ruby-ivar">@facts</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">fact</span>) <span class="ruby-operator">?</span> <span class="ruby-ivar">@facts</span>[<span class="ruby-identifier">fact</span>] <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
+67:         <span class="ruby-keyword kw">end</span>
+68:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000022" class="method-detail">
+        <a name="M000022"></a>
+
+        <div class="method-heading">
+          <a href="#M000022" class="method-signature">
+          <span class="method-name">get_facts</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns all facts
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000022-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/facts/base.rb, line 71</span>
+71:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_facts</span>
+72:         <span class="ruby-identifier">get_fact</span>(<span class="ruby-keyword kw">nil</span>)
+73:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000023" class="method-detail">
+        <a name="M000023"></a>
+
+        <div class="method-heading">
+          <a href="#M000023" class="method-signature">
+          <span class="method-name">has_fact?</span><span class="method-args">(fact)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns true if we know about a specific fact, false otherwise
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000023-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/facts/base.rb, line 76</span>
+76:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">has_fact?</span>(<span class="ruby-identifier">fact</span>)
+77:         <span class="ruby-identifier">get_fact</span>(<span class="ruby-keyword kw">nil</span>).<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">fact</span>)
+78:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Generators.html b/doc/classes/MCollective/Generators.html
new file mode 100644 (file)
index 0000000..7e68a34
--- /dev/null
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Module: MCollective::Generators</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Module</strong></td>
+          <td class="class-name-in-header">MCollective::Generators</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/generators/base_rb.html">
+                lib/mcollective/generators/base.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/generators/data_generator_rb.html">
+                lib/mcollective/generators/data_generator.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/generators/agent_generator_rb.html">
+                lib/mcollective/generators/agent_generator.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/generators_rb.html">
+                lib/mcollective/generators.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+    <div id="class-list">
+      <h3 class="section-bar">Classes and Modules</h3>
+
+      Class <a href="Generators/AgentGenerator.html" class="link">MCollective::Generators::AgentGenerator</a><br />
+Class <a href="Generators/Base.html" class="link">MCollective::Generators::Base</a><br />
+Class <a href="Generators/DataGenerator.html" class="link">MCollective::Generators::DataGenerator</a><br />
+
+    </div>
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Generators/AgentGenerator.html b/doc/classes/MCollective/Generators/AgentGenerator.html
new file mode 100644 (file)
index 0000000..caf5c1a
--- /dev/null
@@ -0,0 +1,267 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Generators::AgentGenerator</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Generators::AgentGenerator</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/generators/agent_generator_rb.html">
+                lib/mcollective/generators/agent_generator.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                <a href="Base.html">
+                Base
+               </a>
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000252">action_help</a>&nbsp;&nbsp;
+      <a href="#M000250">create_ddl</a>&nbsp;&nbsp;
+      <a href="#M000251">create_plugin_content</a>&nbsp;&nbsp;
+      <a href="#M000249">new</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">content</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">ddl</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000249" class="method-detail">
+        <a name="M000249"></a>
+
+        <div class="method-heading">
+          <a href="#M000249" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(plugin_name, actions = [], name = nil, description = nil, author = nil , license = nil, version = nil, url = nil, timeout = nil)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000249-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000249-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/generators/agent_generator.rb, line 7</span>
+ 7:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">plugin_name</span>, <span class="ruby-identifier">actions</span> = [],  <span class="ruby-identifier">name</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">description</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">author</span> = <span class="ruby-keyword kw">nil</span> ,
+ 8:                      <span class="ruby-identifier">license</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">version</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">url</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">timeout</span> = <span class="ruby-keyword kw">nil</span>)
+ 9: 
+10:         <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">description</span>, <span class="ruby-identifier">author</span>, <span class="ruby-identifier">license</span>, <span class="ruby-identifier">version</span>, <span class="ruby-identifier">url</span>, <span class="ruby-identifier">timeout</span>)
+11:         <span class="ruby-ivar">@plugin_name</span> = <span class="ruby-identifier">plugin_name</span>
+12:         <span class="ruby-ivar">@actions</span> = <span class="ruby-identifier">actions</span> <span class="ruby-operator">||</span> []
+13:         <span class="ruby-ivar">@ddl</span> = <span class="ruby-identifier">create_ddl</span>
+14:         <span class="ruby-ivar">@mod_name</span> = <span class="ruby-value str">&quot;Agent&quot;</span>
+15:         <span class="ruby-ivar">@pclass</span> = <span class="ruby-value str">&quot;RPC::Agent&quot;</span>
+16:         <span class="ruby-ivar">@content</span> = <span class="ruby-identifier">create_plugin_content</span>
+17:         <span class="ruby-ivar">@plugin</span> = <span class="ruby-identifier">create_plugin_string</span>
+18:         <span class="ruby-identifier">write_plugins</span>
+19:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000252" class="method-detail">
+        <a name="M000252"></a>
+
+        <div class="method-heading">
+          <a href="#M000252" class="method-signature">
+          <span class="method-name">action_help</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000252-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000252-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/generators/agent_generator.rb, line 45</span>
+45:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">action_help</span>
+46:         <span class="ruby-identifier">action_snippet</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>), <span class="ruby-value str">&quot;templates&quot;</span>, <span class="ruby-value str">&quot;action_snippet.erb&quot;</span>))
+47:         <span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">action_snippet</span>).<span class="ruby-identifier">result</span>
+48:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000250" class="method-detail">
+        <a name="M000250"></a>
+
+        <div class="method-heading">
+          <a href="#M000250" class="method-signature">
+          <span class="method-name">create_ddl</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000250-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000250-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/generators/agent_generator.rb, line 21</span>
+21:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_ddl</span>
+22:         <span class="ruby-identifier">action_text</span> = <span class="ruby-value str">&quot;&quot;</span>
+23:         <span class="ruby-ivar">@actions</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">action</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
+24:           <span class="ruby-identifier">action_text</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot;action \&quot;#{action}\&quot;, :description =&gt; \&quot;%ACTIONDESCRIPTION%\&quot; do\n&quot;</span>
+25:           <span class="ruby-identifier">action_text</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">action_help</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
+26:           <span class="ruby-identifier">action_text</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">&quot;end\n&quot;</span>
+27:           <span class="ruby-identifier">action_text</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">&quot;\n&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@actions</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> (<span class="ruby-identifier">i</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
+28:         <span class="ruby-keyword kw">end</span>
+29:         <span class="ruby-comment cmt"># Use inherited method to create metadata part of the ddl</span>
+30:         <span class="ruby-identifier">create_metadata_string</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">action_text</span>
+31:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000251" class="method-detail">
+        <a name="M000251"></a>
+
+        <div class="method-heading">
+          <a href="#M000251" class="method-signature">
+          <span class="method-name">create_plugin_content</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000251-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000251-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/generators/agent_generator.rb, line 33</span>
+33:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_plugin_content</span>
+34:         <span class="ruby-identifier">content_text</span> = <span class="ruby-value str">&quot;&quot;</span>
+35: 
+36:         <span class="ruby-comment cmt"># Add actions to agent file</span>
+37:         <span class="ruby-ivar">@actions</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">action</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
+38:           <span class="ruby-identifier">content_text</span> <span class="ruby-operator">+=</span>  <span class="ruby-value str">&quot;%6s%s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-value str">&quot; &quot;</span>, <span class="ruby-node">&quot;action \&quot;#{action}\&quot; do\n&quot;</span>]
+39:           <span class="ruby-identifier">content_text</span> <span class="ruby-operator">+=</span>  <span class="ruby-value str">&quot;%6s%s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-value str">&quot; &quot;</span>, <span class="ruby-value str">&quot;end\n&quot;</span>]
+40:           <span class="ruby-identifier">content_text</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">&quot;\n&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@actions</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> (<span class="ruby-identifier">i</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
+41:         <span class="ruby-keyword kw">end</span>
+42:         <span class="ruby-identifier">content_text</span>
+43:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Generators/Base.html b/doc/classes/MCollective/Generators/Base.html
new file mode 100644 (file)
index 0000000..de6cecd
--- /dev/null
@@ -0,0 +1,267 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Generators::Base</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Generators::Base</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/generators/base_rb.html">
+                lib/mcollective/generators/base.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000257">create_metadata_string</a>&nbsp;&nbsp;
+      <a href="#M000258">create_plugin_string</a>&nbsp;&nbsp;
+      <a href="#M000256">new</a>&nbsp;&nbsp;
+      <a href="#M000259">write_plugins</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">meta</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">mod_name</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">plugin_name</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000256" class="method-detail">
+        <a name="M000256"></a>
+
+        <div class="method-heading">
+          <a href="#M000256" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(name, description, author, license, version, url, timeout)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000256-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000256-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/generators/base.rb, line 5</span>
+ 5:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">description</span>, <span class="ruby-identifier">author</span>, <span class="ruby-identifier">license</span>, <span class="ruby-identifier">version</span>, <span class="ruby-identifier">url</span>, <span class="ruby-identifier">timeout</span>)
+ 6:         <span class="ruby-ivar">@meta</span> = {<span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">name</span>,
+ 7:                  <span class="ruby-identifier">:description</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">description</span>,
+ 8:                  <span class="ruby-identifier">:author</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">author</span>,
+ 9:                  <span class="ruby-identifier">:license</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">license</span>,
+10:                  <span class="ruby-identifier">:version</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">version</span>,
+11:                  <span class="ruby-identifier">:url</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">url</span>,
+12:                  <span class="ruby-identifier">:timeout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">timeout</span>}
+13:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000257" class="method-detail">
+        <a name="M000257"></a>
+
+        <div class="method-heading">
+          <a href="#M000257" class="method-signature">
+          <span class="method-name">create_metadata_string</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000257-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000257-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/generators/base.rb, line 15</span>
+15:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_metadata_string</span>
+16:         <span class="ruby-identifier">ddl_template</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>), <span class="ruby-value str">&quot;templates&quot;</span>, <span class="ruby-value str">&quot;ddl.erb&quot;</span>))
+17:         <span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ddl_template</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-value str">&quot;-&quot;</span>).<span class="ruby-identifier">result</span>(<span class="ruby-identifier">binding</span>)
+18:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000258" class="method-detail">
+        <a name="M000258"></a>
+
+        <div class="method-heading">
+          <a href="#M000258" class="method-signature">
+          <span class="method-name">create_plugin_string</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000258-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000258-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/generators/base.rb, line 20</span>
+20:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_plugin_string</span>
+21:         <span class="ruby-identifier">plugin_template</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>), <span class="ruby-value str">&quot;templates&quot;</span>, <span class="ruby-value str">&quot;plugin.erb&quot;</span>))
+22:         <span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">plugin_template</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-value str">&quot;-&quot;</span>).<span class="ruby-identifier">result</span>(<span class="ruby-identifier">binding</span>)
+23:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000259" class="method-detail">
+        <a name="M000259"></a>
+
+        <div class="method-heading">
+          <a href="#M000259" class="method-signature">
+          <span class="method-name">write_plugins</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000259-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000259-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/generators/base.rb, line 25</span>
+25:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write_plugins</span>
+26:         <span class="ruby-keyword kw">begin</span>
+27:           <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">mkdir</span> <span class="ruby-ivar">@plugin_name</span>
+28:           <span class="ruby-identifier">dirname</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@plugin_name</span>, <span class="ruby-ivar">@mod_name</span>.<span class="ruby-identifier">downcase</span>)
+29:           <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">mkdir</span> <span class="ruby-identifier">dirname</span>
+30:           <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Created plugin directory : #{@plugin_name}&quot;</span>
+31: 
+32:           <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">dirname</span>, <span class="ruby-node">&quot;#{@plugin_name}.ddl&quot;</span>), <span class="ruby-value str">&quot;w&quot;</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-ivar">@ddl</span>}
+33:           <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Created DDL file : #{File.join(dirname, &quot;#{@plugin_name}.ddl&quot;)}&quot;</span>
+34: 
+35:           <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">dirname</span>, <span class="ruby-node">&quot;#{@plugin_name}.rb&quot;</span>), <span class="ruby-value str">&quot;w&quot;</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-ivar">@plugin</span>}
+36:           <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Created #{@mod_name} file : #{File.join(dirname, &quot;#{@plugin_name}.rb&quot;)}&quot;</span>
+37:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EEXIST</span>
+38:           <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;cannot generate '#{@plugin_name}' : plugin directory already exists.&quot;</span>
+39:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+40:           <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_rf</span>(<span class="ruby-ivar">@plugin_name</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-ivar">@plugin_name</span>)
+41:           <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;cannot generate plugin - #{e}&quot;</span>
+42:         <span class="ruby-keyword kw">end</span>
+43:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Generators/DataGenerator.html b/doc/classes/MCollective/Generators/DataGenerator.html
new file mode 100644 (file)
index 0000000..16bd9df
--- /dev/null
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Generators::DataGenerator</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Generators::DataGenerator</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/generators/data_generator_rb.html">
+                lib/mcollective/generators/data_generator.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                <a href="Base.html">
+                Base
+               </a>
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000254">create_ddl</a>&nbsp;&nbsp;
+      <a href="#M000255">create_plugin_content</a>&nbsp;&nbsp;
+      <a href="#M000253">new</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">content</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">ddl</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000253" class="method-detail">
+        <a name="M000253"></a>
+
+        <div class="method-heading">
+          <a href="#M000253" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(plugin_name, outputs = [], name = nil, description = nil, author = nil , license = nil, version = nil, url = nil, timeout = nil)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000253-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000253-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/generators/data_generator.rb, line 7</span>
+ 7:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">plugin_name</span>, <span class="ruby-identifier">outputs</span> = [],  <span class="ruby-identifier">name</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">description</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">author</span> = <span class="ruby-keyword kw">nil</span> ,
+ 8:                      <span class="ruby-identifier">license</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">version</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">url</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">timeout</span> = <span class="ruby-keyword kw">nil</span>)
+ 9: 
+10:         <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">description</span>, <span class="ruby-identifier">author</span>, <span class="ruby-identifier">license</span>, <span class="ruby-identifier">version</span>, <span class="ruby-identifier">url</span>, <span class="ruby-identifier">timeout</span>)
+11:         <span class="ruby-ivar">@mod_name</span> = <span class="ruby-value str">&quot;Data&quot;</span>
+12:         <span class="ruby-ivar">@pclass</span> = <span class="ruby-value str">&quot;Base&quot;</span>
+13:         <span class="ruby-ivar">@plugin_name</span> = <span class="ruby-identifier">plugin_name</span>
+14:         <span class="ruby-ivar">@outputs</span> = <span class="ruby-identifier">outputs</span>
+15:         <span class="ruby-ivar">@ddl</span> = <span class="ruby-identifier">create_ddl</span>
+16:         <span class="ruby-ivar">@content</span> = <span class="ruby-identifier">create_plugin_content</span>
+17:         <span class="ruby-ivar">@plugin</span> = <span class="ruby-identifier">create_plugin_string</span>
+18:         <span class="ruby-identifier">write_plugins</span>
+19:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000254" class="method-detail">
+        <a name="M000254"></a>
+
+        <div class="method-heading">
+          <a href="#M000254" class="method-signature">
+          <span class="method-name">create_ddl</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000254-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000254-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/generators/data_generator.rb, line 21</span>
+21:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_ddl</span>
+22:         <span class="ruby-identifier">query_text</span> = <span class="ruby-value str">&quot;dataquery :description =&gt; \&quot;Query information\&quot; do\n&quot;</span>
+23:         <span class="ruby-identifier">query_text</span> <span class="ruby-operator">+=</span> <span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>), <span class="ruby-value str">&quot;templates&quot;</span>, <span class="ruby-value str">&quot;data_input_snippet.erb&quot;</span>))).<span class="ruby-identifier">result</span>
+24: 
+25:         <span class="ruby-ivar">@outputs</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">output</span>,<span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
+26:           <span class="ruby-identifier">query_text</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">&quot;%2s%s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-value str">&quot; &quot;</span>, <span class="ruby-node">&quot;output :#{output},\n&quot;</span>]
+27:           <span class="ruby-identifier">query_text</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">&quot;%9s%s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-value str">&quot; &quot;</span>, <span class="ruby-value str">&quot;:description =&gt; \&quot;%DESCRIPTION%\&quot;,\n&quot;</span>]
+28:           <span class="ruby-identifier">query_text</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">&quot;%9s%s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-value str">&quot; &quot;</span>, <span class="ruby-value str">&quot;:display_as =&gt; \&quot;%DESCRIPTION%\&quot;\n&quot;</span>]
+29:           <span class="ruby-identifier">query_text</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">&quot;\n&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@outputs</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> (<span class="ruby-identifier">i</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>)
+30:         <span class="ruby-keyword kw">end</span>
+31: 
+32:         <span class="ruby-identifier">query_text</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">&quot;end&quot;</span>
+33: 
+34:         <span class="ruby-comment cmt"># Use inherited method to create metadata part of the ddl</span>
+35:         <span class="ruby-identifier">create_metadata_string</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">query_text</span>
+36:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000255" class="method-detail">
+        <a name="M000255"></a>
+
+        <div class="method-heading">
+          <a href="#M000255" class="method-signature">
+          <span class="method-name">create_plugin_content</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000255-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000255-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/generators/data_generator.rb, line 38</span>
+38:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_plugin_content</span>
+39:         <span class="ruby-identifier">content_text</span> = <span class="ruby-value str">&quot;%6s%s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-value str">&quot; &quot;</span>, <span class="ruby-value str">&quot;query do |what|\n&quot;</span>]
+40: 
+41:         <span class="ruby-ivar">@outputs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">output</span><span class="ruby-operator">|</span>
+42:            <span class="ruby-identifier">content_text</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">&quot;%8s%s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-value str">&quot; &quot;</span>, <span class="ruby-node">&quot;result[:#{output}] = nil\n&quot;</span>]
+43:         <span class="ruby-keyword kw">end</span>
+44:         <span class="ruby-identifier">content_text</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">&quot;%6s%s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-value str">&quot; &quot;</span>, <span class="ruby-value str">&quot;end\n&quot;</span>]
+45: 
+46:         <span class="ruby-comment cmt"># Add actions to agent file</span>
+47:         <span class="ruby-identifier">content_text</span>
+48:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/InvalidRPCData.html b/doc/classes/MCollective/InvalidRPCData.html
new file mode 100644 (file)
index 0000000..4e1c329
--- /dev/null
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::InvalidRPCData</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::InvalidRPCData</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/exception_rb.html">
+                lib/mcollective/exception.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                <a href="RPCError.html">
+                RPCError
+               </a>
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Log.html b/doc/classes/MCollective/Log.html
new file mode 100644 (file)
index 0000000..4d9c85a
--- /dev/null
@@ -0,0 +1,738 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Log</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Log</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/log_rb.html">
+                lib/mcollective/log.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+A simple class that allows logging at various levels.
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000440">check_level</a>&nbsp;&nbsp;
+      <a href="#M000439">config_and_check_level</a>&nbsp;&nbsp;
+      <a href="#M000447">configure</a>&nbsp;&nbsp;
+      <a href="#M000438">cycle_level</a>&nbsp;&nbsp;
+      <a href="#M000434">debug</a>&nbsp;&nbsp;
+      <a href="#M000436">error</a>&nbsp;&nbsp;
+      <a href="#M000450">execution_stack</a>&nbsp;&nbsp;
+      <a href="#M000435">fatal</a>&nbsp;&nbsp;
+      <a href="#M000449">from</a>&nbsp;&nbsp;
+      <a href="#M000432">info</a>&nbsp;&nbsp;
+      <a href="#M000437">instance</a>&nbsp;&nbsp;
+      <a href="#M000445">log</a>&nbsp;&nbsp;
+      <a href="#M000443">logexception</a>&nbsp;&nbsp;
+      <a href="#M000431">logger</a>&nbsp;&nbsp;
+      <a href="#M000444">logmsg</a>&nbsp;&nbsp;
+      <a href="#M000442">message_for</a>&nbsp;&nbsp;
+      <a href="#M000446">set_logger</a>&nbsp;&nbsp;
+      <a href="#M000448">unconfigure</a>&nbsp;&nbsp;
+      <a href="#M000441">valid_level?</a>&nbsp;&nbsp;
+      <a href="#M000433">warn</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+    <div id="constants-list">
+      <h3 class="section-bar">Constants</h3>
+
+      <div class="name-list">
+        <table summary="Constants">
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">VALID_LEVELS</td>
+          <td>=</td>
+          <td class="context-item-value">[:error, :fatal, :debug, :warn, :info]</td>
+        </tr>
+        </table>
+      </div>
+    </div>
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000440" class="method-detail">
+        <a name="M000440"></a>
+
+        <div class="method-heading">
+          <a href="#M000440" class="method-signature">
+          <span class="method-name">check_level</span><span class="method-args">(level)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000440-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000440-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 55</span>
+55:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">check_level</span>(<span class="ruby-identifier">level</span>)
+56:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Unknown log level&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">valid_level?</span>(<span class="ruby-identifier">level</span>)
+57:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000439" class="method-detail">
+        <a name="M000439"></a>
+
+        <div class="method-heading">
+          <a href="#M000439" class="method-signature">
+          <span class="method-name">config_and_check_level</span><span class="method-args">(level)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000439-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000439-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 49</span>
+49:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">config_and_check_level</span>(<span class="ruby-identifier">level</span>)
+50:         <span class="ruby-identifier">configure</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@configured</span>
+51:         <span class="ruby-identifier">check_level</span>(<span class="ruby-identifier">level</span>)
+52:         <span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">should_log?</span>(<span class="ruby-identifier">level</span>)
+53:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000447" class="method-detail">
+        <a name="M000447"></a>
+
+        <div class="method-heading">
+          <a href="#M000447" class="method-signature">
+          <span class="method-name">configure</span><span class="method-args">(logger=nil)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+configures the <a href="Log.html#M000431">logger</a> class, if the config
+has not yet been loaded we default to the console logging class and do not
+set @configured so that future calls to the <a
+href="Log.html#M000445">log</a> method will keep attempting to <a
+href="Log.html#M000447">configure</a> the <a
+href="Log.html#M000431">logger</a> till we eventually get a logging
+preference <a href="Log.html#M000449">from</a> the config module
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000447-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000447-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 130</span>
+130:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configure</span>(<span class="ruby-identifier">logger</span>=<span class="ruby-keyword kw">nil</span>)
+131:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">logger</span>
+132:           <span class="ruby-identifier">logger_type</span> = <span class="ruby-value str">&quot;console&quot;</span>
+133: 
+134:           <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>
+135: 
+136:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">configured</span>
+137:             <span class="ruby-identifier">logger_type</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">logger_type</span>
+138:             <span class="ruby-ivar">@configured</span> = <span class="ruby-keyword kw">true</span>
+139:           <span class="ruby-keyword kw">end</span>
+140: 
+141:           <span class="ruby-identifier">require</span> <span class="ruby-value str">&quot;mcollective/logger/%s_logger&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">logger_type</span>.<span class="ruby-identifier">downcase</span>
+142: 
+143:           <span class="ruby-identifier">logger_class</span> = <span class="ruby-constant">MCollective</span><span class="ruby-operator">::</span><span class="ruby-constant">Logger</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-value str">&quot;%s_logger&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">logger_type</span>.<span class="ruby-identifier">capitalize</span>)
+144: 
+145:           <span class="ruby-identifier">set_logger</span>(<span class="ruby-identifier">logger_class</span>.<span class="ruby-identifier">new</span>)
+146:         <span class="ruby-keyword kw">else</span>
+147:           <span class="ruby-identifier">set_logger</span>(<span class="ruby-identifier">logger</span>)
+148:           <span class="ruby-ivar">@configured</span> = <span class="ruby-keyword kw">true</span>
+149:         <span class="ruby-keyword kw">end</span>
+150: 
+151: 
+152:         <span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">start</span>
+153:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+154:         <span class="ruby-ivar">@configured</span> = <span class="ruby-keyword kw">false</span>
+155:         <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Could not start logger: #{e.class} #{e}&quot;</span>
+156:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000438" class="method-detail">
+        <a name="M000438"></a>
+
+        <div class="method-heading">
+          <a href="#M000438" class="method-signature">
+          <span class="method-name">cycle_level</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+increments the active <a href="Log.html#M000445">log</a> level
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000438-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000438-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 45</span>
+45:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cycle_level</span>
+46:         <span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">cycle_level</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@configured</span>
+47:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000434" class="method-detail">
+        <a name="M000434"></a>
+
+        <div class="method-heading">
+          <a href="#M000434" class="method-signature">
+          <span class="method-name">debug</span><span class="method-args">(msg)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Logs at <a href="Log.html#M000434">debug</a> level
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000434-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000434-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 25</span>
+25:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">debug</span>(<span class="ruby-identifier">msg</span>)
+26:         <span class="ruby-identifier">log</span>(<span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">msg</span>)
+27:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000436" class="method-detail">
+        <a name="M000436"></a>
+
+        <div class="method-heading">
+          <a href="#M000436" class="method-signature">
+          <span class="method-name">error</span><span class="method-args">(msg)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Logs at <a href="Log.html#M000436">error</a> level
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000436-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000436-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 35</span>
+35:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">error</span>(<span class="ruby-identifier">msg</span>)
+36:         <span class="ruby-identifier">log</span>(<span class="ruby-identifier">:error</span>, <span class="ruby-identifier">msg</span>)
+37:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000450" class="method-detail">
+        <a name="M000450"></a>
+
+        <div class="method-heading">
+          <a href="#M000450" class="method-signature">
+          <span class="method-name">execution_stack</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+this method is here to facilitate testing
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000450-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000450-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 170</span>
+170:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">execution_stack</span>
+171:         <span class="ruby-identifier">caller</span>
+172:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000435" class="method-detail">
+        <a name="M000435"></a>
+
+        <div class="method-heading">
+          <a href="#M000435" class="method-signature">
+          <span class="method-name">fatal</span><span class="method-args">(msg)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Logs at <a href="Log.html#M000435">fatal</a> level
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000435-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000435-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 30</span>
+30:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fatal</span>(<span class="ruby-identifier">msg</span>)
+31:         <span class="ruby-identifier">log</span>(<span class="ruby-identifier">:fatal</span>, <span class="ruby-identifier">msg</span>)
+32:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000449" class="method-detail">
+        <a name="M000449"></a>
+
+        <div class="method-heading">
+          <a href="#M000449" class="method-signature">
+          <span class="method-name">from</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+figures out the filename that called us
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000449-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000449-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 164</span>
+164:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">from</span>
+165:         <span class="ruby-identifier">path</span>, <span class="ruby-identifier">line</span>, <span class="ruby-identifier">method</span> = <span class="ruby-identifier">execution_stack</span>[<span class="ruby-value">3</span>].<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/:(\d+)/</span>)
+166:         <span class="ruby-value str">&quot;%s:%s%s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">path</span>), <span class="ruby-identifier">line</span>, <span class="ruby-identifier">method</span>]
+167:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000432" class="method-detail">
+        <a name="M000432"></a>
+
+        <div class="method-heading">
+          <a href="#M000432" class="method-signature">
+          <span class="method-name">info</span><span class="method-args">(msg)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Logs at <a href="Log.html#M000432">info</a> level
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000432-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000432-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 15</span>
+15:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">info</span>(<span class="ruby-identifier">msg</span>)
+16:         <span class="ruby-identifier">log</span>(<span class="ruby-identifier">:info</span>, <span class="ruby-identifier">msg</span>)
+17:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000437" class="method-detail">
+        <a name="M000437"></a>
+
+        <div class="method-heading">
+          <a href="#M000437" class="method-signature">
+          <span class="method-name">instance</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+handle old code that relied on this class being a singleton
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000437-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000437-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 40</span>
+40:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">instance</span>
+41:         <span class="ruby-keyword kw">self</span>
+42:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000445" class="method-detail">
+        <a name="M000445"></a>
+
+        <div class="method-heading">
+          <a href="#M000445" class="method-signature">
+          <span class="method-name">log</span><span class="method-args">(level, msg, origin=nil)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+logs a message at a certain level
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000445-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000445-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 106</span>
+106:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log</span>(<span class="ruby-identifier">level</span>, <span class="ruby-identifier">msg</span>, <span class="ruby-identifier">origin</span>=<span class="ruby-keyword kw">nil</span>)
+107:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">config_and_check_level</span>(<span class="ruby-identifier">level</span>)
+108: 
+109:         <span class="ruby-identifier">origin</span> = <span class="ruby-identifier">from</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">origin</span>
+110: 
+111:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@logger</span>
+112:           <span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">log</span>(<span class="ruby-identifier">level</span>, <span class="ruby-identifier">origin</span>, <span class="ruby-identifier">msg</span>)
+113:         <span class="ruby-keyword kw">else</span>
+114:           <span class="ruby-identifier">t</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">new</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">&quot;%H:%M:%S&quot;</span>)
+115: 
+116:           <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;#{t}: #{level}: #{origin}: #{msg}&quot;</span>
+117:         <span class="ruby-keyword kw">end</span>
+118:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000443" class="method-detail">
+        <a name="M000443"></a>
+
+        <div class="method-heading">
+          <a href="#M000443" class="method-signature">
+          <span class="method-name">logexception</span><span class="method-args">(msgid, level, e, backtrace=false, args={})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000443-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000443-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 67</span>
+67:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logexception</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">level</span>, <span class="ruby-identifier">e</span>, <span class="ruby-identifier">backtrace</span>=<span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">args</span>={})
+68:         <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">config_and_check_level</span>(<span class="ruby-identifier">level</span>)
+69: 
+70:         <span class="ruby-identifier">path</span>, <span class="ruby-identifier">line</span>, <span class="ruby-identifier">method</span> = <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/:(\d+)/</span>)
+71:         <span class="ruby-identifier">origin</span> = <span class="ruby-value str">&quot;%s:%s%s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">path</span>), <span class="ruby-identifier">line</span>, <span class="ruby-identifier">method</span>]
+72: 
+73:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">CodedError</span>)
+74:           <span class="ruby-identifier">msg</span> = <span class="ruby-value str">&quot;%s: %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">e</span>.<span class="ruby-identifier">code</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>]
+75:         <span class="ruby-keyword kw">else</span>
+76:           <span class="ruby-identifier">error_string</span> = <span class="ruby-value str">&quot;%s: %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">e</span>.<span class="ruby-identifier">class</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>]
+77:           <span class="ruby-identifier">msg</span> = <span class="ruby-identifier">message_for</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">args</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">:error</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">error_string</span>))
+78:         <span class="ruby-keyword kw">end</span>
+79: 
+80:         <span class="ruby-identifier">log</span>(<span class="ruby-identifier">level</span>, <span class="ruby-identifier">msg</span>, <span class="ruby-identifier">origin</span>)
+81: 
+82:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">backtrace</span>
+83:           <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
+84:             <span class="ruby-identifier">log</span>(<span class="ruby-identifier">level</span>, <span class="ruby-value str">&quot;%s:          %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">line</span>], <span class="ruby-identifier">origin</span>)
+85:           <span class="ruby-keyword kw">end</span>
+86:         <span class="ruby-keyword kw">end</span>
+87:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000431" class="method-detail">
+        <a name="M000431"></a>
+
+        <div class="method-heading">
+          <a href="#M000431" class="method-signature">
+          <span class="method-name">logger</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Obtain the class name of the currently configured <a
+href="Log.html#M000431">logger</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000431-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000431-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 10</span>
+10:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logger</span>
+11:         <span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">class</span>
+12:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000444" class="method-detail">
+        <a name="M000444"></a>
+
+        <div class="method-heading">
+          <a href="#M000444" class="method-signature">
+          <span class="method-name">logmsg</span><span class="method-args">(msgid, default, level, args={})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Logs a message at a certain level, the message must be a token that will be
+looked up <a href="Log.html#M000449">from</a> the i18n localization
+database
+</p>
+<p>
+Messages can interprolate strings <a href="Log.html#M000449">from</a> the
+args hash, a message with &quot;foo %{bar}&quot; in the localization
+database will use args[:bar] for the value there, the interprolation is
+handled by the i18n library itself
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000444-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000444-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 97</span>
+ 97:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logmsg</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">default</span>, <span class="ruby-identifier">level</span>, <span class="ruby-identifier">args</span>={})
+ 98:         <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">config_and_check_level</span>(<span class="ruby-identifier">level</span>)
+ 99: 
+100:         <span class="ruby-identifier">msg</span> = <span class="ruby-identifier">message_for</span>(<span class="ruby-identifier">msgid</span>, {<span class="ruby-identifier">:default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">default</span>}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">args</span>))
+101: 
+102:         <span class="ruby-identifier">log</span>(<span class="ruby-identifier">level</span>, <span class="ruby-identifier">msg</span>)
+103:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000442" class="method-detail">
+        <a name="M000442"></a>
+
+        <div class="method-heading">
+          <a href="#M000442" class="method-signature">
+          <span class="method-name">message_for</span><span class="method-args">(msgid, args={})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000442-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000442-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 63</span>
+63:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">message_for</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">args</span>={})
+64:         <span class="ruby-value str">&quot;%s: %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">msgid</span>, <span class="ruby-constant">Util</span>.<span class="ruby-identifier">t</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">args</span>)]
+65:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000446" class="method-detail">
+        <a name="M000446"></a>
+
+        <div class="method-heading">
+          <a href="#M000446" class="method-signature">
+          <span class="method-name">set_logger</span><span class="method-args">(logger)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+sets the <a href="Log.html#M000431">logger</a> class to use
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000446-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000446-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 121</span>
+121:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_logger</span>(<span class="ruby-identifier">logger</span>)
+122:         <span class="ruby-ivar">@logger</span> = <span class="ruby-identifier">logger</span>
+123:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000448" class="method-detail">
+        <a name="M000448"></a>
+
+        <div class="method-heading">
+          <a href="#M000448" class="method-signature">
+          <span class="method-name">unconfigure</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000448-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000448-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 158</span>
+158:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unconfigure</span>
+159:         <span class="ruby-ivar">@configured</span> = <span class="ruby-keyword kw">false</span>
+160:         <span class="ruby-identifier">set_logger</span>(<span class="ruby-keyword kw">nil</span>)
+161:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000441" class="method-detail">
+        <a name="M000441"></a>
+
+        <div class="method-heading">
+          <a href="#M000441" class="method-signature">
+          <span class="method-name">valid_level?</span><span class="method-args">(level)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000441-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000441-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 59</span>
+59:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid_level?</span>(<span class="ruby-identifier">level</span>)
+60:         <span class="ruby-constant">VALID_LEVELS</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">level</span>)
+61:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000433" class="method-detail">
+        <a name="M000433"></a>
+
+        <div class="method-heading">
+          <a href="#M000433" class="method-signature">
+          <span class="method-name">warn</span><span class="method-args">(msg)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Logs at <a href="Log.html#M000433">warn</a> level
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000433-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000433-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/log.rb, line 20</span>
+20:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">warn</span>(<span class="ruby-identifier">msg</span>)
+21:         <span class="ruby-identifier">log</span>(<span class="ruby-identifier">:warn</span>, <span class="ruby-identifier">msg</span>)
+22:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Logger.html b/doc/classes/MCollective/Logger.html
new file mode 100644 (file)
index 0000000..de8deae
--- /dev/null
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Module: MCollective::Logger</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Module</strong></td>
+          <td class="class-name-in-header">MCollective::Logger</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/logger_rb.html">
+                lib/mcollective/logger.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/logger/console_logger_rb.html">
+                lib/mcollective/logger/console_logger.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/logger/base_rb.html">
+                lib/mcollective/logger/base.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/logger/syslog_logger_rb.html">
+                lib/mcollective/logger/syslog_logger.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/logger/file_logger_rb.html">
+                lib/mcollective/logger/file_logger.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+    <div id="class-list">
+      <h3 class="section-bar">Classes and Modules</h3>
+
+      Class <a href="Logger/Base.html" class="link">MCollective::Logger::Base</a><br />
+Class <a href="Logger/Console_logger.html" class="link">MCollective::Logger::Console_logger</a><br />
+Class <a href="Logger/File_logger.html" class="link">MCollective::Logger::File_logger</a><br />
+Class <a href="Logger/Syslog_logger.html" class="link">MCollective::Logger::Syslog_logger</a><br />
+
+    </div>
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Logger/Base.html b/doc/classes/MCollective/Logger/Base.html
new file mode 100644 (file)
index 0000000..cb3aa66
--- /dev/null
@@ -0,0 +1,264 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Logger::Base</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Logger::Base</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/logger/base_rb.html">
+                lib/mcollective/logger/base.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+A base class for logging providers.
+</p>
+<p>
+Logging providers should provide the following:
+</p>
+<pre>
+   * start - all you need to do to setup your logging
+   * set_logging_level - set your logging to :info, :warn, etc
+   * valid_levels - a hash of maps from :info to your internal level name
+   * log - what needs to be done to log a specific message
+</pre>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000204">cycle_level</a>&nbsp;&nbsp;
+      <a href="#M000202">new</a>&nbsp;&nbsp;
+      <a href="#M000205">set_level</a>&nbsp;&nbsp;
+      <a href="#M000203">should_log?</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">active_level</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000202" class="method-detail">
+        <a name="M000202"></a>
+
+        <div class="method-heading">
+          <a href="#M000202" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000202-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000202-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/logger/base.rb, line 14</span>
+14:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
+15:         <span class="ruby-ivar">@known_levels</span> = [<span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:info</span>, <span class="ruby-identifier">:warn</span>, <span class="ruby-identifier">:error</span>, <span class="ruby-identifier">:fatal</span>]
+16: 
+17:         <span class="ruby-comment cmt"># Sanity check the class that impliments the logging</span>
+18:         <span class="ruby-ivar">@known_levels</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">lvl</span><span class="ruby-operator">|</span>
+19:           <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Logger class did not specify a map for #{lvl}&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">valid_levels</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">lvl</span>)
+20:         <span class="ruby-keyword kw">end</span>
+21:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000204" class="method-detail">
+        <a name="M000204"></a>
+
+        <div class="method-heading">
+          <a href="#M000204" class="method-signature">
+          <span class="method-name">cycle_level</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Figures out the next level and sets it
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000204-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000204-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/logger/base.rb, line 28</span>
+28:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cycle_level</span>
+29:         <span class="ruby-identifier">lvl</span> = <span class="ruby-identifier">get_next_level</span>
+30:         <span class="ruby-identifier">set_level</span>(<span class="ruby-identifier">lvl</span>)
+31: 
+32:         <span class="ruby-identifier">log</span>(<span class="ruby-identifier">lvl</span>, <span class="ruby-value str">&quot;&quot;</span>, <span class="ruby-node">&quot;Logging level is now #{lvl.to_s.upcase}&quot;</span>)
+33:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000205" class="method-detail">
+        <a name="M000205"></a>
+
+        <div class="method-heading">
+          <a href="#M000205" class="method-signature">
+          <span class="method-name">set_level</span><span class="method-args">(level)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Sets a <a href="Base.html#M000202">new</a> level and record it in
+@active_level
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000205-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000205-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/logger/base.rb, line 36</span>
+36:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_level</span>(<span class="ruby-identifier">level</span>)
+37:         <span class="ruby-identifier">set_logging_level</span>(<span class="ruby-identifier">level</span>)
+38:         <span class="ruby-ivar">@active_level</span> = <span class="ruby-identifier">level</span>.<span class="ruby-identifier">to_sym</span>
+39:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000203" class="method-detail">
+        <a name="M000203"></a>
+
+        <div class="method-heading">
+          <a href="#M000203" class="method-signature">
+          <span class="method-name">should_log?</span><span class="method-args">(level)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000203-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000203-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/logger/base.rb, line 23</span>
+23:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">should_log?</span>(<span class="ruby-identifier">level</span>)
+24:         <span class="ruby-ivar">@known_levels</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">level</span>) <span class="ruby-operator">&gt;=</span> <span class="ruby-ivar">@known_levels</span>.<span class="ruby-identifier">index</span>(<span class="ruby-ivar">@active_level</span>)
+25:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Logger/Console_logger.html b/doc/classes/MCollective/Logger/Console_logger.html
new file mode 100644 (file)
index 0000000..78fdc89
--- /dev/null
@@ -0,0 +1,308 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Logger::Console_logger</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Logger::Console_logger</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/logger/console_logger_rb.html">
+                lib/mcollective/logger/console_logger.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                <a href="Base.html">
+                Base
+               </a>
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+Implements a syslog based logger using the standard ruby syslog class
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000210">color</a>&nbsp;&nbsp;
+      <a href="#M000211">colorize</a>&nbsp;&nbsp;
+      <a href="#M000209">log</a>&nbsp;&nbsp;
+      <a href="#M000207">set_logging_level</a>&nbsp;&nbsp;
+      <a href="#M000206">start</a>&nbsp;&nbsp;
+      <a href="#M000208">valid_levels</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000210" class="method-detail">
+        <a name="M000210"></a>
+
+        <div class="method-heading">
+          <a href="#M000210" class="method-signature">
+          <span class="method-name">color</span><span class="method-args">(level)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Set some colors for various logging levels, will honor the <a
+href="Console_logger.html#M000210">color</a> configuration option and
+return nothing if its configured not to
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000210-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000210-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/logger/console_logger.rb, line 37</span>
+37:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">color</span>(<span class="ruby-identifier">level</span>)
+38:         <span class="ruby-identifier">colorize</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">color</span>
+39: 
+40:         <span class="ruby-identifier">colors</span> = {<span class="ruby-identifier">:error</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">color</span>(<span class="ruby-identifier">:red</span>),
+41:                   <span class="ruby-identifier">:fatal</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">color</span>(<span class="ruby-identifier">:red</span>),
+42:                   <span class="ruby-identifier">:warn</span>  =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">color</span>(<span class="ruby-identifier">:yellow</span>),
+43:                   <span class="ruby-identifier">:info</span>  =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">color</span>(<span class="ruby-identifier">:green</span>),
+44:                   <span class="ruby-identifier">:reset</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">color</span>(<span class="ruby-identifier">:reset</span>)}
+45: 
+46:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">colorize</span>
+47:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">colors</span>[<span class="ruby-identifier">level</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span>
+48:         <span class="ruby-keyword kw">else</span>
+49:           <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;&quot;</span>
+50:         <span class="ruby-keyword kw">end</span>
+51:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000211" class="method-detail">
+        <a name="M000211"></a>
+
+        <div class="method-heading">
+          <a href="#M000211" class="method-signature">
+          <span class="method-name">colorize</span><span class="method-args">(level, msg)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Helper to return a string in specific <a
+href="Console_logger.html#M000210">color</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000211-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000211-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/logger/console_logger.rb, line 54</span>
+54:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">level</span>, <span class="ruby-identifier">msg</span>)
+55:         <span class="ruby-value str">&quot;%s%s%s&quot;</span> <span class="ruby-operator">%</span> [ <span class="ruby-identifier">color</span>(<span class="ruby-identifier">level</span>), <span class="ruby-identifier">msg</span>, <span class="ruby-identifier">color</span>(<span class="ruby-identifier">:reset</span>) ]
+56:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000209" class="method-detail">
+        <a name="M000209"></a>
+
+        <div class="method-heading">
+          <a href="#M000209" class="method-signature">
+          <span class="method-name">log</span><span class="method-args">(level, from, msg, normal_output=STDERR, last_resort_output=STDERR)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000209-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000209-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/logger/console_logger.rb, line 24</span>
+24:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log</span>(<span class="ruby-identifier">level</span>, <span class="ruby-identifier">from</span>, <span class="ruby-identifier">msg</span>, <span class="ruby-identifier">normal_output</span>=<span class="ruby-constant">STDERR</span>, <span class="ruby-identifier">last_resort_output</span>=<span class="ruby-constant">STDERR</span>)
+25:         <span class="ruby-identifier">time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">new</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-value str">&quot;%Y/%m/%d %H:%M:%S&quot;</span>)
+26: 
+27:         <span class="ruby-identifier">normal_output</span>.<span class="ruby-identifier">puts</span>(<span class="ruby-value str">&quot;%s %s: %s %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">level</span>, <span class="ruby-identifier">level</span>), <span class="ruby-identifier">time</span>, <span class="ruby-identifier">from</span>, <span class="ruby-identifier">msg</span>])
+28:       <span class="ruby-keyword kw">rescue</span>
+29:         <span class="ruby-comment cmt"># if this fails we probably cant show the user output at all,</span>
+30:         <span class="ruby-comment cmt"># STDERR it as last resort</span>
+31:         <span class="ruby-identifier">last_resort_output</span>.<span class="ruby-identifier">puts</span>(<span class="ruby-node">&quot;#{level}: #{msg}&quot;</span>)
+32:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000207" class="method-detail">
+        <a name="M000207"></a>
+
+        <div class="method-heading">
+          <a href="#M000207" class="method-signature">
+          <span class="method-name">set_logging_level</span><span class="method-args">(level)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000207-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000207-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/logger/console_logger.rb, line 12</span>
+12:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_logging_level</span>(<span class="ruby-identifier">level</span>)
+13:         <span class="ruby-comment cmt"># nothing to do here, we ignore high levels when we log</span>
+14:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000206" class="method-detail">
+        <a name="M000206"></a>
+
+        <div class="method-heading">
+          <a href="#M000206" class="method-signature">
+          <span class="method-name">start</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000206-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000206-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/logger/console_logger.rb, line 5</span>
+ 5:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
+ 6:         <span class="ruby-identifier">set_level</span>(<span class="ruby-identifier">:info</span>)
+ 7: 
+ 8:         <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>
+ 9:         <span class="ruby-identifier">set_level</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">loglevel</span>.<span class="ruby-identifier">to_sym</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">configured</span>
+10:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000208" class="method-detail">
+        <a name="M000208"></a>
+
+        <div class="method-heading">
+          <a href="#M000208" class="method-signature">
+          <span class="method-name">valid_levels</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000208-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000208-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/logger/console_logger.rb, line 16</span>
+16:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid_levels</span>
+17:         {<span class="ruby-identifier">:info</span>  =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:info</span>,
+18:          <span class="ruby-identifier">:warn</span>  =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:warning</span>,
+19:          <span class="ruby-identifier">:debug</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:debug</span>,
+20:          <span class="ruby-identifier">:fatal</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:crit</span>,
+21:          <span class="ruby-identifier">:error</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:err</span>}
+22:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Logger/File_logger.html b/doc/classes/MCollective/Logger/File_logger.html
new file mode 100644 (file)
index 0000000..93999db
--- /dev/null
@@ -0,0 +1,250 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Logger::File_logger</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Logger::File_logger</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/logger/file_logger_rb.html">
+                lib/mcollective/logger/file_logger.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                <a href="Base.html">
+                Base
+               </a>
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+Impliments a file based logger using the standard ruby logger class
+</p>
+<p>
+To configure you should set:
+</p>
+<pre>
+  - config.logfile
+  - config.keeplogs defaults to 2097152
+  - config.max_log_size defaults to 5
+</pre>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000215">log</a>&nbsp;&nbsp;
+      <a href="#M000213">set_logging_level</a>&nbsp;&nbsp;
+      <a href="#M000212">start</a>&nbsp;&nbsp;
+      <a href="#M000214">valid_levels</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000215" class="method-detail">
+        <a name="M000215"></a>
+
+        <div class="method-heading">
+          <a href="#M000215" class="method-signature">
+          <span class="method-name">log</span><span class="method-args">(level, from, msg)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000215-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000215-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/logger/file_logger.rb, line 37</span>
+37:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log</span>(<span class="ruby-identifier">level</span>, <span class="ruby-identifier">from</span>, <span class="ruby-identifier">msg</span>)
+38:         <span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">map_level</span>(<span class="ruby-identifier">level</span>)) { <span class="ruby-node">&quot;#{from} #{msg}&quot;</span> }
+39:       <span class="ruby-keyword kw">rescue</span>
+40:         <span class="ruby-comment cmt"># if this fails we probably cant show the user output at all,</span>
+41:         <span class="ruby-comment cmt"># STDERR it as last resort</span>
+42:         <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span>(<span class="ruby-node">&quot;#{level}: #{msg}&quot;</span>)
+43:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000213" class="method-detail">
+        <a name="M000213"></a>
+
+        <div class="method-heading">
+          <a href="#M000213" class="method-signature">
+          <span class="method-name">set_logging_level</span><span class="method-args">(level)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000213-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000213-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/logger/file_logger.rb, line 22</span>
+22:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_logging_level</span>(<span class="ruby-identifier">level</span>)
+23:         <span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">level</span> = <span class="ruby-identifier">map_level</span>(<span class="ruby-identifier">level</span>)
+24:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+25:         <span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">level</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>
+26:         <span class="ruby-identifier">log</span>(<span class="ruby-identifier">:error</span>, <span class="ruby-value str">&quot;&quot;</span>, <span class="ruby-node">&quot;Could not set logging to #{level} using debug instead: #{e.class} #{e}&quot;</span>)
+27:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000212" class="method-detail">
+        <a name="M000212"></a>
+
+        <div class="method-heading">
+          <a href="#M000212" class="method-signature">
+          <span class="method-name">start</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000212-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000212-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/logger/file_logger.rb, line 13</span>
+13:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
+14:         <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>
+15: 
+16:         <span class="ruby-ivar">@logger</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Logger</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">logfile</span>, <span class="ruby-identifier">config</span>.<span class="ruby-identifier">keeplogs</span>, <span class="ruby-identifier">config</span>.<span class="ruby-identifier">max_log_size</span>)
+17:         <span class="ruby-ivar">@logger</span>.<span class="ruby-identifier">formatter</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">Formatter</span>.<span class="ruby-identifier">new</span>
+18: 
+19:         <span class="ruby-identifier">set_level</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">loglevel</span>.<span class="ruby-identifier">to_sym</span>)
+20:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000214" class="method-detail">
+        <a name="M000214"></a>
+
+        <div class="method-heading">
+          <a href="#M000214" class="method-signature">
+          <span class="method-name">valid_levels</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000214-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000214-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/logger/file_logger.rb, line 29</span>
+29:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid_levels</span>
+30:         {<span class="ruby-identifier">:info</span>  =<span class="ruby-operator">&gt;</span> <span class="ruby-operator">::</span><span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">INFO</span>,
+31:          <span class="ruby-identifier">:warn</span>  =<span class="ruby-operator">&gt;</span> <span class="ruby-operator">::</span><span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">WARN</span>,
+32:          <span class="ruby-identifier">:debug</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-operator">::</span><span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">DEBUG</span>,
+33:          <span class="ruby-identifier">:fatal</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-operator">::</span><span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">FATAL</span>,
+34:          <span class="ruby-identifier">:error</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-operator">::</span><span class="ruby-constant">Logger</span><span class="ruby-operator">::</span><span class="ruby-constant">ERROR</span>}
+35:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Logger/Syslog_logger.html b/doc/classes/MCollective/Logger/Syslog_logger.html
new file mode 100644 (file)
index 0000000..3a57425
--- /dev/null
@@ -0,0 +1,278 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Logger::Syslog_logger</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Logger::Syslog_logger</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/logger/syslog_logger_rb.html">
+                lib/mcollective/logger/syslog_logger.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                <a href="Base.html">
+                Base
+               </a>
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+Implements a syslog based logger using the standard ruby syslog class
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000201">log</a>&nbsp;&nbsp;
+      <a href="#M000199">set_logging_level</a>&nbsp;&nbsp;
+      <a href="#M000197">start</a>&nbsp;&nbsp;
+      <a href="#M000198">syslog_facility</a>&nbsp;&nbsp;
+      <a href="#M000200">valid_levels</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+    <div id="includes">
+      <h3 class="section-bar">Included Modules</h3>
+
+      <div id="includes-list">
+        <span class="include-name">Syslog::Constants</span>
+      </div>
+    </div>
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000201" class="method-detail">
+        <a name="M000201"></a>
+
+        <div class="method-heading">
+          <a href="#M000201" class="method-signature">
+          <span class="method-name">log</span><span class="method-args">(level, from, msg)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000201-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000201-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/logger/syslog_logger.rb, line 42</span>
+42:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log</span>(<span class="ruby-identifier">level</span>, <span class="ruby-identifier">from</span>, <span class="ruby-identifier">msg</span>)
+43:         <span class="ruby-constant">Syslog</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">map_level</span>(<span class="ruby-identifier">level</span>), <span class="ruby-node">&quot;#{from} #{msg}&quot;</span>)
+44:       <span class="ruby-keyword kw">rescue</span>
+45:         <span class="ruby-comment cmt"># if this fails we probably cant show the user output at all,</span>
+46:         <span class="ruby-comment cmt"># STDERR it as last resort</span>
+47:         <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span>(<span class="ruby-node">&quot;#{level}: #{msg}&quot;</span>)
+48:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000199" class="method-detail">
+        <a name="M000199"></a>
+
+        <div class="method-heading">
+          <a href="#M000199" class="method-signature">
+          <span class="method-name">set_logging_level</span><span class="method-args">(level)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000199-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000199-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/logger/syslog_logger.rb, line 30</span>
+30:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_logging_level</span>(<span class="ruby-identifier">level</span>)
+31:         <span class="ruby-comment cmt"># noop</span>
+32:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000197" class="method-detail">
+        <a name="M000197"></a>
+
+        <div class="method-heading">
+          <a href="#M000197" class="method-signature">
+          <span class="method-name">start</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000197-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000197-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/logger/syslog_logger.rb, line 9</span>
+ 9:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>
+10:         <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>
+11: 
+12:         <span class="ruby-identifier">facility</span> = <span class="ruby-identifier">syslog_facility</span>(<span class="ruby-identifier">config</span>.<span class="ruby-identifier">logfacility</span>)
+13:         <span class="ruby-identifier">level</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">loglevel</span>.<span class="ruby-identifier">to_sym</span>
+14: 
+15:         <span class="ruby-constant">Syslog</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Syslog</span>.<span class="ruby-identifier">opened?</span>
+16:         <span class="ruby-constant">Syslog</span>.<span class="ruby-identifier">open</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">$0</span>), <span class="ruby-value">3</span>, <span class="ruby-identifier">facility</span>)
+17: 
+18:         <span class="ruby-identifier">set_level</span>(<span class="ruby-identifier">level</span>)
+19:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000198" class="method-detail">
+        <a name="M000198"></a>
+
+        <div class="method-heading">
+          <a href="#M000198" class="method-signature">
+          <span class="method-name">syslog_facility</span><span class="method-args">(facility)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000198-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000198-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/logger/syslog_logger.rb, line 21</span>
+21:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">syslog_facility</span>(<span class="ruby-identifier">facility</span>)
+22:         <span class="ruby-keyword kw">begin</span>
+23:           <span class="ruby-constant">Syslog</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-node">&quot;LOG_#{facility.upcase}&quot;</span>)
+24:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">NameError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+25:           <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Invalid syslog facility #{facility} supplied, reverting to USER&quot;</span>
+26:           <span class="ruby-constant">Syslog</span><span class="ruby-operator">::</span><span class="ruby-constant">LOG_USER</span>
+27:         <span class="ruby-keyword kw">end</span>
+28:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000200" class="method-detail">
+        <a name="M000200"></a>
+
+        <div class="method-heading">
+          <a href="#M000200" class="method-signature">
+          <span class="method-name">valid_levels</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000200-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000200-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/logger/syslog_logger.rb, line 34</span>
+34:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid_levels</span>
+35:         {<span class="ruby-identifier">:info</span>  =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:info</span>,
+36:          <span class="ruby-identifier">:warn</span>  =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:warning</span>,
+37:          <span class="ruby-identifier">:debug</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:debug</span>,
+38:          <span class="ruby-identifier">:fatal</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:crit</span>,
+39:          <span class="ruby-identifier">:error</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:err</span>}
+40:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Matcher.html b/doc/classes/MCollective/Matcher.html
new file mode 100644 (file)
index 0000000..1e8d9ef
--- /dev/null
@@ -0,0 +1,434 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Module: MCollective::Matcher</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Module</strong></td>
+          <td class="class-name-in-header">MCollective::Matcher</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/matcher/scanner_rb.html">
+                lib/mcollective/matcher/scanner.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/matcher/parser_rb.html">
+                lib/mcollective/matcher/parser.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/matcher_rb.html">
+                lib/mcollective/matcher.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+A parser and scanner that creates a stack machine for a simple fact and
+class matching language used on the CLI to facilitate a rich discovery
+language
+</p>
+<p>
+Language EBNF
+</p>
+<p>
+compound = [&quot;(&quot;] expression [&quot;)&quot;] {[&quot;(&quot;]
+expression [&quot;)&quot;]} expression = [!|not]statement
+[&quot;and&quot;|&quot;or&quot;] [!|not] statement char = A-Z | a-z | &lt;
+| &gt; | =&gt; | =&lt; | _ | - |* | / { A-Z | a-z | &lt; | &gt; | =&gt; |
+=&lt; | _ | - | * | / | } int = 0|1|2|3|4|5|6|7|8|9{|0|1|2|3|4|5|6|7|8|9|0}
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000147">create_compound_callstack</a>&nbsp;&nbsp;
+      <a href="#M000143">create_function_hash</a>&nbsp;&nbsp;
+      <a href="#M000146">eval_compound_fstatement</a>&nbsp;&nbsp;
+      <a href="#M000145">eval_compound_statement</a>&nbsp;&nbsp;
+      <a href="#M000144">execute_function</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+    <div id="class-list">
+      <h3 class="section-bar">Classes and Modules</h3>
+
+      Class <a href="Matcher/Parser.html" class="link">MCollective::Matcher::Parser</a><br />
+Class <a href="Matcher/Scanner.html" class="link">MCollective::Matcher::Scanner</a><br />
+
+    </div>
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000147" class="method-detail">
+        <a name="M000147"></a>
+
+        <div class="method-heading">
+          <a href="#M000147" class="method-signature">
+          <span class="method-name">create_compound_callstack</span><span class="method-args">(call_string)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Creates a callstack to be evaluated from a compound evaluation string
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000147-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000147-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/matcher.rb, line 181</span>
+181:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">create_compound_callstack</span>(<span class="ruby-identifier">call_string</span>)
+182:       <span class="ruby-identifier">callstack</span> = <span class="ruby-constant">Matcher</span><span class="ruby-operator">::</span><span class="ruby-constant">Parser</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">call_string</span>).<span class="ruby-identifier">execution_stack</span>
+183:       <span class="ruby-identifier">callstack</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">statement</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
+184:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">statement</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;fstatement&quot;</span>
+185:           <span class="ruby-identifier">callstack</span>[<span class="ruby-identifier">i</span>][<span class="ruby-value str">&quot;fstatement&quot;</span>] = <span class="ruby-identifier">create_function_hash</span>(<span class="ruby-identifier">statement</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">first</span>)
+186:         <span class="ruby-keyword kw">end</span>
+187:       <span class="ruby-keyword kw">end</span>
+188:       <span class="ruby-identifier">callstack</span>
+189:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000143" class="method-detail">
+        <a name="M000143"></a>
+
+        <div class="method-heading">
+          <a href="#M000143" class="method-signature">
+          <span class="method-name">create_function_hash</span><span class="method-args">(function_call)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Helper creates a hash from a function call string
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000143-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000143-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/matcher.rb, line 17</span>
+17:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">create_function_hash</span>(<span class="ruby-identifier">function_call</span>)
+18:       <span class="ruby-identifier">func_hash</span> = {}
+19:       <span class="ruby-identifier">f</span> = <span class="ruby-value str">&quot;&quot;</span>
+20:       <span class="ruby-identifier">func_parts</span> = <span class="ruby-identifier">function_call</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/(!=|&gt;=|&lt;=|&lt;|&gt;|=)/</span>)
+21:       <span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;r_compare&quot;</span>] = <span class="ruby-identifier">func_parts</span>.<span class="ruby-identifier">pop</span>
+22:       <span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;operator&quot;</span>] = <span class="ruby-identifier">func_parts</span>.<span class="ruby-identifier">pop</span>
+23:       <span class="ruby-identifier">func</span> = <span class="ruby-identifier">func_parts</span>.<span class="ruby-identifier">join</span>
+24: 
+25:       <span class="ruby-comment cmt"># Deal with dots in function parameters and functions without dot values</span>
+26:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">func</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/^.+\(.*\)$/</span>)
+27:         <span class="ruby-identifier">f</span> = <span class="ruby-identifier">func</span>
+28:       <span class="ruby-keyword kw">else</span>
+29:         <span class="ruby-identifier">func_parts</span> = <span class="ruby-identifier">func</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;.&quot;</span>)
+30:         <span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;value&quot;</span>] = <span class="ruby-identifier">func_parts</span>.<span class="ruby-identifier">pop</span>
+31:         <span class="ruby-identifier">f</span> = <span class="ruby-identifier">func_parts</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;.&quot;</span>)
+32:       <span class="ruby-keyword kw">end</span>
+33: 
+34:       <span class="ruby-comment cmt"># Deal with regular expression matches</span>
+35:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;r_compare&quot;</span>] <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\/.*\/$/</span>
+36:         <span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;operator&quot;</span>] = <span class="ruby-value str">&quot;=~&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;operator&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;=&quot;</span>
+37:         <span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;operator&quot;</span>] = <span class="ruby-value str">&quot;!=~&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;operator&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;!=&quot;</span>
+38:         <span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;r_compare&quot;</span>] = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;r_compare&quot;</span>].<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/^\/|\/$/</span>, <span class="ruby-value str">&quot;&quot;</span>))
+39:       <span class="ruby-comment cmt"># Convert = operators to == so they can be propperly evaluated</span>
+40:       <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;operator&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;=&quot;</span>
+41:         <span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;operator&quot;</span>] = <span class="ruby-value str">&quot;==&quot;</span>
+42:       <span class="ruby-keyword kw">end</span>
+43: 
+44:       <span class="ruby-comment cmt"># Grab function name and parameters from left compare string</span>
+45:       <span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;name&quot;</span>], <span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;params&quot;</span>] = <span class="ruby-identifier">f</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;(&quot;</span>)
+46:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;params&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;)&quot;</span>
+47:         <span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;params&quot;</span>] = <span class="ruby-keyword kw">nil</span>
+48:       <span class="ruby-keyword kw">else</span>
+49: 
+50:         <span class="ruby-comment cmt"># Walk the function parameters from the front and from the</span>
+51:         <span class="ruby-comment cmt"># back removing the first and last instances of single of</span>
+52:         <span class="ruby-comment cmt"># double qoutes. We do this to handle the case where params</span>
+53:         <span class="ruby-comment cmt"># contain escaped qoutes.</span>
+54:         <span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;params&quot;</span>] = <span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;params&quot;</span>].<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">&quot;)&quot;</span>, <span class="ruby-value str">&quot;&quot;</span>)
+55:         <span class="ruby-identifier">func_quotes</span> = <span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;params&quot;</span>].<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/('|&quot;)/</span>)
+56: 
+57:         <span class="ruby-identifier">func_quotes</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">item</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
+58:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/'|&quot;/</span>)
+59:             <span class="ruby-identifier">func_quotes</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-identifier">i</span>)
+60:             <span class="ruby-keyword kw">break</span>
+61:           <span class="ruby-keyword kw">end</span>
+62:         <span class="ruby-keyword kw">end</span>
+63: 
+64:         <span class="ruby-identifier">func_quotes</span>.<span class="ruby-identifier">reverse</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">item</span>,<span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
+65:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/'|&quot;/</span>)
+66:             <span class="ruby-identifier">func_quotes</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-identifier">func_quotes</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)
+67:             <span class="ruby-keyword kw">break</span>
+68:           <span class="ruby-keyword kw">end</span>
+69:         <span class="ruby-keyword kw">end</span>
+70: 
+71:         <span class="ruby-identifier">func_hash</span>[<span class="ruby-value str">&quot;params&quot;</span>] = <span class="ruby-identifier">func_quotes</span>.<span class="ruby-identifier">join</span>
+72:       <span class="ruby-keyword kw">end</span>
+73: 
+74:       <span class="ruby-identifier">func_hash</span>
+75:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000146" class="method-detail">
+        <a name="M000146"></a>
+
+        <div class="method-heading">
+          <a href="#M000146" class="method-signature">
+          <span class="method-name">eval_compound_fstatement</span><span class="method-args">(function_hash)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns the result of an evaluated compound statement that includes a
+function
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000146-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000146-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/matcher.rb, line 135</span>
+135:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">eval_compound_fstatement</span>(<span class="ruby-identifier">function_hash</span>)
+136:       <span class="ruby-identifier">l_compare</span> = <span class="ruby-identifier">execute_function</span>(<span class="ruby-identifier">function_hash</span>)
+137: 
+138:       <span class="ruby-comment cmt"># Break out early and return false if the function returns nil</span>
+139:       <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">l_compare</span>
+140: 
+141:       <span class="ruby-comment cmt"># Prevent unwanted discovery by limiting comparison operators</span>
+142:       <span class="ruby-comment cmt"># on Strings and Booleans</span>
+143:       <span class="ruby-keyword kw">if</span>((<span class="ruby-identifier">l_compare</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">l_compare</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">TrueClass</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">l_compare</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">FalseClass</span>)) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">function_hash</span>[<span class="ruby-value str">&quot;operator&quot;</span>].<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/&lt;|&gt;/</span>))
+144:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span> <span class="ruby-node">&quot;Cannot do &gt; and &lt; comparison on Booleans and Strings '#{l_compare} #{function_hash[&quot;operator&quot;]} #{function_hash[&quot;r_compare&quot;]}'&quot;</span>
+145:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
+146:       <span class="ruby-keyword kw">end</span>
+147: 
+148:       <span class="ruby-comment cmt"># Prevent backticks in function parameters</span>
+149:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">function_hash</span>[<span class="ruby-value str">&quot;params&quot;</span>] <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/`/</span>
+150:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Cannot use backticks in function parameters&quot;</span>)
+151:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
+152:       <span class="ruby-keyword kw">end</span>
+153: 
+154:       <span class="ruby-comment cmt"># Escape strings for evaluation</span>
+155:       <span class="ruby-identifier">function_hash</span>[<span class="ruby-value str">&quot;r_compare&quot;</span>] = <span class="ruby-node">&quot;\&quot;#{function_hash[&quot;r_compare&quot;]}\&quot;&quot;</span> <span class="ruby-keyword kw">if</span>(<span class="ruby-identifier">l_compare</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)  <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">function_hash</span>[<span class="ruby-value str">&quot;operator&quot;</span>] <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/=~|!=~/</span>))
+156: 
+157:       <span class="ruby-comment cmt"># Do a regex comparison if right compare string is a regex</span>
+158:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">function_hash</span>[<span class="ruby-value str">&quot;operator&quot;</span>] <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/(=~|!=~)/</span>
+159:         <span class="ruby-comment cmt"># Fail if left compare value isn't a string</span>
+160:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">l_compare</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
+161:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Cannot do a regex check on a non string value.&quot;</span>)
+162:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
+163:         <span class="ruby-keyword kw">else</span>
+164:           <span class="ruby-identifier">compare_result</span> = <span class="ruby-identifier">l_compare</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">function_hash</span>[<span class="ruby-value str">&quot;r_compare&quot;</span>])
+165:           <span class="ruby-comment cmt"># Flip return value for != operator</span>
+166:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">function_hash</span>[<span class="ruby-value str">&quot;operator&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;!=~&quot;</span>
+167:             <span class="ruby-operator">!</span>((<span class="ruby-identifier">compare_result</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-operator">?</span> <span class="ruby-keyword kw">false</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">true</span>)
+168:           <span class="ruby-keyword kw">else</span>
+169:             (<span class="ruby-identifier">compare_result</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-operator">?</span> <span class="ruby-keyword kw">false</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">true</span>
+170:           <span class="ruby-keyword kw">end</span>
+171:         <span class="ruby-keyword kw">end</span>
+172:         <span class="ruby-comment cmt"># Otherwise evaluate the logical comparison</span>
+173:       <span class="ruby-keyword kw">else</span>
+174:         <span class="ruby-identifier">l_compare</span> = <span class="ruby-node">&quot;\&quot;#{l_compare}\&quot;&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">l_compare</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
+175:         <span class="ruby-identifier">result</span> = <span class="ruby-identifier">eval</span>(<span class="ruby-node">&quot;#{l_compare} #{function_hash[&quot;operator&quot;]} #{function_hash[&quot;r_compare&quot;]}&quot;</span>)
+176:         (<span class="ruby-identifier">result</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-operator">?</span> <span class="ruby-keyword kw">false</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">result</span>
+177:       <span class="ruby-keyword kw">end</span>
+178:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000145" class="method-detail">
+        <a name="M000145"></a>
+
+        <div class="method-heading">
+          <a href="#M000145" class="method-signature">
+          <span class="method-name">eval_compound_statement</span><span class="method-args">(expression)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Evaluates a compound statement
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000145-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000145-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/matcher.rb, line 115</span>
+115:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">eval_compound_statement</span>(<span class="ruby-identifier">expression</span>)
+116:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">expression</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\//</span>
+117:         <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">has_cf_class?</span>(<span class="ruby-identifier">expression</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">first</span>)
+118:       <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">expression</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/&gt;=|&lt;=|=|&lt;|&gt;/</span>
+119:         <span class="ruby-identifier">optype</span> = <span class="ruby-identifier">expression</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/&gt;=|&lt;=|=|&lt;|&gt;/</span>)
+120:         <span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span> = <span class="ruby-identifier">expression</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">split</span>(<span class="ruby-identifier">optype</span>[<span class="ruby-value">0</span>])
+121:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;&quot;</span>)[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;/&quot;</span>
+122:           <span class="ruby-identifier">optype</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;=&quot;</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">optype</span> = <span class="ruby-value str">&quot;==&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">optype</span> = <span class="ruby-identifier">optype</span>[<span class="ruby-value">0</span>]
+123:         <span class="ruby-keyword kw">else</span>
+124:           <span class="ruby-identifier">optype</span> = <span class="ruby-value str">&quot;=~&quot;</span>
+125:         <span class="ruby-keyword kw">end</span>
+126: 
+127:         <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">has_fact?</span>(<span class="ruby-identifier">name</span>,<span class="ruby-identifier">value</span>, <span class="ruby-identifier">optype</span>).<span class="ruby-identifier">to_s</span>
+128:       <span class="ruby-keyword kw">else</span>
+129:         <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">has_cf_class?</span>(<span class="ruby-identifier">expression</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">first</span>)
+130:       <span class="ruby-keyword kw">end</span>
+131:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000144" class="method-detail">
+        <a name="M000144"></a>
+
+        <div class="method-heading">
+          <a href="#M000144" class="method-signature">
+          <span class="method-name">execute_function</span><span class="method-args">(function_hash)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns the result of an executed function
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000144-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000144-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/matcher.rb, line 78</span>
+ 78:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">execute_function</span>(<span class="ruby-identifier">function_hash</span>)
+ 79:       <span class="ruby-comment cmt"># In the case where a data plugin isn't present there are two ways we can handle</span>
+ 80:       <span class="ruby-comment cmt"># the raised exception. The function result can either be false or the entire</span>
+ 81:       <span class="ruby-comment cmt"># expression can fail.</span>
+ 82:       <span class="ruby-comment cmt">#</span>
+ 83:       <span class="ruby-comment cmt"># In the case where we return the result as false it opens us op to unexpected</span>
+ 84:       <span class="ruby-comment cmt"># negation behavior.</span>
+ 85:       <span class="ruby-comment cmt">#</span>
+ 86:       <span class="ruby-comment cmt">#   !foo('bar').name = bar</span>
+ 87:       <span class="ruby-comment cmt">#</span>
+ 88:       <span class="ruby-comment cmt"># In this case the user would expect discovery to match on all machines where</span>
+ 89:       <span class="ruby-comment cmt"># the name value of the foo function does not equal bar. If a non existent function</span>
+ 90:       <span class="ruby-comment cmt"># returns false then it is posible to match machines where the name value of the</span>
+ 91:       <span class="ruby-comment cmt"># foo function is bar.</span>
+ 92:       <span class="ruby-comment cmt">#</span>
+ 93:       <span class="ruby-comment cmt"># Instead we raise a DDLValidationError to prevent this unexpected behavior from</span>
+ 94:       <span class="ruby-comment cmt"># happening.</span>
+ 95: 
+ 96:       <span class="ruby-identifier">result</span> = <span class="ruby-constant">Data</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">function_hash</span>[<span class="ruby-value str">&quot;name&quot;</span>], <span class="ruby-identifier">function_hash</span>[<span class="ruby-value str">&quot;params&quot;</span>])
+ 97: 
+ 98:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">function_hash</span>[<span class="ruby-value str">&quot;value&quot;</span>]
+ 99:         <span class="ruby-keyword kw">begin</span>
+100:           <span class="ruby-identifier">eval_result</span> = <span class="ruby-identifier">result</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">function_hash</span>[<span class="ruby-value str">&quot;value&quot;</span>])
+101:         <span class="ruby-keyword kw">rescue</span>
+102:           <span class="ruby-comment cmt"># If data field has not been set we set the comparison result to nil</span>
+103:           <span class="ruby-identifier">eval_result</span> = <span class="ruby-keyword kw">nil</span>
+104:         <span class="ruby-keyword kw">end</span>
+105:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">eval_result</span>
+106:       <span class="ruby-keyword kw">else</span>
+107:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span>
+108:       <span class="ruby-keyword kw">end</span>
+109:     <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">NoMethodError</span>
+110:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;cannot execute discovery function '#{function_hash[&quot;name&quot;]}'. data plugin not found&quot;</span>)
+111:       <span class="ruby-identifier">raise</span> <span class="ruby-constant">DDLValidationError</span>
+112:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Matcher/Parser.html b/doc/classes/MCollective/Matcher/Parser.html
new file mode 100644 (file)
index 0000000..a32d2cc
--- /dev/null
@@ -0,0 +1,367 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Matcher::Parser</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Matcher::Parser</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/matcher/parser_rb.html">
+                lib/mcollective/matcher/parser.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000151">exit_with_paren_errors</a>&nbsp;&nbsp;
+      <a href="#M000150">exit_with_parse_errors</a>&nbsp;&nbsp;
+      <a href="#M000149">exit_with_token_errors</a>&nbsp;&nbsp;
+      <a href="#M000148">new</a>&nbsp;&nbsp;
+      <a href="#M000152">parse</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">execution_stack</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">scanner</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000148" class="method-detail">
+        <a name="M000148"></a>
+
+        <div class="method-heading">
+          <a href="#M000148" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(args)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000148-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000148-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/matcher/parser.rb, line 6</span>
+ 6:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">args</span>)
+ 7:         <span class="ruby-ivar">@scanner</span> = <span class="ruby-constant">Scanner</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">args</span>)
+ 8:         <span class="ruby-ivar">@execution_stack</span> = []
+ 9:         <span class="ruby-ivar">@parse_errors</span> = []
+10:         <span class="ruby-ivar">@token_errors</span> = []
+11:         <span class="ruby-ivar">@paren_errors</span> = []
+12:         <span class="ruby-identifier">parse</span>
+13:         <span class="ruby-identifier">exit_with_token_errors</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@token_errors</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
+14:         <span class="ruby-identifier">exit_with_parse_errors</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@parse_errors</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
+15:         <span class="ruby-identifier">exit_with_paren_errors</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@paren_errors</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
+16:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000151" class="method-detail">
+        <a name="M000151"></a>
+
+        <div class="method-heading">
+          <a href="#M000151" class="method-signature">
+          <span class="method-name">exit_with_paren_errors</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000151-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000151-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/matcher/parser.rb, line 37</span>
+37:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exit_with_paren_errors</span>
+38:         <span class="ruby-ivar">@paren_errors</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
+39:           <span class="ruby-ivar">@scanner</span>.<span class="ruby-identifier">arguments</span>[<span class="ruby-identifier">i</span>] = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:red</span>, <span class="ruby-ivar">@scanner</span>.<span class="ruby-identifier">arguments</span>[<span class="ruby-identifier">i</span>])
+40:         <span class="ruby-keyword kw">end</span>
+41:         <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Missing parenthesis found while parsing -S input #{@scanner.arguments.join}&quot;</span>
+42:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000150" class="method-detail">
+        <a name="M000150"></a>
+
+        <div class="method-heading">
+          <a href="#M000150" class="method-signature">
+          <span class="method-name">exit_with_parse_errors</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000150-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000150-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/matcher/parser.rb, line 28</span>
+28:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exit_with_parse_errors</span>
+29:         <span class="ruby-ivar">@parse_errors</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">error_range</span><span class="ruby-operator">|</span>
+30:           (<span class="ruby-identifier">error_range</span>[<span class="ruby-value">0</span>]<span class="ruby-operator">..</span><span class="ruby-identifier">error_range</span>[<span class="ruby-value">1</span>]).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
+31:             <span class="ruby-ivar">@scanner</span>.<span class="ruby-identifier">arguments</span>[<span class="ruby-identifier">i</span>] = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:red</span>, <span class="ruby-ivar">@scanner</span>.<span class="ruby-identifier">arguments</span>[<span class="ruby-identifier">i</span>])
+32:           <span class="ruby-keyword kw">end</span>
+33:         <span class="ruby-keyword kw">end</span>
+34:         <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Parse errors found while parsing -S input #{ @scanner.arguments.join}&quot;</span>
+35:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000149" class="method-detail">
+        <a name="M000149"></a>
+
+        <div class="method-heading">
+          <a href="#M000149" class="method-signature">
+          <span class="method-name">exit_with_token_errors</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Exit and highlight any malformed tokens
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000149-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000149-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/matcher/parser.rb, line 19</span>
+19:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">exit_with_token_errors</span>
+20:         <span class="ruby-ivar">@token_errors</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">error_range</span><span class="ruby-operator">|</span>
+21:           (<span class="ruby-identifier">error_range</span>[<span class="ruby-value">0</span>]<span class="ruby-operator">..</span><span class="ruby-identifier">error_range</span>[<span class="ruby-value">1</span>]).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
+22:             <span class="ruby-ivar">@scanner</span>.<span class="ruby-identifier">arguments</span>[<span class="ruby-identifier">i</span>] = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:red</span>, <span class="ruby-ivar">@scanner</span>.<span class="ruby-identifier">arguments</span>[<span class="ruby-identifier">i</span>])
+23:           <span class="ruby-keyword kw">end</span>
+24:         <span class="ruby-keyword kw">end</span>
+25:         <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Malformed token(s) found while parsing -S input #{@scanner.arguments.join}&quot;</span>
+26:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000152" class="method-detail">
+        <a name="M000152"></a>
+
+        <div class="method-heading">
+          <a href="#M000152" class="method-signature">
+          <span class="method-name">parse</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Parse the input string, one token at a time a contruct the call stack
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000152-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000152-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/matcher/parser.rb, line 45</span>
+ 45:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse</span>
+ 46:         <span class="ruby-identifier">pre_index</span> = <span class="ruby-ivar">@scanner</span>.<span class="ruby-identifier">token_index</span>
+ 47:         <span class="ruby-identifier">p_token</span>,<span class="ruby-identifier">p_token_value</span> = <span class="ruby-keyword kw">nil</span>
+ 48:         <span class="ruby-identifier">c_token</span>,<span class="ruby-identifier">c_token_value</span> = <span class="ruby-ivar">@scanner</span>.<span class="ruby-identifier">get_token</span>
+ 49:         <span class="ruby-identifier">parenth</span> = <span class="ruby-value">0</span>
+ 50: 
+ 51:         <span class="ruby-keyword kw">while</span> (<span class="ruby-identifier">c_token</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>)
+ 52:           <span class="ruby-ivar">@scanner</span>.<span class="ruby-identifier">token_index</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ 53:           <span class="ruby-identifier">n_token</span>, <span class="ruby-identifier">n_token_value</span> = <span class="ruby-ivar">@scanner</span>.<span class="ruby-identifier">get_token</span>
+ 54: 
+ 55:           <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">n_token</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot; &quot;</span>
+ 56:             <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">c_token</span>
+ 57:             <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;bad_token&quot;</span>
+ 58:               <span class="ruby-ivar">@token_errors</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">c_token_value</span>
+ 59: 
+ 60:             <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;and&quot;</span>
+ 61:               <span class="ruby-keyword kw">unless</span> (<span class="ruby-identifier">n_token</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/not|fstatement|statement|\(/</span>) <span class="ruby-operator">||</span> (<span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">token_index</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">arguments</span>.<span class="ruby-identifier">size</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">n_token</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>)
+ 62:                 <span class="ruby-ivar">@parse_errors</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">pre_index</span>, <span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">token_index</span>]
+ 63:               <span class="ruby-keyword kw">end</span>
+ 64: 
+ 65:               <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">p_token</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
+ 66:                 <span class="ruby-ivar">@parse_errors</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">pre_index</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">c_token</span>.<span class="ruby-identifier">size</span>, <span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">token_index</span>]
+ 67:               <span class="ruby-keyword kw">elsif</span> (<span class="ruby-identifier">p_token</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;and&quot;</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">p_token</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;or&quot;</span>)
+ 68:                 <span class="ruby-ivar">@parse_errors</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">pre_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">p_token</span>.<span class="ruby-identifier">size</span>, <span class="ruby-identifier">pre_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>]
+ 69:               <span class="ruby-keyword kw">end</span>
+ 70: 
+ 71:             <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;or&quot;</span>
+ 72:               <span class="ruby-keyword kw">unless</span> (<span class="ruby-identifier">n_token</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/not|fstatement|statement|\(/</span>) <span class="ruby-operator">||</span> (<span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">token_index</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">arguments</span>.<span class="ruby-identifier">size</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">n_token</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>)
+ 73:                 <span class="ruby-ivar">@parse_errors</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">pre_index</span>, <span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">token_index</span>]
+ 74:               <span class="ruby-keyword kw">end</span>
+ 75: 
+ 76:               <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">p_token</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
+ 77:                 <span class="ruby-ivar">@parse_errors</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">pre_index</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">c_token</span>.<span class="ruby-identifier">size</span>, <span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">token_index</span>]
+ 78:               <span class="ruby-keyword kw">elsif</span> (<span class="ruby-identifier">p_token</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;and&quot;</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">p_token</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;or&quot;</span>)
+ 79:                 <span class="ruby-ivar">@parse_errors</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">pre_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">p_token</span>.<span class="ruby-identifier">size</span>, <span class="ruby-identifier">pre_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>]
+ 80:               <span class="ruby-keyword kw">end</span>
+ 81: 
+ 82:             <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;not&quot;</span>
+ 83:               <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">n_token</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/fstatement|statement|\(|not/</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">n_token</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>)
+ 84:                 <span class="ruby-ivar">@parse_errors</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">pre_index</span>, <span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">token_index</span>]
+ 85:               <span class="ruby-keyword kw">end</span>
+ 86: 
+ 87:             <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;statement&quot;</span>,<span class="ruby-value str">&quot;fstatement&quot;</span>
+ 88:               <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">n_token</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/and|or|\)/</span>
+ 89:                 <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">token_index</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">arguments</span>.<span class="ruby-identifier">size</span>
+ 90:                   <span class="ruby-ivar">@parse_errors</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">pre_index</span>, <span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">token_index</span>]
+ 91:                 <span class="ruby-keyword kw">end</span>
+ 92:               <span class="ruby-keyword kw">end</span>
+ 93: 
+ 94:             <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;)&quot;</span>
+ 95:               <span class="ruby-keyword kw">unless</span> (<span class="ruby-identifier">n_token</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/|and|or|not|\(/</span>)
+ 96:                 <span class="ruby-keyword kw">unless</span>(<span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">token_index</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">arguments</span>.<span class="ruby-identifier">size</span>)
+ 97:                   <span class="ruby-ivar">@parse_errors</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">pre_index</span>, <span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">token_index</span>]
+ 98:                 <span class="ruby-keyword kw">end</span>
+ 99:               <span class="ruby-keyword kw">end</span>
+100:               <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@paren_errors</span>.<span class="ruby-identifier">empty?</span>
+101:                 <span class="ruby-ivar">@paren_errors</span>.<span class="ruby-identifier">pop</span>
+102:               <span class="ruby-keyword kw">else</span>
+103:                 <span class="ruby-ivar">@paren_errors</span>.<span class="ruby-identifier">push</span>((<span class="ruby-identifier">n_token</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">token_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span><span class="ruby-operator">:</span> <span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">token_index</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">n_token_value</span>.<span class="ruby-identifier">size</span>)
+104:               <span class="ruby-keyword kw">end</span>
+105: 
+106:             <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;(&quot;</span>
+107:               <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">n_token</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/fstatement|statement|not|\(/</span>
+108:                 <span class="ruby-ivar">@parse_errors</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">pre_index</span>, <span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">token_index</span>]
+109:               <span class="ruby-keyword kw">end</span>
+110:               <span class="ruby-ivar">@paren_errors</span>.<span class="ruby-identifier">push</span>((<span class="ruby-identifier">n_token</span>.<span class="ruby-identifier">nil?</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">token_index</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span><span class="ruby-operator">:</span> <span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">token_index</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">n_token_value</span>.<span class="ruby-identifier">size</span>)
+111: 
+112:             <span class="ruby-keyword kw">else</span>
+113:               <span class="ruby-ivar">@parse_errors</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">pre_index</span>, <span class="ruby-identifier">scanner</span>.<span class="ruby-identifier">token_index</span>]
+114:             <span class="ruby-keyword kw">end</span>
+115: 
+116:             <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">n_token</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot; &quot;</span> <span class="ruby-operator">||</span><span class="ruby-identifier">c_token</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;bad_token&quot;</span>
+117:               <span class="ruby-ivar">@execution_stack</span> <span class="ruby-operator">&lt;&lt;</span> {<span class="ruby-identifier">c_token</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">c_token_value</span>}
+118:             <span class="ruby-keyword kw">end</span>
+119: 
+120:             <span class="ruby-identifier">p_token</span>, <span class="ruby-identifier">p_token_value</span> = <span class="ruby-identifier">c_token</span>, <span class="ruby-identifier">c_token_value</span>
+121:             <span class="ruby-identifier">c_token</span>, <span class="ruby-identifier">c_token_value</span> = <span class="ruby-identifier">n_token</span>, <span class="ruby-identifier">n_token_value</span>
+122:           <span class="ruby-keyword kw">end</span>
+123:           <span class="ruby-identifier">pre_index</span> = <span class="ruby-ivar">@scanner</span>.<span class="ruby-identifier">token_index</span>
+124:         <span class="ruby-keyword kw">end</span>
+125:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Matcher/Scanner.html b/doc/classes/MCollective/Matcher/Scanner.html
new file mode 100644 (file)
index 0000000..a72088f
--- /dev/null
@@ -0,0 +1,239 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Matcher::Scanner</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Matcher::Scanner</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/matcher/scanner_rb.html">
+                lib/mcollective/matcher/scanner.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000154">get_token</a>&nbsp;&nbsp;
+      <a href="#M000153">new</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">arguments</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">token_index</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000153" class="method-detail">
+        <a name="M000153"></a>
+
+        <div class="method-heading">
+          <a href="#M000153" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(arguments)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000153-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000153-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/matcher/scanner.rb, line 6</span>
+ 6:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">arguments</span>)
+ 7:         <span class="ruby-ivar">@token_index</span> = <span class="ruby-value">0</span>
+ 8:         <span class="ruby-ivar">@arguments</span> = <span class="ruby-identifier">arguments</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;&quot;</span>)
+ 9:         <span class="ruby-ivar">@seperation_counter</span> = <span class="ruby-value">0</span>
+10:         <span class="ruby-ivar">@white_spaces</span> = <span class="ruby-value">0</span>
+11:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000154" class="method-detail">
+        <a name="M000154"></a>
+
+        <div class="method-heading">
+          <a href="#M000154" class="method-signature">
+          <span class="method-name">get_token</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Scans the input string and identifies single language tokens
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000154-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000154-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/matcher/scanner.rb, line 14</span>
+14:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_token</span>
+15:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@token_index</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-ivar">@arguments</span>.<span class="ruby-identifier">size</span>
+16:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
+17:         <span class="ruby-keyword kw">end</span>
+18: 
+19:         <span class="ruby-keyword kw">case</span> <span class="ruby-ivar">@arguments</span>[<span class="ruby-ivar">@token_index</span>]
+20:         <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;(&quot;</span>
+21:           <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;(&quot;</span>, <span class="ruby-value str">&quot;(&quot;</span>
+22: 
+23:         <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;)&quot;</span>
+24:           <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;)&quot;</span>, <span class="ruby-value str">&quot;)&quot;</span>
+25: 
+26:         <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;n&quot;</span>
+27:           <span class="ruby-keyword kw">if</span> (<span class="ruby-ivar">@arguments</span>[<span class="ruby-ivar">@token_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;o&quot;</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-ivar">@arguments</span>[<span class="ruby-ivar">@token_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">2</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;t&quot;</span>) <span class="ruby-operator">&amp;&amp;</span> ((<span class="ruby-ivar">@arguments</span>[<span class="ruby-ivar">@token_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">3</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot; &quot;</span>) <span class="ruby-operator">||</span> (<span class="ruby-ivar">@arguments</span>[<span class="ruby-ivar">@token_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">3</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;(&quot;</span>))
+28:             <span class="ruby-ivar">@token_index</span> <span class="ruby-operator">+=</span> <span class="ruby-value">2</span>
+29:             <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;not&quot;</span>, <span class="ruby-value str">&quot;not&quot;</span>
+30:           <span class="ruby-keyword kw">else</span>
+31:             <span class="ruby-identifier">gen_statement</span>
+32:           <span class="ruby-keyword kw">end</span>
+33: 
+34:         <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;!&quot;</span>
+35:           <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;not&quot;</span>, <span class="ruby-value str">&quot;not&quot;</span>
+36: 
+37:         <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;a&quot;</span>
+38:           <span class="ruby-keyword kw">if</span> (<span class="ruby-ivar">@arguments</span>[<span class="ruby-ivar">@token_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;n&quot;</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-ivar">@arguments</span>[<span class="ruby-ivar">@token_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">2</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;d&quot;</span>) <span class="ruby-operator">&amp;&amp;</span> ((<span class="ruby-ivar">@arguments</span>[<span class="ruby-ivar">@token_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">3</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot; &quot;</span>) <span class="ruby-operator">||</span> (<span class="ruby-ivar">@arguments</span>[<span class="ruby-ivar">@token_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">3</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;(&quot;</span>))
+39:             <span class="ruby-ivar">@token_index</span> <span class="ruby-operator">+=</span> <span class="ruby-value">2</span>
+40:             <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;and&quot;</span>, <span class="ruby-value str">&quot;and&quot;</span>
+41:           <span class="ruby-keyword kw">else</span>
+42:             <span class="ruby-identifier">gen_statement</span>
+43:           <span class="ruby-keyword kw">end</span>
+44: 
+45:         <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;o&quot;</span>
+46:           <span class="ruby-keyword kw">if</span> (<span class="ruby-ivar">@arguments</span>[<span class="ruby-ivar">@token_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;r&quot;</span>) <span class="ruby-operator">&amp;&amp;</span> ((<span class="ruby-ivar">@arguments</span>[<span class="ruby-ivar">@token_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">2</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot; &quot;</span>) <span class="ruby-operator">||</span> (<span class="ruby-ivar">@arguments</span>[<span class="ruby-ivar">@token_index</span> <span class="ruby-operator">+</span> <span class="ruby-value">2</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;(&quot;</span>))
+47:             <span class="ruby-ivar">@token_index</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+48:             <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;or&quot;</span>, <span class="ruby-value str">&quot;or&quot;</span>
+49:           <span class="ruby-keyword kw">else</span>
+50:             <span class="ruby-identifier">gen_statement</span>
+51:           <span class="ruby-keyword kw">end</span>
+52: 
+53:         <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot; &quot;</span>
+54:           <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot; &quot;</span>, <span class="ruby-value str">&quot; &quot;</span>
+55: 
+56:         <span class="ruby-keyword kw">else</span>
+57:           <span class="ruby-identifier">gen_statement</span>
+58:         <span class="ruby-keyword kw">end</span>
+59:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Message.html b/doc/classes/MCollective/Message.html
new file mode 100644 (file)
index 0000000..f8583ae
--- /dev/null
@@ -0,0 +1,728 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Message</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Message</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/message_rb.html">
+                lib/mcollective/message.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+container for a message, its headers, agent, collective and other meta data
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000338">base64?</a>&nbsp;&nbsp;
+      <a href="#M000336">base64_decode!</a>&nbsp;&nbsp;
+      <a href="#M000337">base64_encode!</a>&nbsp;&nbsp;
+      <a href="#M000344">create_reqid</a>&nbsp;&nbsp;
+      <a href="#M000341">decode!</a>&nbsp;&nbsp;
+      <a href="#M000339">encode!</a>&nbsp;&nbsp;
+      <a href="#M000335">expected_msgid=</a>&nbsp;&nbsp;
+      <a href="#M000332">new</a>&nbsp;&nbsp;
+      <a href="#M000343">publish</a>&nbsp;&nbsp;
+      <a href="#M000334">reply_to=</a>&nbsp;&nbsp;
+      <a href="#M000333">type=</a>&nbsp;&nbsp;
+      <a href="#M000342">validate</a>&nbsp;&nbsp;
+      <a href="#M000340">validate_compound_filter</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+    <div id="constants-list">
+      <h3 class="section-bar">Constants</h3>
+
+      <div class="name-list">
+        <table summary="Constants">
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">VALIDTYPES</td>
+          <td>=</td>
+          <td class="context-item-value">[:message, :request, :direct_request, :reply]</td>
+        </tr>
+        </table>
+      </div>
+    </div>
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">agent</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">collective</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">discovered_hosts</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">expected_msgid</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">filter</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">headers</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">message</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">msgtime</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">options</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">payload</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">reply_to</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">request</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">requestid</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">ttl</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">type</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">validated</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000332" class="method-detail">
+        <a name="M000332"></a>
+
+        <div class="method-heading">
+          <a href="#M000332" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(payload, message, options = {})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+payload - the message body without headers etc, just the text message - the
+original message received from the middleware options[:base64] - if the
+body base64 encoded? options[:agent] - the agent the message is for/from
+options[:collective] - the collective its for/from options[:headers] - the
+message headers options[:type] - an indicator about the type of message,
+:message, :request, :direct_request or :reply options[:request] - if this
+is a reply this should old the message we are replying to options[:filter]
+- for requests, the filter to encode into the message options[:options] -
+the normal client options hash options[:ttl] - the maximum amount of
+seconds this message can be valid for options[:expected_msgid] - in the
+case of replies this is the msgid it is expecting in the replies
+options[:requestid] - specific request id to use else one will be generated
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000332-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000332-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 23</span>
+23:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">payload</span>, <span class="ruby-identifier">message</span>, <span class="ruby-identifier">options</span> = {})
+24:       <span class="ruby-identifier">options</span> = {<span class="ruby-identifier">:base64</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>,
+25:                  <span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>,
+26:                  <span class="ruby-identifier">:headers</span> =<span class="ruby-operator">&gt;</span> {},
+27:                  <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:message</span>,
+28:                  <span class="ruby-identifier">:request</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>,
+29:                  <span class="ruby-identifier">:filter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">empty_filter</span>,
+30:                  <span class="ruby-identifier">:options</span> =<span class="ruby-operator">&gt;</span> {},
+31:                  <span class="ruby-identifier">:ttl</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">60</span>,
+32:                  <span class="ruby-identifier">:expected_msgid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>,
+33:                  <span class="ruby-identifier">:requestid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>,
+34:                  <span class="ruby-identifier">:collective</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
+35: 
+36:       <span class="ruby-ivar">@payload</span> = <span class="ruby-identifier">payload</span>
+37:       <span class="ruby-ivar">@message</span> = <span class="ruby-identifier">message</span>
+38:       <span class="ruby-ivar">@requestid</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:requestid</span>]
+39:       <span class="ruby-ivar">@discovered_hosts</span> = <span class="ruby-keyword kw">nil</span>
+40:       <span class="ruby-ivar">@reply_to</span> = <span class="ruby-keyword kw">nil</span>
+41: 
+42:       <span class="ruby-ivar">@type</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:type</span>]
+43:       <span class="ruby-ivar">@headers</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:headers</span>]
+44:       <span class="ruby-ivar">@base64</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:base64</span>]
+45:       <span class="ruby-ivar">@filter</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:filter</span>]
+46:       <span class="ruby-ivar">@expected_msgid</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:expected_msgid</span>]
+47:       <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:options</span>]
+48: 
+49:       <span class="ruby-ivar">@ttl</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:ttl</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">ttl</span>
+50:       <span class="ruby-ivar">@msgtime</span> = <span class="ruby-value">0</span>
+51: 
+52:       <span class="ruby-ivar">@validated</span> = <span class="ruby-keyword kw">false</span>
+53: 
+54:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:request</span>]
+55:         <span class="ruby-ivar">@request</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:request</span>]
+56:         <span class="ruby-ivar">@agent</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">agent</span>
+57:         <span class="ruby-ivar">@collective</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">collective</span>
+58:         <span class="ruby-ivar">@type</span> = <span class="ruby-identifier">:reply</span>
+59:       <span class="ruby-keyword kw">else</span>
+60:         <span class="ruby-ivar">@agent</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:agent</span>]
+61:         <span class="ruby-ivar">@collective</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:collective</span>]
+62:       <span class="ruby-keyword kw">end</span>
+63: 
+64:       <span class="ruby-identifier">base64_decode!</span>
+65:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000338" class="method-detail">
+        <a name="M000338"></a>
+
+        <div class="method-heading">
+          <a href="#M000338" class="method-signature">
+          <span class="method-name">base64?</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000338-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000338-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 129</span>
+129:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">base64?</span>
+130:       <span class="ruby-ivar">@base64</span>
+131:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000336" class="method-detail">
+        <a name="M000336"></a>
+
+        <div class="method-heading">
+          <a href="#M000336" class="method-signature">
+          <span class="method-name">base64_decode!</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000336-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000336-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 115</span>
+115:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">base64_decode!</span>
+116:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@base64</span>
+117: 
+118:       <span class="ruby-ivar">@payload</span> = <span class="ruby-constant">SSL</span>.<span class="ruby-identifier">base64_decode</span>(<span class="ruby-ivar">@payload</span>)
+119:       <span class="ruby-ivar">@base64</span> = <span class="ruby-keyword kw">false</span>
+120:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000337" class="method-detail">
+        <a name="M000337"></a>
+
+        <div class="method-heading">
+          <a href="#M000337" class="method-signature">
+          <span class="method-name">base64_encode!</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000337-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000337-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 122</span>
+122:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">base64_encode!</span>
+123:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@base64</span>
+124: 
+125:       <span class="ruby-ivar">@payload</span> = <span class="ruby-constant">SSL</span>.<span class="ruby-identifier">base64_encode</span>(<span class="ruby-ivar">@payload</span>)
+126:       <span class="ruby-ivar">@base64</span> = <span class="ruby-keyword kw">true</span>
+127:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000344" class="method-detail">
+        <a name="M000344"></a>
+
+        <div class="method-heading">
+          <a href="#M000344" class="method-signature">
+          <span class="method-name">create_reqid</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000344-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000344-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 226</span>
+226:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_reqid</span>
+227:       <span class="ruby-comment cmt"># we gsub out the -s so that the format of the id does not</span>
+228:       <span class="ruby-comment cmt"># change from previous versions, these should just be more</span>
+229:       <span class="ruby-comment cmt"># unique than previous ones</span>
+230:       <span class="ruby-constant">SSL</span>.<span class="ruby-identifier">uuid</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">&quot;-&quot;</span>, <span class="ruby-value str">&quot;&quot;</span>)
+231:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000341" class="method-detail">
+        <a name="M000341"></a>
+
+        <div class="method-heading">
+          <a href="#M000341" class="method-signature">
+          <span class="method-name">decode!</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000341-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000341-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 175</span>
+175:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">decode!</span>
+176:       <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Cannot decode message type #{type}&quot;</span> <span class="ruby-keyword kw">unless</span> [<span class="ruby-identifier">:request</span>, <span class="ruby-identifier">:reply</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">type</span>)
+177: 
+178:       <span class="ruby-ivar">@payload</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;security_plugin&quot;</span>].<span class="ruby-identifier">decodemsg</span>(<span class="ruby-keyword kw">self</span>)
+179: 
+180:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:request</span>
+181:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">'callerid in request is not valid, surpressing reply to potentially forged request'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;security_plugin&quot;</span>].<span class="ruby-identifier">valid_callerid?</span>(<span class="ruby-identifier">payload</span>[<span class="ruby-identifier">:callerid</span>])
+182:       <span class="ruby-keyword kw">end</span>
+183: 
+184:       [<span class="ruby-identifier">:collective</span>, <span class="ruby-identifier">:agent</span>, <span class="ruby-identifier">:filter</span>, <span class="ruby-identifier">:requestid</span>, <span class="ruby-identifier">:ttl</span>, <span class="ruby-identifier">:msgtime</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">prop</span><span class="ruby-operator">|</span>
+185:         <span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-node">&quot;@#{prop}&quot;</span>, <span class="ruby-identifier">payload</span>[<span class="ruby-identifier">prop</span>]) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">payload</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">prop</span>)
+186:       <span class="ruby-keyword kw">end</span>
+187:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000339" class="method-detail">
+        <a name="M000339"></a>
+
+        <div class="method-heading">
+          <a href="#M000339" class="method-signature">
+          <span class="method-name">encode!</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000339-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000339-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 133</span>
+133:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">encode!</span>
+134:       <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">type</span>
+135:         <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:reply</span>
+136:           <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Cannot encode a reply message if no request has been associated with it&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">request</span>
+137:           <span class="ruby-identifier">raise</span> <span class="ruby-value str">'callerid in original request is not valid, surpressing reply to potentially forged request'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;security_plugin&quot;</span>].<span class="ruby-identifier">valid_callerid?</span>(<span class="ruby-identifier">request</span>.<span class="ruby-identifier">payload</span>[<span class="ruby-identifier">:callerid</span>])
+138: 
+139:           <span class="ruby-ivar">@requestid</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">payload</span>[<span class="ruby-identifier">:requestid</span>]
+140:           <span class="ruby-ivar">@payload</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;security_plugin&quot;</span>].<span class="ruby-identifier">encodereply</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">payload</span>, <span class="ruby-identifier">requestid</span>, <span class="ruby-identifier">request</span>.<span class="ruby-identifier">payload</span>[<span class="ruby-identifier">:callerid</span>])
+141:         <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:request</span>, <span class="ruby-identifier">:direct_request</span>
+142:           <span class="ruby-identifier">validate_compound_filter</span>(<span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;compound&quot;</span>]) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;compound&quot;</span>].<span class="ruby-identifier">empty?</span>
+143: 
+144:           <span class="ruby-ivar">@requestid</span> = <span class="ruby-identifier">create_reqid</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@requestid</span>
+145:           <span class="ruby-ivar">@payload</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;security_plugin&quot;</span>].<span class="ruby-identifier">encoderequest</span>(<span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">identity</span>, <span class="ruby-identifier">payload</span>, <span class="ruby-identifier">requestid</span>, <span class="ruby-identifier">filter</span>, <span class="ruby-identifier">agent</span>, <span class="ruby-identifier">collective</span>, <span class="ruby-identifier">ttl</span>)
+146:         <span class="ruby-keyword kw">else</span>
+147:           <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Cannot encode #{type} messages&quot;</span>
+148:       <span class="ruby-keyword kw">end</span>
+149:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000335" class="method-detail">
+        <a name="M000335"></a>
+
+        <div class="method-heading">
+          <a href="#M000335" class="method-signature">
+          <span class="method-name">expected_msgid=</span><span class="method-args">(msgid)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+in the case of reply messages we are expecting replies to a previously
+created message. This stores a hint to that previously sent message id and
+can be used by other classes like the security plugins as a means of
+optimizing their behavior like by ignoring messages not directed at us.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000335-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000335-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 110</span>
+110:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expected_msgid=</span>(<span class="ruby-identifier">msgid</span>)
+111:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Can only store the expected msgid for reply messages&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:reply</span>
+112:       <span class="ruby-ivar">@expected_msgid</span> = <span class="ruby-identifier">msgid</span>
+113:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000343" class="method-detail">
+        <a name="M000343"></a>
+
+        <div class="method-heading">
+          <a href="#M000343" class="method-signature">
+          <span class="method-name">publish</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+<a href="Message.html#M000343">publish</a> a reply message by creating a
+target name and sending it
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000343-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000343-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 213</span>
+213:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">publish</span>
+214:       <span class="ruby-comment cmt"># If we've been specificaly told about hosts that were discovered</span>
+215:       <span class="ruby-comment cmt"># use that information to do P2P calls if appropriate else just</span>
+216:       <span class="ruby-comment cmt"># send it as is.</span>
+217:       <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>
+218:       <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@discovered_hosts</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">direct_addressing</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-ivar">@discovered_hosts</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">direct_addressing_threshold</span>)
+219:         <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">type</span> = <span class="ruby-identifier">:direct_request</span>
+220:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Handling #{requestid} as a direct request&quot;</span>)
+221:       <span class="ruby-keyword kw">end</span>
+222: 
+223:       <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">'connector_plugin'</span>].<span class="ruby-identifier">publish</span>(<span class="ruby-keyword kw">self</span>)
+224:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000334" class="method-detail">
+        <a name="M000334"></a>
+
+        <div class="method-heading">
+          <a href="#M000334" class="method-signature">
+          <span class="method-name">reply_to=</span><span class="method-args">(target)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Sets a custom reply-to target for requests. The connector plugin should
+inspect this when constructing requests and set this header ensuring
+replies will go to the custom target otherwise the connector should just do
+what it usually does
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000334-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000334-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 99</span>
+ 99:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reply_to=</span>(<span class="ruby-identifier">target</span>)
+100:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Custom reply targets can only be set on requests&quot;</span> <span class="ruby-keyword kw">unless</span> [<span class="ruby-identifier">:request</span>, <span class="ruby-identifier">:direct_request</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-ivar">@type</span>)
+101: 
+102:       <span class="ruby-ivar">@reply_to</span> = <span class="ruby-identifier">target</span>
+103:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000333" class="method-detail">
+        <a name="M000333"></a>
+
+        <div class="method-heading">
+          <a href="#M000333" class="method-signature">
+          <span class="method-name">type=</span><span class="method-args">(type)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Sets the message type to one of the known types. In the case of
+:direct_request the list of hosts to communicate with should have been set
+with discovered_hosts else an exception will be raised. This is for extra
+security, we never accidentally want to send a direct request without a
+list of hosts or something weird like that as it might result in a
+filterless broadcast being sent.
+</p>
+<p>
+Additionally you simply cannot set :direct_request if direct_addressing was
+not enabled this is to force a workflow that doesnt not yield in a mistake
+when someone might assume direct_addressing is enabled when its not.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000333-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000333-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 76</span>
+76:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">type=</span>(<span class="ruby-identifier">type</span>)
+77:       <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unknown message type #{type}&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">VALIDTYPES</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">type</span>)
+78: 
+79:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:direct_request</span>
+80:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Direct requests is not enabled using the direct_addressing config option&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">direct_addressing</span>
+81: 
+82:         <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@discovered_hosts</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@discovered_hosts</span>.<span class="ruby-identifier">empty?</span>
+83:           <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Can only set type to :direct_request if discovered_hosts have been set&quot;</span>
+84:         <span class="ruby-keyword kw">end</span>
+85: 
+86:         <span class="ruby-comment cmt"># clear out the filter, custom discovery sources might interpret the filters</span>
+87:         <span class="ruby-comment cmt"># different than the remote mcollectived and in directed mode really the only</span>
+88:         <span class="ruby-comment cmt"># filter that matters is the agent filter</span>
+89:         <span class="ruby-ivar">@filter</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">empty_filter</span>
+90:         <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;agent&quot;</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@agent</span>
+91:       <span class="ruby-keyword kw">end</span>
+92: 
+93:       <span class="ruby-ivar">@type</span> = <span class="ruby-identifier">type</span>
+94:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000342" class="method-detail">
+        <a name="M000342"></a>
+
+        <div class="method-heading">
+          <a href="#M000342" class="method-signature">
+          <span class="method-name">validate</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Perform validation against the message by checking filters and ttl
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000342-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000342-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 190</span>
+190:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate</span>
+191:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Can only validate request messages&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:request</span>
+192: 
+193:       <span class="ruby-identifier">msg_age</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">utc</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">msgtime</span>
+194: 
+195:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">msg_age</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">ttl</span>
+196:         <span class="ruby-identifier">cid</span> = <span class="ruby-value str">&quot;&quot;</span>
+197:         <span class="ruby-identifier">cid</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">payload</span>[<span class="ruby-identifier">:callerid</span>] <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;@&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">payload</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:callerid</span>)
+198:         <span class="ruby-identifier">cid</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">payload</span>[<span class="ruby-identifier">:senderid</span>]
+199: 
+200:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">msg_age</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">ttl</span>
+201:           <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;global_stats&quot;</span>].<span class="ruby-identifier">ttlexpired</span>
+202: 
+203:           <span class="ruby-identifier">raise</span>(<span class="ruby-constant">MsgTTLExpired</span>, <span class="ruby-node">&quot;message #{requestid} from #{cid} created at #{msgtime} is #{msg_age} seconds old, TTL is #{ttl}&quot;</span>)
+204:         <span class="ruby-keyword kw">end</span>
+205:       <span class="ruby-keyword kw">end</span>
+206: 
+207:       <span class="ruby-identifier">raise</span>(<span class="ruby-constant">NotTargettedAtUs</span>, <span class="ruby-value str">&quot;Received message is not targetted to us&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;security_plugin&quot;</span>].<span class="ruby-identifier">validate_filter?</span>(<span class="ruby-identifier">payload</span>[<span class="ruby-identifier">:filter</span>])
+208: 
+209:       <span class="ruby-ivar">@validated</span> = <span class="ruby-keyword kw">true</span>
+210:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000340" class="method-detail">
+        <a name="M000340"></a>
+
+        <div class="method-heading">
+          <a href="#M000340" class="method-signature">
+          <span class="method-name">validate_compound_filter</span><span class="method-args">(compound_filter)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000340-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000340-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/message.rb, line 151</span>
+151:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_compound_filter</span>(<span class="ruby-identifier">compound_filter</span>)
+152:       <span class="ruby-identifier">compound_filter</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">filter</span><span class="ruby-operator">|</span>
+153:         <span class="ruby-identifier">filter</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">statement</span><span class="ruby-operator">|</span>
+154:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">statement</span>[<span class="ruby-value str">&quot;fstatement&quot;</span>]
+155:             <span class="ruby-identifier">functionname</span> = <span class="ruby-identifier">statement</span>[<span class="ruby-value str">&quot;fstatement&quot;</span>][<span class="ruby-value str">&quot;name&quot;</span>]
+156:             <span class="ruby-identifier">pluginname</span> = <span class="ruby-constant">Data</span>.<span class="ruby-identifier">pluginname</span>(<span class="ruby-identifier">functionname</span>)
+157:             <span class="ruby-identifier">value</span> = <span class="ruby-identifier">statement</span>[<span class="ruby-value str">&quot;fstatement&quot;</span>][<span class="ruby-value str">&quot;value&quot;</span>]
+158: 
+159:             <span class="ruby-identifier">ddl</span> = <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">pluginname</span>, <span class="ruby-identifier">:data</span>)
+160: 
+161:             <span class="ruby-comment cmt"># parses numbers and booleans entered as strings into proper</span>
+162:             <span class="ruby-comment cmt"># types of data so that DDL validation will pass</span>
+163:             <span class="ruby-identifier">statement</span>[<span class="ruby-value str">&quot;fstatement&quot;</span>][<span class="ruby-value str">&quot;params&quot;</span>] = <span class="ruby-constant">Data</span>.<span class="ruby-identifier">ddl_transform_input</span>(<span class="ruby-identifier">ddl</span>, <span class="ruby-identifier">statement</span>[<span class="ruby-value str">&quot;fstatement&quot;</span>][<span class="ruby-value str">&quot;params&quot;</span>])
+164: 
+165:             <span class="ruby-constant">Data</span>.<span class="ruby-identifier">ddl_validate</span>(<span class="ruby-identifier">ddl</span>, <span class="ruby-identifier">statement</span>[<span class="ruby-value str">&quot;fstatement&quot;</span>][<span class="ruby-value str">&quot;params&quot;</span>])
+166: 
+167:             <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">Data</span>.<span class="ruby-identifier">ddl_has_output?</span>(<span class="ruby-identifier">ddl</span>, <span class="ruby-identifier">value</span>)
+168:               <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">validation_fail!</span>(<span class="ruby-identifier">:PLMC41</span>, <span class="ruby-value str">&quot;Data plugin '%{functionname}()' does not return a '%{value}' value&quot;</span>, <span class="ruby-identifier">:error</span>, {<span class="ruby-identifier">:functionname</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">functionname</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">value</span>})
+169:             <span class="ruby-keyword kw">end</span>
+170:           <span class="ruby-keyword kw">end</span>
+171:         <span class="ruby-keyword kw">end</span>
+172:       <span class="ruby-keyword kw">end</span>
+173:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/MissingRPCData.html b/doc/classes/MCollective/MissingRPCData.html
new file mode 100644 (file)
index 0000000..8181974
--- /dev/null
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::MissingRPCData</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::MissingRPCData</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/exception_rb.html">
+                lib/mcollective/exception.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                <a href="RPCError.html">
+                RPCError
+               </a>
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/MsgDoesNotMatchRequestID.html b/doc/classes/MCollective/MsgDoesNotMatchRequestID.html
new file mode 100644 (file)
index 0000000..7d57933
--- /dev/null
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::MsgDoesNotMatchRequestID</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::MsgDoesNotMatchRequestID</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/exception_rb.html">
+                lib/mcollective/exception.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                RuntimeError
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/MsgTTLExpired.html b/doc/classes/MCollective/MsgTTLExpired.html
new file mode 100644 (file)
index 0000000..182a9a7
--- /dev/null
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::MsgTTLExpired</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::MsgTTLExpired</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/exception_rb.html">
+                lib/mcollective/exception.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                RuntimeError
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/NotTargettedAtUs.html b/doc/classes/MCollective/NotTargettedAtUs.html
new file mode 100644 (file)
index 0000000..7ca3d44
--- /dev/null
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::NotTargettedAtUs</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::NotTargettedAtUs</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/exception_rb.html">
+                lib/mcollective/exception.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                RuntimeError
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Optionparser.html b/doc/classes/MCollective/Optionparser.html
new file mode 100644 (file)
index 0000000..946d0f2
--- /dev/null
@@ -0,0 +1,441 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Optionparser</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Optionparser</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/optionparser_rb.html">
+                lib/mcollective/optionparser.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+A simple helper to build cli tools that supports a uniform command line
+layout.
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000455">add_common_options</a>&nbsp;&nbsp;
+      <a href="#M000453">add_filter_options</a>&nbsp;&nbsp;
+      <a href="#M000454">add_required_options</a>&nbsp;&nbsp;
+      <a href="#M000451">new</a>&nbsp;&nbsp;
+      <a href="#M000452">parse</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">parser</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000451" class="method-detail">
+        <a name="M000451"></a>
+
+        <div class="method-heading">
+          <a href="#M000451" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(defaults = {}, include_sections = nil, exclude_sections = nil)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Creates a <a href="Optionparser.html#M000451">new</a> instance of the
+parser, you can supply defaults and include named groups of options.
+</p>
+<p>
+Starts a parser that defaults to verbose and that includs the filter
+options:
+</p>
+<pre>
+ oparser = MCollective::Optionparser.new({:verbose =&gt; true}, &quot;filter&quot;)
+</pre>
+<p>
+Stats a parser in non verbose mode that does support discovery
+</p>
+<pre>
+ oparser = MCollective::Optionparser.new()
+</pre>
+<p>
+Starts a parser in verbose mode that does not show the common options:
+</p>
+<pre>
+ oparser = MCollective::Optionparser.new({:verbose =&gt; true}, &quot;filter&quot;, &quot;common&quot;)
+</pre>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000451-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000451-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/optionparser.rb, line 20</span>
+20:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">defaults</span> = {}, <span class="ruby-identifier">include_sections</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">exclude_sections</span> = <span class="ruby-keyword kw">nil</span>)
+21:       <span class="ruby-ivar">@parser</span> = <span class="ruby-operator">::</span><span class="ruby-constant">OptionParser</span>.<span class="ruby-identifier">new</span>
+22: 
+23:       <span class="ruby-ivar">@include</span> = [<span class="ruby-identifier">include_sections</span>].<span class="ruby-identifier">flatten</span>
+24:       <span class="ruby-ivar">@exclude</span> = [<span class="ruby-identifier">exclude_sections</span>].<span class="ruby-identifier">flatten</span>
+25: 
+26:       <span class="ruby-ivar">@options</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">default_options</span>
+27: 
+28:       <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">defaults</span>)
+29:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000455" class="method-detail">
+        <a name="M000455"></a>
+
+        <div class="method-heading">
+          <a href="#M000455" class="method-signature">
+          <span class="method-name">add_common_options</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+These options will be added to most cli tools
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000455-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000455-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/optionparser.rb, line 128</span>
+128:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_common_options</span>
+129:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">separator</span> <span class="ruby-value str">&quot;&quot;</span>
+130:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">separator</span> <span class="ruby-value str">&quot;Common Options&quot;</span>
+131: 
+132:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'-T'</span>, <span class="ruby-value str">'--target COLLECTIVE'</span>, <span class="ruby-value str">'Target messages to a specific sub collective'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
+133:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:collective</span>] = <span class="ruby-identifier">f</span>
+134:       <span class="ruby-keyword kw">end</span>
+135: 
+136:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--dt'</span>, <span class="ruby-value str">'--discovery-timeout SECONDS'</span>, <span class="ruby-constant">Integer</span>, <span class="ruby-value str">'Timeout for doing discovery'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
+137:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:disctimeout</span>] = <span class="ruby-identifier">t</span>
+138:       <span class="ruby-keyword kw">end</span>
+139: 
+140:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'-t'</span>, <span class="ruby-value str">'--timeout SECONDS'</span>, <span class="ruby-constant">Integer</span>, <span class="ruby-value str">'Timeout for calling remote agents'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
+141:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:timeout</span>] = <span class="ruby-identifier">t</span>
+142:       <span class="ruby-keyword kw">end</span>
+143: 
+144:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'-q'</span>, <span class="ruby-value str">'--quiet'</span>, <span class="ruby-value str">'Do not be verbose'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
+145:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:verbose</span>] = <span class="ruby-keyword kw">false</span>
+146:       <span class="ruby-keyword kw">end</span>
+147: 
+148:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--ttl TTL'</span>, <span class="ruby-value str">'Set the message validity period'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
+149:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:ttl</span>] = <span class="ruby-identifier">v</span>.<span class="ruby-identifier">to_i</span>
+150:       <span class="ruby-keyword kw">end</span>
+151: 
+152:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--reply-to TARGET'</span>, <span class="ruby-value str">'Set a custom target for replies'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
+153:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:reply_to</span>] = <span class="ruby-identifier">v</span>
+154:       <span class="ruby-keyword kw">end</span>
+155: 
+156:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--dm'</span>, <span class="ruby-value str">'--disc-method METHOD'</span>, <span class="ruby-value str">'Which discovery method to use'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
+157:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Discovery method is already set by a competing option&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:discovery_method</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:discovery_method</span>] <span class="ruby-operator">!=</span> <span class="ruby-identifier">v</span>
+158:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:discovery_method</span>] = <span class="ruby-identifier">v</span>
+159:       <span class="ruby-keyword kw">end</span>
+160: 
+161:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--do'</span>, <span class="ruby-value str">'--disc-option OPTION'</span>, <span class="ruby-value str">'Options to pass to the discovery method'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
+162:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:discovery_options</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">a</span>
+163:       <span class="ruby-keyword kw">end</span>
+164: 
+165:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">&quot;--nodes FILE&quot;</span>, <span class="ruby-value str">&quot;List of nodes to address&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
+166:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Cannot mix --disc-method, --disc-option and --nodes&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:discovery_method</span>] <span class="ruby-operator">||</span> <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:discovery_options</span>].<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
+167:         <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Cannot read the discovery file #{v}&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">readable?</span>(<span class="ruby-identifier">v</span>)
+168: 
+169:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:discovery_method</span>] = <span class="ruby-value str">&quot;flatfile&quot;</span>
+170:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:discovery_options</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">v</span>
+171:       <span class="ruby-keyword kw">end</span>
+172: 
+173:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">&quot;--publish_timeout TIMEOUT&quot;</span>, <span class="ruby-constant">Integer</span>, <span class="ruby-value str">&quot;Timeout for publishing requests to remote agents.&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">pt</span><span class="ruby-operator">|</span>
+174:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:publish_timeout</span>] = <span class="ruby-identifier">pt</span>
+175:       <span class="ruby-keyword kw">end</span>
+176: 
+177:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">&quot;--threaded&quot;</span>, <span class="ruby-value str">&quot;Start publishing requests and receiving responses in threaded mode.&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
+178:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:threaded</span>] = <span class="ruby-keyword kw">true</span>
+179:       <span class="ruby-keyword kw">end</span>
+180:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000453" class="method-detail">
+        <a name="M000453"></a>
+
+        <div class="method-heading">
+          <a href="#M000453" class="method-signature">
+          <span class="method-name">add_filter_options</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+These options will be added if you pass &#8216;filter&#8217; into the
+include list of the constructor.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000453-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000453-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/optionparser.rb, line 73</span>
+ 73:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_filter_options</span>
+ 74:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">separator</span> <span class="ruby-value str">&quot;&quot;</span>
+ 75:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">separator</span> <span class="ruby-value str">&quot;Host Filters&quot;</span>
+ 76: 
+ 77:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'-W'</span>, <span class="ruby-value str">'--with FILTER'</span>, <span class="ruby-value str">'Combined classes and facts filter'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
+ 78:         <span class="ruby-identifier">f</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot; &quot;</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">filter</span><span class="ruby-operator">|</span>
+ 79:           <span class="ruby-keyword kw">begin</span>
+ 80:             <span class="ruby-identifier">fact_parsed</span> = <span class="ruby-identifier">parse_fact</span>(<span class="ruby-identifier">filter</span>)
+ 81:             <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:filter</span>][<span class="ruby-value str">&quot;fact&quot;</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">fact_parsed</span>
+ 82:           <span class="ruby-keyword kw">rescue</span>
+ 83:             <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:filter</span>][<span class="ruby-value str">&quot;cf_class&quot;</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">filter</span>
+ 84:           <span class="ruby-keyword kw">end</span>
+ 85:         <span class="ruby-keyword kw">end</span>
+ 86:       <span class="ruby-keyword kw">end</span>
+ 87: 
+ 88:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'-S'</span>, <span class="ruby-value str">'--select FILTER'</span>, <span class="ruby-value str">'Compound filter combining facts and classes'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
+ 89:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:filter</span>][<span class="ruby-value str">&quot;compound&quot;</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Matcher</span>.<span class="ruby-identifier">create_compound_callstack</span>(<span class="ruby-identifier">f</span>)
+ 90:       <span class="ruby-keyword kw">end</span>
+ 91: 
+ 92:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'-F'</span>, <span class="ruby-value str">'--wf'</span>, <span class="ruby-value str">'--with-fact fact=val'</span>, <span class="ruby-value str">'Match hosts with a certain fact'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
+ 93:         <span class="ruby-identifier">fact_parsed</span> = <span class="ruby-identifier">parse_fact</span>(<span class="ruby-identifier">f</span>)
+ 94: 
+ 95:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:filter</span>][<span class="ruby-value str">&quot;fact&quot;</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">fact_parsed</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fact_parsed</span>
+ 96:       <span class="ruby-keyword kw">end</span>
+ 97: 
+ 98:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'-C'</span>, <span class="ruby-value str">'--wc'</span>, <span class="ruby-value str">'--with-class CLASS'</span>, <span class="ruby-value str">'Match hosts with a certain config management class'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
+ 99:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:filter</span>][<span class="ruby-value str">&quot;cf_class&quot;</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">f</span>
+100:       <span class="ruby-keyword kw">end</span>
+101: 
+102:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'-A'</span>, <span class="ruby-value str">'--wa'</span>, <span class="ruby-value str">'--with-agent AGENT'</span>, <span class="ruby-value str">'Match hosts with a certain agent'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
+103:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:filter</span>][<span class="ruby-value str">&quot;agent&quot;</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">a</span>
+104:       <span class="ruby-keyword kw">end</span>
+105: 
+106:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'-I'</span>, <span class="ruby-value str">'--wi'</span>, <span class="ruby-value str">'--with-identity IDENT'</span>, <span class="ruby-value str">'Match hosts with a certain configured identity'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
+107:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:filter</span>][<span class="ruby-value str">&quot;identity&quot;</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">a</span>
+108:       <span class="ruby-keyword kw">end</span>
+109:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000454" class="method-detail">
+        <a name="M000454"></a>
+
+        <div class="method-heading">
+          <a href="#M000454" class="method-signature">
+          <span class="method-name">add_required_options</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+These options should always be present
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000454-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000454-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/optionparser.rb, line 112</span>
+112:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_required_options</span>
+113:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'-c'</span>, <span class="ruby-value str">'--config FILE'</span>, <span class="ruby-value str">'Load configuratuion from file rather than default'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
+114:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:config</span>] = <span class="ruby-identifier">f</span>
+115:       <span class="ruby-keyword kw">end</span>
+116: 
+117:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'-v'</span>, <span class="ruby-value str">'--verbose'</span>, <span class="ruby-value str">'Be verbose'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
+118:         <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:verbose</span>] = <span class="ruby-identifier">v</span>
+119:       <span class="ruby-keyword kw">end</span>
+120: 
+121:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'-h'</span>, <span class="ruby-value str">'--help'</span>, <span class="ruby-value str">'Display this screen'</span>) <span class="ruby-keyword kw">do</span>
+122:         <span class="ruby-identifier">puts</span> <span class="ruby-ivar">@parser</span>
+123:         <span class="ruby-identifier">exit!</span> <span class="ruby-value">1</span>
+124:       <span class="ruby-keyword kw">end</span>
+125:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000452" class="method-detail">
+        <a name="M000452"></a>
+
+        <div class="method-heading">
+          <a href="#M000452" class="method-signature">
+          <span class="method-name">parse</span><span class="method-args">() {|@parser, @options| ...}</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Parse the options returning the options, you can pass a block that adds
+additional options to the <a href="Optionparser.html">Optionparser</a>.
+</p>
+<p>
+The sample below starts a parser that also prompts for &#8212;arguments in
+addition to the defaults. It also sets the description and shows a usage
+message specific to this app.
+</p>
+<pre>
+ options = oparser.parse{|parser, options|
+      parser.define_head &quot;Control the mcollective controller daemon&quot;
+      parser.banner = &quot;Usage: sh-mcollective [options] command&quot;
+
+      parser.on('--arg', '--argument ARGUMENT', 'Argument to pass to agent') do |v|
+          options[:argument] = v
+      end
+ }
+</pre>
+<p>
+Users can set default options that get parsed in using the
+MCOLLECTIVE_EXTRA_OPTS environemnt variable
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000452-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000452-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/optionparser.rb, line 48</span>
+48:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+49:       <span class="ruby-keyword kw">yield</span>(<span class="ruby-ivar">@parser</span>, <span class="ruby-ivar">@options</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
+50: 
+51:       <span class="ruby-identifier">add_required_options</span>
+52: 
+53:       <span class="ruby-identifier">add_common_options</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@exclude</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;common&quot;</span>)
+54: 
+55:       <span class="ruby-ivar">@include</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
+56:         <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@exclude</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">i</span>)
+57: 
+58:         <span class="ruby-identifier">options_name</span> = <span class="ruby-node">&quot;add_#{i}_options&quot;</span>
+59:         <span class="ruby-identifier">send</span>(<span class="ruby-identifier">options_name</span>)  <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">options_name</span>)
+60:       <span class="ruby-keyword kw">end</span>
+61: 
+62:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">environment</span>(<span class="ruby-value str">&quot;MCOLLECTIVE_EXTRA_OPTS&quot;</span>)
+63: 
+64:       <span class="ruby-ivar">@parser</span>.<span class="ruby-identifier">parse!</span>
+65: 
+66:       <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:collective</span>] = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">main_collective</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:collective</span>]
+67: 
+68:       <span class="ruby-ivar">@options</span>
+69:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/PluginManager.html b/doc/classes/MCollective/PluginManager.html
new file mode 100644 (file)
index 0000000..0e2d714
--- /dev/null
@@ -0,0 +1,562 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Module: MCollective::PluginManager</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Module</strong></td>
+          <td class="class-name-in-header">MCollective::PluginManager</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/pluginmanager_rb.html">
+                lib/mcollective/pluginmanager.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+A simple plugin manager, it stores one plugin each of a specific type the
+idea is that we can only have one security provider, one connector etc.
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000025">&lt;&lt;</a>&nbsp;&nbsp;
+      <a href="#M000030">[]</a>&nbsp;&nbsp;
+      <a href="#M000029">clear</a>&nbsp;&nbsp;
+      <a href="#M000031">create_instance</a>&nbsp;&nbsp;
+      <a href="#M000026">delete</a>&nbsp;&nbsp;
+      <a href="#M000032">find</a>&nbsp;&nbsp;
+      <a href="#M000033">find_and_load</a>&nbsp;&nbsp;
+      <a href="#M000035">grep</a>&nbsp;&nbsp;
+      <a href="#M000027">include?</a>&nbsp;&nbsp;
+      <a href="#M000034">loadclass</a>&nbsp;&nbsp;
+      <a href="#M000028">pluginlist</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000025" class="method-detail">
+        <a name="M000025"></a>
+
+        <div class="method-heading">
+          <a href="#M000025" class="method-signature">
+          <span class="method-name">&lt;&lt;</span><span class="method-args">(plugin)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Adds a plugin to the list of plugins, we expect a hash like:
+</p>
+<pre>
+   {:type =&gt; &quot;base&quot;,
+    :class =&gt; foo.new}
+</pre>
+<p>
+or like:
+</p>
+<pre>
+   {:type =&gt; &quot;base&quot;,
+    :class =&gt; &quot;Foo::Bar&quot;}
+</pre>
+<p>
+In the event that we already have a class with the given type an exception
+will be raised.
+</p>
+<p>
+If the :class passed is a <a href="../String.html">String</a> then we will
+delay instantiation till the first time someone asks for the plugin, this
+is because most likely the registration gets done by inherited() hooks, at
+which point the plugin class is not final.
+</p>
+<p>
+If we were to do a .new here the Class initialize method would get called
+and not the plugins, we there for only initialize the classes when they get
+requested via []
+</p>
+<p>
+By default all plugin instances are cached and returned later so
+there&#8216;s always a single instance. You can pass :single_instance =&gt;
+false when calling this to instruct it to always return a new instance when
+a copy is requested. This only works with sending a <a
+href="../String.html">String</a> for :class.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000025-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginmanager.rb, line 30</span>
+30:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-operator">&lt;&lt;</span>(<span class="ruby-identifier">plugin</span>)
+31:       <span class="ruby-identifier">plugin</span>[<span class="ruby-identifier">:single_instance</span>] = <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">plugin</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:single_instance</span>)
+32: 
+33:       <span class="ruby-identifier">type</span> = <span class="ruby-identifier">plugin</span>[<span class="ruby-identifier">:type</span>]
+34:       <span class="ruby-identifier">klass</span> = <span class="ruby-identifier">plugin</span>[<span class="ruby-identifier">:class</span>]
+35:       <span class="ruby-identifier">single</span> = <span class="ruby-identifier">plugin</span>[<span class="ruby-identifier">:single_instance</span>]
+36: 
+37:       <span class="ruby-identifier">raise</span>(<span class="ruby-node">&quot;Plugin #{type} already loaded&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@plugins</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">type</span>)
+38: 
+39: 
+40:       <span class="ruby-comment cmt"># If we get a string then store 'nil' as the instance, signalling that we'll</span>
+41:       <span class="ruby-comment cmt"># create the class later on demand.</span>
+42:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
+43:         <span class="ruby-ivar">@plugins</span>[<span class="ruby-identifier">type</span>] = {<span class="ruby-identifier">:loadtime</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>, <span class="ruby-identifier">:class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">klass</span>, <span class="ruby-identifier">:instance</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">:single</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">single</span>}
+44:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Registering plugin #{type} with class #{klass} single_instance: #{single}&quot;</span>)
+45:       <span class="ruby-keyword kw">else</span>
+46:         <span class="ruby-ivar">@plugins</span>[<span class="ruby-identifier">type</span>] = {<span class="ruby-identifier">:loadtime</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>, <span class="ruby-identifier">:class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">class</span>, <span class="ruby-identifier">:instance</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">klass</span>, <span class="ruby-identifier">:single</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>}
+47:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Registering plugin #{type} with class #{klass.class} single_instance: true&quot;</span>)
+48:       <span class="ruby-keyword kw">end</span>
+49:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000030" class="method-detail">
+        <a name="M000030"></a>
+
+        <div class="method-heading">
+          <a href="#M000030" class="method-signature">
+          <span class="method-name">[]</span><span class="method-args">(plugin)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Gets a plugin by type
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000030-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginmanager.rb, line 72</span>
+72:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-operator">[]</span>(<span class="ruby-identifier">plugin</span>)
+73:       <span class="ruby-identifier">raise</span>(<span class="ruby-node">&quot;No plugin #{plugin} defined&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@plugins</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">plugin</span>)
+74: 
+75:       <span class="ruby-identifier">klass</span> = <span class="ruby-ivar">@plugins</span>[<span class="ruby-identifier">plugin</span>][<span class="ruby-identifier">:class</span>]
+76: 
+77:       <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@plugins</span>[<span class="ruby-identifier">plugin</span>][<span class="ruby-identifier">:single</span>]
+78:         <span class="ruby-comment cmt"># Create an instance of the class if one hasn't been done before</span>
+79:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@plugins</span>[<span class="ruby-identifier">plugin</span>][<span class="ruby-identifier">:instance</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
+80:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Returning new plugin #{plugin} with class #{klass}&quot;</span>)
+81:           <span class="ruby-ivar">@plugins</span>[<span class="ruby-identifier">plugin</span>][<span class="ruby-identifier">:instance</span>] = <span class="ruby-identifier">create_instance</span>(<span class="ruby-identifier">klass</span>)
+82:         <span class="ruby-keyword kw">else</span>
+83:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Returning cached plugin #{plugin} with class #{klass}&quot;</span>)
+84:         <span class="ruby-keyword kw">end</span>
+85: 
+86:         <span class="ruby-ivar">@plugins</span>[<span class="ruby-identifier">plugin</span>][<span class="ruby-identifier">:instance</span>]
+87:       <span class="ruby-keyword kw">else</span>
+88:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Returning new plugin #{plugin} with class #{klass}&quot;</span>)
+89:         <span class="ruby-identifier">create_instance</span>(<span class="ruby-identifier">klass</span>)
+90:       <span class="ruby-keyword kw">end</span>
+91:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000029" class="method-detail">
+        <a name="M000029"></a>
+
+        <div class="method-heading">
+          <a href="#M000029" class="method-signature">
+          <span class="method-name">clear</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+deletes all registered plugins
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000029-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginmanager.rb, line 67</span>
+67:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">clear</span>
+68:       <span class="ruby-ivar">@plugins</span>.<span class="ruby-identifier">clear</span>
+69:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000031" class="method-detail">
+        <a name="M000031"></a>
+
+        <div class="method-heading">
+          <a href="#M000031" class="method-signature">
+          <span class="method-name">create_instance</span><span class="method-args">(klass)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+use eval to create an instance of a class
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000031-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/pluginmanager.rb, line 94</span>
+ 94:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">create_instance</span>(<span class="ruby-identifier">klass</span>)
+ 95:       <span class="ruby-keyword kw">begin</span>
+ 96:         <span class="ruby-identifier">eval</span>(<span class="ruby-node">&quot;#{klass}.new&quot;</span>)
+ 97:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+ 98:         <span class="ruby-identifier">raise</span>(<span class="ruby-node">&quot;Could not create instance of plugin #{klass}: #{e}&quot;</span>)
+ 99:       <span class="ruby-keyword kw">end</span>
+100:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000026" class="method-detail">
+        <a name="M000026"></a>
+
+        <div class="method-heading">
+          <a href="#M000026" class="method-signature">
+          <span class="method-name">delete</span><span class="method-args">(plugin)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Removes a plugim the list
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000026-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginmanager.rb, line 52</span>
+52:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">plugin</span>)
+53:       <span class="ruby-ivar">@plugins</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">plugin</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@plugins</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">plugin</span>)
+54:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000032" class="method-detail">
+        <a name="M000032"></a>
+
+        <div class="method-heading">
+          <a href="#M000032" class="method-signature">
+          <span class="method-name">find</span><span class="method-args">(type, extension=&quot;rb&quot;)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Finds plugins in all configured libdirs
+</p>
+<pre>
+  find(&quot;agent&quot;)
+</pre>
+<p>
+will return an array of just agent names, for example:
+</p>
+<pre>
+  [&quot;puppetd&quot;, &quot;package&quot;]
+</pre>
+<p>
+Can also be used to <a href="PluginManager.html#M000032">find</a> files of
+other extensions:
+</p>
+<pre>
+  find(&quot;agent&quot;, &quot;ddl&quot;)
+</pre>
+<p>
+Will return the same list but only of files with extension .ddl in the
+agent subdirectory
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000032-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/pluginmanager.rb, line 116</span>
+116:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">extension</span>=<span class="ruby-value str">&quot;rb&quot;</span>)
+117:       <span class="ruby-identifier">extension</span> = <span class="ruby-node">&quot;.#{extension}&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">extension</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/^\./</span>)
+118: 
+119:       <span class="ruby-identifier">plugins</span> = []
+120: 
+121:       <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</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>
+122:         <span class="ruby-identifier">plugdir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>([<span class="ruby-identifier">libdir</span>, <span class="ruby-value str">&quot;mcollective&quot;</span>, <span class="ruby-identifier">type</span>.<span class="ruby-identifier">to_s</span>])
+123:         <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">plugdir</span>)
+124: 
+125:         <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">plugdir</span>).<span class="ruby-identifier">grep</span>(<span class="ruby-node">/#{extension}$/</span>).<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">plugin</span><span class="ruby-operator">|</span>
+126:           <span class="ruby-identifier">plugins</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">plugin</span>, <span class="ruby-identifier">extension</span>)
+127:         <span class="ruby-keyword kw">end</span>
+128:       <span class="ruby-keyword kw">end</span>
+129: 
+130:       <span class="ruby-identifier">plugins</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">uniq</span>
+131:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000033" class="method-detail">
+        <a name="M000033"></a>
+
+        <div class="method-heading">
+          <a href="#M000033" class="method-signature">
+          <span class="method-name">find_and_load</span><span class="method-args">(type, extension=&quot;rb&quot;) {|plugin| ...}</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Finds and loads from disk all plugins from all libdirs that match certain
+criteria.
+</p>
+<pre>
+   find_and_load(&quot;pluginpackager&quot;)
+</pre>
+<p>
+Will <a href="PluginManager.html#M000032">find</a> all .rb files in the
+libdir/mcollective/pluginpackager/ directory in all libdirs and load them
+from disk.
+</p>
+<p>
+You can influence what plugins get loaded using a block notation:
+</p>
+<pre>
+   find_and_load(&quot;pluginpackager&quot;) do |plugin|
+      plugin.match(/puppet/)
+   end
+</pre>
+<p>
+This will load only plugins matching /puppet/
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000033-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/pluginmanager.rb, line 148</span>
+148:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">find_and_load</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">extension</span>=<span class="ruby-value str">&quot;rb&quot;</span>)
+149:       <span class="ruby-identifier">extension</span> = <span class="ruby-node">&quot;.#{extension}&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">extension</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/^\./</span>)
+150: 
+151:       <span class="ruby-identifier">klasses</span> = <span class="ruby-identifier">find</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">extension</span>).<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">plugin</span><span class="ruby-operator">|</span>
+152:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
+153:           <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">plugin</span>)
+154:         <span class="ruby-keyword kw">end</span>
+155: 
+156:         <span class="ruby-value str">&quot;%s::%s::%s&quot;</span> <span class="ruby-operator">%</span> [ <span class="ruby-value str">&quot;MCollective&quot;</span>, <span class="ruby-identifier">type</span>.<span class="ruby-identifier">capitalize</span>, <span class="ruby-identifier">plugin</span>.<span class="ruby-identifier">capitalize</span> ]
+157:       <span class="ruby-keyword kw">end</span>.<span class="ruby-identifier">compact</span>
+158: 
+159:       <span class="ruby-identifier">klasses</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">uniq</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">klass</span><span class="ruby-operator">|</span> <span class="ruby-identifier">loadclass</span>(<span class="ruby-identifier">klass</span>, <span class="ruby-keyword kw">true</span>)}
+160:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000035" class="method-detail">
+        <a name="M000035"></a>
+
+        <div class="method-heading">
+          <a href="#M000035" class="method-signature">
+          <span class="method-name">grep</span><span class="method-args">(regex)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Grep&#8216;s over the plugin list and returns the list found
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000035-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/pluginmanager.rb, line 176</span>
+176:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">grep</span>(<span class="ruby-identifier">regex</span>)
+177:       <span class="ruby-ivar">@plugins</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">grep</span>(<span class="ruby-identifier">regex</span>)
+178:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000027" class="method-detail">
+        <a name="M000027"></a>
+
+        <div class="method-heading">
+          <a href="#M000027" class="method-signature">
+          <span class="method-name">include?</span><span class="method-args">(plugin)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Finds out if we have a plugin with the given name
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000027-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginmanager.rb, line 57</span>
+57:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">plugin</span>)
+58:       <span class="ruby-ivar">@plugins</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">plugin</span>)
+59:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000034" class="method-detail">
+        <a name="M000034"></a>
+
+        <div class="method-heading">
+          <a href="#M000034" class="method-signature">
+          <span class="method-name">loadclass</span><span class="method-args">(klass, squash_failures=false)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Loads a class from file by doing some simple search/replace on class names
+and then doing a require.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000034-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/pluginmanager.rb, line 164</span>
+164:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">loadclass</span>(<span class="ruby-identifier">klass</span>, <span class="ruby-identifier">squash_failures</span>=<span class="ruby-keyword kw">false</span>)
+165:       <span class="ruby-identifier">fname</span> = <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">&quot;::&quot;</span>, <span class="ruby-value str">&quot;/&quot;</span>).<span class="ruby-identifier">downcase</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;.rb&quot;</span>
+166: 
+167:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Loading #{klass} from #{fname}&quot;</span>)
+168: 
+169:       <span class="ruby-identifier">load</span> <span class="ruby-identifier">fname</span>
+170:     <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+171:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">&quot;Failed to load #{klass}: #{e}&quot;</span>)
+172:       <span class="ruby-identifier">raise</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">squash_failures</span>
+173:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000028" class="method-detail">
+        <a name="M000028"></a>
+
+        <div class="method-heading">
+          <a href="#M000028" class="method-signature">
+          <span class="method-name">pluginlist</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Provides a list of plugins we know about
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000028-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginmanager.rb, line 62</span>
+62:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">pluginlist</span>
+63:       <span class="ruby-ivar">@plugins</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">sort</span>
+64:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/PluginPackager.html b/doc/classes/MCollective/PluginPackager.html
new file mode 100644 (file)
index 0000000..6b5a6c2
--- /dev/null
@@ -0,0 +1,383 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Module: MCollective::PluginPackager</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Module</strong></td>
+          <td class="class-name-in-header">MCollective::PluginPackager</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/pluginpackager_rb.html">
+                lib/mcollective/pluginpackager.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/pluginpackager/standard_definition_rb.html">
+                lib/mcollective/pluginpackager/standard_definition.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/pluginpackager/agent_definition_rb.html">
+                lib/mcollective/pluginpackager/agent_definition.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000312">[]</a>&nbsp;&nbsp;
+      <a href="#M000314">check_dir_present</a>&nbsp;&nbsp;
+      <a href="#M000316">command_available?</a>&nbsp;&nbsp;
+      <a href="#M000315">execute_verbosely</a>&nbsp;&nbsp;
+      <a href="#M000318">filter_dependencies</a>&nbsp;&nbsp;
+      <a href="#M000313">get_metadata</a>&nbsp;&nbsp;
+      <a href="#M000311">load_packagers</a>&nbsp;&nbsp;
+      <a href="#M000317">safe_system</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+    <div id="class-list">
+      <h3 class="section-bar">Classes and Modules</h3>
+
+      Class <a href="PluginPackager/AgentDefinition.html" class="link">MCollective::PluginPackager::AgentDefinition</a><br />
+Class <a href="PluginPackager/StandardDefinition.html" class="link">MCollective::PluginPackager::StandardDefinition</a><br />
+
+    </div>
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000312" class="method-detail">
+        <a name="M000312"></a>
+
+        <div class="method-heading">
+          <a href="#M000312" class="method-signature">
+          <span class="method-name">[]</span><span class="method-args">(klass)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000312-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000312-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginpackager.rb, line 12</span>
+12:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-operator">[]</span>(<span class="ruby-identifier">klass</span>)
+13:       <span class="ruby-identifier">const_get</span>(<span class="ruby-node">&quot;#{klass}&quot;</span>)
+14:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000314" class="method-detail">
+        <a name="M000314"></a>
+
+        <div class="method-heading">
+          <a href="#M000314" class="method-signature">
+          <span class="method-name">check_dir_present</span><span class="method-args">(path)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Checks if a directory is present and not empty
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000314-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000314-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginpackager.rb, line 31</span>
+31:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">check_dir_present</span>(<span class="ruby-identifier">path</span>)
+32:       (<span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">path</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">path</span>, <span class="ruby-value str">&quot;*&quot;</span>)).<span class="ruby-identifier">empty?</span>)
+33:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000316" class="method-detail">
+        <a name="M000316"></a>
+
+        <div class="method-heading">
+          <a href="#M000316" class="method-signature">
+          <span class="method-name">command_available?</span><span class="method-args">(build_tool)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Checks if a build tool is present on the system
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000316-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000316-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginpackager.rb, line 54</span>
+54:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">command_available?</span>(<span class="ruby-identifier">build_tool</span>)
+55:       <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;PATH&quot;</span>].<span class="ruby-identifier">split</span>(<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH_SEPARATOR</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span>
+56:         <span class="ruby-identifier">builder</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">build_tool</span>)
+57:         <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">builder</span>)
+58:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
+59:         <span class="ruby-keyword kw">end</span>
+60:       <span class="ruby-keyword kw">end</span>
+61:       <span class="ruby-keyword kw">false</span>
+62:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000315" class="method-detail">
+        <a name="M000315"></a>
+
+        <div class="method-heading">
+          <a href="#M000315" class="method-signature">
+          <span class="method-name">execute_verbosely</span><span class="method-args">(verbose, &amp;block)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Quietly calls a block if verbose parameter is false
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000315-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000315-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginpackager.rb, line 36</span>
+36:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">execute_verbosely</span>(<span class="ruby-identifier">verbose</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+37:       <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">verbose</span>
+38:         <span class="ruby-identifier">old_stdout</span> = <span class="ruby-identifier">$stdout</span>.<span class="ruby-identifier">clone</span>
+39:         <span class="ruby-identifier">$stdout</span>.<span class="ruby-identifier">reopen</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;/dev/null&quot;</span>, <span class="ruby-value str">&quot;w&quot;</span>))
+40:         <span class="ruby-keyword kw">begin</span>
+41:           <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>
+42:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+43:           <span class="ruby-identifier">$stdout</span>.<span class="ruby-identifier">reopen</span> <span class="ruby-identifier">old_stdout</span>
+44:           <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
+45:         <span class="ruby-keyword kw">ensure</span>
+46:           <span class="ruby-identifier">$stdout</span>.<span class="ruby-identifier">reopen</span> <span class="ruby-identifier">old_stdout</span>
+47:         <span class="ruby-keyword kw">end</span>
+48:       <span class="ruby-keyword kw">else</span>
+49:         <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>
+50:       <span class="ruby-keyword kw">end</span>
+51:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000318" class="method-detail">
+        <a name="M000318"></a>
+
+        <div class="method-heading">
+          <a href="#M000318" class="method-signature">
+          <span class="method-name">filter_dependencies</span><span class="method-args">(prefix, dependencies)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Filter out platform specific dependencies Given a list of dependencies
+named - debian::foo redhat::bar <a
+href="PluginPackager.html#M000318">PluginPackager.filter_dependencies</a>(&#8216;debian&#8217;,
+dependencies) will return foo.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000318-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000318-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginpackager.rb, line 74</span>
+74:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">filter_dependencies</span>(<span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">dependencies</span>)
+75:       <span class="ruby-identifier">dependencies</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dependency</span><span class="ruby-operator">|</span>
+76:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">dependency</span>[<span class="ruby-identifier">:name</span>] <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^(\w+)::(\w+)/</span>
+77:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">prefix</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">$1</span>
+78:             <span class="ruby-identifier">dependency</span>[<span class="ruby-identifier">:name</span>] = <span class="ruby-identifier">$2</span>
+79:             <span class="ruby-identifier">dependency</span>
+80:           <span class="ruby-keyword kw">else</span>
+81:             <span class="ruby-keyword kw">nil</span>
+82:           <span class="ruby-keyword kw">end</span>
+83:         <span class="ruby-keyword kw">else</span>
+84:           <span class="ruby-identifier">dependency</span>
+85:         <span class="ruby-keyword kw">end</span>
+86:       <span class="ruby-keyword kw">end</span>.<span class="ruby-identifier">reject</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">dependency</span><span class="ruby-operator">|</span> <span class="ruby-identifier">dependency</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span> }
+87:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000313" class="method-detail">
+        <a name="M000313"></a>
+
+        <div class="method-heading">
+          <a href="#M000313" class="method-signature">
+          <span class="method-name">get_metadata</span><span class="method-args">(path, type)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Fetch and return metadata from plugin <a href="DDL.html">DDL</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000313-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000313-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginpackager.rb, line 17</span>
+17:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get_metadata</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">type</span>)
+18:       <span class="ruby-identifier">ddl</span> = <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;package&quot;</span>, <span class="ruby-identifier">type</span>.<span class="ruby-identifier">to_sym</span>, <span class="ruby-keyword kw">false</span>)
+19: 
+20:       <span class="ruby-keyword kw">begin</span>
+21:         <span class="ruby-identifier">ddl_file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">type</span>, <span class="ruby-value str">&quot;*.ddl&quot;</span>)).<span class="ruby-identifier">first</span>)
+22:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span>
+23:         <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;failed to load ddl file in plugin directory : #{File.join(path, type)}&quot;</span>
+24:       <span class="ruby-keyword kw">end</span>
+25:       <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">instance_eval</span> <span class="ruby-identifier">ddl_file</span>
+26: 
+27:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">meta</span>, <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">requirements</span>[<span class="ruby-identifier">:mcollective</span>]
+28:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000311" class="method-detail">
+        <a name="M000311"></a>
+
+        <div class="method-heading">
+          <a href="#M000311" class="method-signature">
+          <span class="method-name">load_packagers</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Package implementation plugins
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000311-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000311-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginpackager.rb, line 8</span>
+ 8:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load_packagers</span>
+ 9:       <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">find_and_load</span>(<span class="ruby-value str">&quot;pluginpackager&quot;</span>)
+10:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000317" class="method-detail">
+        <a name="M000317"></a>
+
+        <div class="method-heading">
+          <a href="#M000317" class="method-signature">
+          <span class="method-name">safe_system</span><span class="method-args">(*args)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000317-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000317-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginpackager.rb, line 64</span>
+64:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">safe_system</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
+65:       <span class="ruby-identifier">raise</span>(<span class="ruby-constant">RuntimeError</span>, <span class="ruby-node">&quot;Failed: #{args.join(' ')}&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">system</span> <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>
+66:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/PluginPackager/AgentDefinition.html b/doc/classes/MCollective/PluginPackager/AgentDefinition.html
new file mode 100644 (file)
index 0000000..4b89ce6
--- /dev/null
@@ -0,0 +1,394 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::PluginPackager::AgentDefinition</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::PluginPackager::AgentDefinition</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/pluginpackager/agent_definition_rb.html">
+                lib/mcollective/pluginpackager/agent_definition.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+<a href="../../MCollective.html">MCollective</a> <a
+href="../Agent.html">Agent</a> Plugin package
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000325">agent</a>&nbsp;&nbsp;
+      <a href="#M000326">client</a>&nbsp;&nbsp;
+      <a href="#M000327">common</a>&nbsp;&nbsp;
+      <a href="#M000324">identify_packages</a>&nbsp;&nbsp;
+      <a href="#M000323">new</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">dependencies</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">mcname</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">mcversion</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">metadata</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">packagedata</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">path</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">plugintype</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">postinstall</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">preinstall</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">revision</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">target_path</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">vendor</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000323" class="method-detail">
+        <a name="M000323"></a>
+
+        <div class="method-heading">
+          <a href="#M000323" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(configuration, mcdependency, plugintype)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000323-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000323-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginpackager/agent_definition.rb, line 8</span>
+ 8:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">configuration</span>, <span class="ruby-identifier">mcdependency</span>, <span class="ruby-identifier">plugintype</span>)
+ 9:         <span class="ruby-ivar">@plugintype</span> = <span class="ruby-identifier">plugintype</span>
+10:         <span class="ruby-ivar">@path</span> = <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:target</span>]
+11:         <span class="ruby-ivar">@packagedata</span> = {}
+12:         <span class="ruby-ivar">@revision</span> = <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:revision</span>] <span class="ruby-operator">||</span> <span class="ruby-value">1</span>
+13:         <span class="ruby-ivar">@preinstall</span> = <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:preinstall</span>]
+14:         <span class="ruby-ivar">@postinstall</span> = <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:postinstall</span>]
+15:         <span class="ruby-ivar">@vendor</span> = <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:vendor</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;Puppet Labs&quot;</span>
+16:         <span class="ruby-ivar">@dependencies</span> = <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:dependency</span>] <span class="ruby-operator">||</span> []
+17:         <span class="ruby-ivar">@target_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-ivar">@path</span>)
+18:         <span class="ruby-ivar">@metadata</span>, <span class="ruby-identifier">mcversion</span> = <span class="ruby-constant">PluginPackager</span>.<span class="ruby-identifier">get_metadata</span>(<span class="ruby-ivar">@path</span>, <span class="ruby-value str">&quot;agent&quot;</span>)
+19:         <span class="ruby-ivar">@mcname</span> = <span class="ruby-identifier">mcdependency</span>[<span class="ruby-identifier">:mcname</span>] <span class="ruby-operator">||</span>  <span class="ruby-value str">&quot;mcollective&quot;</span>
+20:         <span class="ruby-ivar">@mcversion</span> = <span class="ruby-identifier">mcdependency</span>[<span class="ruby-identifier">:mcversion</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">mcversion</span>
+21:         <span class="ruby-ivar">@metadata</span>[<span class="ruby-identifier">:version</span>] = (<span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:version</span>] <span class="ruby-operator">||</span> <span class="ruby-ivar">@metadata</span>[<span class="ruby-identifier">:version</span>])
+22:         <span class="ruby-ivar">@dependencies</span> <span class="ruby-operator">&lt;&lt;</span> {<span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;#{@mcname}-common&quot;</span>, <span class="ruby-identifier">:version</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@mcversion</span>}
+23:         <span class="ruby-ivar">@metadata</span>[<span class="ruby-identifier">:name</span>] = (<span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:pluginname</span>] <span class="ruby-operator">||</span> <span class="ruby-ivar">@metadata</span>[<span class="ruby-identifier">:name</span>]).<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/\s+|_/</span>, <span class="ruby-value str">&quot;-&quot;</span>)
+24:         <span class="ruby-identifier">identify_packages</span>
+25:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000325" class="method-detail">
+        <a name="M000325"></a>
+
+        <div class="method-heading">
+          <a href="#M000325" class="method-signature">
+          <span class="method-name">agent</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Obtain <a href="../Agent.html">Agent</a> package files and dependencies.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000325-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000325-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginpackager/agent_definition.rb, line 38</span>
+38:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">agent</span>
+39:         <span class="ruby-identifier">agent</span> = {<span class="ruby-identifier">:files</span> =<span class="ruby-operator">&gt;</span> [],
+40:                  <span class="ruby-identifier">:dependencies</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@dependencies</span>.<span class="ruby-identifier">clone</span>,
+41:                  <span class="ruby-identifier">:description</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;Agent plugin for #{@metadata[:name]}&quot;</span>}
+42: 
+43:         <span class="ruby-identifier">agentdir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@path</span>, <span class="ruby-value str">&quot;agent&quot;</span>)
+44: 
+45:         <span class="ruby-keyword kw">if</span> <span class="ruby-constant">PluginPackager</span>.<span class="ruby-identifier">check_dir_present</span> <span class="ruby-identifier">agentdir</span>
+46:           <span class="ruby-identifier">ddls</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">agentdir</span>, <span class="ruby-value str">&quot;*.ddl&quot;</span>))
+47:           <span class="ruby-identifier">agent</span>[<span class="ruby-identifier">:files</span>] = (<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">agentdir</span>, <span class="ruby-value str">&quot;*&quot;</span>)) <span class="ruby-operator">-</span> <span class="ruby-identifier">ddls</span>)
+48:         <span class="ruby-keyword kw">else</span>
+49:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
+50:         <span class="ruby-keyword kw">end</span>
+51:         <span class="ruby-identifier">agent</span>[<span class="ruby-identifier">:plugindependency</span>] = {<span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;#{@mcname}-#{@metadata[:name]}-common&quot;</span>, <span class="ruby-identifier">:version</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@metadata</span>[<span class="ruby-identifier">:version</span>], <span class="ruby-identifier">:revision</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@revision</span>}
+52:         <span class="ruby-identifier">agent</span>
+53:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000326" class="method-detail">
+        <a name="M000326"></a>
+
+        <div class="method-heading">
+          <a href="#M000326" class="method-signature">
+          <span class="method-name">client</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Obtain <a href="AgentDefinition.html#M000326">client</a> package files and
+dependencies.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000326-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000326-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginpackager/agent_definition.rb, line 56</span>
+56:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">client</span>
+57:         <span class="ruby-identifier">client</span> = {<span class="ruby-identifier">:files</span> =<span class="ruby-operator">&gt;</span> [],
+58:                   <span class="ruby-identifier">:dependencies</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@dependencies</span>.<span class="ruby-identifier">clone</span>,
+59:                   <span class="ruby-identifier">:description</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;Client plugin for #{@metadata[:name]}&quot;</span>}
+60: 
+61:         <span class="ruby-identifier">clientdir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@path</span>, <span class="ruby-value str">&quot;application&quot;</span>)
+62:         <span class="ruby-identifier">aggregatedir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@path</span>, <span class="ruby-value str">&quot;aggregate&quot;</span>)
+63: 
+64:         <span class="ruby-identifier">client</span>[<span class="ruby-identifier">:files</span>] <span class="ruby-operator">+=</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">clientdir</span>, <span class="ruby-value str">&quot;*&quot;</span>)) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">PluginPackager</span>.<span class="ruby-identifier">check_dir_present</span> <span class="ruby-identifier">clientdir</span>
+65:         <span class="ruby-identifier">client</span>[<span class="ruby-identifier">:files</span>] <span class="ruby-operator">+=</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">aggregatedir</span>, <span class="ruby-value str">&quot;*&quot;</span>)) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">PluginPackager</span>.<span class="ruby-identifier">check_dir_present</span> <span class="ruby-identifier">aggregatedir</span>
+66:         <span class="ruby-identifier">client</span>[<span class="ruby-identifier">:plugindependency</span>] = {<span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;#{@mcname}-#{@metadata[:name]}-common&quot;</span>, <span class="ruby-identifier">:version</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@metadata</span>[<span class="ruby-identifier">:version</span>], <span class="ruby-identifier">:revision</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@revision</span>}
+67:         <span class="ruby-identifier">client</span>[<span class="ruby-identifier">:files</span>].<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">client</span>
+68:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000327" class="method-detail">
+        <a name="M000327"></a>
+
+        <div class="method-heading">
+          <a href="#M000327" class="method-signature">
+          <span class="method-name">common</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Obtain <a href="AgentDefinition.html#M000327">common</a> package files and
+dependencies.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000327-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000327-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginpackager/agent_definition.rb, line 71</span>
+71:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">common</span>
+72:         <span class="ruby-identifier">common</span> = {<span class="ruby-identifier">:files</span> =<span class="ruby-operator">&gt;</span>[],
+73:                   <span class="ruby-identifier">:dependencies</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@dependencies</span>.<span class="ruby-identifier">clone</span>,
+74:                   <span class="ruby-identifier">:description</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;Common libraries for #{@metadata[:name]}&quot;</span>}
+75: 
+76:         <span class="ruby-identifier">datadir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@path</span>, <span class="ruby-value str">&quot;data&quot;</span>, <span class="ruby-value str">&quot;**&quot;</span>)
+77:         <span class="ruby-identifier">utildir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@path</span>, <span class="ruby-value str">&quot;util&quot;</span>, <span class="ruby-value str">&quot;**&quot;</span>, <span class="ruby-value str">&quot;**&quot;</span>)
+78:         <span class="ruby-identifier">ddldir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@path</span>, <span class="ruby-value str">&quot;agent&quot;</span>, <span class="ruby-value str">&quot;*.ddl&quot;</span>)
+79:         <span class="ruby-identifier">validatordir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@path</span>, <span class="ruby-value str">&quot;validator&quot;</span>, <span class="ruby-value str">&quot;**&quot;</span>)
+80: 
+81:         [<span class="ruby-identifier">datadir</span>, <span class="ruby-identifier">utildir</span>, <span class="ruby-identifier">validatordir</span>, <span class="ruby-identifier">ddldir</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">directory</span><span class="ruby-operator">|</span>
+82:           <span class="ruby-identifier">common</span>[<span class="ruby-identifier">:files</span>] <span class="ruby-operator">+=</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>(<span class="ruby-identifier">directory</span>)
+83:         <span class="ruby-keyword kw">end</span>
+84: 
+85:         <span class="ruby-comment cmt"># We fail if there is no ddl file present</span>
+86:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">common</span>[<span class="ruby-identifier">:files</span>].<span class="ruby-identifier">grep</span>(<span class="ruby-regexp re">/^.*\.ddl$/</span>).<span class="ruby-identifier">empty?</span>
+87:           <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;cannot create package - No ddl file found in #{File.join(@path, &quot;agent&quot;)}&quot;</span>
+88:         <span class="ruby-keyword kw">end</span>
+89: 
+90:         <span class="ruby-identifier">common</span>[<span class="ruby-identifier">:files</span>].<span class="ruby-identifier">empty?</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">common</span>
+91:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000324" class="method-detail">
+        <a name="M000324"></a>
+
+        <div class="method-heading">
+          <a href="#M000324" class="method-signature">
+          <span class="method-name">identify_packages</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Identify present packages and populate packagedata hash.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000324-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000324-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginpackager/agent_definition.rb, line 28</span>
+28:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">identify_packages</span>
+29:         <span class="ruby-identifier">common_package</span> = <span class="ruby-identifier">common</span>
+30:         <span class="ruby-ivar">@packagedata</span>[<span class="ruby-identifier">:common</span>] = <span class="ruby-identifier">common_package</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">common_package</span>
+31:         <span class="ruby-identifier">agent_package</span> = <span class="ruby-identifier">agent</span>
+32:         <span class="ruby-ivar">@packagedata</span>[<span class="ruby-identifier">:agent</span>] = <span class="ruby-identifier">agent_package</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">agent_package</span>
+33:         <span class="ruby-identifier">client_package</span> = <span class="ruby-identifier">client</span>
+34:         <span class="ruby-ivar">@packagedata</span>[<span class="ruby-identifier">:client</span>] = <span class="ruby-identifier">client_package</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">client_package</span>
+35:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/PluginPackager/StandardDefinition.html b/doc/classes/MCollective/PluginPackager/StandardDefinition.html
new file mode 100644 (file)
index 0000000..d190b63
--- /dev/null
@@ -0,0 +1,340 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::PluginPackager::StandardDefinition</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::PluginPackager::StandardDefinition</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/pluginpackager/standard_definition_rb.html">
+                lib/mcollective/pluginpackager/standard_definition.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000322">common</a>&nbsp;&nbsp;
+      <a href="#M000320">identify_packages</a>&nbsp;&nbsp;
+      <a href="#M000319">new</a>&nbsp;&nbsp;
+      <a href="#M000321">plugin</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">dependencies</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">mcname</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">mcversion</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">metadata</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">packagedata</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">path</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">plugintype</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">postinstall</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">preinstall</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">revision</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">target_path</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">vendor</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000319" class="method-detail">
+        <a name="M000319"></a>
+
+        <div class="method-heading">
+          <a href="#M000319" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(configuration, mcdependency, plugintype)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000319-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000319-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginpackager/standard_definition.rb, line 7</span>
+ 7:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">configuration</span>, <span class="ruby-identifier">mcdependency</span>, <span class="ruby-identifier">plugintype</span>)
+ 8:         <span class="ruby-ivar">@plugintype</span> = <span class="ruby-identifier">plugintype</span>
+ 9:         <span class="ruby-ivar">@path</span> = <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:target</span>]
+10:         <span class="ruby-ivar">@packagedata</span> = {}
+11:         <span class="ruby-ivar">@revision</span> = <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:revision</span>] <span class="ruby-operator">||</span> <span class="ruby-value">1</span>
+12:         <span class="ruby-ivar">@preinstall</span> = <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:preinstall</span>]
+13:         <span class="ruby-ivar">@postinstall</span> = <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:postinstall</span>]
+14:         <span class="ruby-ivar">@vendor</span> = <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:vendor</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;Puppet Labs&quot;</span>
+15:         <span class="ruby-ivar">@dependencies</span> = <span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:dependency</span>] <span class="ruby-operator">||</span> []
+16:         <span class="ruby-ivar">@target_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-ivar">@path</span>)
+17:         <span class="ruby-ivar">@metadata</span>, <span class="ruby-identifier">mcversion</span> = <span class="ruby-constant">PluginPackager</span>.<span class="ruby-identifier">get_metadata</span>(<span class="ruby-ivar">@path</span>, <span class="ruby-ivar">@plugintype</span>)
+18:         <span class="ruby-ivar">@mcname</span> = <span class="ruby-identifier">mcdependency</span>[<span class="ruby-identifier">:mcname</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;mcollective&quot;</span>
+19:         <span class="ruby-ivar">@mcversion</span> = <span class="ruby-identifier">mcdependency</span>[<span class="ruby-identifier">:mcversion</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">mcversion</span>
+20:         <span class="ruby-ivar">@dependencies</span> <span class="ruby-operator">&lt;&lt;</span> {<span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;#{mcname}-common&quot;</span>, <span class="ruby-identifier">:version</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@mcversion</span>}
+21:         <span class="ruby-ivar">@metadata</span>[<span class="ruby-identifier">:name</span>] = (<span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:pluginname</span>] <span class="ruby-operator">||</span> <span class="ruby-ivar">@metadata</span>[<span class="ruby-identifier">:name</span>]).<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/\s+|_/</span>, <span class="ruby-value str">&quot;-&quot;</span>)
+22:         <span class="ruby-ivar">@metadata</span>[<span class="ruby-identifier">:version</span>] = (<span class="ruby-identifier">configuration</span>[<span class="ruby-identifier">:version</span>] <span class="ruby-operator">||</span> <span class="ruby-ivar">@metadata</span>[<span class="ruby-identifier">:version</span>])
+23:         <span class="ruby-identifier">identify_packages</span>
+24:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000322" class="method-detail">
+        <a name="M000322"></a>
+
+        <div class="method-heading">
+          <a href="#M000322" class="method-signature">
+          <span class="method-name">common</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Obtain list of <a href="StandardDefinition.html#M000322">common</a> files
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000322-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000322-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginpackager/standard_definition.rb, line 54</span>
+54:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">common</span>
+55:         <span class="ruby-identifier">common</span> = {<span class="ruby-identifier">:files</span> =<span class="ruby-operator">&gt;</span> [],
+56:                   <span class="ruby-identifier">:dependencies</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@dependencies</span>.<span class="ruby-identifier">clone</span>,
+57:                   <span class="ruby-identifier">:description</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;Common libraries for #{@name} connector plugin&quot;</span>}
+58: 
+59:         <span class="ruby-identifier">commondir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@path</span>, <span class="ruby-value str">&quot;util&quot;</span>)
+60:         <span class="ruby-keyword kw">if</span> <span class="ruby-constant">PluginPackager</span>.<span class="ruby-identifier">check_dir_present</span> <span class="ruby-identifier">commondir</span>
+61:           <span class="ruby-identifier">common</span>[<span class="ruby-identifier">:files</span>] = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">commondir</span>, <span class="ruby-value str">&quot;*&quot;</span>))
+62:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">common</span>
+63:         <span class="ruby-keyword kw">else</span>
+64:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
+65:         <span class="ruby-keyword kw">end</span>
+66:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000320" class="method-detail">
+        <a name="M000320"></a>
+
+        <div class="method-heading">
+          <a href="#M000320" class="method-signature">
+          <span class="method-name">identify_packages</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Identify present packages and populate the packagedata hash
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000320-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000320-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginpackager/standard_definition.rb, line 27</span>
+27:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">identify_packages</span>
+28:         <span class="ruby-identifier">common_package</span> = <span class="ruby-identifier">common</span>
+29:         <span class="ruby-ivar">@packagedata</span>[<span class="ruby-identifier">:common</span>] = <span class="ruby-identifier">common_package</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">common_package</span>
+30:         <span class="ruby-identifier">plugin_package</span> = <span class="ruby-identifier">plugin</span>
+31:         <span class="ruby-ivar">@packagedata</span>[<span class="ruby-ivar">@plugintype</span>.<span class="ruby-identifier">to_sym</span>] = <span class="ruby-identifier">plugin_package</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">plugin_package</span>
+32:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000321" class="method-detail">
+        <a name="M000321"></a>
+
+        <div class="method-heading">
+          <a href="#M000321" class="method-signature">
+          <span class="method-name">plugin</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Obtain standard <a href="StandardDefinition.html#M000321">plugin</a> files
+and dependencies
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000321-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000321-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/pluginpackager/standard_definition.rb, line 35</span>
+35:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">plugin</span>
+36:         <span class="ruby-identifier">plugindata</span> = {<span class="ruby-identifier">:files</span> =<span class="ruby-operator">&gt;</span> [],
+37:                       <span class="ruby-identifier">:dependencies</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@dependencies</span>.<span class="ruby-identifier">clone</span>,
+38:                       <span class="ruby-identifier">:description</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;#{@name} #{@plugintype} plugin for the Marionette Collective.&quot;</span>}
+39: 
+40:         <span class="ruby-identifier">plugindir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@path</span>, <span class="ruby-ivar">@plugintype</span>.<span class="ruby-identifier">to_s</span>)
+41:         <span class="ruby-keyword kw">if</span> <span class="ruby-constant">PluginPackager</span>.<span class="ruby-identifier">check_dir_present</span> <span class="ruby-identifier">plugindir</span>
+42:           <span class="ruby-identifier">plugindata</span>[<span class="ruby-identifier">:files</span>] = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">plugindir</span>, <span class="ruby-value str">&quot;*&quot;</span>))
+43:         <span class="ruby-keyword kw">else</span>
+44:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
+45:         <span class="ruby-keyword kw">end</span>
+46: 
+47:         <span class="ruby-identifier">plugindata</span>[<span class="ruby-identifier">:plugindependency</span>] = {<span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;#{@mcname}-#{@metadata[:name]}-common&quot;</span>,
+48:                                       <span class="ruby-identifier">:version</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@metadata</span>[<span class="ruby-identifier">:version</span>],
+49:                                       <span class="ruby-identifier">:revision</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@revision</span>} <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@packagedata</span>[<span class="ruby-identifier">:common</span>]
+50:         <span class="ruby-identifier">plugindata</span>
+51:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/RPC.html b/doc/classes/MCollective/RPC.html
new file mode 100644 (file)
index 0000000..23c2f74
--- /dev/null
@@ -0,0 +1,539 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Module: MCollective::RPC</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Module</strong></td>
+          <td class="class-name-in-header">MCollective::RPC</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/rpc_rb.html">
+                lib/mcollective/rpc.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/rpc/actionrunner_rb.html">
+                lib/mcollective/rpc/actionrunner.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/rpc/reply_rb.html">
+                lib/mcollective/rpc/reply.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/rpc/progress_rb.html">
+                lib/mcollective/rpc/progress.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/rpc/agent_rb.html">
+                lib/mcollective/rpc/agent.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/rpc/request_rb.html">
+                lib/mcollective/rpc/request.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/rpc/audit_rb.html">
+                lib/mcollective/rpc/audit.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/rpc/stats_rb.html">
+                lib/mcollective/rpc/stats.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/rpc/result_rb.html">
+                lib/mcollective/rpc/result.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/rpc/client_rb.html">
+                lib/mcollective/rpc/client.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/rpc/helpers_rb.html">
+                lib/mcollective/rpc/helpers.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+Toolset to create a standard interface of client and agent using an <a
+href="RPC.html">RPC</a> metaphor, standard compliant agents will make it
+easier to create generic clients like web interfaces etc
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000043">const_missing</a>&nbsp;&nbsp;
+      <a href="#M000039">discovered</a>&nbsp;&nbsp;
+      <a href="#M000042">empty_filter?</a>&nbsp;&nbsp;
+      <a href="#M000041">printrpc</a>&nbsp;&nbsp;
+      <a href="#M000040">printrpcstats</a>&nbsp;&nbsp;
+      <a href="#M000037">rpcclient</a>&nbsp;&nbsp;
+      <a href="#M000036">rpcoptions</a>&nbsp;&nbsp;
+      <a href="#M000038">stats</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+    <div id="class-list">
+      <h3 class="section-bar">Classes and Modules</h3>
+
+      Class <a href="RPC/ActionRunner.html" class="link">MCollective::RPC::ActionRunner</a><br />
+Class <a href="RPC/Agent.html" class="link">MCollective::RPC::Agent</a><br />
+Class <a href="RPC/Audit.html" class="link">MCollective::RPC::Audit</a><br />
+Class <a href="RPC/Client.html" class="link">MCollective::RPC::Client</a><br />
+Class <a href="RPC/Helpers.html" class="link">MCollective::RPC::Helpers</a><br />
+Class <a href="RPC/Progress.html" class="link">MCollective::RPC::Progress</a><br />
+Class <a href="RPC/Reply.html" class="link">MCollective::RPC::Reply</a><br />
+Class <a href="RPC/Request.html" class="link">MCollective::RPC::Request</a><br />
+Class <a href="RPC/Result.html" class="link">MCollective::RPC::Result</a><br />
+Class <a href="RPC/Stats.html" class="link">MCollective::RPC::Stats</a><br />
+
+    </div>
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000043" class="method-detail">
+        <a name="M000043"></a>
+
+        <div class="method-heading">
+          <a href="#M000043" class="method-signature">
+          <span class="method-name">const_missing</span><span class="method-args">(const_name)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000043-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000043-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc.rb, line 175</span>
+175:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">const_missing</span>(<span class="ruby-identifier">const_name</span>)
+176:       <span class="ruby-keyword kw">super</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">const_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:DDL</span>
+177: 
+178:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">warn</span>(<span class="ruby-value str">&quot;MCollective::RPC::DDL is deprecatd, please use MCollective::DDL instead&quot;</span>)
+179:       <span class="ruby-constant">MCollective</span><span class="ruby-operator">::</span><span class="ruby-constant">DDL</span>
+180:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000039" class="method-detail">
+        <a name="M000039"></a>
+
+        <div class="method-heading">
+          <a href="#M000039" class="method-signature">
+          <span class="method-name">discovered</span><span class="method-args">(discovered)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+means for other classes to drop <a href="RPC.html#M000039">discovered</a>
+hosts into this module its a bit hacky but needed so that the mixin methods
+like <a href="RPC.html#M000040">printrpcstats</a> can easily get access to
+it without users having to pass it around in params.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000039-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000039-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc.rb, line 107</span>
+107:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">discovered</span>(<span class="ruby-identifier">discovered</span>)
+108:       <span class="ruby-ivar">@@discovered</span> = <span class="ruby-identifier">discovered</span>
+109:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000038" class="method-detail">
+        <a name="M000038"></a>
+
+        <div class="method-heading">
+          <a href="#M000038" class="method-signature">
+          <span class="method-name">stats</span><span class="method-args">(stats)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+means for other classes to drop <a href="RPC.html#M000038">stats</a> into
+this module its a bit hacky but needed so that the mixin methods like <a
+href="RPC.html#M000040">printrpcstats</a> can easily get access to it
+without users having to pass it around in params.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000038-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc.rb, line 99</span>
+ 99:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">stats</span>(<span class="ruby-identifier">stats</span>)
+100:       <span class="ruby-ivar">@@stats</span> = <span class="ruby-identifier">stats</span>
+101:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000042" class="method-detail">
+        <a name="M000042"></a>
+
+        <div class="method-heading">
+          <a href="#M000042" class="method-signature">
+          <span class="method-name">empty_filter?</span><span class="method-args">(options)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Wrapper for <a href="Util.html#M000288">MCollective::Util.empty_filter</a>?
+to make clients less fugly to write - ticket 18
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000042-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000042-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc.rb, line 167</span>
+167:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">empty_filter?</span>(<span class="ruby-identifier">options</span>)
+168:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:filter</span>)
+169:         <span class="ruby-constant">Util</span>.<span class="ruby-identifier">empty_filter?</span>(<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:filter</span>])
+170:       <span class="ruby-keyword kw">else</span>
+171:         <span class="ruby-constant">Util</span>.<span class="ruby-identifier">empty_filter?</span>(<span class="ruby-identifier">options</span>)
+172:       <span class="ruby-keyword kw">end</span>
+173:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000041" class="method-detail">
+        <a name="M000041"></a>
+
+        <div class="method-heading">
+          <a href="#M000041" class="method-signature">
+          <span class="method-name">printrpc</span><span class="method-args">(result, flags = {})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Prints the result of an <a href="RPC.html">RPC</a> call.
+</p>
+<p>
+In the default quiet mode - no flattening or verbose - only results that
+produce an error will be printed
+</p>
+<p>
+To get details of each result run with the -v command line option.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000041-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000041-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc.rb, line 146</span>
+146:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">printrpc</span>(<span class="ruby-identifier">result</span>, <span class="ruby-identifier">flags</span> = {})
+147:       <span class="ruby-identifier">verbose</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:verbose</span>] <span class="ruby-keyword kw">rescue</span> <span class="ruby-identifier">verbose</span> = <span class="ruby-keyword kw">false</span>
+148:       <span class="ruby-identifier">verbose</span> = <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:verbose</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">verbose</span>
+149:       <span class="ruby-identifier">flatten</span> = <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:flatten</span>] <span class="ruby-operator">||</span> <span class="ruby-keyword kw">false</span>
+150:       <span class="ruby-identifier">format</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:output_format</span>]
+151:       <span class="ruby-identifier">forced_mode</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:force_display_mode</span>] <span class="ruby-operator">||</span> <span class="ruby-keyword kw">false</span>
+152: 
+153:       <span class="ruby-identifier">result_text</span> =  <span class="ruby-constant">Helpers</span>.<span class="ruby-identifier">rpcresults</span>(<span class="ruby-identifier">result</span>, {<span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">verbose</span>, <span class="ruby-identifier">:flatten</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">flatten</span>, <span class="ruby-identifier">:format</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">format</span>, <span class="ruby-identifier">:force_display_mode</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">forced_mode</span>})
+154: 
+155:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">format</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:console</span>
+156:         <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;\n%s\n&quot;</span> <span class="ruby-operator">%</span> [ <span class="ruby-identifier">result_text</span> ]
+157:       <span class="ruby-keyword kw">else</span>
+158:         <span class="ruby-comment cmt"># when we get just one result to print dont pad them all with</span>
+159:         <span class="ruby-comment cmt"># blank spaces etc, just print the individual result with no</span>
+160:         <span class="ruby-comment cmt"># padding</span>
+161:         <span class="ruby-identifier">puts</span> <span class="ruby-identifier">result_text</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">result_text</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span>
+162:       <span class="ruby-keyword kw">end</span>
+163:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000040" class="method-detail">
+        <a name="M000040"></a>
+
+        <div class="method-heading">
+          <a href="#M000040" class="method-signature">
+          <span class="method-name">printrpcstats</span><span class="method-args">(flags={})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Prints <a href="RPC.html#M000038">stats</a>, requires <a
+href="RPC.html#M000038">stats</a> to be saved from elsewhere using the <a
+href="RPC.html#M000038">MCollective::RPC.stats</a> method.
+</p>
+<p>
+If you&#8216;ve passed -v on the command line a detailed stat block will be
+printed, else just a one liner.
+</p>
+<p>
+You can pass flags into it:
+</p>
+<pre>
+  printrpcstats :caption =&gt; &quot;Foo&quot;, :summarize =&gt; true
+</pre>
+<p>
+This will use &quot;Foo&quot; as the caption to the <a
+href="RPC.html#M000038">stats</a> in verbose mode and print out any
+aggregate summary information if present
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000040-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000040-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc.rb, line 123</span>
+123:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">printrpcstats</span>(<span class="ruby-identifier">flags</span>={})
+124:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:output_format</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">:console</span>
+125: 
+126:       <span class="ruby-identifier">flags</span> = {<span class="ruby-identifier">:summarize</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">:caption</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;rpc stats&quot;</span>}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">flags</span>)
+127: 
+128:       <span class="ruby-identifier">verbose</span> = <span class="ruby-ivar">@options</span>[<span class="ruby-identifier">:verbose</span>] <span class="ruby-keyword kw">rescue</span> <span class="ruby-identifier">verbose</span> = <span class="ruby-keyword kw">false</span>
+129: 
+130:       <span class="ruby-keyword kw">begin</span>
+131:         <span class="ruby-identifier">stats</span> = <span class="ruby-ivar">@@stats</span>
+132:       <span class="ruby-keyword kw">rescue</span>
+133:         <span class="ruby-identifier">puts</span>(<span class="ruby-value str">&quot;no stats to display&quot;</span>)
+134:         <span class="ruby-keyword kw">return</span>
+135:       <span class="ruby-keyword kw">end</span>
+136: 
+137:       <span class="ruby-identifier">puts</span> <span class="ruby-identifier">stats</span>.<span class="ruby-identifier">report</span>(<span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:caption</span>], <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:summarize</span>], <span class="ruby-identifier">verbose</span>)
+138:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000037" class="method-detail">
+        <a name="M000037"></a>
+
+        <div class="method-heading">
+          <a href="#M000037" class="method-signature">
+          <span class="method-name">rpcclient</span><span class="method-args">(agent, flags = {}) {|rpc| ...}</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Wrapper to create clients, supposed to be used as a mixin:
+</p>
+<p>
+include <a href="RPC.html">MCollective::RPC</a>
+</p>
+<p>
+exim = <a href="RPC.html#M000037">rpcclient</a>(&quot;exim&quot;) <a
+href="RPC.html#M000041">printrpc</a> exim.mailq
+</p>
+<p>
+or
+</p>
+<p>
+<a href="RPC.html#M000037">rpcclient</a>(&quot;exim&quot;) do |exim|
+</p>
+<pre>
+   printrpc exim.mailq
+</pre>
+<p>
+end
+</p>
+<p>
+It will take a few flags:
+</p>
+<pre>
+   :configfile =&gt; &quot;etc/client.cfg&quot;
+   :options =&gt; options
+   :exit_on_failure =&gt; true
+</pre>
+<p>
+Options would be a build up options hash from the <a
+href="Optionparser.html">Optionparser</a> you can use the <a
+href="RPC.html#M000036">rpcoptions</a> helper to create this
+</p>
+<p>
+:exit_on_failure is true by default, and causes the application to exit if
+there is a failure constructing the <a href="RPC.html">RPC</a> client. Set
+this flag to false to cause an Exception to be raised instead.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000037-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc.rb, line 60</span>
+60:     <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> = {})
+61:       <span class="ruby-identifier">configfile</span> = <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:configfile</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;/etc/mcollective/client.cfg&quot;</span>
+62:       <span class="ruby-identifier">options</span> = <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:options</span>] <span class="ruby-operator">||</span> <span class="ruby-keyword kw">nil</span>
+63: 
+64:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">:exit_on_failure</span>)
+65:         <span class="ruby-identifier">exit_on_failure</span> = <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:exit_on_failure</span>]
+66:       <span class="ruby-keyword kw">else</span>
+67:         <span class="ruby-comment cmt"># We exit on failure by default for CLI-friendliness</span>
+68:         <span class="ruby-identifier">exit_on_failure</span> = <span class="ruby-keyword kw">true</span>
+69:       <span class="ruby-keyword kw">end</span>
+70: 
+71:       <span class="ruby-keyword kw">begin</span>
+72:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>
+73:           <span class="ruby-identifier">rpc</span> = <span class="ruby-constant">Client</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">:configfile</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:config</span>], <span class="ruby-identifier">:options</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">options</span>)
+74:           <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">rpc</span>.<span class="ruby-identifier">options</span>
+75:         <span class="ruby-keyword kw">else</span>
+76:           <span class="ruby-identifier">rpc</span> = <span class="ruby-constant">Client</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">:configfile</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">configfile</span>)
+77:           <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">rpc</span>.<span class="ruby-identifier">options</span>
+78:         <span class="ruby-keyword kw">end</span>
+79:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+80:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">exit_on_failure</span>
+81:           <span class="ruby-identifier">puts</span>(<span class="ruby-node">&quot;Could not create RPC client: #{e}&quot;</span>)
+82:           <span class="ruby-identifier">exit!</span>
+83:         <span class="ruby-keyword kw">else</span>
+84:           <span class="ruby-identifier">raise</span> <span class="ruby-identifier">e</span>
+85:         <span class="ruby-keyword kw">end</span>
+86:       <span class="ruby-keyword kw">end</span>
+87: 
+88:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
+89:         <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">rpc</span>)
+90:       <span class="ruby-keyword kw">else</span>
+91:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">rpc</span>
+92:       <span class="ruby-keyword kw">end</span>
+93:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000036" class="method-detail">
+        <a name="M000036"></a>
+
+        <div class="method-heading">
+          <a href="#M000036" class="method-signature">
+          <span class="method-name">rpcoptions</span><span class="method-args">() {|parser, options| ...}</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Creates a standard options hash, pass in a block to add extra headings etc
+see <a href="Optionparser.html">Optionparser</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000036-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc.rb, line 21</span>
+21:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rpcoptions</span>
+22:       <span class="ruby-identifier">oparser</span> = <span class="ruby-constant">MCollective</span><span class="ruby-operator">::</span><span class="ruby-constant">Optionparser</span>.<span class="ruby-identifier">new</span>({<span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">:progress_bar</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>}, <span class="ruby-value str">&quot;filter&quot;</span>)
+23: 
+24:       <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>
+25:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
+26:           <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">parser</span>, <span class="ruby-identifier">options</span>)
+27:         <span class="ruby-keyword kw">end</span>
+28: 
+29:         <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>)
+30:       <span class="ruby-keyword kw">end</span>
+31: 
+32:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">options</span>
+33:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/RPC/ActionRunner.html b/doc/classes/MCollective/RPC/ActionRunner.html
new file mode 100644 (file)
index 0000000..79686b9
--- /dev/null
@@ -0,0 +1,534 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::RPC::ActionRunner</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::RPC::ActionRunner</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/rpc/actionrunner_rb.html">
+                lib/mcollective/rpc/actionrunner.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+A helper used by RPC::Agent#implemented_by to delegate an action to an
+external script. At present only JSON based serialization is supported in
+future ones based on key=val pairs etc will be added
+</p>
+<p>
+It serializes the request object into an input file and creates an empty
+output file. It then calls the external command reading the output file at
+the end.
+</p>
+<p>
+any STDERR gets logged at error level and any STDOUT gets logged at info
+level.
+</p>
+<p>
+It will interpret the exit code from the application the same way <a
+href="Reply.html#M000074">RPC::Reply#fail</a>! and fail handles their codes
+creating a consistent interface, the message part of the fail message will
+come from STDERR
+</p>
+<p>
+Generally externals should just exit with code 1 on failure and print to
+STDERR, this is exactly what Perl die() does and translates perfectly to
+our model
+</p>
+<p>
+It uses the <a href="../Shell.html">MCollective::Shell</a> wrapper to call
+the external application
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000066">canrun?</a>&nbsp;&nbsp;
+      <a href="#M000063">load_json_results</a>&nbsp;&nbsp;
+      <a href="#M000062">load_results</a>&nbsp;&nbsp;
+      <a href="#M000059">new</a>&nbsp;&nbsp;
+      <a href="#M000069">path_to_command</a>&nbsp;&nbsp;
+      <a href="#M000060">run</a>&nbsp;&nbsp;
+      <a href="#M000065">save_json_request</a>&nbsp;&nbsp;
+      <a href="#M000064">saverequest</a>&nbsp;&nbsp;
+      <a href="#M000061">shell</a>&nbsp;&nbsp;
+      <a href="#M000068">tempfile</a>&nbsp;&nbsp;
+      <a href="#M000067">to_s</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">action</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">agent</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">command</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">format</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">request</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">stderr</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">stdout</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000059" class="method-detail">
+        <a name="M000059"></a>
+
+        <div class="method-heading">
+          <a href="#M000059" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(command, request, format=:json)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000059-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/actionrunner.rb, line 26</span>
+26:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">command</span>, <span class="ruby-identifier">request</span>, <span class="ruby-identifier">format</span>=<span class="ruby-identifier">:json</span>)
+27:         <span class="ruby-ivar">@agent</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">agent</span>
+28:         <span class="ruby-ivar">@action</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">action</span>
+29:         <span class="ruby-ivar">@format</span> = <span class="ruby-identifier">format</span>
+30:         <span class="ruby-ivar">@request</span> = <span class="ruby-identifier">request</span>
+31:         <span class="ruby-ivar">@command</span> = <span class="ruby-identifier">path_to_command</span>(<span class="ruby-identifier">command</span>)
+32:         <span class="ruby-ivar">@stdout</span> = <span class="ruby-value str">&quot;&quot;</span>
+33:         <span class="ruby-ivar">@stderr</span> = <span class="ruby-value str">&quot;&quot;</span>
+34:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000066" class="method-detail">
+        <a name="M000066"></a>
+
+        <div class="method-heading">
+          <a href="#M000066" class="method-signature">
+          <span class="method-name">canrun?</span><span class="method-args">(command)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000066-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000066-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/actionrunner.rb, line 117</span>
+117:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">canrun?</span>(<span class="ruby-identifier">command</span>)
+118:         <span class="ruby-constant">File</span>.<span class="ruby-identifier">executable?</span>(<span class="ruby-identifier">command</span>)
+119:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000063" class="method-detail">
+        <a name="M000063"></a>
+
+        <div class="method-heading">
+          <a href="#M000063" class="method-signature">
+          <span class="method-name">load_json_results</span><span class="method-args">(file)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000063-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000063-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/actionrunner.rb, line 91</span>
+91:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_json_results</span>(<span class="ruby-identifier">file</span>)
+92:         <span class="ruby-keyword kw">return</span> {} <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">readable?</span>(<span class="ruby-identifier">file</span>)
+93: 
+94:         <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">load</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">file</span>)) <span class="ruby-operator">||</span> {}
+95:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">ParserError</span>
+96:         {}
+97:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000062" class="method-detail">
+        <a name="M000062"></a>
+
+        <div class="method-heading">
+          <a href="#M000062" class="method-signature">
+          <span class="method-name">load_results</span><span class="method-args">(file)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000062-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/actionrunner.rb, line 73</span>
+73:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_results</span>(<span class="ruby-identifier">file</span>)
+74:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Attempting to load results in #{format} format from #{file}&quot;</span>)
+75: 
+76:         <span class="ruby-identifier">data</span> = {}
+77: 
+78:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-node">&quot;load_#{format}_results&quot;</span>)
+79:           <span class="ruby-identifier">tempdata</span> = <span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;load_#{format}_results&quot;</span>, <span class="ruby-identifier">file</span>)
+80: 
+81:           <span class="ruby-identifier">tempdata</span>.<span class="ruby-identifier">each_pair</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
+82:             <span class="ruby-identifier">data</span>[<span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_sym</span>] = <span class="ruby-identifier">v</span>
+83:           <span class="ruby-keyword kw">end</span>
+84:         <span class="ruby-keyword kw">end</span>
+85: 
+86:         <span class="ruby-identifier">data</span>
+87:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+88:         {}
+89:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000069" class="method-detail">
+        <a name="M000069"></a>
+
+        <div class="method-heading">
+          <a href="#M000069" class="method-signature">
+          <span class="method-name">path_to_command</span><span class="method-args">(command)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000069-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000069-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/actionrunner.rb, line 129</span>
+129:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">path_to_command</span>(<span class="ruby-identifier">command</span>)
+130:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">command</span>[<span class="ruby-value">0</span>,<span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">SEPARATOR</span>
+131:           <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</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>
+132:             <span class="ruby-identifier">command_file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">libdir</span>, <span class="ruby-value str">&quot;agent&quot;</span>, <span class="ruby-identifier">agent</span>, <span class="ruby-identifier">command</span>)
+133: 
+134:             <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">command_file</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">command_file</span>)
+135:           <span class="ruby-keyword kw">end</span>
+136:         <span class="ruby-keyword kw">end</span>
+137: 
+138:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">command</span>
+139:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000060" class="method-detail">
+        <a name="M000060"></a>
+
+        <div class="method-heading">
+          <a href="#M000060" class="method-signature">
+          <span class="method-name">run</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000060-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/actionrunner.rb, line 36</span>
+36:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>
+37:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">canrun?</span>(<span class="ruby-identifier">command</span>)
+38:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">warn</span>(<span class="ruby-node">&quot;Cannot run #{to_s}&quot;</span>)
+39:           <span class="ruby-identifier">raise</span> <span class="ruby-constant">RPCAborted</span>, <span class="ruby-node">&quot;Cannot execute #{to_s}&quot;</span>
+40:         <span class="ruby-keyword kw">end</span>
+41: 
+42:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Running #{to_s}&quot;</span>)
+43: 
+44:         <span class="ruby-identifier">request_file</span> = <span class="ruby-identifier">saverequest</span>(<span class="ruby-identifier">request</span>)
+45:         <span class="ruby-identifier">reply_file</span> = <span class="ruby-identifier">tempfile</span>(<span class="ruby-value str">&quot;reply&quot;</span>)
+46:         <span class="ruby-identifier">reply_file</span>.<span class="ruby-identifier">close</span>
+47: 
+48:         <span class="ruby-identifier">runner</span> = <span class="ruby-identifier">shell</span>(<span class="ruby-identifier">command</span>, <span class="ruby-identifier">request_file</span>.<span class="ruby-identifier">path</span>, <span class="ruby-identifier">reply_file</span>.<span class="ruby-identifier">path</span>)
+49: 
+50:         <span class="ruby-identifier">runner</span>.<span class="ruby-identifier">runcommand</span>
+51: 
+52:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;#{command} exited with #{runner.status.exitstatus}&quot;</span>)
+53: 
+54:         <span class="ruby-identifier">stderr</span>.<span class="ruby-identifier">each_line</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span> <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">&quot;#{to_s}: #{l.chomp}&quot;</span>)} <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">stderr</span>.<span class="ruby-identifier">empty?</span>
+55:         <span class="ruby-identifier">stdout</span>.<span class="ruby-identifier">each_line</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span> <span class="ruby-constant">Log</span>.<span class="ruby-identifier">info</span>(<span class="ruby-node">&quot;#{to_s}: #{l.chomp}&quot;</span>)} <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">stdout</span>.<span class="ruby-identifier">empty?</span>
+56: 
+57:         {<span class="ruby-identifier">:exitstatus</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">runner</span>.<span class="ruby-identifier">status</span>.<span class="ruby-identifier">exitstatus</span>,
+58:          <span class="ruby-identifier">:stdout</span>     =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">runner</span>.<span class="ruby-identifier">stdout</span>,
+59:          <span class="ruby-identifier">:stderr</span>     =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">runner</span>.<span class="ruby-identifier">stderr</span>,
+60:          <span class="ruby-identifier">:data</span>       =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">load_results</span>(<span class="ruby-identifier">reply_file</span>.<span class="ruby-identifier">path</span>)}
+61:       <span class="ruby-keyword kw">ensure</span>
+62:         <span class="ruby-identifier">request_file</span>.<span class="ruby-identifier">close!</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request_file</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value str">&quot;close!&quot;</span>)
+63:         <span class="ruby-identifier">reply_file</span>.<span class="ruby-identifier">close!</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">reply_file</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value str">&quot;close&quot;</span>)
+64:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000065" class="method-detail">
+        <a name="M000065"></a>
+
+        <div class="method-heading">
+          <a href="#M000065" class="method-signature">
+          <span class="method-name">save_json_request</span><span class="method-args">(req)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000065-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000065-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/actionrunner.rb, line 113</span>
+113:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">save_json_request</span>(<span class="ruby-identifier">req</span>)
+114:         <span class="ruby-identifier">req</span>.<span class="ruby-identifier">to_json</span>
+115:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000064" class="method-detail">
+        <a name="M000064"></a>
+
+        <div class="method-heading">
+          <a href="#M000064" class="method-signature">
+          <span class="method-name">saverequest</span><span class="method-args">(req)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000064-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000064-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/actionrunner.rb, line 99</span>
+ 99:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">saverequest</span>(<span class="ruby-identifier">req</span>)
+100:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Attempting to save request in #{format} format&quot;</span>)
+101: 
+102:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-node">&quot;save_#{format}_request&quot;</span>)
+103:           <span class="ruby-identifier">data</span> = <span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;save_#{format}_request&quot;</span>, <span class="ruby-identifier">req</span>)
+104: 
+105:           <span class="ruby-identifier">request_file</span> = <span class="ruby-identifier">tempfile</span>(<span class="ruby-value str">&quot;request&quot;</span>)
+106:           <span class="ruby-identifier">request_file</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">data</span>
+107:           <span class="ruby-identifier">request_file</span>.<span class="ruby-identifier">close</span>
+108:         <span class="ruby-keyword kw">end</span>
+109: 
+110:         <span class="ruby-identifier">request_file</span>
+111:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000061" class="method-detail">
+        <a name="M000061"></a>
+
+        <div class="method-heading">
+          <a href="#M000061" class="method-signature">
+          <span class="method-name">shell</span><span class="method-args">(command, infile, outfile)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000061-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/actionrunner.rb, line 66</span>
+66:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">shell</span>(<span class="ruby-identifier">command</span>, <span class="ruby-identifier">infile</span>, <span class="ruby-identifier">outfile</span>)
+67:         <span class="ruby-identifier">env</span> = {<span class="ruby-value str">&quot;MCOLLECTIVE_REQUEST_FILE&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">infile</span>,
+68:                <span class="ruby-value str">&quot;MCOLLECTIVE_REPLY_FILE&quot;</span>   =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">outfile</span>}
+69: 
+70:         <span class="ruby-constant">Shell</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;#{command} #{infile} #{outfile}&quot;</span>, <span class="ruby-identifier">:cwd</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">tmpdir</span>, <span class="ruby-identifier">:stdout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">stdout</span>, <span class="ruby-identifier">:stderr</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">stderr</span>, <span class="ruby-identifier">:environment</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">env</span>)
+71:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000068" class="method-detail">
+        <a name="M000068"></a>
+
+        <div class="method-heading">
+          <a href="#M000068" class="method-signature">
+          <span class="method-name">tempfile</span><span class="method-args">(prefix)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000068-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000068-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/actionrunner.rb, line 125</span>
+125:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tempfile</span>(<span class="ruby-identifier">prefix</span>)
+126:         <span class="ruby-constant">Tempfile</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;mcollective_#{prefix}&quot;</span>, <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">tmpdir</span>)
+127:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000067" class="method-detail">
+        <a name="M000067"></a>
+
+        <div class="method-heading">
+          <a href="#M000067" class="method-signature">
+          <span class="method-name">to_s</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000067-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000067-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/actionrunner.rb, line 121</span>
+121:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
+122:         <span class="ruby-value str">&quot;%s#%s command: %s&quot;</span> <span class="ruby-operator">%</span> [ <span class="ruby-identifier">agent</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">command</span> ]
+123:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/RPC/Agent.html b/doc/classes/MCollective/RPC/Agent.html
new file mode 100644 (file)
index 0000000..4050b22
--- /dev/null
@@ -0,0 +1,462 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::RPC::Agent</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::RPC::Agent</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/rpc/agent_rb.html">
+                lib/mcollective/rpc/agent.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+A wrapper around the traditional agent, it takes care of a lot of the
+tedious setup you would do for each agent allowing you to just create
+methods following a naming standard leaving the heavy lifting up to this
+clas.
+</p>
+<p>
+See <a
+href="http://marionette-collective.org/simplerpc/agents.html">marionette-collective.org/simplerpc/agents.html</a>
+</p>
+<p>
+It only really makes sense to use this with a Simple <a
+href="../RPC.html">RPC</a> client on the other end, basic usage would be:
+</p>
+<pre>
+   module MCollective
+     module Agent
+       class Helloworld&lt;RPC::Agent
+         action &quot;hello&quot; do
+           reply[:msg] = &quot;Hello #{request[:name]}&quot;
+         end
+
+         action &quot;foo&quot; do
+           implemented_by &quot;/some/script.sh&quot;
+         end
+       end
+     end
+   end
+</pre>
+<p>
+If you wish to implement the logic for an action using an external script
+use the implemented_by method that will cause your script to be run with 2
+arguments.
+</p>
+<p>
+The first argument is a file containing JSON with the request and the 2nd
+argument is where the script should save its output as a JSON hash.
+</p>
+<p>
+We also currently have the validation code in here, this will be moved to
+plugins soon.
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000084">actions</a>&nbsp;&nbsp;
+      <a href="#M000083">activate?</a>&nbsp;&nbsp;
+      <a href="#M000082">handlemsg</a>&nbsp;&nbsp;
+      <a href="#M000081">load_ddl</a>&nbsp;&nbsp;
+      <a href="#M000080">new</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+    <div id="includes">
+      <h3 class="section-bar">Included Modules</h3>
+
+      <div id="includes-list">
+        <span class="include-name"><a href="../Translatable.html">Translatable</a></span>
+      </div>
+    </div>
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">agent_name</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">config</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">ddl</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">logger</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">meta</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">reply</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">request</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">timeout</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000084" class="method-detail">
+        <a name="M000084"></a>
+
+        <div class="method-heading">
+          <a href="#M000084" class="method-signature">
+          <span class="method-name">actions</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns an array of <a href="Agent.html#M000084">actions</a> this agent
+support
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000084-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000084-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/agent.rb, line 157</span>
+157:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">actions</span>
+158:         <span class="ruby-identifier">public_instance_methods</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">grep</span>(<span class="ruby-regexp re">/_action$/</span>).<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">method</span><span class="ruby-operator">|</span>
+159:           <span class="ruby-identifier">$1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">method</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/(.+)_action$/</span>
+160:         <span class="ruby-keyword kw">end</span>
+161:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000083" class="method-detail">
+        <a name="M000083"></a>
+
+        <div class="method-heading">
+          <a href="#M000083" class="method-signature">
+          <span class="method-name">activate?</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+By default <a href="../RPC.html">RPC</a> <a
+href="../Agents.html">Agents</a> support a toggle in the configuration that
+can enable and disable them based on the agent name
+</p>
+<p>
+Example an agent called Foo can have:
+</p>
+<p>
+plugin.foo.activate_agent = false
+</p>
+<p>
+and this will prevent the agent from loading on this particular machine.
+</p>
+<p>
+<a href="../Agents.html">Agents</a> can use the activate_when helper to
+override this for example:
+</p>
+<p>
+activate_when do
+</p>
+<pre>
+   File.exist?(&quot;/usr/bin/puppet&quot;)
+</pre>
+<p>
+end
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000083-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000083-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/agent.rb, line 142</span>
+142:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">activate?</span>
+143:         <span class="ruby-identifier">agent_name</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;::&quot;</span>).<span class="ruby-identifier">last</span>.<span class="ruby-identifier">downcase</span>
+144: 
+145:         <span class="ruby-identifier">log_code</span>(<span class="ruby-identifier">:PLMC37</span>, <span class="ruby-value str">&quot;Starting default activation checks for the '%{agent}' agent&quot;</span>, <span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">agent_name</span>)
+146: 
+147:         <span class="ruby-identifier">should_activate</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">str_to_bool</span>(<span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">pluginconf</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-node">&quot;#{agent_name}.activate_agent&quot;</span>, <span class="ruby-keyword kw">true</span>))
+148: 
+149:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">should_activate</span>
+150:           <span class="ruby-identifier">log_code</span>(<span class="ruby-identifier">:PLMC38</span>, <span class="ruby-value str">&quot;Found plugin configuration '%{agent}.activate_agent' with value '%{should_activate}'&quot;</span>, <span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">agent_name</span>, <span class="ruby-identifier">:should_activate</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">should_activate</span>)
+151:         <span class="ruby-keyword kw">end</span>
+152: 
+153:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">should_activate</span>
+154:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000080" class="method-detail">
+        <a name="M000080"></a>
+
+        <div class="method-heading">
+          <a href="#M000080" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000080-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000080-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/agent.rb, line 40</span>
+40:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
+41:         <span class="ruby-ivar">@agent_name</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;::&quot;</span>).<span class="ruby-identifier">last</span>.<span class="ruby-identifier">downcase</span>
+42: 
+43:         <span class="ruby-identifier">load_ddl</span>
+44: 
+45:         <span class="ruby-ivar">@logger</span> = <span class="ruby-constant">Log</span>.<span class="ruby-identifier">instance</span>
+46:         <span class="ruby-ivar">@config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>
+47: 
+48:         <span class="ruby-comment cmt"># if we have a global authorization provider enable it</span>
+49:         <span class="ruby-comment cmt"># plugins can still override it per plugin</span>
+50:         <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">authorized_by</span>(<span class="ruby-ivar">@config</span>.<span class="ruby-identifier">rpcauthprovider</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">rpcauthorization</span>
+51: 
+52:         <span class="ruby-identifier">startup_hook</span>
+53:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000082" class="method-detail">
+        <a name="M000082"></a>
+
+        <div class="method-heading">
+          <a href="#M000082" class="method-signature">
+          <span class="method-name">handlemsg</span><span class="method-args">(msg, connection)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000082-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000082-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/agent.rb, line 64</span>
+ 64:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handlemsg</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">connection</span>)
+ 65:         <span class="ruby-ivar">@request</span> = <span class="ruby-constant">RPC</span><span class="ruby-operator">::</span><span class="ruby-constant">Request</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-ivar">@ddl</span>)
+ 66:         <span class="ruby-ivar">@reply</span> = <span class="ruby-constant">RPC</span><span class="ruby-operator">::</span><span class="ruby-constant">Reply</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@request</span>.<span class="ruby-identifier">action</span>, <span class="ruby-ivar">@ddl</span>)
+ 67: 
+ 68:         <span class="ruby-keyword kw">begin</span>
+ 69:           <span class="ruby-comment cmt"># Incoming requests need to be validated against the DDL thus reusing</span>
+ 70:           <span class="ruby-comment cmt"># all the work users put into creating DDLs and creating a consistent</span>
+ 71:           <span class="ruby-comment cmt"># quality of input validation everywhere with the a simple once off</span>
+ 72:           <span class="ruby-comment cmt"># investment of writing a DDL</span>
+ 73:           <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">validate!</span>
+ 74: 
+ 75:           <span class="ruby-comment cmt"># Calls the authorization plugin if any is defined</span>
+ 76:           <span class="ruby-comment cmt"># if this raises an exception we wil just skip processing this</span>
+ 77:           <span class="ruby-comment cmt"># message</span>
+ 78:           <span class="ruby-identifier">authorization_hook</span>(<span class="ruby-ivar">@request</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-value str">&quot;authorization_hook&quot;</span>)
+ 79: 
+ 80:           <span class="ruby-comment cmt"># Audits the request, currently continues processing the message</span>
+ 81:           <span class="ruby-comment cmt"># we should make this a configurable so that an audit failure means</span>
+ 82:           <span class="ruby-comment cmt"># a message wont be processed by this node depending on config</span>
+ 83:           <span class="ruby-identifier">audit_request</span>(<span class="ruby-ivar">@request</span>, <span class="ruby-identifier">connection</span>)
+ 84: 
+ 85:           <span class="ruby-identifier">before_processing_hook</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">connection</span>)
+ 86: 
+ 87:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-node">&quot;#{@request.action}_action&quot;</span>)
+ 88:             <span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;#{@request.action}_action&quot;</span>)
+ 89:           <span class="ruby-keyword kw">else</span>
+ 90:             <span class="ruby-identifier">log_code</span>(<span class="ruby-identifier">:PLMC36</span>, <span class="ruby-value str">&quot;Unknown action '%{action}' for agent '%{agent}'&quot;</span>, <span class="ruby-identifier">:warn</span>, <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">action</span>, <span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">agent</span>)
+ 91:             <span class="ruby-identifier">raise</span> <span class="ruby-constant">UnknownRPCAction</span>, <span class="ruby-node">&quot;Unknown action '#{@request.action}' for agent '#{@request.agent}'&quot;</span>
+ 92:           <span class="ruby-keyword kw">end</span>
+ 93:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">RPCAborted</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+ 94:           <span class="ruby-ivar">@reply</span>.<span class="ruby-identifier">fail</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-value">1</span>
+ 95: 
+ 96:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">UnknownRPCAction</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+ 97:           <span class="ruby-ivar">@reply</span>.<span class="ruby-identifier">fail</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-value">2</span>
+ 98: 
+ 99:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">MissingRPCData</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+100:           <span class="ruby-ivar">@reply</span>.<span class="ruby-identifier">fail</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-value">3</span>
+101: 
+102:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">InvalidRPCData</span>, <span class="ruby-constant">DDLValidationError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+103:           <span class="ruby-ivar">@reply</span>.<span class="ruby-identifier">fail</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-value">4</span>
+104: 
+105:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">UnknownRPCError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+106:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-value str">&quot;%s#%s failed: %s: %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-ivar">@agent_name</span>, <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">action</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">class</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>])
+107:           <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">&quot;\n\t&quot;</span>))
+108:           <span class="ruby-ivar">@reply</span>.<span class="ruby-identifier">fail</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-value">5</span>
+109: 
+110:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+111:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-value str">&quot;%s#%s failed: %s: %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-ivar">@agent_name</span>, <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">action</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">class</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>])
+112:           <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">&quot;\n\t&quot;</span>))
+113:           <span class="ruby-ivar">@reply</span>.<span class="ruby-identifier">fail</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-value">5</span>
+114: 
+115:         <span class="ruby-keyword kw">end</span>
+116: 
+117:         <span class="ruby-identifier">after_processing_hook</span>
+118: 
+119:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">should_respond?</span>
+120:           <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@reply</span>.<span class="ruby-identifier">to_hash</span>
+121:         <span class="ruby-keyword kw">else</span>
+122:           <span class="ruby-identifier">log_code</span>(<span class="ruby-identifier">:PLMC35</span>, <span class="ruby-value str">&quot;Client did not request a response, surpressing reply&quot;</span>, <span class="ruby-identifier">:debug</span>)
+123:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
+124:         <span class="ruby-keyword kw">end</span>
+125:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000081" class="method-detail">
+        <a name="M000081"></a>
+
+        <div class="method-heading">
+          <a href="#M000081" class="method-signature">
+          <span class="method-name">load_ddl</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000081-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000081-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/agent.rb, line 55</span>
+55:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_ddl</span>
+56:         <span class="ruby-ivar">@ddl</span> = <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@agent_name</span>, <span class="ruby-identifier">:agent</span>)
+57:         <span class="ruby-ivar">@meta</span> = <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">meta</span>
+58:         <span class="ruby-ivar">@timeout</span> = <span class="ruby-ivar">@meta</span>[<span class="ruby-identifier">:timeout</span>] <span class="ruby-operator">||</span> <span class="ruby-value">10</span>
+59: 
+60:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+61:         <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">validation_fail!</span>(<span class="ruby-identifier">:PLMC24</span>, <span class="ruby-value str">&quot;Failed to load DDL for the '%{agent}' agent, DDLs are required: %{error_class}: %{error}&quot;</span>, <span class="ruby-identifier">:error</span>, <span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@agent_name</span>, <span class="ruby-identifier">:error_class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">class</span>, <span class="ruby-identifier">:error</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>)
+62:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/RPC/Audit.html b/doc/classes/MCollective/RPC/Audit.html
new file mode 100644 (file)
index 0000000..c3878f7
--- /dev/null
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::RPC::Audit</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::RPC::Audit</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/rpc/audit_rb.html">
+                lib/mcollective/rpc/audit.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+Auditing of requests is done only for SimpleRPC requests, you provide a
+plugin in the MCollective::Audit::* namespace which the SimpleRPC framework
+calls for each message
+</p>
+<p>
+We provide a simple one that logs to a logfile in the class
+MCollective::Audit::Logfile you can create your own:
+</p>
+<p>
+Create a class in plugins/mcollective/audit/&lt;yourplugin&gt;.rb
+</p>
+<p>
+You must inherit from <a href="Audit.html">MCollective::RPC::Audit</a>
+which will take care of registering you with the plugin system.
+</p>
+<p>
+Your plugin must provide <a
+href="Audit.html#M000071">audit_request</a>(request, connection) the
+request parameter will be an instance of <a
+href="Request.html">MCollective::RPC::Request</a>
+</p>
+<p>
+To enable auditing you should set:
+</p>
+<p>
+rpcaudit = 1 rpcauditprovider = Logfile
+</p>
+<p>
+in the config file this will enable logging using the
+MCollective::Audit::Logile class
+</p>
+<p>
+The <a href="Audit.html">Audit</a> class acts as a base for audit plugins
+and takes care of registering them with the plugin manager
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000071">audit_request</a>&nbsp;&nbsp;
+      <a href="#M000070">inherited</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000070" class="method-detail">
+        <a name="M000070"></a>
+
+        <div class="method-heading">
+          <a href="#M000070" class="method-signature">
+          <span class="method-name">inherited</span><span class="method-args">(klass)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000070-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/audit.rb, line 29</span>
+29:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">inherited</span>(<span class="ruby-identifier">klass</span>)
+30:         <span class="ruby-constant">PluginManager</span> <span class="ruby-operator">&lt;&lt;</span> {<span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;rpcaudit_plugin&quot;</span>, <span class="ruby-identifier">:class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">to_s</span>}
+31:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000071" class="method-detail">
+        <a name="M000071"></a>
+
+        <div class="method-heading">
+          <a href="#M000071" class="method-signature">
+          <span class="method-name">audit_request</span><span class="method-args">(request, connection)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000071-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000071-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/audit.rb, line 33</span>
+33:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">audit_request</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">connection</span>)
+34:         <span class="ruby-ivar">@log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">&quot;audit_request is not implimented in #{this.class}&quot;</span>)
+35:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/RPC/Client.html b/doc/classes/MCollective/RPC/Client.html
new file mode 100644 (file)
index 0000000..bdd115e
--- /dev/null
@@ -0,0 +1,2052 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::RPC::Client</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::RPC::Client</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/rpc/client_rb.html">
+                lib/mcollective/rpc/client.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+The main component of the Simple <a href="../RPC.html">RPC</a> client
+system, this wraps around <a href="../Client.html">MCollective::Client</a>
+and just brings in a lot of convention and standard approached.
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000098">agent_filter</a>&nbsp;&nbsp;
+      <a href="#M000112">aggregate_reply</a>&nbsp;&nbsp;
+      <a href="#M000108">batch_size=</a>&nbsp;&nbsp;
+      <a href="#M000109">batch_sleep_time=</a>&nbsp;&nbsp;
+      <a href="#M000117">call_agent</a>&nbsp;&nbsp;
+      <a href="#M000116">call_agent_batched</a>&nbsp;&nbsp;
+      <a href="#M000096">class_filter</a>&nbsp;&nbsp;
+      <a href="#M000105">collective=</a>&nbsp;&nbsp;
+      <a href="#M000100">compound_filter</a>&nbsp;&nbsp;
+      <a href="#M000091">custom_request</a>&nbsp;&nbsp;
+      <a href="#M000086">disconnect</a>&nbsp;&nbsp;
+      <a href="#M000103">discover</a>&nbsp;&nbsp;
+      <a href="#M000094">discovery_method=</a>&nbsp;&nbsp;
+      <a href="#M000095">discovery_options=</a>&nbsp;&nbsp;
+      <a href="#M000092">discovery_timeout</a>&nbsp;&nbsp;
+      <a href="#M000093">discovery_timeout=</a>&nbsp;&nbsp;
+      <a href="#M000097">fact_filter</a>&nbsp;&nbsp;
+      <a href="#M000114">fire_and_forget_request</a>&nbsp;&nbsp;
+      <a href="#M000087">help</a>&nbsp;&nbsp;
+      <a href="#M000099">identity_filter</a>&nbsp;&nbsp;
+      <a href="#M000115">identity_filter_discovery_optimization</a>&nbsp;&nbsp;
+      <a href="#M000107">limit_method=</a>&nbsp;&nbsp;
+      <a href="#M000106">limit_targets=</a>&nbsp;&nbsp;
+      <a href="#M000111">load_aggregate_functions</a>&nbsp;&nbsp;
+      <a href="#M000090">method_missing</a>&nbsp;&nbsp;
+      <a href="#M000085">new</a>&nbsp;&nbsp;
+      <a href="#M000088">new_request</a>&nbsp;&nbsp;
+      <a href="#M000104">options</a>&nbsp;&nbsp;
+      <a href="#M000110">pick_nodes_from_discovered</a>&nbsp;&nbsp;
+      <a href="#M000119">process_results_with_block</a>&nbsp;&nbsp;
+      <a href="#M000118">process_results_without_block</a>&nbsp;&nbsp;
+      <a href="#M000101">reset</a>&nbsp;&nbsp;
+      <a href="#M000102">reset_filter</a>&nbsp;&nbsp;
+      <a href="#M000113">rpc_result_from_reply</a>&nbsp;&nbsp;
+      <a href="#M000089">validate_request</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">agent</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">batch_mode</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">batch_size</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">batch_sleep_time</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">client</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">config</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">ddl</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">default_discovery_method</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">discovery_method</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">discovery_options</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">filter</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">limit_method</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">limit_seed</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">limit_targets</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">output_format</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">progress</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">reply_to</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">stats</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">timeout</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">ttl</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">verbose</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000085" class="method-detail">
+        <a name="M000085"></a>
+
+        <div class="method-heading">
+          <a href="#M000085" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(agent, flags = {}) {|parser, opts| ...}</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Creates a stub for a remote agent, you can pass in an <a
+href="Client.html#M000104">options</a> array in the flags which will then
+be used else it will just create a default <a
+href="Client.html#M000104">options</a> array with filtering enabled based
+on the standard command line use.
+</p>
+<pre>
+  rpc = RPC::Client.new(&quot;rpctest&quot;, :configfile =&gt; &quot;client.cfg&quot;, :options =&gt; options)
+</pre>
+<p>
+You typically would not call this directly you&#8216;d use <a
+href="../RPC.html#M000037">MCollective::RPC#rpcclient</a> instead which is
+a wrapper around this that can be used as a Mixin
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000085-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000085-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 20</span>
+ 20:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">flags</span> = {})
+ 21:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:options</span>)
+ 22:           <span class="ruby-identifier">initial_options</span> = <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:options</span>]
+ 23: 
+ 24:         <span class="ruby-keyword kw">elsif</span> <span class="ruby-ivar">@@initial_options</span>
+ 25:           <span class="ruby-identifier">initial_options</span> = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-ivar">@@initial_options</span>)
+ 26: 
+ 27:         <span class="ruby-keyword kw">else</span>
+ 28:           <span class="ruby-identifier">oparser</span> = <span class="ruby-constant">MCollective</span><span class="ruby-operator">::</span><span class="ruby-constant">Optionparser</span>.<span class="ruby-identifier">new</span>({<span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">:progress_bar</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">:mcollective_limit_targets</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">:batch_size</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">:batch_sleep_time</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>}, <span class="ruby-value str">&quot;filter&quot;</span>)
+ 29: 
+ 30:           <span class="ruby-identifier">initial_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">opts</span><span class="ruby-operator">|</span>
+ 31:             <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
+ 32:               <span class="ruby-keyword kw">yield</span>(<span class="ruby-identifier">parser</span>, <span class="ruby-identifier">opts</span>)
+ 33:             <span class="ruby-keyword kw">end</span>
+ 34: 
+ 35:             <span class="ruby-constant">Helpers</span>.<span class="ruby-identifier">add_simplerpc_options</span>(<span class="ruby-identifier">parser</span>, <span class="ruby-identifier">opts</span>)
+ 36:           <span class="ruby-keyword kw">end</span>
+ 37: 
+ 38:           <span class="ruby-ivar">@@initial_options</span> = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">initial_options</span>)
+ 39:         <span class="ruby-keyword kw">end</span>
+ 40: 
+ 41:         <span class="ruby-ivar">@initial_options</span> = <span class="ruby-identifier">initial_options</span>
+ 42: 
+ 43:         <span class="ruby-ivar">@config</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:config</span>]
+ 44:         <span class="ruby-ivar">@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-ivar">@config</span>)
+ 45:         <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">options</span> = <span class="ruby-identifier">initial_options</span>
+ 46: 
+ 47:         <span class="ruby-ivar">@stats</span> = <span class="ruby-constant">Stats</span>.<span class="ruby-identifier">new</span>
+ 48:         <span class="ruby-ivar">@agent</span> = <span class="ruby-identifier">agent</span>
+ 49:         <span class="ruby-ivar">@timeout</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:timeout</span>] <span class="ruby-operator">||</span> <span class="ruby-value">5</span>
+ 50:         <span class="ruby-ivar">@verbose</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:verbose</span>]
+ 51:         <span class="ruby-ivar">@filter</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:filter</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">empty_filter</span>
+ 52:         <span class="ruby-ivar">@discovered_agents</span> = <span class="ruby-keyword kw">nil</span>
+ 53:         <span class="ruby-ivar">@progress</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:progress_bar</span>]
+ 54:         <span class="ruby-ivar">@limit_targets</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:mcollective_limit_targets</span>]
+ 55:         <span class="ruby-ivar">@limit_method</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">rpclimitmethod</span>
+ 56:         <span class="ruby-ivar">@limit_seed</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:limit_seed</span>] <span class="ruby-operator">||</span> <span class="ruby-keyword kw">nil</span>
+ 57:         <span class="ruby-ivar">@output_format</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:output_format</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">:console</span>
+ 58:         <span class="ruby-ivar">@force_direct_request</span> = <span class="ruby-keyword kw">false</span>
+ 59:         <span class="ruby-ivar">@reply_to</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:reply_to</span>]
+ 60:         <span class="ruby-ivar">@discovery_method</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:discovery_method</span>]
+ 61:         <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@discovery_method</span>
+ 62:           <span class="ruby-ivar">@discovery_method</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">default_discovery_method</span>
+ 63:           <span class="ruby-ivar">@default_discovery_method</span> = <span class="ruby-keyword kw">true</span>
+ 64:         <span class="ruby-keyword kw">else</span>
+ 65:           <span class="ruby-ivar">@default_discovery_method</span> = <span class="ruby-keyword kw">false</span>
+ 66:         <span class="ruby-keyword kw">end</span>
+ 67:         <span class="ruby-ivar">@discovery_options</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:discovery_options</span>] <span class="ruby-operator">||</span> []
+ 68:         <span class="ruby-ivar">@force_display_mode</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:force_display_mode</span>] <span class="ruby-operator">||</span> <span class="ruby-keyword kw">false</span>
+ 69: 
+ 70:         <span class="ruby-ivar">@batch_size</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:batch_size</span>] <span class="ruby-operator">||</span> <span class="ruby-value">0</span>)
+ 71:         <span class="ruby-ivar">@batch_sleep_time</span> = <span class="ruby-constant">Float</span>(<span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:batch_sleep_time</span>] <span class="ruby-operator">||</span> <span class="ruby-value">1</span>)
+ 72:         <span class="ruby-ivar">@batch_mode</span> = <span class="ruby-ivar">@batch_size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
+ 73: 
+ 74:         <span class="ruby-identifier">agent_filter</span> <span class="ruby-identifier">agent</span>
+ 75: 
+ 76:         <span class="ruby-ivar">@discovery_timeout</span> = <span class="ruby-ivar">@initial_options</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">:disctimeout</span>, <span class="ruby-keyword kw">nil</span>)
+ 77: 
+ 78:         <span class="ruby-ivar">@collective</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">collective</span>
+ 79:         <span class="ruby-ivar">@ttl</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:ttl</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">ttl</span>
+ 80:         <span class="ruby-ivar">@publish_timeout</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:publish_timeout</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">publish_timeout</span>
+ 81:         <span class="ruby-ivar">@threaded</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:threaded</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">threaded</span>
+ 82: 
+ 83:         <span class="ruby-comment cmt"># if we can find a DDL for the service override</span>
+ 84:         <span class="ruby-comment cmt"># the timeout of the client so we always magically</span>
+ 85:         <span class="ruby-comment cmt"># wait appropriate amounts of time.</span>
+ 86:         <span class="ruby-comment cmt">#</span>
+ 87:         <span class="ruby-comment cmt"># We add the discovery timeout to the ddl supplied</span>
+ 88:         <span class="ruby-comment cmt"># timeout as the discovery timeout tends to be tuned</span>
+ 89:         <span class="ruby-comment cmt"># for local network conditions and fact source speed</span>
+ 90:         <span class="ruby-comment cmt"># which would other wise not be accounted for and</span>
+ 91:         <span class="ruby-comment cmt"># some results might get missed.</span>
+ 92:         <span class="ruby-comment cmt">#</span>
+ 93:         <span class="ruby-comment cmt"># We do this only if the timeout is the default 5</span>
+ 94:         <span class="ruby-comment cmt"># seconds, so that users cli overrides will still</span>
+ 95:         <span class="ruby-comment cmt"># get applied</span>
+ 96:         <span class="ruby-comment cmt">#</span>
+ 97:         <span class="ruby-comment cmt"># DDLs are required, failure to find a DDL is fatal</span>
+ 98:         <span class="ruby-ivar">@ddl</span> = <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">agent</span>)
+ 99:         <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">ddl</span> = <span class="ruby-ivar">@ddl</span>
+100:         <span class="ruby-ivar">@timeout</span> = <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">meta</span>[<span class="ruby-identifier">:timeout</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">discovery_timeout</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@timeout</span> <span class="ruby-operator">==</span> <span class="ruby-value">5</span>
+101: 
+102:         <span class="ruby-comment cmt"># allows stderr and stdout to be overridden for testing</span>
+103:         <span class="ruby-comment cmt"># but also for web apps that might not want a bunch of stuff</span>
+104:         <span class="ruby-comment cmt"># generated to actual file handles</span>
+105:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:stderr</span>]
+106:           <span class="ruby-ivar">@stderr</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:stderr</span>]
+107:         <span class="ruby-keyword kw">else</span>
+108:           <span class="ruby-ivar">@stderr</span> = <span class="ruby-constant">STDERR</span>
+109:           <span class="ruby-ivar">@stderr</span>.<span class="ruby-identifier">sync</span> = <span class="ruby-keyword kw">true</span>
+110:         <span class="ruby-keyword kw">end</span>
+111: 
+112:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:stdout</span>]
+113:           <span class="ruby-ivar">@stdout</span> = <span class="ruby-identifier">initial_options</span>[<span class="ruby-identifier">:stdout</span>]
+114:         <span class="ruby-keyword kw">else</span>
+115:           <span class="ruby-ivar">@stdout</span> = <span class="ruby-constant">STDOUT</span>
+116:           <span class="ruby-ivar">@stdout</span>.<span class="ruby-identifier">sync</span> = <span class="ruby-keyword kw">true</span>
+117:         <span class="ruby-keyword kw">end</span>
+118:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000098" class="method-detail">
+        <a name="M000098"></a>
+
+        <div class="method-heading">
+          <a href="#M000098" class="method-signature">
+          <span class="method-name">agent_filter</span><span class="method-args">(agent)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Sets the agent filter
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000098-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000098-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 422</span>
+422:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">agent_filter</span>(<span class="ruby-identifier">agent</span>)
+423:         <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;agent&quot;</span>] = <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;agent&quot;</span>] <span class="ruby-operator">|</span> [<span class="ruby-identifier">agent</span>]
+424:         <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;agent&quot;</span>].<span class="ruby-identifier">compact!</span>
+425:         <span class="ruby-identifier">reset</span>
+426:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000112" class="method-detail">
+        <a name="M000112"></a>
+
+        <div class="method-heading">
+          <a href="#M000112" class="method-signature">
+          <span class="method-name">aggregate_reply</span><span class="method-args">(reply, aggregate)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000112-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000112-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 687</span>
+687:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">aggregate_reply</span>(<span class="ruby-identifier">reply</span>, <span class="ruby-identifier">aggregate</span>)
+688:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">aggregate</span>
+689: 
+690:         <span class="ruby-identifier">aggregate</span>.<span class="ruby-identifier">call_functions</span>(<span class="ruby-identifier">reply</span>)
+691:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">aggregate</span>
+692:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+693:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-value str">&quot;Failed to calculate aggregate summaries for reply from %s, calculating summaries disabled: %s: %s (%s)&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">reply</span>[<span class="ruby-identifier">:senderid</span>], <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">first</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">class</span>])
+694:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
+695:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000108" class="method-detail">
+        <a name="M000108"></a>
+
+        <div class="method-heading">
+          <a href="#M000108" class="method-signature">
+          <span class="method-name">batch_size=</span><span class="method-args">(limit)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Sets the batch size, if the size is set to 0 that will disable batch mode
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000108-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000108-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 608</span>
+608:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">batch_size=</span>(<span class="ruby-identifier">limit</span>)
+609:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Can only set batch size if direct addressing is supported&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">direct_addressing</span>
+610: 
+611:         <span class="ruby-ivar">@batch_size</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">limit</span>)
+612:         <span class="ruby-ivar">@batch_mode</span> = <span class="ruby-ivar">@batch_size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
+613:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000109" class="method-detail">
+        <a name="M000109"></a>
+
+        <div class="method-heading">
+          <a href="#M000109" class="method-signature">
+          <span class="method-name">batch_sleep_time=</span><span class="method-args">(time)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000109-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000109-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 615</span>
+615:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">batch_sleep_time=</span>(<span class="ruby-identifier">time</span>)
+616:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Can only set batch sleep time if direct addressing is supported&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">direct_addressing</span>
+617: 
+618:         <span class="ruby-ivar">@batch_sleep_time</span> = <span class="ruby-constant">Float</span>(<span class="ruby-identifier">time</span>)
+619:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000117" class="method-detail">
+        <a name="M000117"></a>
+
+        <div class="method-heading">
+          <a href="#M000117" class="method-signature">
+          <span class="method-name">call_agent</span><span class="method-args">(action, args, opts, disc=:auto, &amp;block)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Handles traditional calls to the remote agents with full stats blocks, non
+blocks and everything else supported.
+</p>
+<p>
+Other methods of calling the nodes can reuse this code by for example
+specifying custom <a href="Client.html#M000104">options</a> and discovery
+data
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000117-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000117-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 844</span>
+844:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call_agent</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">opts</span>, <span class="ruby-identifier">disc</span>=<span class="ruby-identifier">:auto</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+845:         <span class="ruby-comment cmt"># Handle fire and forget requests and make sure</span>
+846:         <span class="ruby-comment cmt"># the :process_results value is set appropriately</span>
+847:         <span class="ruby-comment cmt">#</span>
+848:         <span class="ruby-comment cmt"># specific reply-to requests should be treated like</span>
+849:         <span class="ruby-comment cmt"># fire and forget since the client will never get</span>
+850:         <span class="ruby-comment cmt"># the responses</span>
+851:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>[<span class="ruby-identifier">:process_results</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@reply_to</span>
+852:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">fire_and_forget_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
+853:         <span class="ruby-keyword kw">else</span>
+854:           <span class="ruby-identifier">args</span>[<span class="ruby-identifier">:process_results</span>] = <span class="ruby-keyword kw">true</span>
+855:         <span class="ruby-keyword kw">end</span>
+856: 
+857:         <span class="ruby-comment cmt"># Do discovery when no specific discovery array is given</span>
+858:         <span class="ruby-comment cmt">#</span>
+859:         <span class="ruby-comment cmt"># If an array is given set the force_direct_request hint that</span>
+860:         <span class="ruby-comment cmt"># will tell the message object to be a direct request one</span>
+861:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">disc</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:auto</span>
+862:           <span class="ruby-identifier">discovered</span> = <span class="ruby-identifier">discover</span>
+863:         <span class="ruby-keyword kw">else</span>
+864:           <span class="ruby-ivar">@force_direct_request</span> = <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">direct_addressing</span>
+865:           <span class="ruby-identifier">discovered</span> = <span class="ruby-identifier">disc</span>
+866:         <span class="ruby-keyword kw">end</span>
+867: 
+868:         <span class="ruby-identifier">req</span> = <span class="ruby-identifier">new_request</span>(<span class="ruby-identifier">action</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">args</span>)
+869: 
+870:         <span class="ruby-identifier">message</span> = <span class="ruby-constant">Message</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">req</span>, <span class="ruby-keyword kw">nil</span>, {<span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@agent</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:request</span>, <span class="ruby-identifier">:collective</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@collective</span>, <span class="ruby-identifier">:filter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:filter</span>], <span class="ruby-identifier">:options</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">opts</span>})
+871:         <span class="ruby-identifier">message</span>.<span class="ruby-identifier">discovered_hosts</span> = <span class="ruby-identifier">discovered</span>.<span class="ruby-identifier">clone</span>
+872: 
+873:         <span class="ruby-identifier">results</span> = []
+874:         <span class="ruby-identifier">respcount</span> = <span class="ruby-value">0</span>
+875: 
+876:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">discovered</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
+877:           <span class="ruby-identifier">message</span>.<span class="ruby-identifier">type</span> = <span class="ruby-identifier">:direct_request</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@force_direct_request</span>
+878: 
+879:           <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@progress</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">block_given?</span>
+880:             <span class="ruby-identifier">twirl</span> = <span class="ruby-constant">Progress</span>.<span class="ruby-identifier">new</span>
+881:             <span class="ruby-ivar">@stdout</span>.<span class="ruby-identifier">puts</span>
+882:             <span class="ruby-ivar">@stdout</span>.<span class="ruby-identifier">print</span> <span class="ruby-identifier">twirl</span>.<span class="ruby-identifier">twirl</span>(<span class="ruby-identifier">respcount</span>, <span class="ruby-identifier">discovered</span>.<span class="ruby-identifier">size</span>)
+883:           <span class="ruby-keyword kw">end</span>
+884: 
+885:           <span class="ruby-identifier">aggregate</span> = <span class="ruby-identifier">load_aggregate_functions</span>(<span class="ruby-identifier">action</span>, <span class="ruby-ivar">@ddl</span>)
+886: 
+887:           <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">req</span>(<span class="ruby-identifier">message</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">resp</span><span class="ruby-operator">|</span>
+888:             <span class="ruby-identifier">respcount</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+889: 
+890:             <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
+891:               <span class="ruby-identifier">aggregate</span> = <span class="ruby-identifier">process_results_with_block</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">resp</span>, <span class="ruby-identifier">block</span>, <span class="ruby-identifier">aggregate</span>)
+892:             <span class="ruby-keyword kw">else</span>
+893:               <span class="ruby-ivar">@stdout</span>.<span class="ruby-identifier">print</span> <span class="ruby-identifier">twirl</span>.<span class="ruby-identifier">twirl</span>(<span class="ruby-identifier">respcount</span>, <span class="ruby-identifier">discovered</span>.<span class="ruby-identifier">size</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@progress</span>
+894: 
+895:               <span class="ruby-identifier">result</span>, <span class="ruby-identifier">aggregate</span> = <span class="ruby-identifier">process_results_without_block</span>(<span class="ruby-identifier">resp</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">aggregate</span>)
+896: 
+897:               <span class="ruby-identifier">results</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">result</span>
+898:             <span class="ruby-keyword kw">end</span>
+899:           <span class="ruby-keyword kw">end</span>
+900: 
+901:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">aggregate_summary</span> = <span class="ruby-identifier">aggregate</span>.<span class="ruby-identifier">summarize</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aggregate</span>
+902:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">aggregate_failures</span> = <span class="ruby-identifier">aggregate</span>.<span class="ruby-identifier">failed</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aggregate</span>
+903:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">client_stats</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">stats</span>
+904:         <span class="ruby-keyword kw">else</span>
+905:           <span class="ruby-ivar">@stderr</span>.<span class="ruby-identifier">print</span>(<span class="ruby-value str">&quot;\nNo request sent, we did not discover any nodes.&quot;</span>)
+906:         <span class="ruby-keyword kw">end</span>
+907: 
+908:         <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">finish_request</span>
+909: 
+910:         <span class="ruby-constant">RPC</span>.<span class="ruby-identifier">stats</span>(<span class="ruby-ivar">@stats</span>)
+911: 
+912:         <span class="ruby-ivar">@stdout</span>.<span class="ruby-identifier">print</span>(<span class="ruby-value str">&quot;\n\n&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@progress</span>
+913: 
+914:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
+915:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">stats</span>
+916:         <span class="ruby-keyword kw">else</span>
+917:           <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">results</span>].<span class="ruby-identifier">flatten</span>
+918:         <span class="ruby-keyword kw">end</span>
+919:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000116" class="method-detail">
+        <a name="M000116"></a>
+
+        <div class="method-heading">
+          <a href="#M000116" class="method-signature">
+          <span class="method-name">call_agent_batched</span><span class="method-args">(action, args, opts, batch_size, sleep_time, &amp;block)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Calls an agent in a way very similar to <a
+href="Client.html#M000117">call_agent</a> but it supports batching the
+queries to the network.
+</p>
+<p>
+The result sets, stats, block handling etc is all exactly like you would
+expect from normal <a href="Client.html#M000117">call_agent</a>.
+</p>
+<p>
+This is used by <a href="Client.html#M000090">method_missing</a> and works
+only with direct addressing mode
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000116-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000116-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 759</span>
+759:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call_agent_batched</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">opts</span>, <span class="ruby-identifier">batch_size</span>, <span class="ruby-identifier">sleep_time</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+760:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Batched requests requires direct addressing&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">direct_addressing</span>
+761:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Cannot bypass result processing for batched requests&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>[<span class="ruby-identifier">:process_results</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span>
+762: 
+763:         <span class="ruby-identifier">batch_size</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">batch_size</span>)
+764:         <span class="ruby-identifier">sleep_time</span> = <span class="ruby-constant">Float</span>(<span class="ruby-identifier">sleep_time</span>)
+765: 
+766:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Calling #{agent}##{action} in batches of #{batch_size} with sleep time of #{sleep_time}&quot;</span>)
+767: 
+768:         <span class="ruby-ivar">@force_direct_request</span> = <span class="ruby-keyword kw">true</span>
+769: 
+770:         <span class="ruby-identifier">discovered</span> = <span class="ruby-identifier">discover</span>
+771:         <span class="ruby-identifier">results</span> = []
+772:         <span class="ruby-identifier">respcount</span> = <span class="ruby-value">0</span>
+773: 
+774:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">discovered</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
+775:           <span class="ruby-identifier">req</span> = <span class="ruby-identifier">new_request</span>(<span class="ruby-identifier">action</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">args</span>)
+776: 
+777:           <span class="ruby-identifier">aggregate</span> = <span class="ruby-identifier">load_aggregate_functions</span>(<span class="ruby-identifier">action</span>, <span class="ruby-ivar">@ddl</span>)
+778: 
+779:           <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@progress</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">block_given?</span>
+780:             <span class="ruby-identifier">twirl</span> = <span class="ruby-constant">Progress</span>.<span class="ruby-identifier">new</span>
+781:             <span class="ruby-ivar">@stdout</span>.<span class="ruby-identifier">puts</span>
+782:             <span class="ruby-ivar">@stdout</span>.<span class="ruby-identifier">print</span> <span class="ruby-identifier">twirl</span>.<span class="ruby-identifier">twirl</span>(<span class="ruby-identifier">respcount</span>, <span class="ruby-identifier">discovered</span>.<span class="ruby-identifier">size</span>)
+783:           <span class="ruby-keyword kw">end</span>
+784: 
+785:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">requestid</span> = <span class="ruby-keyword kw">nil</span>
+786: 
+787:           <span class="ruby-identifier">discovered</span>.<span class="ruby-identifier">in_groups_of</span>(<span class="ruby-identifier">batch_size</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">hosts</span>, <span class="ruby-identifier">last_batch</span><span class="ruby-operator">|</span>
+788:             <span class="ruby-identifier">message</span> = <span class="ruby-constant">Message</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">req</span>, <span class="ruby-keyword kw">nil</span>, {<span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@agent</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:direct_request</span>, <span class="ruby-identifier">:collective</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@collective</span>, <span class="ruby-identifier">:filter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:filter</span>], <span class="ruby-identifier">:options</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">opts</span>})
+789: 
+790:             <span class="ruby-comment cmt"># first time round we let the Message object create a request id</span>
+791:             <span class="ruby-comment cmt"># we then re-use it for future requests to keep auditing sane etc</span>
+792:             <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">requestid</span> = <span class="ruby-identifier">message</span>.<span class="ruby-identifier">create_reqid</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">requestid</span>
+793:             <span class="ruby-identifier">message</span>.<span class="ruby-identifier">requestid</span> = <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">requestid</span>
+794: 
+795:             <span class="ruby-identifier">message</span>.<span class="ruby-identifier">discovered_hosts</span> = <span class="ruby-identifier">hosts</span>.<span class="ruby-identifier">clone</span>.<span class="ruby-identifier">compact</span>
+796: 
+797:             <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">req</span>(<span class="ruby-identifier">message</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">resp</span><span class="ruby-operator">|</span>
+798:               <span class="ruby-identifier">respcount</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+799: 
+800:               <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
+801:                 <span class="ruby-identifier">aggregate</span> = <span class="ruby-identifier">process_results_with_block</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">resp</span>, <span class="ruby-identifier">block</span>, <span class="ruby-identifier">aggregate</span>)
+802:               <span class="ruby-keyword kw">else</span>
+803:                 <span class="ruby-ivar">@stdout</span>.<span class="ruby-identifier">print</span> <span class="ruby-identifier">twirl</span>.<span class="ruby-identifier">twirl</span>(<span class="ruby-identifier">respcount</span>, <span class="ruby-identifier">discovered</span>.<span class="ruby-identifier">size</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@progress</span>
+804: 
+805:                 <span class="ruby-identifier">result</span>, <span class="ruby-identifier">aggregate</span> = <span class="ruby-identifier">process_results_without_block</span>(<span class="ruby-identifier">resp</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">aggregate</span>)
+806: 
+807:                 <span class="ruby-identifier">results</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">result</span>
+808:               <span class="ruby-keyword kw">end</span>
+809:             <span class="ruby-keyword kw">end</span>
+810: 
+811:             <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">noresponsefrom</span>.<span class="ruby-identifier">concat</span> <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:noresponsefrom</span>]
+812:             <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">responses</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:responses</span>]
+813:             <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">blocktime</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:blocktime</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">sleep_time</span>
+814:             <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">totaltime</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:totaltime</span>]
+815:             <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">discoverytime</span> <span class="ruby-operator">+=</span> <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:discoverytime</span>]
+816: 
+817:             <span class="ruby-identifier">sleep</span> <span class="ruby-identifier">sleep_time</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">last_batch</span>
+818:           <span class="ruby-keyword kw">end</span>
+819: 
+820:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">aggregate_summary</span> = <span class="ruby-identifier">aggregate</span>.<span class="ruby-identifier">summarize</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aggregate</span>
+821:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">aggregate_failures</span> = <span class="ruby-identifier">aggregate</span>.<span class="ruby-identifier">failed</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aggregate</span>
+822:         <span class="ruby-keyword kw">else</span>
+823:           <span class="ruby-ivar">@stderr</span>.<span class="ruby-identifier">print</span>(<span class="ruby-value str">&quot;\nNo request sent, we did not discover any nodes.&quot;</span>)
+824:         <span class="ruby-keyword kw">end</span>
+825: 
+826:         <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">finish_request</span>
+827: 
+828:         <span class="ruby-constant">RPC</span>.<span class="ruby-identifier">stats</span>(<span class="ruby-ivar">@stats</span>)
+829: 
+830:         <span class="ruby-ivar">@stdout</span>.<span class="ruby-identifier">print</span>(<span class="ruby-value str">&quot;\n&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@progress</span>
+831: 
+832:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
+833:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">stats</span>
+834:         <span class="ruby-keyword kw">else</span>
+835:           <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">results</span>].<span class="ruby-identifier">flatten</span>
+836:         <span class="ruby-keyword kw">end</span>
+837:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000096" class="method-detail">
+        <a name="M000096"></a>
+
+        <div class="method-heading">
+          <a href="#M000096" class="method-signature">
+          <span class="method-name">class_filter</span><span class="method-args">(klass)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Sets the class filter
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000096-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000096-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 398</span>
+398:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">class_filter</span>(<span class="ruby-identifier">klass</span>)
+399:         <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;cf_class&quot;</span>] = <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;cf_class&quot;</span>] <span class="ruby-operator">|</span> [<span class="ruby-identifier">klass</span>]
+400:         <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;cf_class&quot;</span>].<span class="ruby-identifier">compact!</span>
+401:         <span class="ruby-identifier">reset</span>
+402:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000105" class="method-detail">
+        <a name="M000105"></a>
+
+        <div class="method-heading">
+          <a href="#M000105" class="method-signature">
+          <span class="method-name">collective=</span><span class="method-args">(c)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Sets the collective we are communicating with
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000105-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000105-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 573</span>
+573:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">collective=</span>(<span class="ruby-identifier">c</span>)
+574:         <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unknown collective #{c}&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">collectives</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">c</span>)
+575: 
+576:         <span class="ruby-ivar">@collective</span> = <span class="ruby-identifier">c</span>
+577:         <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">options</span> = <span class="ruby-identifier">options</span>
+578:         <span class="ruby-identifier">reset</span>
+579:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000100" class="method-detail">
+        <a name="M000100"></a>
+
+        <div class="method-heading">
+          <a href="#M000100" class="method-signature">
+          <span class="method-name">compound_filter</span><span class="method-args">(filter)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Set a compound filter
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000100-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000100-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 436</span>
+436:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">compound_filter</span>(<span class="ruby-identifier">filter</span>)
+437:         <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;compound&quot;</span>] = <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;compound&quot;</span>] <span class="ruby-operator">|</span>  [<span class="ruby-constant">Matcher</span>.<span class="ruby-identifier">create_compound_callstack</span>(<span class="ruby-identifier">filter</span>)]
+438:         <span class="ruby-identifier">reset</span>
+439:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000091" class="method-detail">
+        <a name="M000091"></a>
+
+        <div class="method-heading">
+          <a href="#M000091" class="method-signature">
+          <span class="method-name">custom_request</span><span class="method-args">(action, args, expected_agents, filter = {}, &amp;block)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Constructs custom requests with custom filters and discovery data the idea
+is that this would be used in web applications where you might be using a
+cached copy of data provided by a registration agent to figure out on your
+own what nodes will be responding and what your filter would be.
+</p>
+<p>
+This will <a href="Client.html#M000087">help</a> you essentially short
+circuit the traditional cycle of:
+</p>
+<p>
+mc <a href="Client.html#M000103">discover</a> / call / wait for discovered
+nodes
+</p>
+<p>
+by doing discovery however you like, contructing a filter and a list of
+nodes you expect responses from.
+</p>
+<p>
+Other than that it will work exactly like a normal call, blocks will behave
+the same way, stats will be handled the same way etcetc
+</p>
+<p>
+If you just wanted to contact one machine for example with a client that
+already has other filter <a href="Client.html#M000104">options</a> setup
+you can do:
+</p>
+<p>
+puppet.custom_request(&quot;runonce&quot;, {}, [&quot;your.box.com&quot;],
+{:identity =&gt; &quot;your.box.com&quot;})
+</p>
+<p>
+This will do runonce action on just &#8216;your.box.com&#8217;, no
+discovery will be done and after receiving just one response it will stop
+waiting for responses
+</p>
+<p>
+If direct_addressing is enabled in the config file you can provide an empty
+hash as a filter, this will force that request to be a directly addressed
+request which technically does not need filters. If you try to use this
+mode with direct addressing disabled an exception will be raise
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000091-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000091-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 296</span>
+296:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">custom_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">expected_agents</span>, <span class="ruby-identifier">filter</span> = {}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+297:         <span class="ruby-identifier">validate_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
+298: 
+299:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filter</span> <span class="ruby-operator">==</span> {} <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">direct_addressing</span>
+300:           <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Attempted to do a filterless custom_request without direct_addressing enabled, preventing unexpected call to all nodes&quot;</span>
+301:         <span class="ruby-keyword kw">end</span>
+302: 
+303:         <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">reset</span>
+304: 
+305:         <span class="ruby-identifier">custom_filter</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">empty_filter</span>
+306:         <span class="ruby-identifier">custom_options</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">clone</span>
+307: 
+308:         <span class="ruby-comment cmt"># merge the supplied filter with the standard empty one</span>
+309:         <span class="ruby-comment cmt"># we could just use the merge method but I want to be sure</span>
+310:         <span class="ruby-comment cmt"># we dont merge in stuff that isnt actually valid</span>
+311:         [<span class="ruby-value str">&quot;identity&quot;</span>, <span class="ruby-value str">&quot;fact&quot;</span>, <span class="ruby-value str">&quot;agent&quot;</span>, <span class="ruby-value str">&quot;cf_class&quot;</span>, <span class="ruby-value str">&quot;compound&quot;</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ftype</span><span class="ruby-operator">|</span>
+312:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">filter</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">ftype</span>)
+313:             <span class="ruby-identifier">custom_filter</span>[<span class="ruby-identifier">ftype</span>] = [<span class="ruby-identifier">filter</span>[<span class="ruby-identifier">ftype</span>], <span class="ruby-identifier">custom_filter</span>[<span class="ruby-identifier">ftype</span>]].<span class="ruby-identifier">flatten</span>
+314:           <span class="ruby-keyword kw">end</span>
+315:         <span class="ruby-keyword kw">end</span>
+316: 
+317:         <span class="ruby-comment cmt"># ensure that all filters at least restrict the call to the agent we're a proxy for</span>
+318:         <span class="ruby-identifier">custom_filter</span>[<span class="ruby-value str">&quot;agent&quot;</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-ivar">@agent</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">custom_filter</span>[<span class="ruby-value str">&quot;agent&quot;</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-ivar">@agent</span>)
+319:         <span class="ruby-identifier">custom_options</span>[<span class="ruby-identifier">:filter</span>] = <span class="ruby-identifier">custom_filter</span>
+320: 
+321:         <span class="ruby-comment cmt"># Fake out the stats discovery would have put there</span>
+322:         <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">discovered_agents</span>([<span class="ruby-identifier">expected_agents</span>].<span class="ruby-identifier">flatten</span>)
+323: 
+324:         <span class="ruby-comment cmt"># Handle fire and forget requests</span>
+325:         <span class="ruby-comment cmt">#</span>
+326:         <span class="ruby-comment cmt"># If a specific reply-to was set then from the client perspective this should</span>
+327:         <span class="ruby-comment cmt"># be a fire and forget request too since no response will ever reach us - it</span>
+328:         <span class="ruby-comment cmt"># will go to the reply-to destination</span>
+329:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>[<span class="ruby-identifier">:process_results</span>] <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@reply_to</span>
+330:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">fire_and_forget_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">custom_filter</span>)
+331:         <span class="ruby-keyword kw">end</span>
+332: 
+333:         <span class="ruby-comment cmt"># Now do a call pretty much exactly like in method_missing except with our own</span>
+334:         <span class="ruby-comment cmt"># options and discovery magic</span>
+335:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
+336:           <span class="ruby-identifier">call_agent</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">custom_options</span>, [<span class="ruby-identifier">expected_agents</span>].<span class="ruby-identifier">flatten</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
+337:             <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">r</span>)
+338:           <span class="ruby-keyword kw">end</span>
+339:         <span class="ruby-keyword kw">else</span>
+340:           <span class="ruby-identifier">call_agent</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">custom_options</span>, [<span class="ruby-identifier">expected_agents</span>].<span class="ruby-identifier">flatten</span>)
+341:         <span class="ruby-keyword kw">end</span>
+342:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000086" class="method-detail">
+        <a name="M000086"></a>
+
+        <div class="method-heading">
+          <a href="#M000086" class="method-signature">
+          <span class="method-name">disconnect</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Disconnects cleanly from the middleware
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000086-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000086-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 121</span>
+121:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">disconnect</span>
+122:         <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">disconnect</span>
+123:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000103" class="method-detail">
+        <a name="M000103"></a>
+
+        <div class="method-heading">
+          <a href="#M000103" class="method-signature">
+          <span class="method-name">discover</span><span class="method-args">(flags={})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Does discovery based on the filters set, if a discovery was previously done
+return that else do a <a href="Client.html#M000085">new</a> discovery.
+</p>
+<p>
+Alternatively if identity filters are given and none of them are regular
+expressions then just use the provided data as discovered data, avoiding
+discovery
+</p>
+<p>
+<a href="../Discovery.html">Discovery</a> can be forced if
+direct_addressing is enabled by passing in an array of nodes with :nodes or
+JSON data like those produced by mcollective <a href="../RPC.html">RPC</a>
+JSON output using :json
+</p>
+<p>
+Will show a message indicating its doing discovery if running verbose or if
+the :verbose flag is passed in.
+</p>
+<p>
+Use <a href="Client.html#M000101">reset</a> to force a <a
+href="Client.html#M000085">new</a> discovery
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000103-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000103-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 468</span>
+468:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discover</span>(<span class="ruby-identifier">flags</span>={})
+469:         <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
+470:           <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unknown option #{key} passed to discover&quot;</span> <span class="ruby-keyword kw">unless</span> [<span class="ruby-identifier">:verbose</span>, <span class="ruby-identifier">:hosts</span>, <span class="ruby-identifier">:nodes</span>, <span class="ruby-identifier">:json</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>)
+471:         <span class="ruby-keyword kw">end</span>
+472: 
+473:         <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:verbose</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">verbose</span> = <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:verbose</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">verbose</span> = <span class="ruby-ivar">@verbose</span>
+474: 
+475:         <span class="ruby-identifier">verbose</span> = <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@output_format</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:console</span>
+476: 
+477:         <span class="ruby-comment cmt"># flags[:nodes] and flags[:hosts] are the same thing, we should never have</span>
+478:         <span class="ruby-comment cmt"># allowed :hosts as that was inconsistent with the established terminology</span>
+479:         <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:nodes</span>] = <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:hosts</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flags</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:hosts</span>)
+480: 
+481:         <span class="ruby-identifier">reset</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:nodes</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:json</span>]
+482: 
+483:         <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@discovered_agents</span>
+484:           <span class="ruby-comment cmt"># if either hosts or JSON is supplied try to figure out discovery data from there</span>
+485:           <span class="ruby-comment cmt"># if direct_addressing is not enabled this is a critical error as the user might</span>
+486:           <span class="ruby-comment cmt"># not have supplied filters so raise an exception</span>
+487:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:nodes</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:json</span>]
+488:             <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Can only supply discovery data if direct_addressing is enabled&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">direct_addressing</span>
+489: 
+490:             <span class="ruby-identifier">hosts</span> = []
+491: 
+492:             <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:nodes</span>]
+493:               <span class="ruby-identifier">hosts</span> = <span class="ruby-constant">Helpers</span>.<span class="ruby-identifier">extract_hosts_from_array</span>(<span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:nodes</span>])
+494:             <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:json</span>]
+495:               <span class="ruby-identifier">hosts</span> = <span class="ruby-constant">Helpers</span>.<span class="ruby-identifier">extract_hosts_from_json</span>(<span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:json</span>])
+496:             <span class="ruby-keyword kw">end</span>
+497: 
+498:             <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Could not find any hosts in discovery data provided&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hosts</span>.<span class="ruby-identifier">empty?</span>
+499: 
+500:             <span class="ruby-ivar">@discovered_agents</span> = <span class="ruby-identifier">hosts</span>
+501:             <span class="ruby-ivar">@force_direct_request</span> = <span class="ruby-keyword kw">true</span>
+502: 
+503:           <span class="ruby-keyword kw">else</span>
+504:             <span class="ruby-identifier">identity_filter_discovery_optimization</span>
+505:           <span class="ruby-keyword kw">end</span>
+506:         <span class="ruby-keyword kw">end</span>
+507: 
+508:         <span class="ruby-comment cmt"># All else fails we do it the hard way using a traditional broadcast</span>
+509:         <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@discovered_agents</span>
+510:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">time_discovery</span> <span class="ruby-identifier">:start</span>
+511: 
+512:           <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">options</span> = <span class="ruby-identifier">options</span>
+513: 
+514:           <span class="ruby-comment cmt"># if compound filters are used the only real option is to use the mc</span>
+515:           <span class="ruby-comment cmt"># discovery plugin since its the only capable of using data queries etc</span>
+516:           <span class="ruby-comment cmt"># and we do not want to degrade that experience just to allow compounds</span>
+517:           <span class="ruby-comment cmt"># on other discovery plugins the UX would be too bad raising complex sets</span>
+518:           <span class="ruby-comment cmt"># of errors etc.</span>
+519:           <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">discoverer</span>.<span class="ruby-identifier">force_discovery_method_by_filter</span>(<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:filter</span>])
+520: 
+521:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">verbose</span>
+522:             <span class="ruby-identifier">actual_timeout</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">discoverer</span>.<span class="ruby-identifier">discovery_timeout</span>(<span class="ruby-identifier">discovery_timeout</span>, <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:filter</span>])
+523: 
+524:             <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">actual_timeout</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
+525:               <span class="ruby-ivar">@stderr</span>.<span class="ruby-identifier">print</span>(<span class="ruby-value str">&quot;Discovering hosts using the %s method for %d second(s) .... &quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-ivar">@client</span>.<span class="ruby-identifier">discoverer</span>.<span class="ruby-identifier">discovery_method</span>, <span class="ruby-identifier">actual_timeout</span>])
+526:             <span class="ruby-keyword kw">else</span>
+527:               <span class="ruby-ivar">@stderr</span>.<span class="ruby-identifier">print</span>(<span class="ruby-value str">&quot;Discovering hosts using the %s method .... &quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-ivar">@client</span>.<span class="ruby-identifier">discoverer</span>.<span class="ruby-identifier">discovery_method</span>])
+528:             <span class="ruby-keyword kw">end</span>
+529:           <span class="ruby-keyword kw">end</span>
+530: 
+531:           <span class="ruby-comment cmt"># if the requested limit is a pure number and not a percent</span>
+532:           <span class="ruby-comment cmt"># and if we're configured to use the first found hosts as the</span>
+533:           <span class="ruby-comment cmt"># limit method then pass in the limit thus minimizing the amount</span>
+534:           <span class="ruby-comment cmt"># of work we do in the discover phase and speeding it up significantly</span>
+535:           <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@limit_method</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:first</span> <span class="ruby-keyword kw">and</span> <span class="ruby-ivar">@limit_targets</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Fixnum</span>)
+536:             <span class="ruby-ivar">@discovered_agents</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">discover</span>(<span class="ruby-ivar">@filter</span>, <span class="ruby-identifier">discovery_timeout</span>, <span class="ruby-ivar">@limit_targets</span>)
+537:           <span class="ruby-keyword kw">else</span>
+538:             <span class="ruby-ivar">@discovered_agents</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">discover</span>(<span class="ruby-ivar">@filter</span>, <span class="ruby-identifier">discovery_timeout</span>)
+539:           <span class="ruby-keyword kw">end</span>
+540: 
+541:           <span class="ruby-ivar">@stderr</span>.<span class="ruby-identifier">puts</span>(<span class="ruby-ivar">@discovered_agents</span>.<span class="ruby-identifier">size</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">verbose</span>
+542: 
+543:           <span class="ruby-ivar">@force_direct_request</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">discoverer</span>.<span class="ruby-identifier">force_direct_mode?</span>
+544: 
+545:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">time_discovery</span> <span class="ruby-identifier">:end</span>
+546:         <span class="ruby-keyword kw">end</span>
+547: 
+548:         <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">discovered_agents</span>(<span class="ruby-ivar">@discovered_agents</span>)
+549:         <span class="ruby-constant">RPC</span>.<span class="ruby-identifier">discovered</span>(<span class="ruby-ivar">@discovered_agents</span>)
+550: 
+551:         <span class="ruby-ivar">@discovered_agents</span>
+552:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000094" class="method-detail">
+        <a name="M000094"></a>
+
+        <div class="method-heading">
+          <a href="#M000094" class="method-signature">
+          <span class="method-name">discovery_method=</span><span class="method-args">(method)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Sets the discovery method. If we change the method there are a number of
+steps to take:
+</p>
+<pre>
+ - set the new method
+ - if discovery options were provided, re-set those to initially
+   provided ones else clear them as they might now apply to a
+   different provider
+ - update the client options so it knows there is a new discovery
+   method in force
+ - reset discovery data forcing a discover on the next request
+</pre>
+<p>
+The remaining item is the discovery timeout, we leave that as is since that
+is the user supplied timeout either via initial <a
+href="Client.html#M000104">options</a> or via specifically setting it on
+the client.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000094-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000094-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 377</span>
+377:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discovery_method=</span>(<span class="ruby-identifier">method</span>)
+378:         <span class="ruby-ivar">@default_discovery_method</span> = <span class="ruby-keyword kw">false</span>
+379:         <span class="ruby-ivar">@discovery_method</span> = <span class="ruby-identifier">method</span>
+380: 
+381:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@initial_options</span>[<span class="ruby-identifier">:discovery_options</span>]
+382:           <span class="ruby-ivar">@discovery_options</span> = <span class="ruby-ivar">@initial_options</span>[<span class="ruby-identifier">:discovery_options</span>]
+383:         <span class="ruby-keyword kw">else</span>
+384:           <span class="ruby-ivar">@discovery_options</span>.<span class="ruby-identifier">clear</span>
+385:         <span class="ruby-keyword kw">end</span>
+386: 
+387:         <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">options</span> = <span class="ruby-identifier">options</span>
+388: 
+389:         <span class="ruby-identifier">reset</span>
+390:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000095" class="method-detail">
+        <a name="M000095"></a>
+
+        <div class="method-heading">
+          <a href="#M000095" class="method-signature">
+          <span class="method-name">discovery_options=</span><span class="method-args">(options)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000095-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000095-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 392</span>
+392:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discovery_options=</span>(<span class="ruby-identifier">options</span>)
+393:         <span class="ruby-ivar">@discovery_options</span> = [<span class="ruby-identifier">options</span>].<span class="ruby-identifier">flatten</span>
+394:         <span class="ruby-identifier">reset</span>
+395:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000092" class="method-detail">
+        <a name="M000092"></a>
+
+        <div class="method-heading">
+          <a href="#M000092" class="method-signature">
+          <span class="method-name">discovery_timeout</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000092-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000092-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 344</span>
+344:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discovery_timeout</span>
+345:         <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@discovery_timeout</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@discovery_timeout</span>
+346:         <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">discoverer</span>.<span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">meta</span>[<span class="ruby-identifier">:timeout</span>]
+347:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000093" class="method-detail">
+        <a name="M000093"></a>
+
+        <div class="method-heading">
+          <a href="#M000093" class="method-signature">
+          <span class="method-name">discovery_timeout=</span><span class="method-args">(timeout)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000093-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000093-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 349</span>
+349:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discovery_timeout=</span>(<span class="ruby-identifier">timeout</span>)
+350:         <span class="ruby-ivar">@discovery_timeout</span> = <span class="ruby-constant">Float</span>(<span class="ruby-identifier">timeout</span>)
+351: 
+352:         <span class="ruby-comment cmt"># we calculate the overall timeout from the DDL of the agent and</span>
+353:         <span class="ruby-comment cmt"># the supplied discovery timeout unless someone specifically</span>
+354:         <span class="ruby-comment cmt"># specifies a timeout to the constructor</span>
+355:         <span class="ruby-comment cmt">#</span>
+356:         <span class="ruby-comment cmt"># But if we also then specifically set a discovery_timeout on the</span>
+357:         <span class="ruby-comment cmt"># agent that has to override the supplied timeout so we then</span>
+358:         <span class="ruby-comment cmt"># calculate a correct timeout based on DDL timeout and the</span>
+359:         <span class="ruby-comment cmt"># supplied discovery timeout</span>
+360:         <span class="ruby-ivar">@timeout</span> = <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">meta</span>[<span class="ruby-identifier">:timeout</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">discovery_timeout</span>
+361:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000097" class="method-detail">
+        <a name="M000097"></a>
+
+        <div class="method-heading">
+          <a href="#M000097" class="method-signature">
+          <span class="method-name">fact_filter</span><span class="method-args">(fact, value=nil, operator=&quot;=&quot;)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Sets the fact filter
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000097-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000097-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 405</span>
+405:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fact_filter</span>(<span class="ruby-identifier">fact</span>, <span class="ruby-identifier">value</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">operator</span>=<span class="ruby-value str">&quot;=&quot;</span>)
+406:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fact</span>.<span class="ruby-identifier">nil?</span>
+407:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fact</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span>
+408: 
+409:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
+410:           <span class="ruby-identifier">parsed</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">parse_fact_string</span>(<span class="ruby-identifier">fact</span>)
+411:           <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;fact&quot;</span>] = <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;fact&quot;</span>] <span class="ruby-operator">|</span> [<span class="ruby-identifier">parsed</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">parsed</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span>
+412:         <span class="ruby-keyword kw">else</span>
+413:           <span class="ruby-identifier">parsed</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">parse_fact_string</span>(<span class="ruby-node">&quot;#{fact}#{operator}#{value}&quot;</span>)
+414:           <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;fact&quot;</span>] = <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;fact&quot;</span>] <span class="ruby-operator">|</span> [<span class="ruby-identifier">parsed</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">parsed</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span>
+415:         <span class="ruby-keyword kw">end</span>
+416: 
+417:         <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;fact&quot;</span>].<span class="ruby-identifier">compact!</span>
+418:         <span class="ruby-identifier">reset</span>
+419:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000114" class="method-detail">
+        <a name="M000114"></a>
+
+        <div class="method-heading">
+          <a href="#M000114" class="method-signature">
+          <span class="method-name">fire_and_forget_request</span><span class="method-args">(action, args, filter=nil)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+for requests that do not care for results just return the request id and
+don&#8216;t do any of the response processing.
+</p>
+<p>
+We send the :process_results flag with to the nodes so they can make
+decisions based on that.
+</p>
+<p>
+Should only be called via <a href="Client.html#M000090">method_missing</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000114-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000114-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 710</span>
+710:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fire_and_forget_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">filter</span>=<span class="ruby-keyword kw">nil</span>)
+711:         <span class="ruby-identifier">validate_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
+712: 
+713:         <span class="ruby-identifier">identity_filter_discovery_optimization</span>
+714: 
+715:         <span class="ruby-identifier">req</span> = <span class="ruby-identifier">new_request</span>(<span class="ruby-identifier">action</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">args</span>)
+716: 
+717:         <span class="ruby-identifier">filter</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:filter</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">filter</span>
+718: 
+719:         <span class="ruby-identifier">message</span> = <span class="ruby-constant">Message</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">req</span>, <span class="ruby-keyword kw">nil</span>, {<span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@agent</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:request</span>, <span class="ruby-identifier">:collective</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@collective</span>, <span class="ruby-identifier">:filter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">filter</span>, <span class="ruby-identifier">:options</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">options</span>})
+720:         <span class="ruby-identifier">message</span>.<span class="ruby-identifier">reply_to</span> = <span class="ruby-ivar">@reply_to</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@reply_to</span>
+721: 
+722:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@force_direct_request</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">discoverer</span>.<span class="ruby-identifier">force_direct_mode?</span>
+723:           <span class="ruby-identifier">message</span>.<span class="ruby-identifier">discovered_hosts</span> = <span class="ruby-identifier">discover</span>.<span class="ruby-identifier">clone</span>
+724:           <span class="ruby-identifier">message</span>.<span class="ruby-identifier">type</span> = <span class="ruby-identifier">:direct_request</span>
+725:         <span class="ruby-keyword kw">end</span>
+726: 
+727:         <span class="ruby-identifier">client</span>.<span class="ruby-identifier">sendreq</span>(<span class="ruby-identifier">message</span>, <span class="ruby-keyword kw">nil</span>)
+728:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000087" class="method-detail">
+        <a name="M000087"></a>
+
+        <div class="method-heading">
+          <a href="#M000087" class="method-signature">
+          <span class="method-name">help</span><span class="method-args">(template)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns <a href="Client.html#M000087">help</a> for an agent if a <a
+href="../DDL.html">DDL</a> was found
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000087-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000087-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 126</span>
+126:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">help</span>(<span class="ruby-identifier">template</span>)
+127:         <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">help</span>(<span class="ruby-identifier">template</span>)
+128:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000099" class="method-detail">
+        <a name="M000099"></a>
+
+        <div class="method-heading">
+          <a href="#M000099" class="method-signature">
+          <span class="method-name">identity_filter</span><span class="method-args">(identity)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Sets the identity filter
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000099-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000099-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 429</span>
+429:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">identity_filter</span>(<span class="ruby-identifier">identity</span>)
+430:         <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;identity&quot;</span>] = <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;identity&quot;</span>] <span class="ruby-operator">|</span> [<span class="ruby-identifier">identity</span>]
+431:         <span class="ruby-ivar">@filter</span>[<span class="ruby-value str">&quot;identity&quot;</span>].<span class="ruby-identifier">compact!</span>
+432:         <span class="ruby-identifier">reset</span>
+433:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000115" class="method-detail">
+        <a name="M000115"></a>
+
+        <div class="method-heading">
+          <a href="#M000115" class="method-signature">
+          <span class="method-name">identity_filter_discovery_optimization</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+if an identity filter is supplied and it is all strings no regex we can use
+that as discovery data, technically the identity filter is then redundant
+if we are in direct addressing mode and we could empty it out but this use
+case should only really be for a few -I&#8216;s on the CLI
+</p>
+<p>
+For safety we leave the filter in place for now, that way we can support
+this enhancement also in broadcast mode.
+</p>
+<p>
+This is only needed for the &#8216;mc&#8217; discovery method, other
+methods might change the concept of identity to mean something else so we
+should pass the full identity filter to them
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000115-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000115-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 741</span>
+741:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">identity_filter_discovery_optimization</span>
+742:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:filter</span>][<span class="ruby-value str">&quot;identity&quot;</span>].<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@discovery_method</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;mc&quot;</span>
+743:           <span class="ruby-identifier">regex_filters</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:filter</span>][<span class="ruby-value str">&quot;identity&quot;</span>].<span class="ruby-identifier">select</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">match</span>(<span class="ruby-value str">&quot;^\/&quot;</span>)}.<span class="ruby-identifier">size</span>
+744: 
+745:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">regex_filters</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
+746:             <span class="ruby-ivar">@discovered_agents</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:filter</span>][<span class="ruby-value str">&quot;identity&quot;</span>].<span class="ruby-identifier">clone</span>
+747:             <span class="ruby-ivar">@force_direct_request</span> = <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">direct_addressing</span>
+748:           <span class="ruby-keyword kw">end</span>
+749:         <span class="ruby-keyword kw">end</span>
+750:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000107" class="method-detail">
+        <a name="M000107"></a>
+
+        <div class="method-heading">
+          <a href="#M000107" class="method-signature">
+          <span class="method-name">limit_method=</span><span class="method-args">(method)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Sets and sanity check the limit_method variable used to determine how to
+limit targets if limit_targets is set
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000107-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000107-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 599</span>
+599:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">limit_method=</span>(<span class="ruby-identifier">method</span>)
+600:         <span class="ruby-identifier">method</span> = <span class="ruby-identifier">method</span>.<span class="ruby-identifier">to_sym</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">method</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>)
+601: 
+602:         <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unknown limit method #{method} must be :random or :first&quot;</span> <span class="ruby-keyword kw">unless</span> [<span class="ruby-identifier">:random</span>, <span class="ruby-identifier">:first</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">method</span>)
+603: 
+604:         <span class="ruby-ivar">@limit_method</span> = <span class="ruby-identifier">method</span>
+605:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000106" class="method-detail">
+        <a name="M000106"></a>
+
+        <div class="method-heading">
+          <a href="#M000106" class="method-signature">
+          <span class="method-name">limit_targets=</span><span class="method-args">(limit)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Sets and sanity checks the limit_targets variable used to restrict how many
+nodes we&#8216;ll target
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000106-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000106-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 583</span>
+583:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">limit_targets=</span>(<span class="ruby-identifier">limit</span>)
+584:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">limit</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
+585:           <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Invalid limit specified: #{limit} valid limits are /^\d+%*$/&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">limit</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\d+%*$/</span>
+586: 
+587:           <span class="ruby-keyword kw">begin</span>
+588:             <span class="ruby-ivar">@limit_targets</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">limit</span>)
+589:           <span class="ruby-keyword kw">rescue</span>
+590:             <span class="ruby-ivar">@limit_targets</span> = <span class="ruby-identifier">limit</span>
+591:           <span class="ruby-keyword kw">end</span>
+592:         <span class="ruby-keyword kw">else</span>
+593:           <span class="ruby-ivar">@limit_targets</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">limit</span>)
+594:         <span class="ruby-keyword kw">end</span>
+595:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000111" class="method-detail">
+        <a name="M000111"></a>
+
+        <div class="method-heading">
+          <a href="#M000111" class="method-signature">
+          <span class="method-name">load_aggregate_functions</span><span class="method-args">(action, ddl)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000111-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000111-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 676</span>
+676:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_aggregate_functions</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">ddl</span>)
+677:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">ddl</span>
+678:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">action_interface</span>(<span class="ruby-identifier">action</span>).<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:aggregate</span>)
+679: 
+680:         <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Aggregate</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ddl</span>.<span class="ruby-identifier">action_interface</span>(<span class="ruby-identifier">action</span>))
+681: 
+682:       <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+683:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-value str">&quot;Failed to load aggregate functions, calculating summaries disabled: %s: %s (%s)&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">first</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">class</span>])
+684:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
+685:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000090" class="method-detail">
+        <a name="M000090"></a>
+
+        <div class="method-heading">
+          <a href="#M000090" class="method-signature">
+          <span class="method-name">method_missing</span><span class="method-args">(method_name, *args, &amp;block)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Magic handler to invoke remote methods
+</p>
+<p>
+Once the stub is created using the constructor or the <a
+href="../RPC.html#M000037">RPC#rpcclient</a> helper you can call remote
+actions easily:
+</p>
+<pre>
+  ret = rpc.echo(:msg =&gt; &quot;hello world&quot;)
+</pre>
+<p>
+This will call the &#8216;echo&#8217; action of the &#8216;rpctest&#8217;
+agent and return the result as an array, the array will be a simplified
+result set from the usual full MCollective::Client#req with additional
+error codes and error text:
+</p>
+<p>
+{
+</p>
+<pre>
+  :sender =&gt; &quot;remote.box.com&quot;,
+  :statuscode =&gt; 0,
+  :statusmsg =&gt; &quot;OK&quot;,
+  :data =&gt; &quot;hello world&quot;
+</pre>
+<p>
+}
+</p>
+<p>
+If :statuscode is 0 then everything went find, if it&#8216;s 1 then you
+supplied the correct arguments etc but the request could not be completed,
+you&#8216;ll find a human parsable reason in :statusmsg then.
+</p>
+<p>
+Codes 2 to 5 maps directly to <a
+href="../UnknownRPCAction.html">UnknownRPCAction</a>, <a
+href="../MissingRPCData.html">MissingRPCData</a>, <a
+href="../InvalidRPCData.html">InvalidRPCData</a> and <a
+href="../UnknownRPCError.html">UnknownRPCError</a> see below for a
+description of those, in each case :statusmsg would be the reason for
+failure.
+</p>
+<p>
+To get access to the full result of the MCollective::Client#req calls you
+can pass in a block:
+</p>
+<pre>
+  rpc.echo(:msg =&gt; &quot;hello world&quot;) do |resp|
+     pp resp
+  end
+</pre>
+<p>
+In this case resp will the result from MCollective::Client#req. Instead of
+returning simple text and codes as above you&#8216;ll also need to handle
+the following exceptions:
+</p>
+<p>
+<a href="../UnknownRPCAction.html">UnknownRPCAction</a> - There is no
+matching action on the agent <a
+href="../MissingRPCData.html">MissingRPCData</a> - You did not supply all
+the needed parameters for the action <a
+href="../InvalidRPCData.html">InvalidRPCData</a> - The data you did supply
+did not pass validation <a
+href="../UnknownRPCError.html">UnknownRPCError</a> - Some other error
+prevented the agent from running
+</p>
+<p>
+During calls a progress indicator will be shown of how many results
+we&#8216;ve received against how many nodes were discovered, you can
+disable this by setting progress to false:
+</p>
+<pre>
+  rpc.progress = false
+</pre>
+<p>
+This supports a 2nd mode where it will send the SimpleRPC request and never
+handle the responses. It&#8216;s a bit like UDP, it sends the request with
+the filter attached and you only get back the requestid, you have no
+indication about results.
+</p>
+<p>
+You can invoke this using:
+</p>
+<pre>
+  puts rpc.echo(:process_results =&gt; false)
+</pre>
+<p>
+This will output just the request id.
+</p>
+<p>
+Batched processing is supported:
+</p>
+<pre>
+  printrpc rpc.ping(:batch_size =&gt; 5)
+</pre>
+<p>
+This will do everything exactly as normal but communicate to only 5 agents
+at a time
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000090-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000090-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 231</span>
+231:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">method_name</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+232:         <span class="ruby-comment cmt"># set args to an empty hash if nothings given</span>
+233:         <span class="ruby-identifier">args</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>]
+234:         <span class="ruby-identifier">args</span> = {} <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">nil?</span>
+235: 
+236:         <span class="ruby-identifier">action</span> = <span class="ruby-identifier">method_name</span>.<span class="ruby-identifier">to_s</span>
+237: 
+238:         <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">reset</span>
+239: 
+240:         <span class="ruby-identifier">validate_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
+241: 
+242:         <span class="ruby-comment cmt"># if a global batch size is set just use that else set it</span>
+243:         <span class="ruby-comment cmt"># in the case that it was passed as an argument</span>
+244:         <span class="ruby-identifier">batch_mode</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:batch_size</span>) <span class="ruby-operator">||</span> <span class="ruby-ivar">@batch_mode</span>
+245:         <span class="ruby-identifier">batch_size</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:batch_size</span>) <span class="ruby-operator">||</span> <span class="ruby-ivar">@batch_size</span>
+246:         <span class="ruby-identifier">batch_sleep_time</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">:batch_sleep_time</span>) <span class="ruby-operator">||</span> <span class="ruby-ivar">@batch_sleep_time</span>
+247: 
+248:         <span class="ruby-comment cmt"># if we were given a batch_size argument thats 0 and batch_mode was</span>
+249:         <span class="ruby-comment cmt"># determined to be on via global options etc this will allow a batch_size</span>
+250:         <span class="ruby-comment cmt"># of 0 to disable or batch_mode for this call only</span>
+251:         <span class="ruby-identifier">batch_mode</span> = (<span class="ruby-identifier">batch_mode</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">batch_size</span>) <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>)
+252: 
+253:         <span class="ruby-comment cmt"># Handle single target requests by doing discovery and picking</span>
+254:         <span class="ruby-comment cmt"># a random node.  Then do a custom request specifying a filter</span>
+255:         <span class="ruby-comment cmt"># that will only match the one node.</span>
+256:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@limit_targets</span>
+257:           <span class="ruby-identifier">target_nodes</span> = <span class="ruby-identifier">pick_nodes_from_discovered</span>(<span class="ruby-ivar">@limit_targets</span>)
+258:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Picked #{target_nodes.join(',')} as limited target(s)&quot;</span>)
+259: 
+260:           <span class="ruby-identifier">custom_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">target_nodes</span>, {<span class="ruby-value str">&quot;identity&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">/^(#{target_nodes.join('|')})$/</span>}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+261:         <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">batch_mode</span>
+262:           <span class="ruby-identifier">call_agent_batched</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">options</span>, <span class="ruby-identifier">batch_size</span>, <span class="ruby-identifier">batch_sleep_time</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+263:         <span class="ruby-keyword kw">else</span>
+264:           <span class="ruby-identifier">call_agent</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">options</span>, <span class="ruby-identifier">:auto</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+265:         <span class="ruby-keyword kw">end</span>
+266:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000088" class="method-detail">
+        <a name="M000088"></a>
+
+        <div class="method-heading">
+          <a href="#M000088" class="method-signature">
+          <span class="method-name">new_request</span><span class="method-args">(action, data)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Creates a suitable request hash for the SimpleRPC agent.
+</p>
+<p>
+You&#8216;d use this if you ever wanted to take care of sending requests on
+your own - perhaps via Client#sendreq if you didn&#8216;t care for
+responses.
+</p>
+<p>
+In that case you can just do:
+</p>
+<pre>
+  msg = your_rpc.new_request(&quot;some_action&quot;, :foo =&gt; :bar)
+  filter = your_rpc.filter
+
+  your_rpc.client.sendreq(msg, msg[:agent], filter)
+</pre>
+<p>
+This will send a SimpleRPC request to the action some_action with arguments
+:foo = :bar, it will return immediately and you will have no indication at
+all if the request was receieved or not
+</p>
+<p>
+Clearly the use of this technique should be limited and done only if your
+code requires such a thing
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000088-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000088-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 149</span>
+149:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">data</span>)
+150:         <span class="ruby-identifier">callerid</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;security_plugin&quot;</span>].<span class="ruby-identifier">callerid</span>
+151: 
+152:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">'callerid received from security plugin is not valid'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;security_plugin&quot;</span>].<span class="ruby-identifier">valid_callerid?</span>(<span class="ruby-identifier">callerid</span>)
+153: 
+154:         {<span class="ruby-identifier">:agent</span>  =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@agent</span>,
+155:          <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">action</span>,
+156:          <span class="ruby-identifier">:caller</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">callerid</span>,
+157:          <span class="ruby-identifier">:data</span>   =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">data</span>}
+158:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000104" class="method-detail">
+        <a name="M000104"></a>
+
+        <div class="method-heading">
+          <a href="#M000104" class="method-signature">
+          <span class="method-name">options</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Provides a normal <a href="Client.html#M000104">options</a> hash like you
+would get from <a href="../Optionparser.html">Optionparser</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000104-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000104-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 556</span>
+556:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">options</span>
+557:         {<span class="ruby-identifier">:disctimeout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">discovery_timeout</span>,
+558:          <span class="ruby-identifier">:timeout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@timeout</span>,
+559:          <span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@verbose</span>,
+560:          <span class="ruby-identifier">:filter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@filter</span>,
+561:          <span class="ruby-identifier">:collective</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@collective</span>,
+562:          <span class="ruby-identifier">:output_format</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@output_format</span>,
+563:          <span class="ruby-identifier">:ttl</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@ttl</span>,
+564:          <span class="ruby-identifier">:discovery_method</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@discovery_method</span>,
+565:          <span class="ruby-identifier">:discovery_options</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@discovery_options</span>,
+566:          <span class="ruby-identifier">:force_display_mode</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@force_display_mode</span>,
+567:          <span class="ruby-identifier">:config</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@config</span>,
+568:          <span class="ruby-identifier">:publish_timeout</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@publish_timeout</span>,
+569:          <span class="ruby-identifier">:threaded</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@threaded</span>}
+570:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000110" class="method-detail">
+        <a name="M000110"></a>
+
+        <div class="method-heading">
+          <a href="#M000110" class="method-signature">
+          <span class="method-name">pick_nodes_from_discovered</span><span class="method-args">(count)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Pick a number of nodes from the discovered nodes
+</p>
+<p>
+The count should be a string that can be either just a number or a
+percentage like 10%
+</p>
+<p>
+It will select nodes from the discovered list based on the rpclimitmethod
+configuration option which can be either :first or anything else
+</p>
+<pre>
+  - :first would be a simple way to do a distance based
+    selection
+  - anything else will just pick one at random
+  - if random chosen, and batch-seed set, then set srand
+    for the generator, and reset afterwards
+</pre>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000110-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000110-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 635</span>
+635:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pick_nodes_from_discovered</span>(<span class="ruby-identifier">count</span>)
+636:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">count</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/%$/</span>
+637:           <span class="ruby-identifier">pct</span> = <span class="ruby-constant">Integer</span>((<span class="ruby-identifier">discover</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">*</span> (<span class="ruby-identifier">count</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-value">100</span>)))
+638:           <span class="ruby-identifier">pct</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">count</span> = <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">count</span> = <span class="ruby-identifier">pct</span>
+639:         <span class="ruby-keyword kw">else</span>
+640:           <span class="ruby-identifier">count</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">count</span>)
+641:         <span class="ruby-keyword kw">end</span>
+642: 
+643:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">discover</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">discover</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-identifier">count</span>
+644: 
+645:         <span class="ruby-identifier">result</span> = []
+646: 
+647:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@limit_method</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:first</span>
+648:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">discover</span>[<span class="ruby-value">0</span>, <span class="ruby-identifier">count</span>]
+649:         <span class="ruby-keyword kw">else</span>
+650:           <span class="ruby-comment cmt"># we delete from the discovered list because we want</span>
+651:           <span class="ruby-comment cmt"># to be sure there is no chance that the same node will</span>
+652:           <span class="ruby-comment cmt"># be randomly picked twice.  So we have to clone the</span>
+653:           <span class="ruby-comment cmt"># discovered list else this method will only ever work</span>
+654:           <span class="ruby-comment cmt"># once per discovery cycle and not actually return the</span>
+655:           <span class="ruby-comment cmt"># right nodes.</span>
+656:           <span class="ruby-identifier">haystack</span> = <span class="ruby-identifier">discover</span>.<span class="ruby-identifier">clone</span>
+657: 
+658:           <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@limit_seed</span>
+659:             <span class="ruby-identifier">haystack</span>.<span class="ruby-identifier">sort!</span>
+660:             <span class="ruby-identifier">srand</span>(<span class="ruby-ivar">@limit_seed</span>)
+661:           <span class="ruby-keyword kw">end</span>
+662: 
+663:           <span class="ruby-identifier">count</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span>
+664:             <span class="ruby-identifier">rnd</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-identifier">haystack</span>.<span class="ruby-identifier">size</span>)
+665:             <span class="ruby-identifier">result</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">haystack</span>.<span class="ruby-identifier">delete_at</span>(<span class="ruby-identifier">rnd</span>)
+666:           <span class="ruby-keyword kw">end</span>
+667: 
+668:           <span class="ruby-comment cmt"># Reset random number generator to fresh seed</span>
+669:           <span class="ruby-comment cmt"># As our seed from options is most likely short</span>
+670:           <span class="ruby-identifier">srand</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@limit_seed</span>
+671:         <span class="ruby-keyword kw">end</span>
+672: 
+673:         [<span class="ruby-identifier">result</span>].<span class="ruby-identifier">flatten</span>
+674:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000119" class="method-detail">
+        <a name="M000119"></a>
+
+        <div class="method-heading">
+          <a href="#M000119" class="method-signature">
+          <span class="method-name">process_results_with_block</span><span class="method-args">(action, resp, block, aggregate)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+process client requests by calling a block on each result in this mode we
+do not do anything fancy with the result objects and we raise exceptions if
+there are problems with the data
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000119-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000119-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 944</span>
+944:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_results_with_block</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">resp</span>, <span class="ruby-identifier">block</span>, <span class="ruby-identifier">aggregate</span>)
+945:         <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">node_responded</span>(<span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:senderid</span>])
+946: 
+947:         <span class="ruby-identifier">result</span> = <span class="ruby-identifier">rpc_result_from_reply</span>(<span class="ruby-ivar">@agent</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">resp</span>)
+948:         <span class="ruby-identifier">aggregate</span> = <span class="ruby-identifier">aggregate_reply</span>(<span class="ruby-identifier">result</span>, <span class="ruby-identifier">aggregate</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aggregate</span>
+949: 
+950:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
+951:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">ok</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
+952:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">fail</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
+953:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">time_block_execution</span> <span class="ruby-identifier">:start</span>
+954: 
+955:           <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">block</span>.<span class="ruby-identifier">arity</span>
+956:             <span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span>
+957:               <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">resp</span>)
+958:             <span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span>
+959:               <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">resp</span>, <span class="ruby-identifier">result</span>)
+960:           <span class="ruby-keyword kw">end</span>
+961: 
+962:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">time_block_execution</span> <span class="ruby-identifier">:end</span>
+963:         <span class="ruby-keyword kw">else</span>
+964:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">fail</span>
+965: 
+966:           <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>]
+967:             <span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span>
+968:               <span class="ruby-identifier">raise</span> <span class="ruby-constant">UnknownRPCAction</span>, <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statusmsg</span>]
+969:             <span class="ruby-keyword kw">when</span> <span class="ruby-value">3</span>
+970:               <span class="ruby-identifier">raise</span> <span class="ruby-constant">MissingRPCData</span>, <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statusmsg</span>]
+971:             <span class="ruby-keyword kw">when</span> <span class="ruby-value">4</span>
+972:               <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRPCData</span>, <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statusmsg</span>]
+973:             <span class="ruby-keyword kw">when</span> <span class="ruby-value">5</span>
+974:               <span class="ruby-identifier">raise</span> <span class="ruby-constant">UnknownRPCError</span>, <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statusmsg</span>]
+975:           <span class="ruby-keyword kw">end</span>
+976:         <span class="ruby-keyword kw">end</span>
+977: 
+978:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">aggregate</span>
+979:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000118" class="method-detail">
+        <a name="M000118"></a>
+
+        <div class="method-heading">
+          <a href="#M000118" class="method-signature">
+          <span class="method-name">process_results_without_block</span><span class="method-args">(resp, action, aggregate)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Handles result sets that has no block associated, sets fails and ok in the
+stats object and return a hash of the response to send to the caller
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000118-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000118-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 924</span>
+924:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_results_without_block</span>(<span class="ruby-identifier">resp</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">aggregate</span>)
+925:         <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">node_responded</span>(<span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:senderid</span>])
+926: 
+927:         <span class="ruby-identifier">result</span> = <span class="ruby-identifier">rpc_result_from_reply</span>(<span class="ruby-ivar">@agent</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">resp</span>)
+928:         <span class="ruby-identifier">aggregate</span> = <span class="ruby-identifier">aggregate_reply</span>(<span class="ruby-identifier">result</span>, <span class="ruby-identifier">aggregate</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aggregate</span>
+929: 
+930:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
+931:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">ok</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
+932:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">fail</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
+933:         <span class="ruby-keyword kw">else</span>
+934:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">fail</span>
+935:         <span class="ruby-keyword kw">end</span>
+936: 
+937:         [<span class="ruby-identifier">result</span>, <span class="ruby-identifier">aggregate</span>]
+938:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000101" class="method-detail">
+        <a name="M000101"></a>
+
+        <div class="method-heading">
+          <a href="#M000101" class="method-signature">
+          <span class="method-name">reset</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Resets various internal parts of the class, most importantly it clears out
+the cached discovery
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000101-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000101-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 443</span>
+443:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset</span>
+444:         <span class="ruby-ivar">@discovered_agents</span> = <span class="ruby-keyword kw">nil</span>
+445:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000102" class="method-detail">
+        <a name="M000102"></a>
+
+        <div class="method-heading">
+          <a href="#M000102" class="method-signature">
+          <span class="method-name">reset_filter</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Reet the filter to an empty one
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000102-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000102-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 448</span>
+448:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset_filter</span>
+449:         <span class="ruby-ivar">@filter</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">empty_filter</span>
+450:         <span class="ruby-identifier">agent_filter</span> <span class="ruby-ivar">@agent</span>
+451:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000113" class="method-detail">
+        <a name="M000113"></a>
+
+        <div class="method-heading">
+          <a href="#M000113" class="method-signature">
+          <span class="method-name">rpc_result_from_reply</span><span class="method-args">(agent, action, reply)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000113-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000113-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 697</span>
+697:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rpc_result_from_reply</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">reply</span>)
+698:         <span class="ruby-constant">Result</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">action</span>, {<span class="ruby-identifier">:sender</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">reply</span>[<span class="ruby-identifier">:senderid</span>], <span class="ruby-identifier">:statuscode</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">reply</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statuscode</span>],
+699:                                    <span class="ruby-identifier">:statusmsg</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">reply</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:statusmsg</span>], <span class="ruby-identifier">:data</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">reply</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:data</span>]})
+700:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000089" class="method-detail">
+        <a name="M000089"></a>
+
+        <div class="method-heading">
+          <a href="#M000089" class="method-signature">
+          <span class="method-name">validate_request</span><span class="method-args">(action, args)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+For the provided arguments and action the input arguments get modified by
+supplying any defaults provided in the <a href="../DDL.html">DDL</a> for
+arguments that were not supplied in the request
+</p>
+<p>
+We then pass the modified arguments to the <a href="../DDL.html">DDL</a>
+for validation
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000089-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000089-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/client.rb, line 165</span>
+165:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
+166:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;No DDL found for agent %s cannot validate inputs&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-ivar">@agent</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@ddl</span>
+167: 
+168:         <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">set_default_input_arguments</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
+169:         <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">validate_rpc_request</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>)
+170:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/RPC/Helpers.html b/doc/classes/MCollective/RPC/Helpers.html
new file mode 100644 (file)
index 0000000..5e06bce
--- /dev/null
@@ -0,0 +1,595 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::RPC::Helpers</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::RPC::Helpers</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/rpc/helpers_rb.html">
+                lib/mcollective/rpc/helpers.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+Various utilities for the <a href="../RPC.html">RPC</a> system
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000050">add_simplerpc_options</a>&nbsp;&nbsp;
+      <a href="#M000045">extract_hosts_from_array</a>&nbsp;&nbsp;
+      <a href="#M000044">extract_hosts_from_json</a>&nbsp;&nbsp;
+      <a href="#M000049">old_rpcresults</a>&nbsp;&nbsp;
+      <a href="#M000046">rpcresults</a>&nbsp;&nbsp;
+      <a href="#M000048">text_for_flattened_result</a>&nbsp;&nbsp;
+      <a href="#M000047">text_for_result</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000050" class="method-detail">
+        <a name="M000050"></a>
+
+        <div class="method-heading">
+          <a href="#M000050" class="method-signature">
+          <span class="method-name">add_simplerpc_options</span><span class="method-args">(parser, options)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Add SimpleRPC common options
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000050-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/helpers.rb, line 254</span>
+254:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">add_simplerpc_options</span>(<span class="ruby-identifier">parser</span>, <span class="ruby-identifier">options</span>)
+255:         <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">separator</span> <span class="ruby-value str">&quot;&quot;</span>
+256:         <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">separator</span> <span class="ruby-value str">&quot;RPC Options&quot;</span>
+257: 
+258:         <span class="ruby-comment cmt"># add SimpleRPC specific options to all clients that use our library</span>
+259:         <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--np'</span>, <span class="ruby-value str">'--no-progress'</span>, <span class="ruby-value str">'Do not show the progress bar'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
+260:           <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:progress_bar</span>] = <span class="ruby-keyword kw">false</span>
+261:         <span class="ruby-keyword kw">end</span>
+262: 
+263:         <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--one'</span>, <span class="ruby-value str">'-1'</span>, <span class="ruby-value str">'Send request to only one discovered nodes'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
+264:           <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:mcollective_limit_targets</span>] = <span class="ruby-value">1</span>
+265:         <span class="ruby-keyword kw">end</span>
+266: 
+267:         <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--batch SIZE'</span>, <span class="ruby-constant">Integer</span>, <span class="ruby-value str">'Do requests in batches'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
+268:           <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:batch_size</span>] = <span class="ruby-identifier">v</span>
+269:         <span class="ruby-keyword kw">end</span>
+270: 
+271:         <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--batch-sleep SECONDS'</span>, <span class="ruby-constant">Float</span>, <span class="ruby-value str">'Sleep time between batches'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
+272:           <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:batch_sleep_time</span>] = <span class="ruby-identifier">v</span>
+273:         <span class="ruby-keyword kw">end</span>
+274: 
+275:         <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--limit-seed NUMBER'</span>, <span class="ruby-constant">Integer</span>, <span class="ruby-value str">'Seed value for deterministic random batching'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
+276:           <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:limit_seed</span>] = <span class="ruby-identifier">v</span>
+277:         <span class="ruby-keyword kw">end</span>
+278: 
+279:         <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--limit-nodes COUNT'</span>, <span class="ruby-value str">'--ln'</span>, <span class="ruby-value str">'--limit'</span>, <span class="ruby-value str">'Send request to only a subset of nodes, can be a percentage'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
+280:           <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Invalid limit specified: #{v} valid limits are /^\d+%*$/&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\d+%*$/</span>
+281: 
+282:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\d+$/</span>
+283:             <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:mcollective_limit_targets</span>] = <span class="ruby-identifier">v</span>.<span class="ruby-identifier">to_i</span>
+284:           <span class="ruby-keyword kw">else</span>
+285:             <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:mcollective_limit_targets</span>] = <span class="ruby-identifier">v</span>
+286:           <span class="ruby-keyword kw">end</span>
+287:         <span class="ruby-keyword kw">end</span>
+288: 
+289:         <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--json'</span>, <span class="ruby-value str">'-j'</span>, <span class="ruby-value str">'Produce JSON output'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
+290:           <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:progress_bar</span>] = <span class="ruby-keyword kw">false</span>
+291:           <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:output_format</span>] = <span class="ruby-identifier">:json</span>
+292:         <span class="ruby-keyword kw">end</span>
+293: 
+294:         <span class="ruby-identifier">parser</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--display MODE'</span>, <span class="ruby-value str">'Influence how results are displayed. One of ok, all or failed'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
+295:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;all&quot;</span>
+296:             <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:force_display_mode</span>] = <span class="ruby-identifier">:always</span>
+297:           <span class="ruby-keyword kw">else</span>
+298:             <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:force_display_mode</span>] = <span class="ruby-identifier">v</span>.<span class="ruby-identifier">intern</span>
+299:           <span class="ruby-keyword kw">end</span>
+300: 
+301:           <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;--display has to be one of 'ok', 'all' or 'failed'&quot;</span> <span class="ruby-keyword kw">unless</span> [<span class="ruby-identifier">:ok</span>, <span class="ruby-identifier">:failed</span>, <span class="ruby-identifier">:always</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:force_display_mode</span>])
+302:         <span class="ruby-keyword kw">end</span>
+303:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000045" class="method-detail">
+        <a name="M000045"></a>
+
+        <div class="method-heading">
+          <a href="#M000045" class="method-signature">
+          <span class="method-name">extract_hosts_from_array</span><span class="method-args">(hosts)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Given an array of something, make sure each is a string chomp off any new
+lines and return just the array of hosts
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000045-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000045-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/helpers.rb, line 29</span>
+29:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">extract_hosts_from_array</span>(<span class="ruby-identifier">hosts</span>)
+30:         [<span class="ruby-identifier">hosts</span>].<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">host</span><span class="ruby-operator">|</span>
+31:           <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;#{host} should be a string&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">host</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
+32:           <span class="ruby-identifier">host</span>.<span class="ruby-identifier">chomp</span>
+33:         <span class="ruby-keyword kw">end</span>
+34:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000044" class="method-detail">
+        <a name="M000044"></a>
+
+        <div class="method-heading">
+          <a href="#M000044" class="method-signature">
+          <span class="method-name">extract_hosts_from_json</span><span class="method-args">(json)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Parse JSON output as produced by printrpc and extract the
+&quot;sender&quot; of each rpc response
+</p>
+<p>
+The simplist valid JSON based data would be:
+</p>
+<p>
+[
+</p>
+<pre>
+ {&quot;sender&quot; =&gt; &quot;example.com&quot;},
+ {&quot;sender&quot; =&gt; &quot;another.com&quot;}
+</pre>
+<p>
+]
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000044-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000044-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/helpers.rb, line 14</span>
+14:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">extract_hosts_from_json</span>(<span class="ruby-identifier">json</span>)
+15:         <span class="ruby-identifier">hosts</span> = <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">json</span>)
+16: 
+17:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;JSON hosts list is not an array&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">hosts</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
+18: 
+19:         <span class="ruby-identifier">hosts</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">host</span><span class="ruby-operator">|</span>
+20:           <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;JSON host list is not an array of Hashes&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">host</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
+21:           <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;JSON host list does not have senders in it&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">host</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">&quot;sender&quot;</span>)
+22: 
+23:           <span class="ruby-identifier">host</span>[<span class="ruby-value str">&quot;sender&quot;</span>]
+24:         <span class="ruby-keyword kw">end</span>.<span class="ruby-identifier">uniq</span>
+25:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000049" class="method-detail">
+        <a name="M000049"></a>
+
+        <div class="method-heading">
+          <a href="#M000049" class="method-signature">
+          <span class="method-name">old_rpcresults</span><span class="method-args">(result, flags = {})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Backward compatible display block for results without a <a
+href="../DDL.html">DDL</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000049-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/helpers.rb, line 202</span>
+202:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">old_rpcresults</span>(<span class="ruby-identifier">result</span>, <span class="ruby-identifier">flags</span> = {})
+203:         <span class="ruby-identifier">result_text</span> = <span class="ruby-value str">&quot;&quot;</span>
+204: 
+205:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:flatten</span>]
+206:           <span class="ruby-identifier">result</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
+207:             <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">r</span>[<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">&lt;=</span> <span class="ruby-value">1</span>
+208:               <span class="ruby-identifier">data</span> = <span class="ruby-identifier">r</span>[<span class="ruby-identifier">:data</span>]
+209: 
+210:               <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
+211:                 <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">pretty_inspect</span>
+212:               <span class="ruby-keyword kw">else</span>
+213:                 <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">data</span>
+214:               <span class="ruby-keyword kw">end</span>
+215:             <span class="ruby-keyword kw">else</span>
+216:               <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">r</span>.<span class="ruby-identifier">pretty_inspect</span>
+217:             <span class="ruby-keyword kw">end</span>
+218:           <span class="ruby-keyword kw">end</span>
+219: 
+220:           <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&quot;</span>
+221:         <span class="ruby-keyword kw">else</span>
+222:           [<span class="ruby-identifier">result</span>].<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
+223: 
+224:             <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:verbose</span>]
+225:               <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;%-40s: %s\n&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">r</span>[<span class="ruby-identifier">:sender</span>], <span class="ruby-identifier">r</span>[<span class="ruby-identifier">:statusmsg</span>]]
+226: 
+227:               <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">r</span>[<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">&lt;=</span> <span class="ruby-value">1</span>
+228:                 <span class="ruby-identifier">r</span>[<span class="ruby-identifier">:data</span>].<span class="ruby-identifier">pretty_inspect</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;\n&quot;</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-identifier">result_text</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot;    #{m}&quot;</span>}
+229:                 <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n\n&quot;</span>
+230:               <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">r</span>[<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">2</span>
+231:                 <span class="ruby-comment cmt"># dont print anything, no useful data to display</span>
+232:                 <span class="ruby-comment cmt"># past what was already shown</span>
+233:               <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">r</span>[<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">3</span>
+234:                 <span class="ruby-comment cmt"># dont print anything, no useful data to display</span>
+235:                 <span class="ruby-comment cmt"># past what was already shown</span>
+236:               <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">r</span>[<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">4</span>
+237:                 <span class="ruby-comment cmt"># dont print anything, no useful data to display</span>
+238:                 <span class="ruby-comment cmt"># past what was already shown</span>
+239:               <span class="ruby-keyword kw">else</span>
+240:                 <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;    #{r[:statusmsg]}&quot;</span>
+241:               <span class="ruby-keyword kw">end</span>
+242:             <span class="ruby-keyword kw">else</span>
+243:               <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">r</span>[<span class="ruby-identifier">:statuscode</span>] <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
+244:                 <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;%-40s %s\n&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">r</span>[<span class="ruby-identifier">:sender</span>], <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:red</span>, <span class="ruby-identifier">r</span>[<span class="ruby-identifier">:statusmsg</span>])]
+245:               <span class="ruby-keyword kw">end</span>
+246:             <span class="ruby-keyword kw">end</span>
+247:           <span class="ruby-keyword kw">end</span>
+248:         <span class="ruby-keyword kw">end</span>
+249: 
+250:         <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&quot;</span>
+251:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000046" class="method-detail">
+        <a name="M000046"></a>
+
+        <div class="method-heading">
+          <a href="#M000046" class="method-signature">
+          <span class="method-name">rpcresults</span><span class="method-args">(result, flags = {})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns a blob of text representing the results in a standard way
+</p>
+<p>
+It tries hard to do sane things so you often should not need to write your
+own display functions
+</p>
+<p>
+If the agent you are getting results for has a <a
+href="../DDL.html">DDL</a> it will use the hints in there to do the right
+thing specifically it will look at the values of display in the <a
+href="../DDL.html">DDL</a> to choose when to show results
+</p>
+<p>
+If you do not have a <a href="../DDL.html">DDL</a> you can pass these
+flags:
+</p>
+<pre>
+   printrpc exim.mailq, :flatten =&gt; true
+   printrpc exim.mailq, :verbose =&gt; true
+</pre>
+<p>
+If you&#8216;ve asked it to flatten the result it will not print sender
+hostnames, it will just print the result as if it&#8216;s one huge result,
+handy for things like showing a combined mailq.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000046-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000046-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/helpers.rb, line 54</span>
+ 54:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">rpcresults</span>(<span class="ruby-identifier">result</span>, <span class="ruby-identifier">flags</span> = {})
+ 55:         <span class="ruby-identifier">flags</span> = {<span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">:flatten</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">:format</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:console</span>, <span class="ruby-identifier">:force_display_mode</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">flags</span>)
+ 56: 
+ 57:         <span class="ruby-identifier">result_text</span> = <span class="ruby-value str">&quot;&quot;</span>
+ 58:         <span class="ruby-identifier">ddl</span> = <span class="ruby-keyword kw">nil</span>
+ 59: 
+ 60:         <span class="ruby-comment cmt"># if running in verbose mode, just use the old style print</span>
+ 61:         <span class="ruby-comment cmt"># no need for all the DDL helpers obfuscating the result</span>
+ 62:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:format</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">:json</span>
+ 63:           <span class="ruby-keyword kw">if</span> <span class="ruby-constant">STDOUT</span>.<span class="ruby-identifier">tty?</span>
+ 64:             <span class="ruby-identifier">result_text</span> = <span class="ruby-constant">JSON</span>.<span class="ruby-identifier">pretty_generate</span>(<span class="ruby-identifier">result</span>)
+ 65:           <span class="ruby-keyword kw">else</span>
+ 66:             <span class="ruby-identifier">result_text</span> = <span class="ruby-identifier">result</span>.<span class="ruby-identifier">to_json</span>
+ 67:           <span class="ruby-keyword kw">end</span>
+ 68:         <span class="ruby-keyword kw">else</span>
+ 69:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:verbose</span>]
+ 70:             <span class="ruby-identifier">result_text</span> = <span class="ruby-identifier">old_rpcresults</span>(<span class="ruby-identifier">result</span>, <span class="ruby-identifier">flags</span>)
+ 71:           <span class="ruby-keyword kw">else</span>
+ 72:             [<span class="ruby-identifier">result</span>].<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span>
+ 73:               <span class="ruby-keyword kw">begin</span>
+ 74:                 <span class="ruby-identifier">ddl</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">r</span>.<span class="ruby-identifier">agent</span>).<span class="ruby-identifier">action_interface</span>(<span class="ruby-identifier">r</span>.<span class="ruby-identifier">action</span>.<span class="ruby-identifier">to_s</span>)
+ 75: 
+ 76:                 <span class="ruby-identifier">sender</span> = <span class="ruby-identifier">r</span>[<span class="ruby-identifier">:sender</span>]
+ 77:                 <span class="ruby-identifier">status</span> = <span class="ruby-identifier">r</span>[<span class="ruby-identifier">:statuscode</span>]
+ 78:                 <span class="ruby-identifier">message</span> = <span class="ruby-identifier">r</span>[<span class="ruby-identifier">:statusmsg</span>]
+ 79:                 <span class="ruby-identifier">result</span> = <span class="ruby-identifier">r</span>[<span class="ruby-identifier">:data</span>]
+ 80: 
+ 81:                 <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:force_display_mode</span>]
+ 82:                   <span class="ruby-identifier">display</span> = <span class="ruby-identifier">flags</span>[<span class="ruby-identifier">:force_display_mode</span>]
+ 83:                 <span class="ruby-keyword kw">else</span>
+ 84:                   <span class="ruby-identifier">display</span> = <span class="ruby-identifier">ddl</span>[<span class="ruby-identifier">:display</span>]
+ 85:                 <span class="ruby-keyword kw">end</span>
+ 86: 
+ 87:                 <span class="ruby-comment cmt"># appand the results only according to what the DDL says</span>
+ 88:                 <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">display</span>
+ 89:                   <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:ok</span>
+ 90:                     <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
+ 91:                       <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text_for_result</span>(<span class="ruby-identifier">sender</span>, <span class="ruby-identifier">status</span>, <span class="ruby-identifier">message</span>, <span class="ruby-identifier">result</span>, <span class="ruby-identifier">ddl</span>)
+ 92:                     <span class="ruby-keyword kw">end</span>
+ 93: 
+ 94:                   <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:failed</span>
+ 95:                     <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
+ 96:                       <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text_for_result</span>(<span class="ruby-identifier">sender</span>, <span class="ruby-identifier">status</span>, <span class="ruby-identifier">message</span>, <span class="ruby-identifier">result</span>, <span class="ruby-identifier">ddl</span>)
+ 97:                     <span class="ruby-keyword kw">end</span>
+ 98: 
+ 99:                   <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:always</span>
+100:                     <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text_for_result</span>(<span class="ruby-identifier">sender</span>, <span class="ruby-identifier">status</span>, <span class="ruby-identifier">message</span>, <span class="ruby-identifier">result</span>, <span class="ruby-identifier">ddl</span>)
+101: 
+102:                   <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:flatten</span>
+103:                     <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text_for_flattened_result</span>(<span class="ruby-identifier">status</span>, <span class="ruby-identifier">result</span>)
+104: 
+105:                 <span class="ruby-keyword kw">end</span>
+106:               <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+107:                 <span class="ruby-comment cmt"># no DDL so just do the old style print unchanged for</span>
+108:                 <span class="ruby-comment cmt"># backward compat</span>
+109:                 <span class="ruby-identifier">result_text</span> = <span class="ruby-identifier">old_rpcresults</span>(<span class="ruby-identifier">result</span>, <span class="ruby-identifier">flags</span>)
+110:               <span class="ruby-keyword kw">end</span>
+111:             <span class="ruby-keyword kw">end</span>
+112:           <span class="ruby-keyword kw">end</span>
+113:         <span class="ruby-keyword kw">end</span>
+114: 
+115:         <span class="ruby-identifier">result_text</span>
+116:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000048" class="method-detail">
+        <a name="M000048"></a>
+
+        <div class="method-heading">
+          <a href="#M000048" class="method-signature">
+          <span class="method-name">text_for_flattened_result</span><span class="method-args">(status, result)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns text representing a flattened result of only good data
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000048-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/helpers.rb, line 189</span>
+189:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">text_for_flattened_result</span>(<span class="ruby-identifier">status</span>, <span class="ruby-identifier">result</span>)
+190:         <span class="ruby-identifier">result_text</span> = <span class="ruby-value str">&quot;&quot;</span>
+191: 
+192:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-value">1</span>
+193:           <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
+194:             <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">pretty_inspect</span>
+195:           <span class="ruby-keyword kw">else</span>
+196:             <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">result</span>
+197:           <span class="ruby-keyword kw">end</span>
+198:         <span class="ruby-keyword kw">end</span>
+199:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000047" class="method-detail">
+        <a name="M000047"></a>
+
+        <div class="method-heading">
+          <a href="#M000047" class="method-signature">
+          <span class="method-name">text_for_result</span><span class="method-args">(sender, status, msg, result, ddl)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Return text representing a result
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000047-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000047-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/helpers.rb, line 119</span>
+119:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">text_for_result</span>(<span class="ruby-identifier">sender</span>, <span class="ruby-identifier">status</span>, <span class="ruby-identifier">msg</span>, <span class="ruby-identifier">result</span>, <span class="ruby-identifier">ddl</span>)
+120:         <span class="ruby-identifier">statusses</span> = [<span class="ruby-value str">&quot;&quot;</span>,
+121:                      <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:red</span>, <span class="ruby-value str">&quot;Request Aborted&quot;</span>),
+122:                      <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:yellow</span>, <span class="ruby-value str">&quot;Unknown Action&quot;</span>),
+123:                      <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:yellow</span>, <span class="ruby-value str">&quot;Missing Request Data&quot;</span>),
+124:                      <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:yellow</span>, <span class="ruby-value str">&quot;Invalid Request Data&quot;</span>),
+125:                      <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:red</span>, <span class="ruby-value str">&quot;Unknown Request Status&quot;</span>)]
+126: 
+127:         <span class="ruby-identifier">result_text</span> = <span class="ruby-value str">&quot;%-40s %s\n&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">sender</span>, <span class="ruby-identifier">statusses</span>[<span class="ruby-identifier">status</span>]]
+128:         <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;   %s\n&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:yellow</span>, <span class="ruby-identifier">msg</span>)] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">msg</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;OK&quot;</span>
+129: 
+130:         <span class="ruby-comment cmt"># only print good data, ignore data that results from failure</span>
+131:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
+132:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
+133:             <span class="ruby-comment cmt"># figure out the lengths of the display as strings, we'll use</span>
+134:             <span class="ruby-comment cmt"># it later to correctly justify the output</span>
+135:             <span class="ruby-identifier">lengths</span> = <span class="ruby-identifier">result</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span>
+136:               <span class="ruby-keyword kw">begin</span>
+137:                 <span class="ruby-identifier">ddl</span>[<span class="ruby-identifier">:output</span>][<span class="ruby-identifier">k</span>][<span class="ruby-identifier">:display_as</span>].<span class="ruby-identifier">size</span>
+138:               <span class="ruby-keyword kw">rescue</span>
+139:                 <span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">size</span>
+140:               <span class="ruby-keyword kw">end</span>
+141:             <span class="ruby-keyword kw">end</span>
+142: 
+143:             <span class="ruby-identifier">result</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">sort_by</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">k</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>
+144:               <span class="ruby-comment cmt"># get all the output fields nicely lined up with a</span>
+145:               <span class="ruby-comment cmt"># 3 space front padding</span>
+146:               <span class="ruby-keyword kw">begin</span>
+147:                 <span class="ruby-identifier">display_as</span> = <span class="ruby-identifier">ddl</span>[<span class="ruby-identifier">:output</span>][<span class="ruby-identifier">k</span>][<span class="ruby-identifier">:display_as</span>]
+148:               <span class="ruby-keyword kw">rescue</span>
+149:                 <span class="ruby-identifier">display_as</span> = <span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_s</span>
+150:               <span class="ruby-keyword kw">end</span>
+151: 
+152:               <span class="ruby-identifier">display_length</span> = <span class="ruby-identifier">display_as</span>.<span class="ruby-identifier">size</span>
+153:               <span class="ruby-identifier">padding</span> = <span class="ruby-identifier">lengths</span>.<span class="ruby-identifier">max</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">display_length</span> <span class="ruby-operator">+</span> <span class="ruby-value">3</span>
+154:               <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; &quot;</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">padding</span>
+155: 
+156:               <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{display_as}:&quot;</span>
+157: 
+158:               <span class="ruby-keyword kw">if</span> [<span class="ruby-constant">String</span>, <span class="ruby-constant">Numeric</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">result</span>[<span class="ruby-identifier">k</span>].<span class="ruby-identifier">class</span>)
+159:                 <span class="ruby-identifier">lines</span> = <span class="ruby-identifier">result</span>[<span class="ruby-identifier">k</span>].<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
+160: 
+161:                 <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">empty?</span>
+162:                   <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n&quot;</span>
+163:                 <span class="ruby-keyword kw">else</span>
+164:                   <span class="ruby-identifier">lines</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">line</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
+165:                     <span class="ruby-identifier">i</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">padtxt</span> = <span class="ruby-value str">&quot; &quot;</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">padtxt</span> = <span class="ruby-value str">&quot; &quot;</span> <span class="ruby-operator">*</span> (<span class="ruby-identifier">padding</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">display_length</span> <span class="ruby-operator">+</span> <span class="ruby-value">2</span>)
+166: 
+167:                     <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{padtxt}#{line}\n&quot;</span>
+168:                   <span class="ruby-keyword kw">end</span>
+169:                 <span class="ruby-keyword kw">end</span>
+170:               <span class="ruby-keyword kw">else</span>
+171:                 <span class="ruby-identifier">padding</span> = <span class="ruby-value str">&quot; &quot;</span> <span class="ruby-operator">*</span> (<span class="ruby-identifier">lengths</span>.<span class="ruby-identifier">max</span> <span class="ruby-operator">+</span> <span class="ruby-value">5</span>)
+172:                 <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; &quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">result</span>[<span class="ruby-identifier">k</span>].<span class="ruby-identifier">pretty_inspect</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;\n&quot;</span>).<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">padding</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n&quot;</span>
+173:               <span class="ruby-keyword kw">end</span>
+174:             <span class="ruby-keyword kw">end</span>
+175:           <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
+176:             <span class="ruby-comment cmt"># for status 1 we dont want to show half baked</span>
+177:             <span class="ruby-comment cmt"># data by default since the DDL will supply all the defaults</span>
+178:             <span class="ruby-comment cmt"># it just doesnt look right</span>
+179:           <span class="ruby-keyword kw">else</span>
+180:             <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n\t&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">pretty_inspect</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;\n&quot;</span>).<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n\t&quot;</span>)
+181:           <span class="ruby-keyword kw">end</span>
+182:         <span class="ruby-keyword kw">end</span>
+183: 
+184:         <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n&quot;</span>
+185:         <span class="ruby-identifier">result_text</span>
+186:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/RPC/Progress.html b/doc/classes/MCollective/RPC/Progress.html
new file mode 100644 (file)
index 0000000..12910d0
--- /dev/null
@@ -0,0 +1,230 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::RPC::Progress</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::RPC::Progress</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/rpc/progress_rb.html">
+                lib/mcollective/rpc/progress.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+Class that shows a progress bar, currently only supports a twirling
+progress bar.
+</p>
+<p>
+You can specify a size for the progress bar if you want if you dont it will
+use the helper functions to figure out terminal dimensions and draw an
+appropriately sized bar
+</p>
+<p>
+p = <a href="Progress.html#M000051">Progress.new</a> 100.times {|i| print
+p.twirl(i+1, 100) + &quot;\r&quot;};puts
+</p>
+<pre>
+ * [ ==================================================&gt; ] 100 / 100
+</pre>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000051">new</a>&nbsp;&nbsp;
+      <a href="#M000052">twirl</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000051" class="method-detail">
+        <a name="M000051"></a>
+
+        <div class="method-heading">
+          <a href="#M000051" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(size=nil)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000051-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/progress.rb, line 15</span>
+15:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">size</span>=<span class="ruby-keyword kw">nil</span>)
+16:         <span class="ruby-ivar">@twirl</span> = [<span class="ruby-value str">'|'</span>, <span class="ruby-value str">'/'</span>, <span class="ruby-value str">'-'</span>, <span class="ruby-value str">&quot;\\&quot;</span>, <span class="ruby-value str">'|'</span>, <span class="ruby-value str">'/'</span>, <span class="ruby-value str">'-'</span>, <span class="ruby-value str">&quot;\\&quot;</span>]
+17:         <span class="ruby-ivar">@twirldex</span> = <span class="ruby-value">0</span>
+18: 
+19:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">size</span>
+20:           <span class="ruby-ivar">@size</span> = <span class="ruby-identifier">size</span>
+21:         <span class="ruby-keyword kw">else</span>
+22:           <span class="ruby-identifier">cols</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">terminal_dimensions</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">-</span> <span class="ruby-value">22</span>
+23: 
+24:           <span class="ruby-comment cmt"># Defaults back to old behavior if it</span>
+25:           <span class="ruby-comment cmt"># couldn't figure out the size or if</span>
+26:           <span class="ruby-comment cmt"># its more than 60 wide</span>
+27:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cols</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-value">0</span>
+28:             <span class="ruby-ivar">@size</span> = <span class="ruby-value">0</span>
+29:           <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">cols</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">60</span>
+30:             <span class="ruby-ivar">@size</span> = <span class="ruby-value">60</span>
+31:           <span class="ruby-keyword kw">else</span>
+32:             <span class="ruby-ivar">@size</span> = <span class="ruby-identifier">cols</span>
+33:           <span class="ruby-keyword kw">end</span>
+34:         <span class="ruby-keyword kw">end</span>
+35:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000052" class="method-detail">
+        <a name="M000052"></a>
+
+        <div class="method-heading">
+          <a href="#M000052" class="method-signature">
+          <span class="method-name">twirl</span><span class="method-args">(current, total)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000052-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000052-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/progress.rb, line 37</span>
+37:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">twirl</span>(<span class="ruby-identifier">current</span>, <span class="ruby-identifier">total</span>)
+38:         <span class="ruby-comment cmt"># if the size is negative there is just not enough</span>
+39:         <span class="ruby-comment cmt"># space on the terminal, return a simpler version</span>
+40:         <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;\r#{current} / #{total}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@size</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
+41: 
+42:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">current</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">total</span>
+43:           <span class="ruby-identifier">txt</span> = <span class="ruby-value str">&quot;\r %s [ &quot;</span> <span class="ruby-operator">%</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:green</span>, <span class="ruby-value str">&quot;*&quot;</span>)
+44:         <span class="ruby-keyword kw">else</span>
+45:           <span class="ruby-identifier">txt</span> = <span class="ruby-value str">&quot;\r %s [ &quot;</span> <span class="ruby-operator">%</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:red</span>, <span class="ruby-ivar">@twirl</span>[<span class="ruby-ivar">@twirldex</span>])
+46:         <span class="ruby-keyword kw">end</span>
+47: 
+48:         <span class="ruby-identifier">dashes</span> = ((<span class="ruby-identifier">current</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-identifier">total</span>) <span class="ruby-operator">*</span> <span class="ruby-ivar">@size</span>).<span class="ruby-identifier">round</span>
+49: 
+50:         <span class="ruby-identifier">dashes</span>.<span class="ruby-identifier">times</span> { <span class="ruby-identifier">txt</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;=&quot;</span> }
+51:         <span class="ruby-identifier">txt</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&gt;&quot;</span>
+52: 
+53:         (<span class="ruby-ivar">@size</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">dashes</span>).<span class="ruby-identifier">times</span> { <span class="ruby-identifier">txt</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; &quot;</span> }
+54: 
+55:         <span class="ruby-identifier">txt</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; ] #{current} / #{total}&quot;</span>
+56: 
+57:         <span class="ruby-ivar">@twirldex</span> <span class="ruby-operator">==</span> <span class="ruby-value">7</span> <span class="ruby-operator">?</span> <span class="ruby-ivar">@twirldex</span> = <span class="ruby-value">0</span> <span class="ruby-operator">:</span> <span class="ruby-ivar">@twirldex</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+58: 
+59:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">txt</span>
+60:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/RPC/Reply.html b/doc/classes/MCollective/RPC/Reply.html
new file mode 100644 (file)
index 0000000..6361f7e
--- /dev/null
@@ -0,0 +1,404 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::RPC::Reply</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::RPC::Reply</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/rpc/reply_rb.html">
+                lib/mcollective/rpc/reply.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+Simple class to manage compliant replies to <a
+href="../RPC.html">MCollective::RPC</a>
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000077">[]</a>&nbsp;&nbsp;
+      <a href="#M000076">[]=</a>&nbsp;&nbsp;
+      <a href="#M000074">fail</a>&nbsp;&nbsp;
+      <a href="#M000075">fail!</a>&nbsp;&nbsp;
+      <a href="#M000078">fetch</a>&nbsp;&nbsp;
+      <a href="#M000073">initialize_data</a>&nbsp;&nbsp;
+      <a href="#M000072">new</a>&nbsp;&nbsp;
+      <a href="#M000079">to_hash</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">data</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">statuscode</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">statusmsg</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000072" class="method-detail">
+        <a name="M000072"></a>
+
+        <div class="method-heading">
+          <a href="#M000072" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(action, ddl)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000072-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000072-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/reply.rb, line 7</span>
+ 7:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">ddl</span>)
+ 8:         <span class="ruby-ivar">@data</span> = {}
+ 9:         <span class="ruby-ivar">@statuscode</span> = <span class="ruby-value">0</span>
+10:         <span class="ruby-ivar">@statusmsg</span> = <span class="ruby-value str">&quot;OK&quot;</span>
+11:         <span class="ruby-ivar">@ddl</span> = <span class="ruby-identifier">ddl</span>
+12:         <span class="ruby-ivar">@action</span> = <span class="ruby-identifier">action</span>
+13: 
+14:         <span class="ruby-keyword kw">begin</span>
+15:           <span class="ruby-identifier">initialize_data</span>
+16:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+17:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">warn</span>(<span class="ruby-value str">&quot;Could not pre-populate reply data from the DDL: %s: %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">e</span>.<span class="ruby-identifier">class</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span> ])
+18:         <span class="ruby-keyword kw">end</span>
+19:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000077" class="method-detail">
+        <a name="M000077"></a>
+
+        <div class="method-heading">
+          <a href="#M000077" class="method-signature">
+          <span class="method-name">[]</span><span class="method-args">(key)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Read from the data hash
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000077-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000077-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/reply.rb, line 70</span>
+70:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">key</span>)
+71:         <span class="ruby-ivar">@data</span>[<span class="ruby-identifier">key</span>]
+72:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000076" class="method-detail">
+        <a name="M000076"></a>
+
+        <div class="method-heading">
+          <a href="#M000076" class="method-signature">
+          <span class="method-name">[]=</span><span class="method-args">(key, val)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Write to the data hash
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000076-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000076-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/reply.rb, line 65</span>
+65:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>)
+66:         <span class="ruby-ivar">@data</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">val</span>
+67:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000074" class="method-detail">
+        <a name="M000074"></a>
+
+        <div class="method-heading">
+          <a href="#M000074" class="method-signature">
+          <span class="method-name">fail</span><span class="method-args">(msg, code=1)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Helper to fill in statusmsg and code on failure
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000074-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000074-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/reply.rb, line 36</span>
+36:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fail</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">code</span>=<span class="ruby-value">1</span>)
+37:         <span class="ruby-ivar">@statusmsg</span> = <span class="ruby-identifier">msg</span>
+38:         <span class="ruby-ivar">@statuscode</span> = <span class="ruby-identifier">code</span>
+39:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000075" class="method-detail">
+        <a name="M000075"></a>
+
+        <div class="method-heading">
+          <a href="#M000075" class="method-signature">
+          <span class="method-name">fail!</span><span class="method-args">(msg, code=1)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Helper that fills in statusmsg and code but also raises an appropriate
+error
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000075-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000075-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/reply.rb, line 42</span>
+42:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fail!</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">code</span>=<span class="ruby-value">1</span>)
+43:         <span class="ruby-ivar">@statusmsg</span> = <span class="ruby-identifier">msg</span>
+44:         <span class="ruby-ivar">@statuscode</span> = <span class="ruby-identifier">code</span>
+45: 
+46:         <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">code</span>
+47:           <span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span>
+48:             <span class="ruby-identifier">raise</span> <span class="ruby-constant">RPCAborted</span>, <span class="ruby-identifier">msg</span>
+49: 
+50:           <span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span>
+51:             <span class="ruby-identifier">raise</span> <span class="ruby-constant">UnknownRPCAction</span>, <span class="ruby-identifier">msg</span>
+52: 
+53:           <span class="ruby-keyword kw">when</span> <span class="ruby-value">3</span>
+54:             <span class="ruby-identifier">raise</span> <span class="ruby-constant">MissingRPCData</span>, <span class="ruby-identifier">msg</span>
+55: 
+56:           <span class="ruby-keyword kw">when</span> <span class="ruby-value">4</span>
+57:             <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRPCData</span>, <span class="ruby-identifier">msg</span>
+58: 
+59:           <span class="ruby-keyword kw">else</span>
+60:             <span class="ruby-identifier">raise</span> <span class="ruby-constant">UnknownRPCError</span>, <span class="ruby-identifier">msg</span>
+61:         <span class="ruby-keyword kw">end</span>
+62:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000078" class="method-detail">
+        <a name="M000078"></a>
+
+        <div class="method-heading">
+          <a href="#M000078" class="method-signature">
+          <span class="method-name">fetch</span><span class="method-args">(key, default)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000078-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000078-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/reply.rb, line 74</span>
+74:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">default</span>)
+75:         <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">default</span>)
+76:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000073" class="method-detail">
+        <a name="M000073"></a>
+
+        <div class="method-heading">
+          <a href="#M000073" class="method-signature">
+          <span class="method-name">initialize_data</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000073-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/reply.rb, line 21</span>
+21:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize_data</span>
+22:         <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">actions</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-ivar">@action</span>)
+23:           <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;No action '%s' defined for agent '%s' in the DDL&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-ivar">@action</span>, <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">pluginname</span>]
+24:         <span class="ruby-keyword kw">end</span>
+25: 
+26:         <span class="ruby-identifier">interface</span> = <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">action_interface</span>(<span class="ruby-ivar">@action</span>)
+27: 
+28:         <span class="ruby-identifier">interface</span>[<span class="ruby-identifier">:output</span>].<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">output</span><span class="ruby-operator">|</span>
+29:           <span class="ruby-comment cmt"># must deep clone this data to avoid accidental updates of the DDL in cases where the</span>
+30:           <span class="ruby-comment cmt"># default is for example a string and someone does &lt;&lt; on it</span>
+31:           <span class="ruby-ivar">@data</span>[<span class="ruby-identifier">output</span>] = <span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">load</span>(<span class="ruby-constant">Marshal</span>.<span class="ruby-identifier">dump</span>(<span class="ruby-identifier">interface</span>[<span class="ruby-identifier">:output</span>][<span class="ruby-identifier">output</span>].<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">:default</span>, <span class="ruby-keyword kw">nil</span>)))
+32:         <span class="ruby-keyword kw">end</span>
+33:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000079" class="method-detail">
+        <a name="M000079"></a>
+
+        <div class="method-heading">
+          <a href="#M000079" class="method-signature">
+          <span class="method-name">to_hash</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns a compliant Hash of the reply that should be sent over the
+middleware
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000079-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000079-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/reply.rb, line 80</span>
+80:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_hash</span>
+81:         <span class="ruby-keyword kw">return</span> {<span class="ruby-identifier">:statuscode</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@statuscode</span>,
+82:                 <span class="ruby-identifier">:statusmsg</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@statusmsg</span>,
+83:                 <span class="ruby-identifier">:data</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@data</span>}
+84:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/RPC/Request.html b/doc/classes/MCollective/RPC/Request.html
new file mode 100644 (file)
index 0000000..e182884
--- /dev/null
@@ -0,0 +1,401 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::RPC::Request</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::RPC::Request</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/rpc/request_rb.html">
+                lib/mcollective/rpc/request.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+Simple class to manage compliant requests for <a
+href="../RPC.html">MCollective::RPC</a> agents
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000138">[]</a>&nbsp;&nbsp;
+      <a href="#M000139">fetch</a>&nbsp;&nbsp;
+      <a href="#M000136">include?</a>&nbsp;&nbsp;
+      <a href="#M000135">new</a>&nbsp;&nbsp;
+      <a href="#M000137">should_respond?</a>&nbsp;&nbsp;
+      <a href="#M000140">to_hash</a>&nbsp;&nbsp;
+      <a href="#M000142">to_json</a>&nbsp;&nbsp;
+      <a href="#M000141">validate!</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">action</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">agent</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">caller</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">data</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">ddl</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">sender</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">time</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">uniqid</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000135" class="method-detail">
+        <a name="M000135"></a>
+
+        <div class="method-heading">
+          <a href="#M000135" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(msg, ddl)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000135-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000135-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/request.rb, line 7</span>
+ 7:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">ddl</span>)
+ 8:         <span class="ruby-ivar">@time</span> = <span class="ruby-identifier">msg</span>[<span class="ruby-identifier">:msgtime</span>]
+ 9:         <span class="ruby-ivar">@action</span> = <span class="ruby-identifier">msg</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:action</span>]
+10:         <span class="ruby-ivar">@data</span> = <span class="ruby-identifier">msg</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:data</span>]
+11:         <span class="ruby-ivar">@sender</span> = <span class="ruby-identifier">msg</span>[<span class="ruby-identifier">:senderid</span>]
+12:         <span class="ruby-ivar">@agent</span> = <span class="ruby-identifier">msg</span>[<span class="ruby-identifier">:body</span>][<span class="ruby-identifier">:agent</span>]
+13:         <span class="ruby-ivar">@uniqid</span> = <span class="ruby-identifier">msg</span>[<span class="ruby-identifier">:requestid</span>]
+14:         <span class="ruby-ivar">@caller</span> = <span class="ruby-identifier">msg</span>[<span class="ruby-identifier">:callerid</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;unknown&quot;</span>
+15:         <span class="ruby-ivar">@ddl</span> = <span class="ruby-identifier">ddl</span>
+16:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000138" class="method-detail">
+        <a name="M000138"></a>
+
+        <div class="method-heading">
+          <a href="#M000138" class="method-signature">
+          <span class="method-name">[]</span><span class="method-args">(key)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+If data is a hash, gives easy access to its members, else returns nil
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000138-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000138-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/request.rb, line 34</span>
+34:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">key</span>)
+35:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
+36:         <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@data</span>[<span class="ruby-identifier">key</span>]
+37:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000139" class="method-detail">
+        <a name="M000139"></a>
+
+        <div class="method-heading">
+          <a href="#M000139" class="method-signature">
+          <span class="method-name">fetch</span><span class="method-args">(key, default)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000139-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000139-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/request.rb, line 39</span>
+39:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">default</span>)
+40:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
+41:         <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">default</span>)
+42:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000136" class="method-detail">
+        <a name="M000136"></a>
+
+        <div class="method-heading">
+          <a href="#M000136" class="method-signature">
+          <span class="method-name">include?</span><span class="method-args">(key)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+If data is a hash, quick helper to get access to it&#8216;s <a
+href="Request.html#M000136">include?</a> method else returns false
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000136-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000136-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/request.rb, line 20</span>
+20:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>)
+21:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
+22:         <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>)
+23:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000137" class="method-detail">
+        <a name="M000137"></a>
+
+        <div class="method-heading">
+          <a href="#M000137" class="method-signature">
+          <span class="method-name">should_respond?</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+If no :process_results is specified always respond else respond based on
+the supplied property
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000137-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000137-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/request.rb, line 27</span>
+27:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">should_respond?</span>
+28:         <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@data</span>[<span class="ruby-identifier">:process_results</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@data</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:process_results</span>)
+29: 
+30:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
+31:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000140" class="method-detail">
+        <a name="M000140"></a>
+
+        <div class="method-heading">
+          <a href="#M000140" class="method-signature">
+          <span class="method-name">to_hash</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000140-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000140-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/request.rb, line 44</span>
+44:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_hash</span>
+45:         <span class="ruby-keyword kw">return</span> {<span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@agent</span>,
+46:                 <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@action</span>,
+47:                 <span class="ruby-identifier">:data</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@data</span>}
+48:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000142" class="method-detail">
+        <a name="M000142"></a>
+
+        <div class="method-heading">
+          <a href="#M000142" class="method-signature">
+          <span class="method-name">to_json</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000142-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000142-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/request.rb, line 55</span>
+55:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_json</span>
+56:         <span class="ruby-identifier">to_hash</span>.<span class="ruby-identifier">merge!</span>({<span class="ruby-identifier">:sender</span>   =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@sender</span>,
+57:                         <span class="ruby-identifier">:callerid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@callerid</span>,
+58:                         <span class="ruby-identifier">:uniqid</span>   =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@uniqid</span>}).<span class="ruby-identifier">to_json</span>
+59:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000141" class="method-detail">
+        <a name="M000141"></a>
+
+        <div class="method-heading">
+          <a href="#M000141" class="method-signature">
+          <span class="method-name">validate!</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Validate the request against the <a href="../DDL.html">DDL</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000141-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000141-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/request.rb, line 51</span>
+51:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate!</span>
+52:         <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">validate_rpc_request</span>(<span class="ruby-ivar">@action</span>, <span class="ruby-ivar">@data</span>)
+53:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/RPC/Result.html b/doc/classes/MCollective/RPC/Result.html
new file mode 100644 (file)
index 0000000..225f3c8
--- /dev/null
@@ -0,0 +1,317 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::RPC::Result</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::RPC::Result</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/rpc/result_rb.html">
+                lib/mcollective/rpc/result.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+Simple class to manage compliant results from <a
+href="../RPC.html">MCollective::RPC</a> agents
+</p>
+<p>
+Currently it just fakes Hash behaviour to the result to remain backward
+compatible but it also knows which agent and action produced it so you can
+associate results to a <a href="../DDL.html">DDL</a>
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000054">[]</a>&nbsp;&nbsp;
+      <a href="#M000055">[]=</a>&nbsp;&nbsp;
+      <a href="#M000057">each</a>&nbsp;&nbsp;
+      <a href="#M000056">fetch</a>&nbsp;&nbsp;
+      <a href="#M000053">new</a>&nbsp;&nbsp;
+      <a href="#M000058">to_json</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+    <div id="includes">
+      <h3 class="section-bar">Included Modules</h3>
+
+      <div id="includes-list">
+        <span class="include-name">Enumerable</span>
+      </div>
+    </div>
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">action</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">agent</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">results</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000053" class="method-detail">
+        <a name="M000053"></a>
+
+        <div class="method-heading">
+          <a href="#M000053" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(agent, action, result={})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000053-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/result.rb, line 13</span>
+13:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">action</span>, <span class="ruby-identifier">result</span>={})
+14:         <span class="ruby-ivar">@agent</span> = <span class="ruby-identifier">agent</span>
+15:         <span class="ruby-ivar">@action</span> = <span class="ruby-identifier">action</span>
+16:         <span class="ruby-ivar">@results</span> = <span class="ruby-identifier">result</span>
+17:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000054" class="method-detail">
+        <a name="M000054"></a>
+
+        <div class="method-heading">
+          <a href="#M000054" class="method-signature">
+          <span class="method-name">[]</span><span class="method-args">(idx)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000054-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/result.rb, line 19</span>
+19:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">idx</span>)
+20:         <span class="ruby-ivar">@results</span>[<span class="ruby-identifier">idx</span>]
+21:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000055" class="method-detail">
+        <a name="M000055"></a>
+
+        <div class="method-heading">
+          <a href="#M000055" class="method-signature">
+          <span class="method-name">[]=</span><span class="method-args">(idx, item)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000055-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/result.rb, line 23</span>
+23:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-identifier">idx</span>, <span class="ruby-identifier">item</span>)
+24:         <span class="ruby-ivar">@results</span>[<span class="ruby-identifier">idx</span>] = <span class="ruby-identifier">item</span>
+25:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000057" class="method-detail">
+        <a name="M000057"></a>
+
+        <div class="method-heading">
+          <a href="#M000057" class="method-signature">
+          <span class="method-name">each</span><span class="method-args">() {|k,v| ...}</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000057-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/result.rb, line 31</span>
+31:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each</span>
+32:         <span class="ruby-ivar">@results</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-keyword kw">yield</span>(<span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span>) }
+33:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000056" class="method-detail">
+        <a name="M000056"></a>
+
+        <div class="method-heading">
+          <a href="#M000056" class="method-signature">
+          <span class="method-name">fetch</span><span class="method-args">(key, default)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000056-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/result.rb, line 27</span>
+27:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">default</span>)
+28:         <span class="ruby-ivar">@results</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">default</span>)
+29:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000058" class="method-detail">
+        <a name="M000058"></a>
+
+        <div class="method-heading">
+          <a href="#M000058" class="method-signature">
+          <span class="method-name">to_json</span><span class="method-args">(*a)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000058-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/result.rb, line 35</span>
+35:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_json</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">a</span>)
+36:         {<span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@agent</span>,
+37:          <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@action</span>,
+38:          <span class="ruby-identifier">:sender</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@results</span>[<span class="ruby-identifier">:sender</span>],
+39:          <span class="ruby-identifier">:statuscode</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@results</span>[<span class="ruby-identifier">:statuscode</span>],
+40:          <span class="ruby-identifier">:statusmsg</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@results</span>[<span class="ruby-identifier">:statusmsg</span>],
+41:          <span class="ruby-identifier">:data</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@results</span>[<span class="ruby-identifier">:data</span>]}.<span class="ruby-identifier">to_json</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">a</span>)
+42:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/RPC/Stats.html b/doc/classes/MCollective/RPC/Stats.html
new file mode 100644 (file)
index 0000000..8f4522d
--- /dev/null
@@ -0,0 +1,789 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::RPC::Stats</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::RPC::Stats</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/rpc/stats_rb.html">
+                lib/mcollective/rpc/stats.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+Class to wrap all the stats and to keep track of some timings
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000123">[]</a>&nbsp;&nbsp;
+      <a href="#M000126">client_stats=</a>&nbsp;&nbsp;
+      <a href="#M000129">discovered_agents</a>&nbsp;&nbsp;
+      <a href="#M000125">fail</a>&nbsp;&nbsp;
+      <a href="#M000130">finish_request</a>&nbsp;&nbsp;
+      <a href="#M000120">new</a>&nbsp;&nbsp;
+      <a href="#M000134">no_response_report</a>&nbsp;&nbsp;
+      <a href="#M000131">node_responded</a>&nbsp;&nbsp;
+      <a href="#M000124">ok</a>&nbsp;&nbsp;
+      <a href="#M000133">report</a>&nbsp;&nbsp;
+      <a href="#M000121">reset</a>&nbsp;&nbsp;
+      <a href="#M000132">text_for_aggregates</a>&nbsp;&nbsp;
+      <a href="#M000128">time_block_execution</a>&nbsp;&nbsp;
+      <a href="#M000127">time_discovery</a>&nbsp;&nbsp;
+      <a href="#M000122">to_hash</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">aggregate_failures</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">aggregate_summary</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">blocktime</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">ddl</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">discovered</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">discovered_nodes</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">discoverytime</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">failcount</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">noresponsefrom</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">noresponsefrom</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">okcount</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">requestid</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">responses</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">responsesfrom</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">starttime</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">totaltime</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000120" class="method-detail">
+        <a name="M000120"></a>
+
+        <div class="method-heading">
+          <a href="#M000120" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000120-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000120-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/stats.rb, line 9</span>
+ 9:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
+10:         <span class="ruby-identifier">reset</span>
+11:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000123" class="method-detail">
+        <a name="M000123"></a>
+
+        <div class="method-heading">
+          <a href="#M000123" class="method-signature">
+          <span class="method-name">[]</span><span class="method-args">(key)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Fake hash access to keep things backward compatible
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000123-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000123-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/stats.rb, line 51</span>
+51:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">key</span>)
+52:         <span class="ruby-identifier">to_hash</span>[<span class="ruby-identifier">key</span>]
+53:       <span class="ruby-keyword kw">rescue</span>
+54:         <span class="ruby-keyword kw">nil</span>
+55:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000126" class="method-detail">
+        <a name="M000126"></a>
+
+        <div class="method-heading">
+          <a href="#M000126" class="method-signature">
+          <span class="method-name">client_stats=</span><span class="method-args">(stats)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Re-initializes the object with stats from the basic client
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000126-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000126-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/stats.rb, line 72</span>
+72:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">client_stats=</span>(<span class="ruby-identifier">stats</span>)
+73:         <span class="ruby-ivar">@noresponsefrom</span> = <span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:noresponsefrom</span>]
+74:         <span class="ruby-ivar">@responses</span> = <span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:responses</span>]
+75:         <span class="ruby-ivar">@starttime</span> = <span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:starttime</span>]
+76:         <span class="ruby-ivar">@blocktime</span> = <span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:blocktime</span>]
+77:         <span class="ruby-ivar">@totaltime</span> = <span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:totaltime</span>]
+78:         <span class="ruby-ivar">@requestid</span> = <span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:requestid</span>]
+79:         <span class="ruby-ivar">@discoverytime</span> = <span class="ruby-identifier">stats</span>[<span class="ruby-identifier">:discoverytime</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@discoverytime</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
+80:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000129" class="method-detail">
+        <a name="M000129"></a>
+
+        <div class="method-heading">
+          <a href="#M000129" class="method-signature">
+          <span class="method-name">discovered_agents</span><span class="method-args">(agents)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Update discovered and discovered_nodes based on discovery results
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000129-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000129-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/stats.rb, line 110</span>
+110:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">discovered_agents</span>(<span class="ruby-identifier">agents</span>)
+111:         <span class="ruby-ivar">@discovered_nodes</span> = <span class="ruby-identifier">agents</span>
+112:         <span class="ruby-ivar">@discovered</span> = <span class="ruby-identifier">agents</span>.<span class="ruby-identifier">size</span>
+113:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000125" class="method-detail">
+        <a name="M000125"></a>
+
+        <div class="method-heading">
+          <a href="#M000125" class="method-signature">
+          <span class="method-name">fail</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+increment the count of failed hosts
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000125-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000125-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/stats.rb, line 65</span>
+65:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fail</span>
+66:         <span class="ruby-ivar">@failcount</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+67:       <span class="ruby-keyword kw">rescue</span>
+68:         <span class="ruby-ivar">@failcount</span> = <span class="ruby-value">1</span>
+69:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000130" class="method-detail">
+        <a name="M000130"></a>
+
+        <div class="method-heading">
+          <a href="#M000130" class="method-signature">
+          <span class="method-name">finish_request</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Helper to calculate total time etc
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000130-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000130-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/stats.rb, line 116</span>
+116:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">finish_request</span>
+117:         <span class="ruby-ivar">@totaltime</span> = <span class="ruby-ivar">@blocktime</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@discoverytime</span>
+118: 
+119:         <span class="ruby-comment cmt"># figures out who we had no responses from</span>
+120:         <span class="ruby-identifier">dhosts</span> = <span class="ruby-ivar">@discovered_nodes</span>.<span class="ruby-identifier">clone</span>
+121:         <span class="ruby-ivar">@responsesfrom</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span> <span class="ruby-identifier">dhosts</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">r</span>)}
+122:         <span class="ruby-ivar">@noresponsefrom</span> = <span class="ruby-identifier">dhosts</span>
+123:       <span class="ruby-keyword kw">rescue</span>
+124:         <span class="ruby-ivar">@totaltime</span> = <span class="ruby-value">0</span>
+125:         <span class="ruby-ivar">@noresponsefrom</span> = []
+126:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000134" class="method-detail">
+        <a name="M000134"></a>
+
+        <div class="method-heading">
+          <a href="#M000134" class="method-signature">
+          <span class="method-name">no_response_report</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns a blob of text indicating what nodes did not respond
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000134-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000134-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/stats.rb, line 237</span>
+237:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">no_response_report</span>
+238:         <span class="ruby-identifier">result_text</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>
+239: 
+240:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@noresponsefrom</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
+241:           <span class="ruby-identifier">result_text</span>.<span class="ruby-identifier">puts</span>
+242:           <span class="ruby-identifier">result_text</span>.<span class="ruby-identifier">puts</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:red</span>, <span class="ruby-value str">&quot;No response from:&quot;</span>)
+243:           <span class="ruby-identifier">result_text</span>.<span class="ruby-identifier">puts</span>
+244: 
+245:           <span class="ruby-ivar">@noresponsefrom</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">in_groups_of</span>(<span class="ruby-value">3</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
+246:             <span class="ruby-identifier">result_text</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;   %-30s%-30s%-30s&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">c</span>
+247:           <span class="ruby-keyword kw">end</span>
+248: 
+249:           <span class="ruby-identifier">result_text</span>.<span class="ruby-identifier">puts</span>
+250:         <span class="ruby-keyword kw">end</span>
+251: 
+252:         <span class="ruby-identifier">result_text</span>.<span class="ruby-identifier">string</span>
+253:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000131" class="method-detail">
+        <a name="M000131"></a>
+
+        <div class="method-heading">
+          <a href="#M000131" class="method-signature">
+          <span class="method-name">node_responded</span><span class="method-args">(node)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Helper to keep track of who we received responses from
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000131-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000131-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/stats.rb, line 129</span>
+129:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">node_responded</span>(<span class="ruby-identifier">node</span>)
+130:         <span class="ruby-ivar">@responsesfrom</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">node</span>
+131:       <span class="ruby-keyword kw">rescue</span>
+132:         <span class="ruby-ivar">@responsesfrom</span> = [<span class="ruby-identifier">node</span>]
+133:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000124" class="method-detail">
+        <a name="M000124"></a>
+
+        <div class="method-heading">
+          <a href="#M000124" class="method-signature">
+          <span class="method-name">ok</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+increment the count of <a href="Stats.html#M000124">ok</a> hosts
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000124-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000124-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/stats.rb, line 58</span>
+58:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ok</span>
+59:         <span class="ruby-ivar">@okcount</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+60:       <span class="ruby-keyword kw">rescue</span>
+61:         <span class="ruby-ivar">@okcount</span> = <span class="ruby-value">1</span>
+62:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000133" class="method-detail">
+        <a name="M000133"></a>
+
+        <div class="method-heading">
+          <a href="#M000133" class="method-signature">
+          <span class="method-name">report</span><span class="method-args">(caption = &quot;rpc stats&quot;, summarize = true, verbose = false)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns a blob of text representing the request status based on the stats
+contained in this class
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000133-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000133-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/stats.rb, line 187</span>
+187:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">report</span>(<span class="ruby-identifier">caption</span> = <span class="ruby-value str">&quot;rpc stats&quot;</span>, <span class="ruby-identifier">summarize</span> = <span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">verbose</span> = <span class="ruby-keyword kw">false</span>)
+188:         <span class="ruby-identifier">result_text</span> = []
+189: 
+190:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">verbose</span>
+191:             <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@aggregate_summary</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">summarize</span>
+192:               <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text_for_aggregates</span>
+193:             <span class="ruby-keyword kw">else</span>
+194:               <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&quot;</span>
+195:             <span class="ruby-keyword kw">end</span>
+196: 
+197:           <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:yellow</span>, <span class="ruby-node">&quot;---- #{caption} ----&quot;</span>)
+198: 
+199:           <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@discovered</span>
+200:             <span class="ruby-ivar">@responses</span> <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@discovered</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">color</span> = <span class="ruby-identifier">:red</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">color</span> = <span class="ruby-identifier">:reset</span>
+201:             <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;           Nodes: %s / %s&quot;</span> <span class="ruby-operator">%</span> [ <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">color</span>, <span class="ruby-ivar">@discovered</span>), <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">color</span>, <span class="ruby-ivar">@responses</span>) ]
+202:           <span class="ruby-keyword kw">else</span>
+203:             <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;           Nodes: #{@responses}&quot;</span>
+204:           <span class="ruby-keyword kw">end</span>
+205: 
+206:           <span class="ruby-ivar">@failcount</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">color</span> = <span class="ruby-identifier">:red</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">color</span> = <span class="ruby-identifier">:reset</span>
+207: 
+208:           <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;     Pass / Fail: %s / %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">color</span>, <span class="ruby-ivar">@okcount</span>), <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">color</span>, <span class="ruby-ivar">@failcount</span>) ]
+209:           <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;      Start Time: %s&quot;</span>      <span class="ruby-operator">%</span> [<span class="ruby-constant">Time</span>.<span class="ruby-identifier">at</span>(<span class="ruby-ivar">@starttime</span>)]
+210:           <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;  Discovery Time: %.2fms&quot;</span>  <span class="ruby-operator">%</span> [<span class="ruby-ivar">@discoverytime</span> <span class="ruby-operator">*</span> <span class="ruby-value">1000</span>]
+211:           <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;      Agent Time: %.2fms&quot;</span>  <span class="ruby-operator">%</span> [<span class="ruby-ivar">@blocktime</span> <span class="ruby-operator">*</span> <span class="ruby-value">1000</span>]
+212:           <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;      Total Time: %.2fms&quot;</span>  <span class="ruby-operator">%</span> [<span class="ruby-ivar">@totaltime</span> <span class="ruby-operator">*</span> <span class="ruby-value">1000</span>]
+213:         <span class="ruby-keyword kw">else</span>
+214:           <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@discovered</span>
+215:             <span class="ruby-ivar">@responses</span> <span class="ruby-operator">&lt;</span> <span class="ruby-ivar">@discovered</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">color</span> = <span class="ruby-identifier">:red</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">color</span> = <span class="ruby-identifier">:green</span>
+216: 
+217:             <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@aggregate_summary</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@aggregate_failures</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">summarize</span>
+218:               <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">text_for_aggregates</span>
+219:             <span class="ruby-keyword kw">else</span>
+220:               <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&quot;</span>
+221:             <span class="ruby-keyword kw">end</span>
+222: 
+223:             <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;Finished processing %s / %s hosts in %.2f ms&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">color</span>, <span class="ruby-ivar">@responses</span>), <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">color</span>, <span class="ruby-ivar">@discovered</span>), <span class="ruby-ivar">@blocktime</span> <span class="ruby-operator">*</span> <span class="ruby-value">1000</span>]
+224:           <span class="ruby-keyword kw">else</span>
+225:             <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;Finished processing %s hosts in %.2f ms&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:bold</span>, <span class="ruby-ivar">@responses</span>), <span class="ruby-ivar">@blocktime</span> <span class="ruby-operator">*</span> <span class="ruby-value">1000</span>]
+226:           <span class="ruby-keyword kw">end</span>
+227:         <span class="ruby-keyword kw">end</span>
+228: 
+229:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">no_response_report</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">&quot;&quot;</span>
+230:           <span class="ruby-identifier">result_text</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">no_response_report</span>
+231:         <span class="ruby-keyword kw">end</span>
+232: 
+233:         <span class="ruby-identifier">result_text</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
+234:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000121" class="method-detail">
+        <a name="M000121"></a>
+
+        <div class="method-heading">
+          <a href="#M000121" class="method-signature">
+          <span class="method-name">reset</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Resets stats, if discovery time is set we keep it as it was
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000121-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000121-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/stats.rb, line 14</span>
+14:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset</span>
+15:         <span class="ruby-ivar">@noresponsefrom</span> = []
+16:         <span class="ruby-ivar">@responsesfrom</span> = []
+17:         <span class="ruby-ivar">@responses</span> = <span class="ruby-value">0</span>
+18:         <span class="ruby-ivar">@starttime</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_f</span>
+19:         <span class="ruby-ivar">@discoverytime</span> = <span class="ruby-value">0</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@discoverytime</span>
+20:         <span class="ruby-ivar">@blocktime</span> = <span class="ruby-value">0</span>
+21:         <span class="ruby-ivar">@totaltime</span> = <span class="ruby-value">0</span>
+22:         <span class="ruby-ivar">@discovered</span> = <span class="ruby-value">0</span>
+23:         <span class="ruby-ivar">@discovered_nodes</span> = []
+24:         <span class="ruby-ivar">@okcount</span> = <span class="ruby-value">0</span>
+25:         <span class="ruby-ivar">@failcount</span> = <span class="ruby-value">0</span>
+26:         <span class="ruby-ivar">@noresponsefrom</span> = []
+27:         <span class="ruby-ivar">@requestid</span> = <span class="ruby-keyword kw">nil</span>
+28:         <span class="ruby-ivar">@aggregate_summary</span> = []
+29:         <span class="ruby-ivar">@aggregate_failures</span> = []
+30:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000132" class="method-detail">
+        <a name="M000132"></a>
+
+        <div class="method-heading">
+          <a href="#M000132" class="method-signature">
+          <span class="method-name">text_for_aggregates</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000132-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000132-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/stats.rb, line 135</span>
+135:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">text_for_aggregates</span>
+136:         <span class="ruby-identifier">result</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>
+137: 
+138:         <span class="ruby-ivar">@aggregate_summary</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">aggregate</span><span class="ruby-operator">|</span>
+139:           <span class="ruby-identifier">output_item</span> = <span class="ruby-identifier">aggregate</span>.<span class="ruby-identifier">result</span>[<span class="ruby-identifier">:output</span>]
+140: 
+141:           <span class="ruby-keyword kw">begin</span>
+142:             <span class="ruby-identifier">action_interface</span> = <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">action_interface</span>(<span class="ruby-identifier">aggregate</span>.<span class="ruby-identifier">action</span>)
+143:             <span class="ruby-identifier">display_as</span> = <span class="ruby-identifier">action_interface</span>[<span class="ruby-identifier">:output</span>][<span class="ruby-identifier">output_item</span>][<span class="ruby-identifier">:display_as</span>]
+144:           <span class="ruby-keyword kw">rescue</span>
+145:             <span class="ruby-identifier">display_as</span> = <span class="ruby-identifier">output_item</span>
+146:           <span class="ruby-keyword kw">end</span>
+147: 
+148:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aggregate</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Aggregate</span><span class="ruby-operator">::</span><span class="ruby-constant">Result</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>)
+149:             <span class="ruby-identifier">aggregate_report</span> = <span class="ruby-identifier">aggregate</span>.<span class="ruby-identifier">to_s</span>
+150:           <span class="ruby-keyword kw">else</span>
+151:             <span class="ruby-keyword kw">next</span>
+152:           <span class="ruby-keyword kw">end</span>
+153: 
+154:           <span class="ruby-identifier">result</span>.<span class="ruby-identifier">puts</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:bold</span>, <span class="ruby-value str">&quot;Summary of %s:&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">display_as</span>)
+155:           <span class="ruby-identifier">result</span>.<span class="ruby-identifier">puts</span>
+156:           <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">aggregate_report</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span>
+157:             <span class="ruby-identifier">result</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">aggregate</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;\n&quot;</span>).<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-value str">&quot;   &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">x</span>}.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
+158:           <span class="ruby-keyword kw">else</span>
+159:             <span class="ruby-identifier">result</span>.<span class="ruby-identifier">puts</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:yellow</span>, <span class="ruby-value str">&quot;     No aggregate summary could be computed&quot;</span>)
+160:           <span class="ruby-keyword kw">end</span>
+161:           <span class="ruby-identifier">result</span>.<span class="ruby-identifier">puts</span>
+162:         <span class="ruby-keyword kw">end</span>
+163: 
+164:         <span class="ruby-ivar">@aggregate_failures</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">failed</span><span class="ruby-operator">|</span>
+165:           <span class="ruby-keyword kw">case</span>(<span class="ruby-identifier">failed</span>[<span class="ruby-identifier">:type</span>])
+166:           <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:startup</span>
+167:             <span class="ruby-identifier">message</span> = <span class="ruby-value str">&quot;exception raised while processing startup hook&quot;</span>
+168:           <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:create</span>
+169:             <span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;unspecified output '#{failed[:name]}' for the action&quot;</span>
+170:           <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:process_result</span>
+171:             <span class="ruby-identifier">message</span> = <span class="ruby-value str">&quot;exception raised while processing result data&quot;</span>
+172:           <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:summarize</span>
+173:             <span class="ruby-identifier">message</span> = <span class="ruby-value str">&quot;exception raised while summarizing&quot;</span>
+174:           <span class="ruby-keyword kw">end</span>
+175: 
+176:           <span class="ruby-identifier">result</span>.<span class="ruby-identifier">puts</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:bold</span>, <span class="ruby-value str">&quot;Summary of %s:&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">failed</span>[<span class="ruby-identifier">:name</span>])
+177:           <span class="ruby-identifier">result</span>.<span class="ruby-identifier">puts</span>
+178:           <span class="ruby-identifier">result</span>.<span class="ruby-identifier">puts</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">:yellow</span>, <span class="ruby-value str">&quot;     Could not compute summary - %s&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">message</span>)
+179:           <span class="ruby-identifier">result</span>.<span class="ruby-identifier">puts</span>
+180:         <span class="ruby-keyword kw">end</span>
+181: 
+182:         <span class="ruby-identifier">result</span>.<span class="ruby-identifier">string</span>
+183:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000128" class="method-detail">
+        <a name="M000128"></a>
+
+        <div class="method-heading">
+          <a href="#M000128" class="method-signature">
+          <span class="method-name">time_block_execution</span><span class="method-args">(action)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+helper to time block execution time
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000128-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000128-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/stats.rb, line 96</span>
+ 96:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">time_block_execution</span>(<span class="ruby-identifier">action</span>)
+ 97:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">action</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:start</span>
+ 98:           <span class="ruby-ivar">@block_start</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_f</span>
+ 99:         <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">action</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:end</span>
+100:           <span class="ruby-ivar">@blocktime</span> <span class="ruby-operator">+=</span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@block_start</span>
+101:         <span class="ruby-keyword kw">else</span>
+102:           <span class="ruby-identifier">raise</span>(<span class="ruby-node">&quot;Uknown block action #{action}&quot;</span>)
+103:         <span class="ruby-keyword kw">end</span>
+104:       <span class="ruby-keyword kw">rescue</span>
+105:         <span class="ruby-ivar">@blocktime</span> = <span class="ruby-value">0</span>
+106:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000127" class="method-detail">
+        <a name="M000127"></a>
+
+        <div class="method-heading">
+          <a href="#M000127" class="method-signature">
+          <span class="method-name">time_discovery</span><span class="method-args">(action)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Utility to time discovery from :start to :end
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000127-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000127-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/stats.rb, line 83</span>
+83:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">time_discovery</span>(<span class="ruby-identifier">action</span>)
+84:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">action</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:start</span>
+85:           <span class="ruby-ivar">@discovery_start</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_f</span>
+86:         <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">action</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:end</span>
+87:           <span class="ruby-ivar">@discoverytime</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">-</span> <span class="ruby-ivar">@discovery_start</span>
+88:         <span class="ruby-keyword kw">else</span>
+89:           <span class="ruby-identifier">raise</span>(<span class="ruby-node">&quot;Uknown discovery action #{action}&quot;</span>)
+90:         <span class="ruby-keyword kw">end</span>
+91:       <span class="ruby-keyword kw">rescue</span>
+92:         <span class="ruby-ivar">@discoverytime</span> = <span class="ruby-value">0</span>
+93:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000122" class="method-detail">
+        <a name="M000122"></a>
+
+        <div class="method-heading">
+          <a href="#M000122" class="method-signature">
+          <span class="method-name">to_hash</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+returns a hash of our stats
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000122-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000122-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/stats.rb, line 33</span>
+33:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_hash</span>
+34:         {<span class="ruby-identifier">:noresponsefrom</span>    =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@noresponsefrom</span>,
+35:          <span class="ruby-identifier">:starttime</span>         =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@starttime</span>,
+36:          <span class="ruby-identifier">:discoverytime</span>     =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@discoverytime</span>,
+37:          <span class="ruby-identifier">:blocktime</span>         =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@blocktime</span>,
+38:          <span class="ruby-identifier">:responses</span>         =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@responses</span>,
+39:          <span class="ruby-identifier">:totaltime</span>         =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@totaltime</span>,
+40:          <span class="ruby-identifier">:discovered</span>        =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@discovered</span>,
+41:          <span class="ruby-identifier">:discovered_nodes</span>  =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@discovered_nodes</span>,
+42:          <span class="ruby-identifier">:noresponsefrom</span>    =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@noresponsefrom</span>,
+43:          <span class="ruby-identifier">:okcount</span>           =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@okcount</span>,
+44:          <span class="ruby-identifier">:requestid</span>         =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@requestid</span>,
+45:          <span class="ruby-identifier">:failcount</span>         =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@failcount</span>,
+46:          <span class="ruby-identifier">:aggregate_summary</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@aggregate_summary</span>,
+47:          <span class="ruby-identifier">:aggregate_failures</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@aggregate_failures</span>}
+48:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/RPCAborted.html b/doc/classes/MCollective/RPCAborted.html
new file mode 100644 (file)
index 0000000..f101f38
--- /dev/null
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::RPCAborted</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::RPCAborted</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/exception_rb.html">
+                lib/mcollective/exception.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                <a href="RPCError.html">
+                RPCError
+               </a>
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/RPCError.html b/doc/classes/MCollective/RPCError.html
new file mode 100644 (file)
index 0000000..e62de8c
--- /dev/null
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::RPCError</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::RPCError</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/exception_rb.html">
+                lib/mcollective/exception.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                StandardError
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Registration.html b/doc/classes/MCollective/Registration.html
new file mode 100644 (file)
index 0000000..6b4292b
--- /dev/null
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Module: MCollective::Registration</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Module</strong></td>
+          <td class="class-name-in-header">MCollective::Registration</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/registration/base_rb.html">
+                lib/mcollective/registration/base.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/registration_rb.html">
+                lib/mcollective/registration.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+<a href="Registration.html">Registration</a> is implimented using a module
+structure and installations can configure which module they want to use.
+</p>
+<p>
+We provide a simple one that just sends back the list of current known
+agents in MCollective::Registration::Agentlist, you can create your own:
+</p>
+<p>
+Create a module in plugins/mcollective/registration/&lt;yourplugin&gt;.rb
+</p>
+<p>
+You can inherit from <a
+href="Registration/Base.html">MCollective::Registration::Base</a> in which
+case you just need to supply a <em>body</em> method, whatever this method
+returns will be send to the middleware connection for an agent called
+<em>registration</em>
+</p>
+
+    </div>
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+    <div id="class-list">
+      <h3 class="section-bar">Classes and Modules</h3>
+
+      Class <a href="Registration/Base.html" class="link">MCollective::Registration::Base</a><br />
+
+    </div>
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Registration/Base.html b/doc/classes/MCollective/Registration/Base.html
new file mode 100644 (file)
index 0000000..1f000d8
--- /dev/null
@@ -0,0 +1,347 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Registration::Base</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Registration::Base</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/registration/base_rb.html">
+                lib/mcollective/registration/base.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+This is a base class that other registration plugins can use to handle
+regular announcements to the mcollective
+</p>
+<p>
+The configuration file determines how often registration messages gets sent
+using the <em>registerinterval</em> option, the plugin runs in the
+background in a thread.
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000192">config</a>&nbsp;&nbsp;
+      <a href="#M000190">inherited</a>&nbsp;&nbsp;
+      <a href="#M000195">interval</a>&nbsp;&nbsp;
+      <a href="#M000193">msg_filter</a>&nbsp;&nbsp;
+      <a href="#M000196">publish</a>&nbsp;&nbsp;
+      <a href="#M000191">run</a>&nbsp;&nbsp;
+      <a href="#M000194">target_collective</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000190" class="method-detail">
+        <a name="M000190"></a>
+
+        <div class="method-heading">
+          <a href="#M000190" class="method-signature">
+          <span class="method-name">inherited</span><span class="method-args">(klass)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Register plugins that inherits base
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000190-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000190-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/registration/base.rb, line 11</span>
+11:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">inherited</span>(<span class="ruby-identifier">klass</span>)
+12:         <span class="ruby-constant">PluginManager</span> <span class="ruby-operator">&lt;&lt;</span> {<span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;registration_plugin&quot;</span>, <span class="ruby-identifier">:class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">to_s</span>}
+13:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000192" class="method-detail">
+        <a name="M000192"></a>
+
+        <div class="method-heading">
+          <a href="#M000192" class="method-signature">
+          <span class="method-name">config</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000192-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000192-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/registration/base.rb, line 36</span>
+36:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">config</span>
+37:         <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>
+38:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000195" class="method-detail">
+        <a name="M000195"></a>
+
+        <div class="method-heading">
+          <a href="#M000195" class="method-signature">
+          <span class="method-name">interval</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000195-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000195-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/registration/base.rb, line 59</span>
+59:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">interval</span>
+60:         <span class="ruby-identifier">config</span>.<span class="ruby-identifier">registerinterval</span>
+61:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000193" class="method-detail">
+        <a name="M000193"></a>
+
+        <div class="method-heading">
+          <a href="#M000193" class="method-signature">
+          <span class="method-name">msg_filter</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000193-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000193-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/registration/base.rb, line 40</span>
+40:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">msg_filter</span>
+41:         <span class="ruby-identifier">filter</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">empty_filter</span>
+42:         <span class="ruby-identifier">filter</span>[<span class="ruby-value str">&quot;agent&quot;</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;registration&quot;</span>
+43:         <span class="ruby-identifier">filter</span>
+44:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000196" class="method-detail">
+        <a name="M000196"></a>
+
+        <div class="method-heading">
+          <a href="#M000196" class="method-signature">
+          <span class="method-name">publish</span><span class="method-args">(message)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000196-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000196-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/registration/base.rb, line 63</span>
+63:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">publish</span>(<span class="ruby-identifier">message</span>)
+64:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">message</span>
+65:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Skipping registration due to nil body&quot;</span>)
+66:         <span class="ruby-keyword kw">else</span>
+67:           <span class="ruby-identifier">req</span> = <span class="ruby-constant">Message</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">message</span>, <span class="ruby-keyword kw">nil</span>, {<span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:request</span>, <span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;registration&quot;</span>, <span class="ruby-identifier">:collective</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">target_collective</span>, <span class="ruby-identifier">:filter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">msg_filter</span>})
+68:           <span class="ruby-identifier">req</span>.<span class="ruby-identifier">encode!</span>
+69: 
+70:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Sending registration #{req.requestid} to collective #{req.collective}&quot;</span>)
+71: 
+72:           <span class="ruby-identifier">req</span>.<span class="ruby-identifier">publish</span>
+73:         <span class="ruby-keyword kw">end</span>
+74:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000191" class="method-detail">
+        <a name="M000191"></a>
+
+        <div class="method-heading">
+          <a href="#M000191" class="method-signature">
+          <span class="method-name">run</span><span class="method-args">(connection)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Creates a background thread that periodically send a registration notice.
+</p>
+<p>
+The actual registration notices comes from the &#8216;body&#8217; method of
+the registration plugins.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000191-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000191-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/registration/base.rb, line 19</span>
+19:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>(<span class="ruby-identifier">connection</span>)
+20:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">interval</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
+21: 
+22:         <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
+23:           <span class="ruby-identifier">loop</span> <span class="ruby-keyword kw">do</span>
+24:             <span class="ruby-keyword kw">begin</span>
+25:               <span class="ruby-identifier">publish</span>(<span class="ruby-identifier">body</span>)
+26: 
+27:               <span class="ruby-identifier">sleep</span> <span class="ruby-identifier">interval</span>
+28:             <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+29:               <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">&quot;Sending registration message failed: #{e}&quot;</span>)
+30:               <span class="ruby-identifier">sleep</span> <span class="ruby-identifier">interval</span>
+31:             <span class="ruby-keyword kw">end</span>
+32:           <span class="ruby-keyword kw">end</span>
+33:         <span class="ruby-keyword kw">end</span>
+34:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000194" class="method-detail">
+        <a name="M000194"></a>
+
+        <div class="method-heading">
+          <a href="#M000194" class="method-signature">
+          <span class="method-name">target_collective</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000194-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000194-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/registration/base.rb, line 46</span>
+46:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">target_collective</span>
+47:         <span class="ruby-identifier">main_collective</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">main_collective</span>
+48: 
+49:         <span class="ruby-identifier">collective</span> = <span class="ruby-identifier">config</span>.<span class="ruby-identifier">registration_collective</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">main_collective</span>
+50: 
+51:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">collectives</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">collective</span>)
+52:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">warn</span>(<span class="ruby-node">&quot;Sending registration to #{main_collective}: #{collective} is not a valid collective&quot;</span>)
+53:           <span class="ruby-identifier">collective</span> = <span class="ruby-identifier">main_collective</span>
+54:         <span class="ruby-keyword kw">end</span>
+55: 
+56:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">collective</span>
+57:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Runner.html b/doc/classes/MCollective/Runner.html
new file mode 100644 (file)
index 0000000..62f7e8f
--- /dev/null
@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Runner</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Runner</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/runner_rb.html">
+                lib/mcollective/runner.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+The main runner for the daemon, supports running in the foreground and the
+background, keeps detailed stats and provides hooks to access all this
+information
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000496">new</a>&nbsp;&nbsp;
+      <a href="#M000497">run</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+    <div id="includes">
+      <h3 class="section-bar">Included Modules</h3>
+
+      <div id="includes-list">
+        <span class="include-name"><a href="Translatable.html">Translatable</a></span>
+      </div>
+    </div>
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000496" class="method-detail">
+        <a name="M000496"></a>
+
+        <div class="method-heading">
+          <a href="#M000496" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(configfile)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000496-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000496-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/runner.rb, line 8</span>
+ 8:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">configfile</span>)
+ 9:       <span class="ruby-ivar">@config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>
+10:       <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">loadconfig</span>(<span class="ruby-identifier">configfile</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">configured</span>
+11:       <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">mode</span> = <span class="ruby-identifier">:server</span>
+12: 
+13:       <span class="ruby-ivar">@stats</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;global_stats&quot;</span>]
+14: 
+15:       <span class="ruby-ivar">@security</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;security_plugin&quot;</span>]
+16:       <span class="ruby-ivar">@security</span>.<span class="ruby-identifier">initiated_by</span> = <span class="ruby-identifier">:node</span>
+17: 
+18:       <span class="ruby-ivar">@connection</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;connector_plugin&quot;</span>]
+19:       <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">connect</span>
+20: 
+21:       <span class="ruby-ivar">@agents</span> = <span class="ruby-constant">Agents</span>.<span class="ruby-identifier">new</span>
+22: 
+23:       <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">windows?</span>
+24:         <span class="ruby-constant">Signal</span>.<span class="ruby-identifier">trap</span>(<span class="ruby-value str">&quot;USR1&quot;</span>) <span class="ruby-keyword kw">do</span>
+25:           <span class="ruby-identifier">log_code</span>(<span class="ruby-identifier">:PLMC2</span>, <span class="ruby-value str">&quot;Reloading all agents after receiving USR1 signal&quot;</span>, <span class="ruby-identifier">:info</span>)
+26:           <span class="ruby-ivar">@agents</span>.<span class="ruby-identifier">loadagents</span>
+27:         <span class="ruby-keyword kw">end</span>
+28: 
+29:         <span class="ruby-constant">Signal</span>.<span class="ruby-identifier">trap</span>(<span class="ruby-value str">&quot;USR2&quot;</span>) <span class="ruby-keyword kw">do</span>
+30:           <span class="ruby-identifier">log_code</span>(<span class="ruby-identifier">:PLMC3</span>, <span class="ruby-value str">&quot;Cycling logging level due to USR2 signal&quot;</span>, <span class="ruby-identifier">:info</span>)
+31: 
+32:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">cycle_level</span>
+33:         <span class="ruby-keyword kw">end</span>
+34:       <span class="ruby-keyword kw">else</span>
+35:         <span class="ruby-constant">Util</span>.<span class="ruby-identifier">setup_windows_sleeper</span>
+36:       <span class="ruby-keyword kw">end</span>
+37:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000497" class="method-detail">
+        <a name="M000497"></a>
+
+        <div class="method-heading">
+          <a href="#M000497" class="method-signature">
+          <span class="method-name">run</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Starts the main loop, before calling this you should initialize the <a
+href="Config.html">MCollective::Config</a> singleton.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000497-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000497-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/runner.rb, line 40</span>
+40:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>
+41:       <span class="ruby-constant">Data</span>.<span class="ruby-identifier">load_data_sources</span>
+42: 
+43:       <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-value str">&quot;mcollective&quot;</span>, <span class="ruby-identifier">:broadcast</span>))
+44:       <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-value str">&quot;mcollective&quot;</span>, <span class="ruby-identifier">:directed</span>)) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">direct_addressing</span>
+45: 
+46:       <span class="ruby-comment cmt"># Start the registration plugin if interval isn't 0</span>
+47:       <span class="ruby-keyword kw">begin</span>
+48:         <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;registration_plugin&quot;</span>].<span class="ruby-identifier">run</span>(<span class="ruby-ivar">@connection</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">registerinterval</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
+49:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+50:         <span class="ruby-identifier">logexception</span>(<span class="ruby-identifier">:PLMC4</span>, <span class="ruby-value str">&quot;Failed to start registration plugin: %{error}&quot;</span>, <span class="ruby-identifier">:error</span>, <span class="ruby-identifier">e</span>)
+51:       <span class="ruby-keyword kw">end</span>
+52: 
+53:       <span class="ruby-identifier">loop</span> <span class="ruby-keyword kw">do</span>
+54:         <span class="ruby-keyword kw">begin</span>
+55:           <span class="ruby-identifier">request</span> = <span class="ruby-identifier">receive</span>
+56: 
+57:           <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">agent</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;mcollective&quot;</span>
+58:             <span class="ruby-identifier">agentmsg</span>(<span class="ruby-identifier">request</span>)
+59:           <span class="ruby-keyword kw">else</span>
+60:             <span class="ruby-identifier">log_code</span>(<span class="ruby-identifier">:PLMC5</span>, <span class="ruby-value str">&quot;Received a control message, possibly via 'mco controller' but this has been deprecated&quot;</span>, <span class="ruby-identifier">:error</span>)
+61:           <span class="ruby-keyword kw">end</span>
+62:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SignalException</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+63:           <span class="ruby-identifier">logexception</span>(<span class="ruby-identifier">:PLMC7</span>, <span class="ruby-value str">&quot;Exiting after signal: %{error}&quot;</span>, <span class="ruby-identifier">:warn</span>, <span class="ruby-identifier">e</span>)
+64:           <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">disconnect</span>
+65:           <span class="ruby-identifier">raise</span>
+66: 
+67:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">MsgTTLExpired</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+68:           <span class="ruby-identifier">logexception</span>(<span class="ruby-identifier">:PLMC9</span>, <span class="ruby-value str">&quot;Expired Message: %{error}&quot;</span>, <span class="ruby-identifier">:warn</span>, <span class="ruby-identifier">e</span>)
+69: 
+70:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">NotTargettedAtUs</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+71:           <span class="ruby-identifier">log_code</span>(<span class="ruby-identifier">:PLMC6</span>, <span class="ruby-value str">&quot;Message does not pass filters, ignoring&quot;</span>, <span class="ruby-identifier">:debug</span>)
+72: 
+73:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+74:           <span class="ruby-identifier">logexception</span>(<span class="ruby-identifier">:PLMC10</span>, <span class="ruby-value str">&quot;Failed to handle message: %{error}&quot;</span>, <span class="ruby-identifier">:warn</span>, <span class="ruby-identifier">e</span>, <span class="ruby-keyword kw">true</span>)
+75:         <span class="ruby-keyword kw">end</span>
+76:       <span class="ruby-keyword kw">end</span>
+77:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/RunnerStats.html b/doc/classes/MCollective/RunnerStats.html
new file mode 100644 (file)
index 0000000..6c4437b
--- /dev/null
@@ -0,0 +1,412 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::RunnerStats</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::RunnerStats</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/runnerstats_rb.html">
+                lib/mcollective/runnerstats.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+Class to store stats about the mcollectived, it should live in the <a
+href="PluginManager.html">PluginManager</a> so that agents etc can get hold
+of it and return the stats to callers
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000476">filtered</a>&nbsp;&nbsp;
+      <a href="#M000473">new</a>&nbsp;&nbsp;
+      <a href="#M000475">passed</a>&nbsp;&nbsp;
+      <a href="#M000479">received</a>&nbsp;&nbsp;
+      <a href="#M000480">sent</a>&nbsp;&nbsp;
+      <a href="#M000481">to_hash</a>&nbsp;&nbsp;
+      <a href="#M000474">ttlexpired</a>&nbsp;&nbsp;
+      <a href="#M000478">unvalidated</a>&nbsp;&nbsp;
+      <a href="#M000477">validated</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000473" class="method-detail">
+        <a name="M000473"></a>
+
+        <div class="method-heading">
+          <a href="#M000473" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000473-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000473-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/runnerstats.rb, line 5</span>
+ 5:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
+ 6:       <span class="ruby-ivar">@starttime</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_i</span>
+ 7:       <span class="ruby-ivar">@validated</span> = <span class="ruby-value">0</span>
+ 8:       <span class="ruby-ivar">@unvalidated</span> = <span class="ruby-value">0</span>
+ 9:       <span class="ruby-ivar">@filtered</span> = <span class="ruby-value">0</span>
+10:       <span class="ruby-ivar">@passed</span> = <span class="ruby-value">0</span>
+11:       <span class="ruby-ivar">@total</span> = <span class="ruby-value">0</span>
+12:       <span class="ruby-ivar">@replies</span> = <span class="ruby-value">0</span>
+13:       <span class="ruby-ivar">@ttlexpired</span> = <span class="ruby-value">0</span>
+14: 
+15:       <span class="ruby-ivar">@mutex</span> = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
+16:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000476" class="method-detail">
+        <a name="M000476"></a>
+
+        <div class="method-heading">
+          <a href="#M000476" class="method-signature">
+          <span class="method-name">filtered</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Records a message that didnt pass the filters
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000476-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000476-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/runnerstats.rb, line 31</span>
+31:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">filtered</span>
+32:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Incrementing filtered stat&quot;</span>)
+33:       <span class="ruby-ivar">@filtered</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+34:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000475" class="method-detail">
+        <a name="M000475"></a>
+
+        <div class="method-heading">
+          <a href="#M000475" class="method-signature">
+          <span class="method-name">passed</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Records a message that <a href="RunnerStats.html#M000475">passed</a> the
+filters
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000475-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000475-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/runnerstats.rb, line 25</span>
+25:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">passed</span>
+26:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Incrementing passed stat&quot;</span>)
+27:       <span class="ruby-ivar">@passed</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+28:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000479" class="method-detail">
+        <a name="M000479"></a>
+
+        <div class="method-heading">
+          <a href="#M000479" class="method-signature">
+          <span class="method-name">received</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Records receipt of a message
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000479-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000479-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/runnerstats.rb, line 48</span>
+48:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">received</span>
+49:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Incrementing total stat&quot;</span>)
+50:       <span class="ruby-ivar">@total</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+51:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000480" class="method-detail">
+        <a name="M000480"></a>
+
+        <div class="method-heading">
+          <a href="#M000480" class="method-signature">
+          <span class="method-name">sent</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Records sending a message
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000480-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000480-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/runnerstats.rb, line 54</span>
+54:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sent</span>
+55:       <span class="ruby-ivar">@mutex</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
+56:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Incrementing replies stat&quot;</span>)
+57:         <span class="ruby-ivar">@replies</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+58:       <span class="ruby-keyword kw">end</span>
+59:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000481" class="method-detail">
+        <a name="M000481"></a>
+
+        <div class="method-heading">
+          <a href="#M000481" class="method-signature">
+          <span class="method-name">to_hash</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns a hash with all stats
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000481-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000481-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/runnerstats.rb, line 62</span>
+62:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_hash</span>
+63:       <span class="ruby-identifier">stats</span> = {<span class="ruby-identifier">:validated</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@validated</span>,
+64:         <span class="ruby-identifier">:unvalidated</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@unvalidated</span>,
+65:         <span class="ruby-identifier">:passed</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@passed</span>,
+66:         <span class="ruby-identifier">:filtered</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@filtered</span>,
+67:         <span class="ruby-identifier">:starttime</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@starttime</span>,
+68:         <span class="ruby-identifier">:total</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@total</span>,
+69:         <span class="ruby-identifier">:ttlexpired</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@ttlexpired</span>,
+70:         <span class="ruby-identifier">:replies</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@replies</span>}
+71: 
+72:       <span class="ruby-identifier">reply</span> = {<span class="ruby-identifier">:stats</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">stats</span>,
+73:         <span class="ruby-identifier">:threads</span> =<span class="ruby-operator">&gt;</span> [],
+74:         <span class="ruby-identifier">:pid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Process</span>.<span class="ruby-identifier">pid</span>,
+75:         <span class="ruby-identifier">:times</span> =<span class="ruby-operator">&gt;</span> {} }
+76: 
+77:       <span class="ruby-operator">::</span><span class="ruby-constant">Process</span>.<span class="ruby-identifier">times</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>
+78:         <span class="ruby-identifier">k</span> = <span class="ruby-identifier">k</span>.<span class="ruby-identifier">to_sym</span>
+79:         <span class="ruby-identifier">reply</span>[<span class="ruby-identifier">:times</span>][<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">v</span>
+80:       }
+81: 
+82:       <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
+83:         <span class="ruby-identifier">reply</span>[<span class="ruby-identifier">:threads</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{t.inspect}&quot;</span>
+84:       <span class="ruby-keyword kw">end</span>
+85: 
+86:       <span class="ruby-identifier">reply</span>[<span class="ruby-identifier">:agents</span>] = <span class="ruby-constant">Agents</span>.<span class="ruby-identifier">agentlist</span>
+87:       <span class="ruby-identifier">reply</span>
+88:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000474" class="method-detail">
+        <a name="M000474"></a>
+
+        <div class="method-heading">
+          <a href="#M000474" class="method-signature">
+          <span class="method-name">ttlexpired</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Records a message that failed TTL checks
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000474-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000474-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/runnerstats.rb, line 19</span>
+19:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ttlexpired</span>
+20:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Incrementing ttl expired stat&quot;</span>)
+21:       <span class="ruby-ivar">@ttlexpired</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+22:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000478" class="method-detail">
+        <a name="M000478"></a>
+
+        <div class="method-heading">
+          <a href="#M000478" class="method-signature">
+          <span class="method-name">unvalidated</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000478-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000478-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/runnerstats.rb, line 42</span>
+42:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unvalidated</span>
+43:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Incrementing unvalidated stat&quot;</span>)
+44:       <span class="ruby-ivar">@unvalidated</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+45:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000477" class="method-detail">
+        <a name="M000477"></a>
+
+        <div class="method-heading">
+          <a href="#M000477" class="method-signature">
+          <span class="method-name">validated</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Records a message that <a href="RunnerStats.html#M000477">validated</a> ok
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000477-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000477-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/runnerstats.rb, line 37</span>
+37:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validated</span>
+38:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Incrementing validated stat&quot;</span>)
+39:       <span class="ruby-ivar">@validated</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+40:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/SSL.html b/doc/classes/MCollective/SSL.html
new file mode 100644 (file)
index 0000000..678945d
--- /dev/null
@@ -0,0 +1,886 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::SSL</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::SSL</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/ssl_rb.html">
+                lib/mcollective/ssl.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+A class that assists in encrypting and decrypting data using a combination
+of RSA and AES
+</p>
+<p>
+<a href="Data.html">Data</a> will be AES encrypted for speed, the Key used
+in # the AES stage will be encrypted using RSA
+</p>
+<pre>
+  ssl = SSL.new(public_key, private_key, passphrase)
+
+  data = File.read(&quot;largefile.dat&quot;)
+
+  crypted_data = ssl.encrypt_with_private(data)
+
+  pp crypted_data
+</pre>
+<p>
+This will result in a hash of data like:
+</p>
+<pre>
+  crypted = {:key  =&gt; &quot;crd4NHvG....=&quot;,
+             :data =&gt; &quot;XWXlqN+i...==&quot;}
+</pre>
+<p>
+The key and data will all be base 64 encoded already by default you can
+pass a 2nd parameter as false to <a
+href="SSL.html#M000378">encrypt_with_private</a> and counterparts that will
+prevent the base 64 encoding
+</p>
+<p>
+You can pass the data hash into ssl.decrypt_with_public which should return
+your original data
+</p>
+<p>
+There are matching methods for using a public key to encrypt data to be
+decrypted using a private key
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000386">aes_decrypt</a>&nbsp;&nbsp;
+      <a href="#M000385">aes_encrypt</a>&nbsp;&nbsp;
+      <a href="#M000392">base64_decode</a>&nbsp;&nbsp;
+      <a href="#M000391">base64_decode</a>&nbsp;&nbsp;
+      <a href="#M000390">base64_encode</a>&nbsp;&nbsp;
+      <a href="#M000389">base64_encode</a>&nbsp;&nbsp;
+      <a href="#M000379">decrypt_with_private</a>&nbsp;&nbsp;
+      <a href="#M000380">decrypt_with_public</a>&nbsp;&nbsp;
+      <a href="#M000378">encrypt_with_private</a>&nbsp;&nbsp;
+      <a href="#M000377">encrypt_with_public</a>&nbsp;&nbsp;
+      <a href="#M000394">md5</a>&nbsp;&nbsp;
+      <a href="#M000393">md5</a>&nbsp;&nbsp;
+      <a href="#M000376">new</a>&nbsp;&nbsp;
+      <a href="#M000396">read_key</a>&nbsp;&nbsp;
+      <a href="#M000382">rsa_decrypt_with_private</a>&nbsp;&nbsp;
+      <a href="#M000384">rsa_decrypt_with_public</a>&nbsp;&nbsp;
+      <a href="#M000383">rsa_encrypt_with_private</a>&nbsp;&nbsp;
+      <a href="#M000381">rsa_encrypt_with_public</a>&nbsp;&nbsp;
+      <a href="#M000387">sign</a>&nbsp;&nbsp;
+      <a href="#M000395">uuid</a>&nbsp;&nbsp;
+      <a href="#M000388">verify_signature</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">private_key_file</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">public_key_file</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">ssl_cipher</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000392" class="method-detail">
+        <a name="M000392"></a>
+
+        <div class="method-heading">
+          <a href="#M000392" class="method-signature">
+          <span class="method-name">base64_decode</span><span class="method-args">(string)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000392-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000392-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 195</span>
+195:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">base64_decode</span>(<span class="ruby-identifier">string</span>)
+196:       <span class="ruby-constant">Base64</span>.<span class="ruby-identifier">decode64</span>(<span class="ruby-identifier">string</span>)
+197:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000390" class="method-detail">
+        <a name="M000390"></a>
+
+        <div class="method-heading">
+          <a href="#M000390" class="method-signature">
+          <span class="method-name">base64_encode</span><span class="method-args">(string)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000390-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000390-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 186</span>
+186:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">base64_encode</span>(<span class="ruby-identifier">string</span>)
+187:       <span class="ruby-constant">Base64</span>.<span class="ruby-identifier">encode64</span>(<span class="ruby-identifier">string</span>)
+188:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000394" class="method-detail">
+        <a name="M000394"></a>
+
+        <div class="method-heading">
+          <a href="#M000394" class="method-signature">
+          <span class="method-name">md5</span><span class="method-args">(string)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000394-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000394-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 203</span>
+203:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">md5</span>(<span class="ruby-identifier">string</span>)
+204:       <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">MD5</span>.<span class="ruby-identifier">hexdigest</span>(<span class="ruby-identifier">string</span>)
+205:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000376" class="method-detail">
+        <a name="M000376"></a>
+
+        <div class="method-heading">
+          <a href="#M000376" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(pubkey=nil, privkey=nil, passphrase=nil, cipher=nil)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000376-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000376-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 37</span>
+37:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">pubkey</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">privkey</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">passphrase</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">cipher</span>=<span class="ruby-keyword kw">nil</span>)
+38:       <span class="ruby-ivar">@public_key_file</span> = <span class="ruby-identifier">pubkey</span>
+39:       <span class="ruby-ivar">@private_key_file</span> = <span class="ruby-identifier">privkey</span>
+40: 
+41:       <span class="ruby-ivar">@public_key</span>  = <span class="ruby-identifier">read_key</span>(<span class="ruby-identifier">:public</span>, <span class="ruby-identifier">pubkey</span>)
+42:       <span class="ruby-ivar">@private_key</span> = <span class="ruby-identifier">read_key</span>(<span class="ruby-identifier">:private</span>, <span class="ruby-identifier">privkey</span>, <span class="ruby-identifier">passphrase</span>)
+43: 
+44:       <span class="ruby-ivar">@ssl_cipher</span> = <span class="ruby-value str">&quot;aes-256-cbc&quot;</span>
+45:       <span class="ruby-ivar">@ssl_cipher</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">ssl_cipher</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">ssl_cipher</span>
+46:       <span class="ruby-ivar">@ssl_cipher</span> = <span class="ruby-identifier">cipher</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cipher</span>
+47: 
+48:       <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;The supplied cipher '#{@ssl_cipher}' is not supported&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Cipher</span>.<span class="ruby-identifier">ciphers</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-ivar">@ssl_cipher</span>)
+49:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000395" class="method-detail">
+        <a name="M000395"></a>
+
+        <div class="method-heading">
+          <a href="#M000395" class="method-signature">
+          <span class="method-name">uuid</span><span class="method-args">(string=nil)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Creates a RFC 4122 version 5 UUID. If string is supplied it will produce
+repeatable UUIDs for that string else a random 128bit string will be used
+from OpenSSL::BN
+</p>
+<p>
+Code used with permission from:
+</p>
+<pre>
+   https://github.com/kwilczynski/puppet-functions/blob/master/lib/puppet/parser/functions/uuid.rb
+</pre>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000395-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000395-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 213</span>
+213:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">uuid</span>(<span class="ruby-identifier">string</span>=<span class="ruby-keyword kw">nil</span>)
+214:       <span class="ruby-identifier">string</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Random</span>.<span class="ruby-identifier">random_bytes</span>(<span class="ruby-value">16</span>).<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'H*'</span>).<span class="ruby-identifier">shift</span>
+215: 
+216:       <span class="ruby-identifier">uuid_name_space_dns</span> = <span class="ruby-value str">&quot;\x6b\xa7\xb8\x10\x9d\xad\x11\xd1\x80\xb4\x00\xc0\x4f\xd4\x30\xc8&quot;</span>
+217: 
+218:       <span class="ruby-identifier">sha1</span> = <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA1</span>.<span class="ruby-identifier">new</span>
+219:       <span class="ruby-identifier">sha1</span>.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">uuid_name_space_dns</span>)
+220:       <span class="ruby-identifier">sha1</span>.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">string</span>)
+221: 
+222:       <span class="ruby-comment cmt"># first 16 bytes..</span>
+223:       <span class="ruby-identifier">bytes</span> = <span class="ruby-identifier">sha1</span>.<span class="ruby-identifier">digest</span>[<span class="ruby-value">0</span>, <span class="ruby-value">16</span>].<span class="ruby-identifier">bytes</span>.<span class="ruby-identifier">to_a</span>
+224: 
+225:       <span class="ruby-comment cmt"># version 5 adjustments</span>
+226:       <span class="ruby-identifier">bytes</span>[<span class="ruby-value">6</span>] <span class="ruby-operator">&amp;=</span> <span class="ruby-value">0x0f</span>
+227:       <span class="ruby-identifier">bytes</span>[<span class="ruby-value">6</span>] <span class="ruby-operator">|=</span> <span class="ruby-value">0x50</span>
+228: 
+229:       <span class="ruby-comment cmt"># variant is DCE 1.1</span>
+230:       <span class="ruby-identifier">bytes</span>[<span class="ruby-value">8</span>] <span class="ruby-operator">&amp;=</span> <span class="ruby-value">0x3f</span>
+231:       <span class="ruby-identifier">bytes</span>[<span class="ruby-value">8</span>] <span class="ruby-operator">|=</span> <span class="ruby-value">0x80</span>
+232: 
+233:       <span class="ruby-identifier">bytes</span> = [<span class="ruby-value">4</span>, <span class="ruby-value">2</span>, <span class="ruby-value">2</span>, <span class="ruby-value">2</span>, <span class="ruby-value">6</span>].<span class="ruby-identifier">collect</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
+234:         <span class="ruby-identifier">bytes</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-value">0</span>, <span class="ruby-identifier">i</span>).<span class="ruby-identifier">pack</span>(<span class="ruby-value str">'C*'</span>).<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'H*'</span>)
+235:       <span class="ruby-keyword kw">end</span>
+236: 
+237:       <span class="ruby-identifier">bytes</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'-'</span>)
+238:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000386" class="method-detail">
+        <a name="M000386"></a>
+
+        <div class="method-heading">
+          <a href="#M000386" class="method-signature">
+          <span class="method-name">aes_decrypt</span><span class="method-args">(key, crypt_string)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+decrypts a string given key, iv and data
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000386-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000386-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 158</span>
+158:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">aes_decrypt</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">crypt_string</span>)
+159:       <span class="ruby-identifier">cipher</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Cipher</span><span class="ruby-operator">::</span><span class="ruby-constant">Cipher</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ssl_cipher</span>)
+160: 
+161:       <span class="ruby-identifier">cipher</span>.<span class="ruby-identifier">decrypt</span>
+162:       <span class="ruby-identifier">cipher</span>.<span class="ruby-identifier">key</span> = <span class="ruby-identifier">key</span>
+163:       <span class="ruby-identifier">cipher</span>.<span class="ruby-identifier">pkcs5_keyivgen</span>(<span class="ruby-identifier">key</span>)
+164:       <span class="ruby-identifier">decrypted_data</span> = <span class="ruby-identifier">cipher</span>.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">crypt_string</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">cipher</span>.<span class="ruby-identifier">final</span>
+165:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000385" class="method-detail">
+        <a name="M000385"></a>
+
+        <div class="method-heading">
+          <a href="#M000385" class="method-signature">
+          <span class="method-name">aes_encrypt</span><span class="method-args">(plain_string)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+encrypts a string, returns a hash of key, iv and data
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000385-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000385-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 144</span>
+144:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">aes_encrypt</span>(<span class="ruby-identifier">plain_string</span>)
+145:       <span class="ruby-identifier">cipher</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Cipher</span><span class="ruby-operator">::</span><span class="ruby-constant">Cipher</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">ssl_cipher</span>)
+146:       <span class="ruby-identifier">cipher</span>.<span class="ruby-identifier">encrypt</span>
+147: 
+148:       <span class="ruby-identifier">key</span> = <span class="ruby-identifier">cipher</span>.<span class="ruby-identifier">random_key</span>
+149: 
+150:       <span class="ruby-identifier">cipher</span>.<span class="ruby-identifier">key</span> = <span class="ruby-identifier">key</span>
+151:       <span class="ruby-identifier">cipher</span>.<span class="ruby-identifier">pkcs5_keyivgen</span>(<span class="ruby-identifier">key</span>)
+152:       <span class="ruby-identifier">encrypted_data</span> = <span class="ruby-identifier">cipher</span>.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">plain_string</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">cipher</span>.<span class="ruby-identifier">final</span>
+153: 
+154:       {<span class="ruby-identifier">:key</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">key</span>, <span class="ruby-identifier">:data</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">encrypted_data</span>}
+155:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000391" class="method-detail">
+        <a name="M000391"></a>
+
+        <div class="method-heading">
+          <a href="#M000391" class="method-signature">
+          <span class="method-name">base64_decode</span><span class="method-args">(string)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+base 64 decode a string
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000391-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000391-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 191</span>
+191:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">base64_decode</span>(<span class="ruby-identifier">string</span>)
+192:       <span class="ruby-constant">SSL</span>.<span class="ruby-identifier">base64_decode</span>(<span class="ruby-identifier">string</span>)
+193:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000389" class="method-detail">
+        <a name="M000389"></a>
+
+        <div class="method-heading">
+          <a href="#M000389" class="method-signature">
+          <span class="method-name">base64_encode</span><span class="method-args">(string)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+base 64 encode a string
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000389-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000389-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 182</span>
+182:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">base64_encode</span>(<span class="ruby-identifier">string</span>)
+183:       <span class="ruby-constant">SSL</span>.<span class="ruby-identifier">base64_encode</span>(<span class="ruby-identifier">string</span>)
+184:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000379" class="method-detail">
+        <a name="M000379"></a>
+
+        <div class="method-heading">
+          <a href="#M000379" class="method-signature">
+          <span class="method-name">decrypt_with_private</span><span class="method-args">(crypted, base64=true)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Decrypts data, expects a hash as create with crypt_with_public
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000379-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000379-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 88</span>
+88:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">decrypt_with_private</span>(<span class="ruby-identifier">crypted</span>, <span class="ruby-identifier">base64</span>=<span class="ruby-keyword kw">true</span>)
+89:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Crypted data should include a key&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">crypted</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:key</span>)
+90:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Crypted data should include data&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">crypted</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:data</span>)
+91: 
+92:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base64</span>
+93:         <span class="ruby-identifier">key</span> = <span class="ruby-identifier">rsa_decrypt_with_private</span>(<span class="ruby-identifier">base64_decode</span>(<span class="ruby-identifier">crypted</span>[<span class="ruby-identifier">:key</span>]))
+94:         <span class="ruby-identifier">aes_decrypt</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">base64_decode</span>(<span class="ruby-identifier">crypted</span>[<span class="ruby-identifier">:data</span>]))
+95:       <span class="ruby-keyword kw">else</span>
+96:         <span class="ruby-identifier">key</span> = <span class="ruby-identifier">rsa_decrypt_with_private</span>(<span class="ruby-identifier">crypted</span>[<span class="ruby-identifier">:key</span>])
+97:         <span class="ruby-identifier">aes_decrypt</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">crypted</span>[<span class="ruby-identifier">:data</span>])
+98:       <span class="ruby-keyword kw">end</span>
+99:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000380" class="method-detail">
+        <a name="M000380"></a>
+
+        <div class="method-heading">
+          <a href="#M000380" class="method-signature">
+          <span class="method-name">decrypt_with_public</span><span class="method-args">(crypted, base64=true)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Decrypts data, expects a hash as create with crypt_with_private
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000380-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000380-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 102</span>
+102:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">decrypt_with_public</span>(<span class="ruby-identifier">crypted</span>, <span class="ruby-identifier">base64</span>=<span class="ruby-keyword kw">true</span>)
+103:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Crypted data should include a key&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">crypted</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:key</span>)
+104:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Crypted data should include data&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">crypted</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">:data</span>)
+105: 
+106:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base64</span>
+107:         <span class="ruby-identifier">key</span> = <span class="ruby-identifier">rsa_decrypt_with_public</span>(<span class="ruby-identifier">base64_decode</span>(<span class="ruby-identifier">crypted</span>[<span class="ruby-identifier">:key</span>]))
+108:         <span class="ruby-identifier">aes_decrypt</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">base64_decode</span>(<span class="ruby-identifier">crypted</span>[<span class="ruby-identifier">:data</span>]))
+109:       <span class="ruby-keyword kw">else</span>
+110:         <span class="ruby-identifier">key</span> = <span class="ruby-identifier">rsa_decrypt_with_public</span>(<span class="ruby-identifier">crypted</span>[<span class="ruby-identifier">:key</span>])
+111:         <span class="ruby-identifier">aes_decrypt</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">crypted</span>[<span class="ruby-identifier">:data</span>])
+112:       <span class="ruby-keyword kw">end</span>
+113:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000378" class="method-detail">
+        <a name="M000378"></a>
+
+        <div class="method-heading">
+          <a href="#M000378" class="method-signature">
+          <span class="method-name">encrypt_with_private</span><span class="method-args">(plain_text, base64=true)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Encrypts supplied data using AES and then encrypts using RSA the key and IV
+</p>
+<p>
+Return a hash with everything optionally base 64 encoded
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000378-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000378-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 73</span>
+73:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">encrypt_with_private</span>(<span class="ruby-identifier">plain_text</span>, <span class="ruby-identifier">base64</span>=<span class="ruby-keyword kw">true</span>)
+74:       <span class="ruby-identifier">crypted</span> = <span class="ruby-identifier">aes_encrypt</span>(<span class="ruby-identifier">plain_text</span>)
+75: 
+76:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base64</span>
+77:         <span class="ruby-identifier">key</span> = <span class="ruby-identifier">base64_encode</span>(<span class="ruby-identifier">rsa_encrypt_with_private</span>(<span class="ruby-identifier">crypted</span>[<span class="ruby-identifier">:key</span>]))
+78:         <span class="ruby-identifier">data</span> = <span class="ruby-identifier">base64_encode</span>(<span class="ruby-identifier">crypted</span>[<span class="ruby-identifier">:data</span>])
+79:       <span class="ruby-keyword kw">else</span>
+80:         <span class="ruby-identifier">key</span> = <span class="ruby-identifier">rsa_encrypt_with_private</span>(<span class="ruby-identifier">crypted</span>[<span class="ruby-identifier">:key</span>])
+81:         <span class="ruby-identifier">data</span> = <span class="ruby-identifier">crypted</span>[<span class="ruby-identifier">:data</span>]
+82:       <span class="ruby-keyword kw">end</span>
+83: 
+84:       {<span class="ruby-identifier">:key</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">key</span>, <span class="ruby-identifier">:data</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">data</span>}
+85:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000377" class="method-detail">
+        <a name="M000377"></a>
+
+        <div class="method-heading">
+          <a href="#M000377" class="method-signature">
+          <span class="method-name">encrypt_with_public</span><span class="method-args">(plain_text, base64=true)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Encrypts supplied data using AES and then encrypts using RSA the key and IV
+</p>
+<p>
+Return a hash with everything optionally base 64 encoded
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000377-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000377-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 55</span>
+55:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">encrypt_with_public</span>(<span class="ruby-identifier">plain_text</span>, <span class="ruby-identifier">base64</span>=<span class="ruby-keyword kw">true</span>)
+56:       <span class="ruby-identifier">crypted</span> = <span class="ruby-identifier">aes_encrypt</span>(<span class="ruby-identifier">plain_text</span>)
+57: 
+58:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base64</span>
+59:         <span class="ruby-identifier">key</span> = <span class="ruby-identifier">base64_encode</span>(<span class="ruby-identifier">rsa_encrypt_with_public</span>(<span class="ruby-identifier">crypted</span>[<span class="ruby-identifier">:key</span>]))
+60:         <span class="ruby-identifier">data</span> = <span class="ruby-identifier">base64_encode</span>(<span class="ruby-identifier">crypted</span>[<span class="ruby-identifier">:data</span>])
+61:       <span class="ruby-keyword kw">else</span>
+62:         <span class="ruby-identifier">key</span> = <span class="ruby-identifier">rsa_encrypt_with_public</span>(<span class="ruby-identifier">crypted</span>[<span class="ruby-identifier">:key</span>])
+63:         <span class="ruby-identifier">data</span> = <span class="ruby-identifier">crypted</span>[<span class="ruby-identifier">:data</span>]
+64:       <span class="ruby-keyword kw">end</span>
+65: 
+66:       {<span class="ruby-identifier">:key</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">key</span>, <span class="ruby-identifier">:data</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">data</span>}
+67:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000393" class="method-detail">
+        <a name="M000393"></a>
+
+        <div class="method-heading">
+          <a href="#M000393" class="method-signature">
+          <span class="method-name">md5</span><span class="method-args">(string)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000393-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000393-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 199</span>
+199:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">md5</span>(<span class="ruby-identifier">string</span>)
+200:       <span class="ruby-constant">SSL</span>.<span class="ruby-identifier">md5</span>(<span class="ruby-identifier">string</span>)
+201:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000396" class="method-detail">
+        <a name="M000396"></a>
+
+        <div class="method-heading">
+          <a href="#M000396" class="method-signature">
+          <span class="method-name">read_key</span><span class="method-args">(type, key=nil, passphrase=nil)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Reads either a :public or :private key from disk, uses an optional
+passphrase to read the private key
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000396-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000396-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 242</span>
+242:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read_key</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">key</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">passphrase</span>=<span class="ruby-keyword kw">nil</span>)
+243:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">key</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">key</span>.<span class="ruby-identifier">nil?</span>
+244: 
+245:       <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Could not find key #{key}&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">key</span>)
+246:       <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;#{type} key file '#{key}' is empty&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">zero?</span>(<span class="ruby-identifier">key</span>)
+247: 
+248:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:public</span>
+249:         <span class="ruby-keyword kw">begin</span>
+250:           <span class="ruby-identifier">key</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">PKey</span><span class="ruby-operator">::</span><span class="ruby-constant">RSA</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">key</span>))
+251:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">PKey</span><span class="ruby-operator">::</span><span class="ruby-constant">RSAError</span>
+252:           <span class="ruby-identifier">key</span> = <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">X509</span><span class="ruby-operator">::</span><span class="ruby-constant">Certificate</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">key</span>)).<span class="ruby-identifier">public_key</span>
+253:         <span class="ruby-keyword kw">end</span>
+254: 
+255:         <span class="ruby-comment cmt"># Ruby &lt; 1.9.3 had a bug where it does not correctly clear the</span>
+256:         <span class="ruby-comment cmt"># queue of errors while reading a key.  It tries various ways</span>
+257:         <span class="ruby-comment cmt"># to read the key and each failing attempt pushes an error onto</span>
+258:         <span class="ruby-comment cmt"># the queue.  With pubkeys only the 3rd attempt pass leaving 2</span>
+259:         <span class="ruby-comment cmt"># stale errors on the error queue.</span>
+260:         <span class="ruby-comment cmt">#</span>
+261:         <span class="ruby-comment cmt"># In 1.9.3 they fixed this by simply discarding the errors after</span>
+262:         <span class="ruby-comment cmt"># every attempt.  So we simulate this fix here for older rubies</span>
+263:         <span class="ruby-comment cmt"># as without it we get SSL_read errors from the Stomp+TLS sessions</span>
+264:         <span class="ruby-comment cmt">#</span>
+265:         <span class="ruby-comment cmt"># We do this only on 1.8 relying on 1.9.3 to do the right thing</span>
+266:         <span class="ruby-comment cmt"># and we do not support 1.9 less than 1.9.3</span>
+267:         <span class="ruby-comment cmt">#</span>
+268:         <span class="ruby-comment cmt"># See  http://bugs.ruby-lang.org/issues/4550</span>
+269:         <span class="ruby-constant">OpenSSL</span>.<span class="ruby-identifier">errors</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">ruby_version</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^1.8/</span>
+270: 
+271:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">key</span>
+272:       <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:private</span>
+273:         <span class="ruby-keyword kw">return</span> <span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">PKey</span><span class="ruby-operator">::</span><span class="ruby-constant">RSA</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">key</span>), <span class="ruby-identifier">passphrase</span>)
+274:       <span class="ruby-keyword kw">else</span>
+275:         <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Can only load :public or :private keys&quot;</span>
+276:       <span class="ruby-keyword kw">end</span>
+277:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000382" class="method-detail">
+        <a name="M000382"></a>
+
+        <div class="method-heading">
+          <a href="#M000382" class="method-signature">
+          <span class="method-name">rsa_decrypt_with_private</span><span class="method-args">(crypt_string)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Use the private key to RSA decrypt data
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000382-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000382-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 123</span>
+123:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rsa_decrypt_with_private</span>(<span class="ruby-identifier">crypt_string</span>)
+124:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;No private key set&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@private_key</span>
+125: 
+126:       <span class="ruby-ivar">@private_key</span>.<span class="ruby-identifier">private_decrypt</span>(<span class="ruby-identifier">crypt_string</span>)
+127:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000384" class="method-detail">
+        <a name="M000384"></a>
+
+        <div class="method-heading">
+          <a href="#M000384" class="method-signature">
+          <span class="method-name">rsa_decrypt_with_public</span><span class="method-args">(crypt_string)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Use the public key to RSA decrypt data
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000384-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000384-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 137</span>
+137:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rsa_decrypt_with_public</span>(<span class="ruby-identifier">crypt_string</span>)
+138:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;No public key set&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@public_key</span>
+139: 
+140:       <span class="ruby-ivar">@public_key</span>.<span class="ruby-identifier">public_decrypt</span>(<span class="ruby-identifier">crypt_string</span>)
+141:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000383" class="method-detail">
+        <a name="M000383"></a>
+
+        <div class="method-heading">
+          <a href="#M000383" class="method-signature">
+          <span class="method-name">rsa_encrypt_with_private</span><span class="method-args">(plain_string)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Use the private key to RSA encrypt data
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000383-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000383-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 130</span>
+130:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rsa_encrypt_with_private</span>(<span class="ruby-identifier">plain_string</span>)
+131:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;No private key set&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@private_key</span>
+132: 
+133:       <span class="ruby-ivar">@private_key</span>.<span class="ruby-identifier">private_encrypt</span>(<span class="ruby-identifier">plain_string</span>)
+134:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000381" class="method-detail">
+        <a name="M000381"></a>
+
+        <div class="method-heading">
+          <a href="#M000381" class="method-signature">
+          <span class="method-name">rsa_encrypt_with_public</span><span class="method-args">(plain_string)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Use the public key to RSA encrypt data
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000381-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000381-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 116</span>
+116:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rsa_encrypt_with_public</span>(<span class="ruby-identifier">plain_string</span>)
+117:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;No public key set&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@public_key</span>
+118: 
+119:       <span class="ruby-ivar">@public_key</span>.<span class="ruby-identifier">public_encrypt</span>(<span class="ruby-identifier">plain_string</span>)
+120:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000387" class="method-detail">
+        <a name="M000387"></a>
+
+        <div class="method-heading">
+          <a href="#M000387" class="method-signature">
+          <span class="method-name">sign</span><span class="method-args">(string, base64=false)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Signs a string using the private key
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000387-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000387-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 168</span>
+168:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sign</span>(<span class="ruby-identifier">string</span>, <span class="ruby-identifier">base64</span>=<span class="ruby-keyword kw">false</span>)
+169:       <span class="ruby-identifier">sig</span> = <span class="ruby-ivar">@private_key</span>.<span class="ruby-identifier">sign</span>(<span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA1</span>.<span class="ruby-identifier">new</span>, <span class="ruby-identifier">string</span>)
+170: 
+171:       <span class="ruby-identifier">base64</span> <span class="ruby-value">? </span><span class="ruby-identifier">base64_encode</span>(<span class="ruby-identifier">sig</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">sig</span>
+172:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000388" class="method-detail">
+        <a name="M000388"></a>
+
+        <div class="method-heading">
+          <a href="#M000388" class="method-signature">
+          <span class="method-name">verify_signature</span><span class="method-args">(signature, string, base64=false)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Using the public key verifies that a string was signed using the private
+key
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000388-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000388-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/ssl.rb, line 175</span>
+175:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">verify_signature</span>(<span class="ruby-identifier">signature</span>, <span class="ruby-identifier">string</span>, <span class="ruby-identifier">base64</span>=<span class="ruby-keyword kw">false</span>)
+176:       <span class="ruby-identifier">signature</span> = <span class="ruby-identifier">base64_decode</span>(<span class="ruby-identifier">signature</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base64</span>
+177: 
+178:       <span class="ruby-ivar">@public_key</span>.<span class="ruby-identifier">verify</span>(<span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA1</span>.<span class="ruby-identifier">new</span>, <span class="ruby-identifier">signature</span>, <span class="ruby-identifier">string</span>)
+179:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Security.html b/doc/classes/MCollective/Security.html
new file mode 100644 (file)
index 0000000..739dccb
--- /dev/null
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Module: MCollective::Security</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Module</strong></td>
+          <td class="class-name-in-header">MCollective::Security</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/security_rb.html">
+                lib/mcollective/security.rb
+                </a>
+        <br />
+                <a href="../../files/lib/mcollective/security/base_rb.html">
+                lib/mcollective/security/base.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+<a href="Security.html">Security</a> is implimented using a module
+structure and installations can configure which module they want to use.
+</p>
+<p>
+<a href="Security.html">Security</a> modules deal with various aspects of
+authentication and authorization:
+</p>
+<ul>
+<li>Determines if a filter excludes this host from dealing with a request
+
+</li>
+<li>Serialization and Deserialization of messages
+
+</li>
+<li>Validation of messages against keys, certificates or whatever the class
+choose to impliment
+
+</li>
+<li>Encoding and Decoding of messages
+
+</li>
+</ul>
+<p>
+To impliment a new security class using <a href="SSL.html">SSL</a> for
+example you would inherit from the base class and only impliment:
+</p>
+<ul>
+<li>decodemsg
+
+</li>
+<li>encodereply
+
+</li>
+<li>encoderequest
+
+</li>
+<li>validrequest?
+
+</li>
+</ul>
+<p>
+Each of these methods should increment various stats counters, see the
+default MCollective::Security::Psk module for examples of this
+</p>
+<p>
+Filtering can be extended by providing a new validate_filter? method.
+</p>
+
+    </div>
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+    <div id="class-list">
+      <h3 class="section-bar">Classes and Modules</h3>
+
+      Class <a href="Security/Base.html" class="link">MCollective::Security::Base</a><br />
+
+    </div>
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Security/Base.html b/doc/classes/MCollective/Security/Base.html
new file mode 100644 (file)
index 0000000..52886e9
--- /dev/null
@@ -0,0 +1,677 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Security::Base</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Security::Base</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/security/base_rb.html">
+                lib/mcollective/security/base.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+This is a base class the other security modules should inherit from it
+handles statistics and validation of messages that should in most cases
+apply to all security models.
+</p>
+<p>
+To create your own security plugin you should provide a plugin that
+inherits from this and provides the following methods:
+</p>
+<p>
+<a href="Base.html#M000271">decodemsg</a> - Decodes a message that was
+received from the middleware <a href="Base.html#M000270">encodereply</a> -
+Encodes a reply message to a previous request message <a
+href="Base.html#M000269">encoderequest</a> - Encodes a <a
+href="Base.html#M000261">new</a> request message <a
+href="Base.html#M000268">validrequest?</a> - Validates a request received
+from the middleware
+</p>
+<p>
+Optionally if you are identifying users by some other means like
+certificate name you can provide your own <a
+href="Base.html#M000267">callerid</a> method that can provide the rest of
+the system with an id, and you would see this id being usable in SimpleRPC
+authorization methods
+</p>
+<p>
+The @initiated_by variable will be set to either :client or :node depending
+on who is using this plugin. This is to help security providers that
+operate in an asymetric mode like public/private key based systems.
+</p>
+<p>
+Specifics of each of these are a bit fluid and the interfaces for this is
+not set in stone yet, specifically the encode methods will be provided with
+a helper that takes care of encoding the core requirements. The best place
+to see how security works is by looking at the provided
+MCollective::Security::PSK plugin.
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000267">callerid</a>&nbsp;&nbsp;
+      <a href="#M000263">create_reply</a>&nbsp;&nbsp;
+      <a href="#M000264">create_request</a>&nbsp;&nbsp;
+      <a href="#M000271">decodemsg</a>&nbsp;&nbsp;
+      <a href="#M000270">encodereply</a>&nbsp;&nbsp;
+      <a href="#M000269">encoderequest</a>&nbsp;&nbsp;
+      <a href="#M000260">inherited</a>&nbsp;&nbsp;
+      <a href="#M000261">new</a>&nbsp;&nbsp;
+      <a href="#M000265">should_process_msg?</a>&nbsp;&nbsp;
+      <a href="#M000266">valid_callerid?</a>&nbsp;&nbsp;
+      <a href="#M000262">validate_filter?</a>&nbsp;&nbsp;
+      <a href="#M000268">validrequest?</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">initiated_by</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">stats</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000260" class="method-detail">
+        <a name="M000260"></a>
+
+        <div class="method-heading">
+          <a href="#M000260" class="method-signature">
+          <span class="method-name">inherited</span><span class="method-args">(klass)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Register plugins that inherits base
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000260-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000260-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/security/base.rb, line 32</span>
+32:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">inherited</span>(<span class="ruby-identifier">klass</span>)
+33:         <span class="ruby-constant">PluginManager</span> <span class="ruby-operator">&lt;&lt;</span> {<span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;security_plugin&quot;</span>, <span class="ruby-identifier">:class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">to_s</span>}
+34:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000261" class="method-detail">
+        <a name="M000261"></a>
+
+        <div class="method-heading">
+          <a href="#M000261" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Initializes configuration and logging as well as prepare a zero&#8216;d
+hash of stats various security methods and filter validators should
+increment stats, see MCollective::Security::Psk for a sample
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000261-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000261-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/security/base.rb, line 38</span>
+38:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
+39:         <span class="ruby-ivar">@config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>
+40:         <span class="ruby-ivar">@log</span> = <span class="ruby-constant">Log</span>
+41:         <span class="ruby-ivar">@stats</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;global_stats&quot;</span>]
+42:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000267" class="method-detail">
+        <a name="M000267"></a>
+
+        <div class="method-heading">
+          <a href="#M000267" class="method-signature">
+          <span class="method-name">callerid</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns a unique id for the caller, by default we just use the unix user
+id, security plugins can provide their own means of doing ids.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000267-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000267-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/security/base.rb, line 219</span>
+219:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">callerid</span>
+220:         <span class="ruby-node">&quot;uid=#{Process.uid}&quot;</span>
+221:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000263" class="method-detail">
+        <a name="M000263"></a>
+
+        <div class="method-heading">
+          <a href="#M000263" class="method-signature">
+          <span class="method-name">create_reply</span><span class="method-args">(reqid, agent, body)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000263-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000263-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/security/base.rb, line 167</span>
+167:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_reply</span>(<span class="ruby-identifier">reqid</span>, <span class="ruby-identifier">agent</span>, <span class="ruby-identifier">body</span>)
+168:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Encoded a message for request #{reqid}&quot;</span>)
+169: 
+170:         {<span class="ruby-identifier">:senderid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">identity</span>,
+171:          <span class="ruby-identifier">:requestid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">reqid</span>,
+172:          <span class="ruby-identifier">:senderagent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">agent</span>,
+173:          <span class="ruby-identifier">:msgtime</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">utc</span>.<span class="ruby-identifier">to_i</span>,
+174:          <span class="ruby-identifier">:body</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">body</span>}
+175:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000264" class="method-detail">
+        <a name="M000264"></a>
+
+        <div class="method-heading">
+          <a href="#M000264" class="method-signature">
+          <span class="method-name">create_request</span><span class="method-args">(reqid, filter, msg, initiated_by, target_agent, target_collective, ttl=60)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000264-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000264-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/security/base.rb, line 177</span>
+177:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_request</span>(<span class="ruby-identifier">reqid</span>, <span class="ruby-identifier">filter</span>, <span class="ruby-identifier">msg</span>, <span class="ruby-identifier">initiated_by</span>, <span class="ruby-identifier">target_agent</span>, <span class="ruby-identifier">target_collective</span>, <span class="ruby-identifier">ttl</span>=<span class="ruby-value">60</span>)
+178:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Encoding a request for agent '#{target_agent}' in collective #{target_collective} with request id #{reqid}&quot;</span>)
+179: 
+180:         {<span class="ruby-identifier">:body</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">msg</span>,
+181:          <span class="ruby-identifier">:senderid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">identity</span>,
+182:          <span class="ruby-identifier">:requestid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">reqid</span>,
+183:          <span class="ruby-identifier">:filter</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">filter</span>,
+184:          <span class="ruby-identifier">:collective</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">target_collective</span>,
+185:          <span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">target_agent</span>,
+186:          <span class="ruby-identifier">:callerid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">callerid</span>,
+187:          <span class="ruby-identifier">:ttl</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">ttl</span>,
+188:          <span class="ruby-identifier">:msgtime</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">utc</span>.<span class="ruby-identifier">to_i</span>}
+189:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000271" class="method-detail">
+        <a name="M000271"></a>
+
+        <div class="method-heading">
+          <a href="#M000271" class="method-signature">
+          <span class="method-name">decodemsg</span><span class="method-args">(msg)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+<a href="../Security.html">Security</a> providers should provide this, see
+MCollective::Security::Psk
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000271-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000271-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/security/base.rb, line 239</span>
+239:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">decodemsg</span>(<span class="ruby-identifier">msg</span>)
+240:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">&quot;decodemsg is not implemented in #{self.class}&quot;</span>)
+241:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000270" class="method-detail">
+        <a name="M000270"></a>
+
+        <div class="method-heading">
+          <a href="#M000270" class="method-signature">
+          <span class="method-name">encodereply</span><span class="method-args">(sender, msg, requestcallerid=nil)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+<a href="../Security.html">Security</a> providers should provide this, see
+MCollective::Security::Psk
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000270-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000270-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/security/base.rb, line 234</span>
+234:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">encodereply</span>(<span class="ruby-identifier">sender</span>, <span class="ruby-identifier">msg</span>, <span class="ruby-identifier">requestcallerid</span>=<span class="ruby-keyword kw">nil</span>)
+235:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">&quot;encodereply is not implemented in #{self.class}&quot;</span>)
+236:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000269" class="method-detail">
+        <a name="M000269"></a>
+
+        <div class="method-heading">
+          <a href="#M000269" class="method-signature">
+          <span class="method-name">encoderequest</span><span class="method-args">(sender, msg, filter={})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+<a href="../Security.html">Security</a> providers should provide this, see
+MCollective::Security::Psk
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000269-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000269-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/security/base.rb, line 229</span>
+229:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">encoderequest</span>(<span class="ruby-identifier">sender</span>, <span class="ruby-identifier">msg</span>, <span class="ruby-identifier">filter</span>={})
+230:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">&quot;encoderequest is not implemented in #{self.class}&quot;</span>)
+231:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000265" class="method-detail">
+        <a name="M000265"></a>
+
+        <div class="method-heading">
+          <a href="#M000265" class="method-signature">
+          <span class="method-name">should_process_msg?</span><span class="method-args">(msg, msgid)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Give a MC::Message instance and a message id this will figure out if you
+the incoming message id matches the one the <a
+href="../Message.html">Message</a> object is expecting and raise if its not
+</p>
+<p>
+Mostly used by security plugins to figure out if they should do the hard
+work of decrypting etc messages that would only later on be ignored
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000265-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000265-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/security/base.rb, line 196</span>
+196:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">should_process_msg?</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">msgid</span>)
+197:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">msg</span>.<span class="ruby-identifier">expected_msgid</span>
+198:           <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">msg</span>.<span class="ruby-identifier">expected_msgid</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">msgid</span>
+199:             <span class="ruby-identifier">msgtext</span> = <span class="ruby-value str">&quot;Got a message with id %s but was expecting %s, ignoring message&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">msg</span>.<span class="ruby-identifier">expected_msgid</span>]
+200:             <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span> <span class="ruby-identifier">msgtext</span>
+201:             <span class="ruby-identifier">raise</span> <span class="ruby-constant">MsgDoesNotMatchRequestID</span>, <span class="ruby-identifier">msgtext</span>
+202:           <span class="ruby-keyword kw">end</span>
+203:         <span class="ruby-keyword kw">end</span>
+204: 
+205:         <span class="ruby-keyword kw">true</span>
+206:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000266" class="method-detail">
+        <a name="M000266"></a>
+
+        <div class="method-heading">
+          <a href="#M000266" class="method-signature">
+          <span class="method-name">valid_callerid?</span><span class="method-args">(id)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Validates a <a href="Base.html#M000267">callerid</a>. We do not want to
+allow things like \ and / in callerids since other plugins make assumptions
+that these are safe strings.
+</p>
+<p>
+callerids are generally in the form uid=123 or cert=foo etc so we do that
+here but security plugins could override this for some complex uses
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000266-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000266-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/security/base.rb, line 213</span>
+213:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid_callerid?</span>(<span class="ruby-identifier">id</span>)
+214:         <span class="ruby-operator">!</span><span class="ruby-operator">!</span><span class="ruby-identifier">id</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/^[\w]+=[\w\.\-]+$/</span>)
+215:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000262" class="method-detail">
+        <a name="M000262"></a>
+
+        <div class="method-heading">
+          <a href="#M000262" class="method-signature">
+          <span class="method-name">validate_filter?</span><span class="method-args">(filter)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Takes a Hash with a filter in it and validates it against host information.
+</p>
+<p>
+At present this supports filter matches against the following criteria:
+</p>
+<ul>
+<li>puppet_class|cf_class - Presence of a configuration management class in
+
+<pre>
+                        the file configured with classesfile
+</pre>
+</li>
+<li>agent - Presence of a <a href="../../MCollective.html">MCollective</a>
+agent with a supplied name
+
+</li>
+<li>fact - The value of a fact avout this system
+
+</li>
+<li>identity - the configured identity of the system
+
+</li>
+</ul>
+<p>
+TODO: Support REGEX and/or multiple filter keys to be AND&#8216;d
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000262-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000262-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/security/base.rb, line 55</span>
+ 55:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validate_filter?</span>(<span class="ruby-identifier">filter</span>)
+ 56:         <span class="ruby-identifier">failed</span> = <span class="ruby-value">0</span>
+ 57:         <span class="ruby-identifier">passed</span> = <span class="ruby-value">0</span>
+ 58: 
+ 59:         <span class="ruby-identifier">passed</span> = <span class="ruby-value">1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">empty_filter?</span>(<span class="ruby-identifier">filter</span>)
+ 60: 
+ 61:         <span class="ruby-identifier">filter</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span>
+ 62:           <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">key</span>
+ 63:           <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/puppet_class|cf_class/</span>
+ 64:             <span class="ruby-identifier">filter</span>[<span class="ruby-identifier">key</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>
+ 65:               <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Checking for class #{f}&quot;</span>)
+ 66:               <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">has_cf_class?</span>(<span class="ruby-identifier">f</span>) <span class="ruby-keyword kw">then</span>
+ 67:                 <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Passing based on configuration management class #{f}&quot;</span>)
+ 68:                 <span class="ruby-identifier">passed</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ 69:               <span class="ruby-keyword kw">else</span>
+ 70:                 <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Failing based on configuration management class #{f}&quot;</span>)
+ 71:                 <span class="ruby-identifier">failed</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+ 72:               <span class="ruby-keyword kw">end</span>
+ 73:             <span class="ruby-keyword kw">end</span>
+ 74: 
+ 75:           <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;compound&quot;</span>
+ 76:             <span class="ruby-identifier">filter</span>[<span class="ruby-identifier">key</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">compound</span><span class="ruby-operator">|</span>
+ 77:               <span class="ruby-identifier">result</span> = <span class="ruby-keyword kw">false</span>
+ 78:               <span class="ruby-identifier">truth_values</span> = []
+ 79: 
+ 80:               <span class="ruby-keyword kw">begin</span>
+ 81:                 <span class="ruby-identifier">compound</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">expression</span><span class="ruby-operator">|</span>
+ 82:                   <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">expression</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">first</span>
+ 83:                     <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;statement&quot;</span>
+ 84:                       <span class="ruby-identifier">truth_values</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Matcher</span>.<span class="ruby-identifier">eval_compound_statement</span>(<span class="ruby-identifier">expression</span>).<span class="ruby-identifier">to_s</span>
+ 85:                     <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;fstatement&quot;</span>
+ 86:                       <span class="ruby-identifier">truth_values</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Matcher</span>.<span class="ruby-identifier">eval_compound_fstatement</span>(<span class="ruby-identifier">expression</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">first</span>)
+ 87:                     <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;and&quot;</span>
+ 88:                       <span class="ruby-identifier">truth_values</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&amp;&amp;&quot;</span>
+ 89:                     <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;or&quot;</span>
+ 90:                       <span class="ruby-identifier">truth_values</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;||&quot;</span>
+ 91:                     <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;(&quot;</span>
+ 92:                       <span class="ruby-identifier">truth_values</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;(&quot;</span>
+ 93:                     <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;)&quot;</span>
+ 94:                       <span class="ruby-identifier">truth_values</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;)&quot;</span>
+ 95:                     <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;not&quot;</span>
+ 96:                       <span class="ruby-identifier">truth_values</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;!&quot;</span>
+ 97:                   <span class="ruby-keyword kw">end</span>
+ 98:                 <span class="ruby-keyword kw">end</span>
+ 99: 
+100:                 <span class="ruby-identifier">result</span> = <span class="ruby-identifier">eval</span>(<span class="ruby-identifier">truth_values</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot; &quot;</span>))
+101:               <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">DDLValidationError</span>
+102:                 <span class="ruby-identifier">result</span> = <span class="ruby-keyword kw">false</span>
+103:               <span class="ruby-keyword kw">end</span>
+104: 
+105:               <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>
+106:                 <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Passing based on class and fact composition&quot;</span>)
+107:                 <span class="ruby-identifier">passed</span> <span class="ruby-operator">+=</span><span class="ruby-value">1</span>
+108:               <span class="ruby-keyword kw">else</span>
+109:                 <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Failing based on class and fact composition&quot;</span>)
+110:                 <span class="ruby-identifier">failed</span> <span class="ruby-operator">+=</span><span class="ruby-value">1</span>
+111:               <span class="ruby-keyword kw">end</span>
+112:             <span class="ruby-keyword kw">end</span>
+113: 
+114:           <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;agent&quot;</span>
+115:             <span class="ruby-identifier">filter</span>[<span class="ruby-identifier">key</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>
+116:               <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">has_agent?</span>(<span class="ruby-identifier">f</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">f</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;mcollective&quot;</span>
+117:                 <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Passing based on agent #{f}&quot;</span>)
+118:                 <span class="ruby-identifier">passed</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+119:               <span class="ruby-keyword kw">else</span>
+120:                 <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Failing based on agent #{f}&quot;</span>)
+121:                 <span class="ruby-identifier">failed</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+122:               <span class="ruby-keyword kw">end</span>
+123:             <span class="ruby-keyword kw">end</span>
+124: 
+125:           <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;fact&quot;</span>
+126:             <span class="ruby-identifier">filter</span>[<span class="ruby-identifier">key</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>
+127:               <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">has_fact?</span>(<span class="ruby-identifier">f</span>[<span class="ruby-identifier">:fact</span>], <span class="ruby-identifier">f</span>[<span class="ruby-identifier">:value</span>], <span class="ruby-identifier">f</span>[<span class="ruby-identifier">:operator</span>])
+128:                 <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Passing based on fact #{f[:fact]} #{f[:operator]} #{f[:value]}&quot;</span>)
+129:                 <span class="ruby-identifier">passed</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+130:               <span class="ruby-keyword kw">else</span>
+131:                 <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Failing based on fact #{f[:fact]} #{f[:operator]} #{f[:value]}&quot;</span>)
+132:                 <span class="ruby-identifier">failed</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+133:               <span class="ruby-keyword kw">end</span>
+134:             <span class="ruby-keyword kw">end</span>
+135: 
+136:           <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;identity&quot;</span>
+137:             <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">filter</span>[<span class="ruby-identifier">key</span>].<span class="ruby-identifier">empty?</span>
+138:               <span class="ruby-comment cmt"># Identity filters should not be 'and' but 'or' as each node can only have one identity</span>
+139:               <span class="ruby-identifier">matched</span> = <span class="ruby-identifier">filter</span>[<span class="ruby-identifier">key</span>].<span class="ruby-identifier">select</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">has_identity?</span>(<span class="ruby-identifier">f</span>)}.<span class="ruby-identifier">size</span>
+140: 
+141:               <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">matched</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
+142:                 <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Passing based on identity&quot;</span>)
+143:                 <span class="ruby-identifier">passed</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+144:               <span class="ruby-keyword kw">else</span>
+145:                 <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Failed based on identity&quot;</span>)
+146:                 <span class="ruby-identifier">failed</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+147:               <span class="ruby-keyword kw">end</span>
+148:             <span class="ruby-keyword kw">end</span>
+149:           <span class="ruby-keyword kw">end</span>
+150:         <span class="ruby-keyword kw">end</span>
+151: 
+152:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">failed</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">passed</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
+153:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Message passed the filter checks&quot;</span>)
+154: 
+155:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">passed</span>
+156: 
+157:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
+158:         <span class="ruby-keyword kw">else</span>
+159:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Message failed the filter checks&quot;</span>)
+160: 
+161:           <span class="ruby-ivar">@stats</span>.<span class="ruby-identifier">filtered</span>
+162: 
+163:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
+164:         <span class="ruby-keyword kw">end</span>
+165:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000268" class="method-detail">
+        <a name="M000268"></a>
+
+        <div class="method-heading">
+          <a href="#M000268" class="method-signature">
+          <span class="method-name">validrequest?</span><span class="method-args">(req)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+<a href="../Security.html">Security</a> providers should provide this, see
+MCollective::Security::Psk
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000268-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000268-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/security/base.rb, line 224</span>
+224:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">validrequest?</span>(<span class="ruby-identifier">req</span>)
+225:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">&quot;validrequest? is not implemented in #{self.class}&quot;</span>)
+226:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/SecurityValidationFailed.html b/doc/classes/MCollective/SecurityValidationFailed.html
new file mode 100644 (file)
index 0000000..b42e94b
--- /dev/null
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::SecurityValidationFailed</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::SecurityValidationFailed</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/exception_rb.html">
+                lib/mcollective/exception.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                RuntimeError
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Shell.html b/doc/classes/MCollective/Shell.html
new file mode 100644 (file)
index 0000000..31bc5a3
--- /dev/null
@@ -0,0 +1,303 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::Shell</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::Shell</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/shell_rb.html">
+                lib/mcollective/shell.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+Wrapper around systemu that handles executing of system commands in a way
+that makes stdout, stderr and status available. Supports timeouts and sets
+a default sane environment.
+</p>
+<pre>
+  s = Shell.new(&quot;date&quot;, opts)
+  s.runcommand
+  puts s.stdout
+  puts s.stderr
+  puts s.status.exitstatus
+</pre>
+<p>
+Options hash can have:
+</p>
+<pre>
+  cwd         - the working directory the command will be run from
+  stdin       - a string that will be sent to stdin of the program
+  stdout      - a variable that will receive stdout, must support &lt;&lt;
+  stderr      - a variable that will receive stdin, must support &lt;&lt;
+  environment - the shell environment, defaults to include LC_ALL=C
+                set to nil to clear the environment even of LC_ALL
+</pre>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000371">new</a>&nbsp;&nbsp;
+      <a href="#M000372">runcommand</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">command</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">cwd</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">environment</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">status</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">stderr</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">stdin</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">stdout</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000371" class="method-detail">
+        <a name="M000371"></a>
+
+        <div class="method-heading">
+          <a href="#M000371" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">(command, options={})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000371-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000371-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/shell.rb, line 24</span>
+24:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">command</span>, <span class="ruby-identifier">options</span>={})
+25:       <span class="ruby-ivar">@environment</span> = {<span class="ruby-value str">&quot;LC_ALL&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;C&quot;</span>}
+26:       <span class="ruby-ivar">@command</span> = <span class="ruby-identifier">command</span>
+27:       <span class="ruby-ivar">@status</span> = <span class="ruby-keyword kw">nil</span>
+28:       <span class="ruby-ivar">@stdout</span> = <span class="ruby-value str">&quot;&quot;</span>
+29:       <span class="ruby-ivar">@stderr</span> = <span class="ruby-value str">&quot;&quot;</span>
+30:       <span class="ruby-ivar">@stdin</span> = <span class="ruby-keyword kw">nil</span>
+31:       <span class="ruby-ivar">@cwd</span> = <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">tmpdir</span>
+32: 
+33:       <span class="ruby-identifier">options</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">opt</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
+34:         <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">opt</span>.<span class="ruby-identifier">to_s</span>
+35:           <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;stdout&quot;</span>
+36:             <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;stdout should support &lt;&lt;&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value str">&quot;&lt;&lt;&quot;</span>)
+37:             <span class="ruby-ivar">@stdout</span> = <span class="ruby-identifier">val</span>
+38: 
+39:           <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;stderr&quot;</span>
+40:             <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;stderr should support &lt;&lt;&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value str">&quot;&lt;&lt;&quot;</span>)
+41:             <span class="ruby-ivar">@stderr</span> = <span class="ruby-identifier">val</span>
+42: 
+43:           <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;stdin&quot;</span>
+44:             <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;stdin should be a String&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
+45:             <span class="ruby-ivar">@stdin</span> = <span class="ruby-identifier">val</span>
+46: 
+47:           <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;cwd&quot;</span>
+48:             <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Directory #{val} does not exist&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">val</span>)
+49:             <span class="ruby-ivar">@cwd</span> = <span class="ruby-identifier">val</span>
+50: 
+51:           <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;environment&quot;</span>
+52:             <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">nil?</span>
+53:               <span class="ruby-ivar">@environment</span> = {}
+54:             <span class="ruby-keyword kw">else</span>
+55:               <span class="ruby-ivar">@environment</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">val</span>.<span class="ruby-identifier">dup</span>)
+56:             <span class="ruby-keyword kw">end</span>
+57:         <span class="ruby-keyword kw">end</span>
+58:       <span class="ruby-keyword kw">end</span>
+59:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000372" class="method-detail">
+        <a name="M000372"></a>
+
+        <div class="method-heading">
+          <a href="#M000372" class="method-signature">
+          <span class="method-name">runcommand</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Actually does the systemu call passing in the correct environment, stdout
+and stderr
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000372-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000372-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/shell.rb, line 62</span>
+62:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">runcommand</span>
+63:       <span class="ruby-identifier">opts</span> = {<span class="ruby-value str">&quot;env&quot;</span>    =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@environment</span>,
+64:               <span class="ruby-value str">&quot;stdout&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@stdout</span>,
+65:               <span class="ruby-value str">&quot;stderr&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@stderr</span>,
+66:               <span class="ruby-value str">&quot;cwd&quot;</span>    =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@cwd</span>}
+67: 
+68:       <span class="ruby-identifier">opts</span>[<span class="ruby-value str">&quot;stdin&quot;</span>] = <span class="ruby-ivar">@stdin</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@stdin</span>
+69: 
+70:       <span class="ruby-comment cmt"># Check if the parent thread is alive. If it should die,</span>
+71:       <span class="ruby-comment cmt"># and the process spawned by systemu is still alive,</span>
+72:       <span class="ruby-comment cmt"># fire off a blocking waitpid and wait for the process to</span>
+73:       <span class="ruby-comment cmt"># finish so that we can avoid zombies.</span>
+74:       <span class="ruby-identifier">thread</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>
+75:       <span class="ruby-ivar">@status</span> = <span class="ruby-identifier">systemu</span>(<span class="ruby-ivar">@command</span>, <span class="ruby-identifier">opts</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">cid</span><span class="ruby-operator">|</span>
+76:         <span class="ruby-keyword kw">begin</span>
+77:           <span class="ruby-keyword kw">while</span>(<span class="ruby-identifier">thread</span>.<span class="ruby-identifier">alive?</span>)
+78:             <span class="ruby-identifier">sleep</span> <span class="ruby-value">0</span><span class="ruby-value">.1</span>
+79:           <span class="ruby-keyword kw">end</span>
+80: 
+81:           <span class="ruby-constant">Process</span>.<span class="ruby-identifier">waitpid</span>(<span class="ruby-identifier">cid</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Process</span>.<span class="ruby-identifier">getpgid</span>(<span class="ruby-identifier">cid</span>)
+82:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">SystemExit</span>
+83:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ESRCH</span>
+84:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ECHILD</span>
+85:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+86:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">info</span>(<span class="ruby-node">&quot;Unexpected exception received while waiting for child process: #{e.class}: #{e}&quot;</span>)
+87:         <span class="ruby-keyword kw">end</span>
+88:       <span class="ruby-keyword kw">end</span>
+89:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Translatable.html b/doc/classes/MCollective/Translatable.html
new file mode 100644 (file)
index 0000000..732579d
--- /dev/null
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Module: MCollective::Translatable</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Module</strong></td>
+          <td class="class-name-in-header">MCollective::Translatable</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/translatable_rb.html">
+                lib/mcollective/translatable.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000246">log_code</a>&nbsp;&nbsp;
+      <a href="#M000248">logexception</a>&nbsp;&nbsp;
+      <a href="#M000247">raise_code</a>&nbsp;&nbsp;
+      <a href="#M000245">t</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000246" class="method-detail">
+        <a name="M000246"></a>
+
+        <div class="method-heading">
+          <a href="#M000246" class="method-signature">
+          <span class="method-name">log_code</span><span class="method-args">(msgid, default, level, args={})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000246-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000246-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/translatable.rb, line 7</span>
+ 7:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_code</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">default</span>, <span class="ruby-identifier">level</span>, <span class="ruby-identifier">args</span>={})
+ 8:       <span class="ruby-identifier">msg</span> = <span class="ruby-value str">&quot;%s: %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">msgid</span>, <span class="ruby-constant">Util</span>.<span class="ruby-identifier">t</span>(<span class="ruby-identifier">msgid</span>, {<span class="ruby-identifier">:default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">default</span>}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">args</span>))]
+ 9: 
+10:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">log</span>(<span class="ruby-identifier">level</span>, <span class="ruby-identifier">msg</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">caller</span>[<span class="ruby-value">1</span>]))
+11:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000248" class="method-detail">
+        <a name="M000248"></a>
+
+        <div class="method-heading">
+          <a href="#M000248" class="method-signature">
+          <span class="method-name">logexception</span><span class="method-args">(msgid, default, level, e, backtrace=false)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000248-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000248-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/translatable.rb, line 20</span>
+20:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">logexception</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">default</span>, <span class="ruby-identifier">level</span>, <span class="ruby-identifier">e</span>, <span class="ruby-identifier">backtrace</span>=<span class="ruby-keyword kw">false</span>)
+21:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">logexception</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">level</span>, <span class="ruby-identifier">e</span>, <span class="ruby-identifier">backtrace</span>)
+22:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000247" class="method-detail">
+        <a name="M000247"></a>
+
+        <div class="method-heading">
+          <a href="#M000247" class="method-signature">
+          <span class="method-name">raise_code</span><span class="method-args">(msgid, default, level, args={})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000247-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000247-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/translatable.rb, line 13</span>
+13:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">raise_code</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">default</span>, <span class="ruby-identifier">level</span>, <span class="ruby-identifier">args</span>={})
+14:       <span class="ruby-identifier">exception</span> = <span class="ruby-constant">CodedError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">default</span>, <span class="ruby-identifier">level</span>, <span class="ruby-identifier">args</span>)
+15:       <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">set_backtrace</span> <span class="ruby-identifier">caller</span>
+16: 
+17:       <span class="ruby-identifier">raise</span> <span class="ruby-identifier">exception</span>
+18:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000245" class="method-detail">
+        <a name="M000245"></a>
+
+        <div class="method-heading">
+          <a href="#M000245" class="method-signature">
+          <span class="method-name">t</span><span class="method-args">(msgid, default, args={})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000245-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000245-source">
+<pre>
+   <span class="ruby-comment cmt"># File lib/mcollective/translatable.rb, line 3</span>
+3:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">t</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">default</span>, <span class="ruby-identifier">args</span>={})
+4:       <span class="ruby-constant">Util</span>.<span class="ruby-identifier">t</span>(<span class="ruby-identifier">msgid</span>, {<span class="ruby-identifier">:default</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">default</span>}.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">args</span>))
+5:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/UnixDaemon.html b/doc/classes/MCollective/UnixDaemon.html
new file mode 100644 (file)
index 0000000..64f02a5
--- /dev/null
@@ -0,0 +1,198 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::UnixDaemon</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::UnixDaemon</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/unix_daemon_rb.html">
+                lib/mcollective/unix_daemon.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000423">daemonize</a>&nbsp;&nbsp;
+      <a href="#M000424">daemonize_runner</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000423" class="method-detail">
+        <a name="M000423"></a>
+
+        <div class="method-heading">
+          <a href="#M000423" class="method-signature">
+          <span class="method-name">daemonize</span><span class="method-args">() {|| ...}</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Daemonize the current process
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000423-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000423-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/unix_daemon.rb, line 4</span>
+ 4:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">daemonize</span>
+ 5:       <span class="ruby-identifier">fork</span> <span class="ruby-keyword kw">do</span>
+ 6:         <span class="ruby-constant">Process</span>.<span class="ruby-identifier">setsid</span>
+ 7:         <span class="ruby-identifier">exit</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fork</span>
+ 8:         <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span>(<span class="ruby-value str">'/tmp'</span>)
+ 9:         <span class="ruby-constant">STDIN</span>.<span class="ruby-identifier">reopen</span>(<span class="ruby-value str">'/dev/null'</span>)
+10:         <span class="ruby-constant">STDOUT</span>.<span class="ruby-identifier">reopen</span>(<span class="ruby-value str">'/dev/null'</span>, <span class="ruby-value str">'a'</span>)
+11:         <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">reopen</span>(<span class="ruby-value str">'/dev/null'</span>, <span class="ruby-value str">'a'</span>)
+12: 
+13:         <span class="ruby-keyword kw">yield</span>
+14:       <span class="ruby-keyword kw">end</span>
+15:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000424" class="method-detail">
+        <a name="M000424"></a>
+
+        <div class="method-heading">
+          <a href="#M000424" class="method-signature">
+          <span class="method-name">daemonize_runner</span><span class="method-args">(pid=nil)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000424-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000424-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/unix_daemon.rb, line 17</span>
+17:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">daemonize_runner</span>(<span class="ruby-identifier">pid</span>=<span class="ruby-keyword kw">nil</span>)
+18:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;The Unix Daemonizer can not be used on the Windows Platform&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">windows?</span>
+19: 
+20:       <span class="ruby-constant">UnixDaemon</span>.<span class="ruby-identifier">daemonize</span> <span class="ruby-keyword kw">do</span>
+21:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pid</span>
+22:           <span class="ruby-keyword kw">begin</span>
+23:             <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">pid</span>, <span class="ruby-value str">'w'</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">write</span>(<span class="ruby-constant">Process</span>.<span class="ruby-identifier">pid</span>) }
+24:           <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+25:           <span class="ruby-keyword kw">end</span>
+26:         <span class="ruby-keyword kw">end</span>
+27: 
+28:         <span class="ruby-keyword kw">begin</span>
+29:           <span class="ruby-identifier">runner</span> = <span class="ruby-constant">Runner</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">nil</span>)
+30:           <span class="ruby-identifier">runner</span>.<span class="ruby-identifier">run</span>
+31:         <span class="ruby-keyword kw">ensure</span>
+32:           <span class="ruby-constant">File</span>.<span class="ruby-identifier">unlink</span>(<span class="ruby-identifier">pid</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pid</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">pid</span>)
+33:         <span class="ruby-keyword kw">end</span>
+34:       <span class="ruby-keyword kw">end</span>
+35:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/UnknownRPCAction.html b/doc/classes/MCollective/UnknownRPCAction.html
new file mode 100644 (file)
index 0000000..858554c
--- /dev/null
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::UnknownRPCAction</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::UnknownRPCAction</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/exception_rb.html">
+                lib/mcollective/exception.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                <a href="RPCError.html">
+                RPCError
+               </a>
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/UnknownRPCError.html b/doc/classes/MCollective/UnknownRPCError.html
new file mode 100644 (file)
index 0000000..20113c1
--- /dev/null
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::UnknownRPCError</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::UnknownRPCError</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/exception_rb.html">
+                lib/mcollective/exception.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                <a href="RPCError.html">
+                RPCError
+               </a>
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Util.html b/doc/classes/MCollective/Util.html
new file mode 100644 (file)
index 0000000..a7a7018
--- /dev/null
@@ -0,0 +1,1289 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Module: MCollective::Util</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Module</strong></td>
+          <td class="class-name-in-header">MCollective::Util</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/util_rb.html">
+                lib/mcollective/util.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+Some basic utility helper methods useful to clients, agents, runner etc.
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000307">absolute_path?</a>&nbsp;&nbsp;
+      <a href="#M000303">align_text</a>&nbsp;&nbsp;
+      <a href="#M000299">color</a>&nbsp;&nbsp;
+      <a href="#M000300">colorize</a>&nbsp;&nbsp;
+      <a href="#M000305">command_in_path?</a>&nbsp;&nbsp;
+      <a href="#M000290">config_file_for_user</a>&nbsp;&nbsp;
+      <a href="#M000291">default_options</a>&nbsp;&nbsp;
+      <a href="#M000288">empty_filter</a>&nbsp;&nbsp;
+      <a href="#M000287">empty_filter?</a>&nbsp;&nbsp;
+      <a href="#M000284">get_fact</a>&nbsp;&nbsp;
+      <a href="#M000281">has_agent?</a>&nbsp;&nbsp;
+      <a href="#M000283">has_cf_class?</a>&nbsp;&nbsp;
+      <a href="#M000285">has_fact?</a>&nbsp;&nbsp;
+      <a href="#M000286">has_identity?</a>&nbsp;&nbsp;
+      <a href="#M000295">loadclass</a>&nbsp;&nbsp;
+      <a href="#M000292">make_subscriptions</a>&nbsp;&nbsp;
+      <a href="#M000302">mcollective_version</a>&nbsp;&nbsp;
+      <a href="#M000296">parse_fact_string</a>&nbsp;&nbsp;
+      <a href="#M000301">ruby_version</a>&nbsp;&nbsp;
+      <a href="#M000282">setup_windows_sleeper</a>&nbsp;&nbsp;
+      <a href="#M000297">shellescape</a>&nbsp;&nbsp;
+      <a href="#M000308">str_to_bool</a>&nbsp;&nbsp;
+      <a href="#M000293">subscribe</a>&nbsp;&nbsp;
+      <a href="#M000309">t</a>&nbsp;&nbsp;
+      <a href="#M000310">templatepath</a>&nbsp;&nbsp;
+      <a href="#M000304">terminal_dimensions</a>&nbsp;&nbsp;
+      <a href="#M000294">unsubscribe</a>&nbsp;&nbsp;
+      <a href="#M000306">versioncmp</a>&nbsp;&nbsp;
+      <a href="#M000298">windows?</a>&nbsp;&nbsp;
+      <a href="#M000289">windows_prefix</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000307" class="method-detail">
+        <a name="M000307"></a>
+
+        <div class="method-heading">
+          <a href="#M000307" class="method-signature">
+          <span class="method-name">absolute_path?</span><span class="method-args">(path, separator=File::SEPARATOR, alt_separator=File::ALT_SEPARATOR)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+we should really use Pathname#absolute? but it&#8216;s not in all the ruby
+versions we support and it comes down to roughly this
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000307-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000307-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 464</span>
+464:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">absolute_path?</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">separator</span>=<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">SEPARATOR</span>, <span class="ruby-identifier">alt_separator</span>=<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">ALT_SEPARATOR</span>)
+465:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">alt_separator</span>
+466:         <span class="ruby-identifier">path_matcher</span> = <span class="ruby-node">/^([a-zA-Z]:){0,1}[#{Regexp.quote alt_separator}#{Regexp.quote separator}]/</span>
+467:       <span class="ruby-keyword kw">else</span>
+468:         <span class="ruby-identifier">path_matcher</span> = <span class="ruby-node">/^#{Regexp.quote separator}/</span>
+469:       <span class="ruby-keyword kw">end</span>
+470: 
+471:       <span class="ruby-operator">!</span><span class="ruby-operator">!</span><span class="ruby-identifier">path</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">path_matcher</span>)
+472:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000303" class="method-detail">
+        <a name="M000303"></a>
+
+        <div class="method-heading">
+          <a href="#M000303" class="method-signature">
+          <span class="method-name">align_text</span><span class="method-args">(text, console_cols = nil, preamble = 5)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns an aligned_string of text relative to the size of the terminal
+window. If a line in the string exceeds the width of the terminal window
+the line will be chopped off at the whitespace chacter closest to the end
+of the line and prepended to the next line, keeping all indentation.
+</p>
+<p>
+The terminal size is detected by default, but custom line widths can
+passed. All strings will also be left aligned with 5 whitespace characters
+by default.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000303-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000303-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 310</span>
+310:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">align_text</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">console_cols</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">preamble</span> = <span class="ruby-value">5</span>)
+311:       <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">console_cols</span>
+312:         <span class="ruby-identifier">console_cols</span> = <span class="ruby-identifier">terminal_dimensions</span>[<span class="ruby-value">0</span>]
+313: 
+314:         <span class="ruby-comment cmt"># if unknown size we default to the typical unix default</span>
+315:         <span class="ruby-identifier">console_cols</span> = <span class="ruby-value">80</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">console_cols</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
+316:       <span class="ruby-keyword kw">end</span>
+317: 
+318:       <span class="ruby-identifier">console_cols</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">preamble</span>
+319: 
+320:       <span class="ruby-comment cmt"># Return unaligned text if console window is too small</span>
+321:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">text</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">console_cols</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-value">0</span>
+322: 
+323:       <span class="ruby-comment cmt"># If console is 0 this implies unknown so we assume the common</span>
+324:       <span class="ruby-comment cmt"># minimal unix configuration of 80 characters</span>
+325:       <span class="ruby-identifier">console_cols</span> = <span class="ruby-value">80</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">console_cols</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-value">0</span>
+326: 
+327:       <span class="ruby-identifier">text</span> = <span class="ruby-identifier">text</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
+328:       <span class="ruby-identifier">piece</span> = <span class="ruby-value str">''</span>
+329:       <span class="ruby-identifier">whitespace</span> = <span class="ruby-value">0</span>
+330: 
+331:       <span class="ruby-identifier">text</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">line</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
+332:         <span class="ruby-identifier">whitespace</span> = <span class="ruby-value">0</span>
+333: 
+334:         <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">whitespace</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">line</span>[<span class="ruby-identifier">whitespace</span>].<span class="ruby-identifier">chr</span> <span class="ruby-operator">==</span> <span class="ruby-value str">' '</span>
+335:           <span class="ruby-identifier">whitespace</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
+336:         <span class="ruby-keyword kw">end</span>
+337: 
+338:         <span class="ruby-comment cmt"># If the current line is empty, indent it so that a snippet</span>
+339:         <span class="ruby-comment cmt"># from the previous line is aligned correctly.</span>
+340:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">line</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span>
+341:           <span class="ruby-identifier">line</span> = (<span class="ruby-value str">&quot; &quot;</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">whitespace</span>)
+342:         <span class="ruby-keyword kw">end</span>
+343: 
+344:         <span class="ruby-comment cmt"># If text was snipped from the previous line, prepend it to the</span>
+345:         <span class="ruby-comment cmt"># current line after any current indentation.</span>
+346:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">piece</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">''</span>
+347:           <span class="ruby-comment cmt"># Reset whitespaces to 0 if there are more whitespaces than there are</span>
+348:           <span class="ruby-comment cmt"># console columns</span>
+349:           <span class="ruby-identifier">whitespace</span> = <span class="ruby-value">0</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">whitespace</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">console_cols</span>
+350: 
+351:           <span class="ruby-comment cmt"># If the current line is empty and being prepended to, create a new</span>
+352:           <span class="ruby-comment cmt"># empty line in the text so that formatting is preserved.</span>
+353:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">text</span>[<span class="ruby-identifier">i</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">line</span> <span class="ruby-operator">==</span> (<span class="ruby-value str">&quot; &quot;</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">whitespace</span>)
+354:             <span class="ruby-identifier">text</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-identifier">i</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>, <span class="ruby-value str">&quot;&quot;</span>)
+355:           <span class="ruby-keyword kw">end</span>
+356: 
+357:           <span class="ruby-comment cmt"># Add the snipped text to the current line</span>
+358:           <span class="ruby-identifier">line</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-identifier">whitespace</span>, <span class="ruby-node">&quot;#{piece} &quot;</span>)
+359:         <span class="ruby-keyword kw">end</span>
+360: 
+361:         <span class="ruby-identifier">piece</span> = <span class="ruby-value str">''</span>
+362: 
+363:         <span class="ruby-comment cmt"># Compare the line length to the allowed line length.</span>
+364:         <span class="ruby-comment cmt"># If it exceeds it, snip the offending text from the line</span>
+365:         <span class="ruby-comment cmt"># and store it so that it can be prepended to the next line.</span>
+366:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> (<span class="ruby-identifier">console_cols</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">preamble</span>)
+367:           <span class="ruby-identifier">reverse</span> = <span class="ruby-identifier">console_cols</span>
+368: 
+369:           <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">line</span>[<span class="ruby-identifier">reverse</span>].<span class="ruby-identifier">chr</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">' '</span>
+370:             <span class="ruby-identifier">reverse</span> <span class="ruby-operator">-=</span> <span class="ruby-value">1</span>
+371:           <span class="ruby-keyword kw">end</span>
+372: 
+373:           <span class="ruby-identifier">piece</span> = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">slice!</span>(<span class="ruby-identifier">reverse</span>, (<span class="ruby-identifier">line</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>)).<span class="ruby-identifier">lstrip</span>
+374:         <span class="ruby-keyword kw">end</span>
+375: 
+376:         <span class="ruby-comment cmt"># If a snippet exists when all the columns in the text have been</span>
+377:         <span class="ruby-comment cmt"># updated, create a new line and append the snippet to it, using</span>
+378:         <span class="ruby-comment cmt"># the same left alignment as the last line in the text.</span>
+379:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">piece</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">''</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">text</span>[<span class="ruby-identifier">i</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>].<span class="ruby-identifier">nil?</span>
+380:           <span class="ruby-identifier">text</span>[<span class="ruby-identifier">i</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>] = <span class="ruby-node">&quot;#{' ' * (whitespace)}#{piece}&quot;</span>
+381:           <span class="ruby-identifier">piece</span> = <span class="ruby-value str">''</span>
+382:         <span class="ruby-keyword kw">end</span>
+383: 
+384:         <span class="ruby-comment cmt"># Add the preamble to the line and add it to the text</span>
+385:         <span class="ruby-identifier">line</span> = ((<span class="ruby-value str">' '</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">preamble</span>) <span class="ruby-operator">+</span> <span class="ruby-identifier">line</span>)
+386:         <span class="ruby-identifier">text</span>[<span class="ruby-identifier">i</span>] = <span class="ruby-identifier">line</span>
+387:       <span class="ruby-keyword kw">end</span>
+388: 
+389:       <span class="ruby-identifier">text</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
+390:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000299" class="method-detail">
+        <a name="M000299"></a>
+
+        <div class="method-heading">
+          <a href="#M000299" class="method-signature">
+          <span class="method-name">color</span><span class="method-args">(code)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Return <a href="Util.html#M000299">color</a> codes, if the config color=
+option is false just return a empty string
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000299-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000299-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 270</span>
+270:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">color</span>(<span class="ruby-identifier">code</span>)
+271:       <span class="ruby-identifier">colorize</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">color</span>
+272: 
+273:       <span class="ruby-identifier">colors</span> = {<span class="ruby-identifier">:red</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;\e[31m&quot;</span>,
+274:                 <span class="ruby-identifier">:green</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;\e[32m&quot;</span>,
+275:                 <span class="ruby-identifier">:yellow</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;\e[33m&quot;</span>,
+276:                 <span class="ruby-identifier">:cyan</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;\e[36m&quot;</span>,
+277:                 <span class="ruby-identifier">:bold</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;\e[1m&quot;</span>,
+278:                 <span class="ruby-identifier">:reset</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;\e[0m&quot;</span>}
+279: 
+280:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">colorize</span>
+281:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">colors</span>[<span class="ruby-identifier">code</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span>
+282:       <span class="ruby-keyword kw">else</span>
+283:         <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;&quot;</span>
+284:       <span class="ruby-keyword kw">end</span>
+285:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000300" class="method-detail">
+        <a name="M000300"></a>
+
+        <div class="method-heading">
+          <a href="#M000300" class="method-signature">
+          <span class="method-name">colorize</span><span class="method-args">(code, msg)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Helper to return a string in specific <a href="Util.html#M000299">color</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000300-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000300-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 288</span>
+288:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">code</span>, <span class="ruby-identifier">msg</span>)
+289:       <span class="ruby-value str">&quot;%s%s%s&quot;</span> <span class="ruby-operator">%</span> [ <span class="ruby-identifier">color</span>(<span class="ruby-identifier">code</span>), <span class="ruby-identifier">msg</span>, <span class="ruby-identifier">color</span>(<span class="ruby-identifier">:reset</span>) ]
+290:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000305" class="method-detail">
+        <a name="M000305"></a>
+
+        <div class="method-heading">
+          <a href="#M000305" class="method-signature">
+          <span class="method-name">command_in_path?</span><span class="method-args">(command)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Checks in PATH returns true if the command is found
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000305-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000305-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 417</span>
+417:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">command_in_path?</span>(<span class="ruby-identifier">command</span>)
+418:       <span class="ruby-identifier">found</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-value str">&quot;PATH&quot;</span>].<span class="ruby-identifier">split</span>(<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH_SEPARATOR</span>).<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
+419:         <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">p</span>, <span class="ruby-identifier">command</span>))
+420:       <span class="ruby-keyword kw">end</span>
+421: 
+422:       <span class="ruby-identifier">found</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-keyword kw">true</span>)
+423:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000290" class="method-detail">
+        <a name="M000290"></a>
+
+        <div class="method-heading">
+          <a href="#M000290" class="method-signature">
+          <span class="method-name">config_file_for_user</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Picks a config file defaults to ~/.mcollective else
+/etc/mcollective/client.cfg
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000290-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000290-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 148</span>
+148:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">config_file_for_user</span>
+149:       <span class="ruby-comment cmt"># expand_path is pretty lame, it relies on HOME environment</span>
+150:       <span class="ruby-comment cmt"># which isnt't always there so just handling all exceptions</span>
+151:       <span class="ruby-comment cmt"># here as cant find reverting to default</span>
+152:       <span class="ruby-keyword kw">begin</span>
+153:         <span class="ruby-identifier">config</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-value str">&quot;~/.mcollective&quot;</span>)
+154: 
+155:         <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">readable?</span>(<span class="ruby-identifier">config</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">config</span>)
+156:           <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">windows?</span>
+157:             <span class="ruby-identifier">config</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">windows_prefix</span>, <span class="ruby-value str">&quot;etc&quot;</span>, <span class="ruby-value str">&quot;client.cfg&quot;</span>)
+158:           <span class="ruby-keyword kw">else</span>
+159:             <span class="ruby-identifier">config</span> = <span class="ruby-value str">&quot;/etc/mcollective/client.cfg&quot;</span>
+160:           <span class="ruby-keyword kw">end</span>
+161:         <span class="ruby-keyword kw">end</span>
+162:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+163:         <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">windows?</span>
+164:           <span class="ruby-identifier">config</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">windows_prefix</span>, <span class="ruby-value str">&quot;etc&quot;</span>, <span class="ruby-value str">&quot;client.cfg&quot;</span>)
+165:         <span class="ruby-keyword kw">else</span>
+166:           <span class="ruby-identifier">config</span> = <span class="ruby-value str">&quot;/etc/mcollective/client.cfg&quot;</span>
+167:         <span class="ruby-keyword kw">end</span>
+168:       <span class="ruby-keyword kw">end</span>
+169: 
+170:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">config</span>
+171:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000291" class="method-detail">
+        <a name="M000291"></a>
+
+        <div class="method-heading">
+          <a href="#M000291" class="method-signature">
+          <span class="method-name">default_options</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Creates a standard options hash
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000291-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000291-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 174</span>
+174:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">default_options</span>
+175:       {<span class="ruby-identifier">:verbose</span>           =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>,
+176:        <span class="ruby-identifier">:disctimeout</span>       =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>,
+177:        <span class="ruby-identifier">:timeout</span>           =<span class="ruby-operator">&gt;</span> <span class="ruby-value">5</span>,
+178:        <span class="ruby-identifier">:config</span>            =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">config_file_for_user</span>,
+179:        <span class="ruby-identifier">:collective</span>        =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>,
+180:        <span class="ruby-identifier">:discovery_method</span>  =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>,
+181:        <span class="ruby-identifier">:discovery_options</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">default_discovery_options</span>,
+182:        <span class="ruby-identifier">:filter</span>            =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">empty_filter</span>}
+183:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000288" class="method-detail">
+        <a name="M000288"></a>
+
+        <div class="method-heading">
+          <a href="#M000288" class="method-signature">
+          <span class="method-name">empty_filter</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Creates an empty filter
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000288-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000288-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 132</span>
+132:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">empty_filter</span>
+133:       {<span class="ruby-value str">&quot;fact&quot;</span>     =<span class="ruby-operator">&gt;</span> [],
+134:        <span class="ruby-value str">&quot;cf_class&quot;</span> =<span class="ruby-operator">&gt;</span> [],
+135:        <span class="ruby-value str">&quot;agent&quot;</span>    =<span class="ruby-operator">&gt;</span> [],
+136:        <span class="ruby-value str">&quot;identity&quot;</span> =<span class="ruby-operator">&gt;</span> [],
+137:        <span class="ruby-value str">&quot;compound&quot;</span> =<span class="ruby-operator">&gt;</span> []}
+138:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000287" class="method-detail">
+        <a name="M000287"></a>
+
+        <div class="method-heading">
+          <a href="#M000287" class="method-signature">
+          <span class="method-name">empty_filter?</span><span class="method-args">(filter)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Checks if the passed in filter is an empty one
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000287-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000287-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 127</span>
+127:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">empty_filter?</span>(<span class="ruby-identifier">filter</span>)
+128:       <span class="ruby-identifier">filter</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">empty_filter</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">filter</span> <span class="ruby-operator">==</span> {}
+129:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000284" class="method-detail">
+        <a name="M000284"></a>
+
+        <div class="method-heading">
+          <a href="#M000284" class="method-signature">
+          <span class="method-name">get_fact</span><span class="method-args">(fact)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Gets the value of a specific fact, mostly just a duplicate of <a
+href="Facts.html#M000017">MCollective::Facts.get_fact</a> but it kind of
+goes with the other classes here
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000284-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000284-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 63</span>
+63:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get_fact</span>(<span class="ruby-identifier">fact</span>)
+64:       <span class="ruby-constant">Facts</span>.<span class="ruby-identifier">get_fact</span>(<span class="ruby-identifier">fact</span>)
+65:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000281" class="method-detail">
+        <a name="M000281"></a>
+
+        <div class="method-heading">
+          <a href="#M000281" class="method-signature">
+          <span class="method-name">has_agent?</span><span class="method-args">(agent)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Finds out if this <a href="../MCollective.html">MCollective</a> has an
+agent by the name passed
+</p>
+<p>
+If the passed name starts with a / it&#8216;s assumed to be regex and will
+use regex to match
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000281-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000281-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 10</span>
+10:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">has_agent?</span>(<span class="ruby-identifier">agent</span>)
+11:       <span class="ruby-identifier">agent</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">agent</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">&quot;\/&quot;</span>, <span class="ruby-value str">&quot;&quot;</span>)) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">agent</span>.<span class="ruby-identifier">match</span>(<span class="ruby-value str">&quot;^/&quot;</span>)
+12: 
+13:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">agent</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Regexp</span>)
+14:         <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Agents</span>.<span class="ruby-identifier">agentlist</span>.<span class="ruby-identifier">grep</span>(<span class="ruby-identifier">agent</span>).<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
+15:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
+16:         <span class="ruby-keyword kw">else</span>
+17:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
+18:         <span class="ruby-keyword kw">end</span>
+19:       <span class="ruby-keyword kw">else</span>
+20:         <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Agents</span>.<span class="ruby-identifier">agentlist</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">agent</span>)
+21:       <span class="ruby-keyword kw">end</span>
+22: 
+23:       <span class="ruby-keyword kw">false</span>
+24:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000283" class="method-detail">
+        <a name="M000283"></a>
+
+        <div class="method-heading">
+          <a href="#M000283" class="method-signature">
+          <span class="method-name">has_cf_class?</span><span class="method-args">(klass)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Checks if this node has a configuration management class by parsing the a
+text file with just a list of classes, recipes, roles etc. This is ala the
+classes.txt from puppet.
+</p>
+<p>
+If the passed name starts with a / it&#8216;s assumed to be regex and will
+use regex to match
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000283-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000283-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 40</span>
+40:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">has_cf_class?</span>(<span class="ruby-identifier">klass</span>)
+41:       <span class="ruby-identifier">klass</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">klass</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">&quot;\/&quot;</span>, <span class="ruby-value str">&quot;&quot;</span>)) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">match</span>(<span class="ruby-value str">&quot;^/&quot;</span>)
+42:       <span class="ruby-identifier">cfile</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">classesfile</span>
+43: 
+44:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Looking for configuration management classes in #{cfile}&quot;</span>)
+45: 
+46:       <span class="ruby-keyword kw">begin</span>
+47:         <span class="ruby-constant">File</span>.<span class="ruby-identifier">readlines</span>(<span class="ruby-identifier">cfile</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>
+48:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Regexp</span>)
+49:             <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">chomp</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">klass</span>)
+50:           <span class="ruby-keyword kw">else</span>
+51:             <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">k</span>.<span class="ruby-identifier">chomp</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">klass</span>
+52:           <span class="ruby-keyword kw">end</span>
+53:         <span class="ruby-keyword kw">end</span>
+54:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+55:         <span class="ruby-constant">Log</span>.<span class="ruby-identifier">warn</span>(<span class="ruby-node">&quot;Parsing classes file '#{cfile}' failed: #{e.class}: #{e}&quot;</span>)
+56:       <span class="ruby-keyword kw">end</span>
+57: 
+58:       <span class="ruby-keyword kw">false</span>
+59:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000285" class="method-detail">
+        <a name="M000285"></a>
+
+        <div class="method-heading">
+          <a href="#M000285" class="method-signature">
+          <span class="method-name">has_fact?</span><span class="method-args">(fact, value, operator)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Compares fact == value,
+</p>
+<p>
+If the passed value starts with a / it&#8216;s assumed to be regex and will
+use regex to match
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000285-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000285-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 71</span>
+ 71:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">has_fact?</span>(<span class="ruby-identifier">fact</span>, <span class="ruby-identifier">value</span>, <span class="ruby-identifier">operator</span>)
+ 72: 
+ 73:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;Comparing #{fact} #{operator} #{value}&quot;</span>)
+ 74:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-node">&quot;where :fact = '#{fact}', :operator = '#{operator}', :value = '#{value}'&quot;</span>)
+ 75: 
+ 76:       <span class="ruby-identifier">fact</span> = <span class="ruby-constant">Facts</span>[<span class="ruby-identifier">fact</span>]
+ 77:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fact</span>.<span class="ruby-identifier">nil?</span>
+ 78: 
+ 79:       <span class="ruby-identifier">fact</span> = <span class="ruby-identifier">fact</span>.<span class="ruby-identifier">clone</span>
+ 80: 
+ 81:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">operator</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'=~'</span>
+ 82:         <span class="ruby-comment cmt"># to maintain backward compat we send the value</span>
+ 83:         <span class="ruby-comment cmt"># as /.../ which is what 1.0.x needed.  this strips</span>
+ 84:         <span class="ruby-comment cmt"># off the /'s wich is what we need here</span>
+ 85:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\/(.+)\/$/</span>
+ 86:           <span class="ruby-identifier">value</span> = <span class="ruby-identifier">$1</span>
+ 87:         <span class="ruby-keyword kw">end</span>
+ 88: 
+ 89:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fact</span>.<span class="ruby-identifier">match</span>(<span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">value</span>))
+ 90: 
+ 91:       <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">operator</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;==&quot;</span>
+ 92:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fact</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">value</span>
+ 93: 
+ 94:       <span class="ruby-keyword kw">elsif</span> [<span class="ruby-value str">'&lt;='</span>, <span class="ruby-value str">'&gt;='</span>, <span class="ruby-value str">'&lt;'</span>, <span class="ruby-value str">'&gt;'</span>, <span class="ruby-value str">'!='</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">operator</span>)
+ 95:         <span class="ruby-comment cmt"># Yuk - need to type cast, but to_i and to_f are overzealous</span>
+ 96:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^[0-9]+$/</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">fact</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^[0-9]+$/</span>
+ 97:           <span class="ruby-identifier">fact</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">fact</span>)
+ 98:           <span class="ruby-identifier">value</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">value</span>)
+ 99:         <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^[0-9]+.[0-9]+$/</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">fact</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^[0-9]+.[0-9]+$/</span>
+100:           <span class="ruby-identifier">fact</span> = <span class="ruby-constant">Float</span>(<span class="ruby-identifier">fact</span>)
+101:           <span class="ruby-identifier">value</span> = <span class="ruby-constant">Float</span>(<span class="ruby-identifier">value</span>)
+102:         <span class="ruby-keyword kw">end</span>
+103: 
+104:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">eval</span>(<span class="ruby-node">&quot;fact #{operator} value&quot;</span>)
+105:       <span class="ruby-keyword kw">end</span>
+106: 
+107:       <span class="ruby-keyword kw">false</span>
+108:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000286" class="method-detail">
+        <a name="M000286"></a>
+
+        <div class="method-heading">
+          <a href="#M000286" class="method-signature">
+          <span class="method-name">has_identity?</span><span class="method-args">(identity)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Checks if the configured identity matches the one supplied
+</p>
+<p>
+If the passed name starts with a / it&#8216;s assumed to be regex and will
+use regex to match
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000286-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000286-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 114</span>
+114:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">has_identity?</span>(<span class="ruby-identifier">identity</span>)
+115:       <span class="ruby-identifier">identity</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">identity</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">&quot;\/&quot;</span>, <span class="ruby-value str">&quot;&quot;</span>)) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">identity</span>.<span class="ruby-identifier">match</span>(<span class="ruby-value str">&quot;^/&quot;</span>)
+116: 
+117:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">identity</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Regexp</span>)
+118:         <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">identity</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">identity</span>)
+119:       <span class="ruby-keyword kw">else</span>
+120:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">identity</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">identity</span>
+121:       <span class="ruby-keyword kw">end</span>
+122: 
+123:       <span class="ruby-keyword kw">false</span>
+124:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000295" class="method-detail">
+        <a name="M000295"></a>
+
+        <div class="method-heading">
+          <a href="#M000295" class="method-signature">
+          <span class="method-name">loadclass</span><span class="method-args">(klass)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Wrapper around <a
+href="PluginManager.html#M000034">PluginManager.loadclass</a>
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000295-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000295-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 224</span>
+224:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">loadclass</span>(<span class="ruby-identifier">klass</span>)
+225:       <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">loadclass</span>(<span class="ruby-identifier">klass</span>)
+226:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000292" class="method-detail">
+        <a name="M000292"></a>
+
+        <div class="method-heading">
+          <a href="#M000292" class="method-signature">
+          <span class="method-name">make_subscriptions</span><span class="method-args">(agent, type, collective=nil)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000292-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000292-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 185</span>
+185:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">make_subscriptions</span>(<span class="ruby-identifier">agent</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">collective</span>=<span class="ruby-keyword kw">nil</span>)
+186:       <span class="ruby-identifier">config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>
+187: 
+188:       <span class="ruby-identifier">raise</span>(<span class="ruby-node">&quot;Unknown target type #{type}&quot;</span>) <span class="ruby-keyword kw">unless</span> [<span class="ruby-identifier">:broadcast</span>, <span class="ruby-identifier">:directed</span>, <span class="ruby-identifier">:reply</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">type</span>)
+189: 
+190:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">collective</span>.<span class="ruby-identifier">nil?</span>
+191:         <span class="ruby-identifier">config</span>.<span class="ruby-identifier">collectives</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
+192:           {<span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">agent</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">type</span>, <span class="ruby-identifier">:collective</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">c</span>}
+193:         <span class="ruby-keyword kw">end</span>
+194:       <span class="ruby-keyword kw">else</span>
+195:         <span class="ruby-identifier">raise</span>(<span class="ruby-node">&quot;Unknown collective '#{collective}' known collectives are '#{config.collectives.join ', '}'&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">collectives</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">collective</span>)
+196: 
+197:         [{<span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">agent</span>, <span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">type</span>, <span class="ruby-identifier">:collective</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">collective</span>}]
+198:       <span class="ruby-keyword kw">end</span>
+199:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000302" class="method-detail">
+        <a name="M000302"></a>
+
+        <div class="method-heading">
+          <a href="#M000302" class="method-signature">
+          <span class="method-name">mcollective_version</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000302-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000302-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 298</span>
+298:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">mcollective_version</span>
+299:       <span class="ruby-constant">MCollective</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span>
+300:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000296" class="method-detail">
+        <a name="M000296"></a>
+
+        <div class="method-heading">
+          <a href="#M000296" class="method-signature">
+          <span class="method-name">parse_fact_string</span><span class="method-args">(fact)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Parse a fact filter string like foo=bar into the tuple hash thats needed
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000296-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000296-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 229</span>
+229:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse_fact_string</span>(<span class="ruby-identifier">fact</span>)
+230:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fact</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^([^ ]+?)[ ]*=&gt;[ ]*(.+)/</span>
+231:         <span class="ruby-keyword kw">return</span> {<span class="ruby-identifier">:fact</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">$1</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">$2</span>, <span class="ruby-identifier">:operator</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&gt;='</span> }
+232:       <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">fact</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^([^ ]+?)[ ]*=&lt;[ ]*(.+)/</span>
+233:         <span class="ruby-keyword kw">return</span> {<span class="ruby-identifier">:fact</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">$1</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">$2</span>, <span class="ruby-identifier">:operator</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'&lt;='</span> }
+234:       <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">fact</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^([^ ]+?)[ ]*(&lt;=|&gt;=|&lt;|&gt;|!=|==|=~)[ ]*(.+)/</span>
+235:         <span class="ruby-keyword kw">return</span> {<span class="ruby-identifier">:fact</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">$1</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">$3</span>, <span class="ruby-identifier">:operator</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">$2</span> }
+236:       <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">fact</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^(.+?)[ ]*=[ ]*\/(.+)\/$/</span>
+237:         <span class="ruby-keyword kw">return</span> {<span class="ruby-identifier">:fact</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">$1</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;/#{$2}/&quot;</span>, <span class="ruby-identifier">:operator</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'=~'</span> }
+238:       <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">fact</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^([^= ]+?)[ ]*=[ ]*(.+)/</span>
+239:         <span class="ruby-keyword kw">return</span> {<span class="ruby-identifier">:fact</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">$1</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">$2</span>, <span class="ruby-identifier">:operator</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'=='</span> }
+240:       <span class="ruby-keyword kw">else</span>
+241:         <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Could not parse fact #{fact} it does not appear to be in a valid format&quot;</span>
+242:       <span class="ruby-keyword kw">end</span>
+243:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000301" class="method-detail">
+        <a name="M000301"></a>
+
+        <div class="method-heading">
+          <a href="#M000301" class="method-signature">
+          <span class="method-name">ruby_version</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns the current ruby version as per RUBY_VERSION, mostly doing this
+here to aid testing
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000301-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000301-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 294</span>
+294:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ruby_version</span>
+295:       <span class="ruby-constant">RUBY_VERSION</span>
+296:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000282" class="method-detail">
+        <a name="M000282"></a>
+
+        <div class="method-heading">
+          <a href="#M000282" class="method-signature">
+          <span class="method-name">setup_windows_sleeper</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+On windows ^c can&#8216;<a href="Util.html#M000309">t</a> interrupt the VM
+if its blocking on IO, so this sets up a dummy thread that sleeps and this
+will have the end result of being interruptable at least once a second.
+This is a common pattern found in Rails etc
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000282-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000282-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 30</span>
+30:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">setup_windows_sleeper</span>
+31:       <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> { <span class="ruby-identifier">loop</span> { <span class="ruby-identifier">sleep</span> <span class="ruby-value">1</span> } } <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">windows?</span>
+32:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000297" class="method-detail">
+        <a name="M000297"></a>
+
+        <div class="method-heading">
+          <a href="#M000297" class="method-signature">
+          <span class="method-name">shellescape</span><span class="method-args">(str)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Escapes a string so it&#8216;s safe to use in system() or backticks
+</p>
+<p>
+Taken from Shellwords#shellescape since it&#8216;s only in a few ruby
+versions
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000297-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000297-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 248</span>
+248:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">shellescape</span>(<span class="ruby-identifier">str</span>)
+249:       <span class="ruby-keyword kw">return</span> <span class="ruby-value str">&quot;''&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">str</span>.<span class="ruby-identifier">empty?</span>
+250: 
+251:       <span class="ruby-identifier">str</span> = <span class="ruby-identifier">str</span>.<span class="ruby-identifier">dup</span>
+252: 
+253:       <span class="ruby-comment cmt"># Process as a single byte sequence because not all shell</span>
+254:       <span class="ruby-comment cmt"># implementations are multibyte aware.</span>
+255:       <span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/([^A-Za-z0-9_\-.,:\/@\n])/n</span>, <span class="ruby-value str">&quot;\\\\\\1&quot;</span>)
+256: 
+257:       <span class="ruby-comment cmt"># A LF cannot be escaped with a backslash because a backslash + LF</span>
+258:       <span class="ruby-comment cmt"># combo is regarded as line continuation and simply ignored.</span>
+259:       <span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\n/</span>, <span class="ruby-value str">&quot;'\n'&quot;</span>)
+260: 
+261:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">str</span>
+262:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000308" class="method-detail">
+        <a name="M000308"></a>
+
+        <div class="method-heading">
+          <a href="#M000308" class="method-signature">
+          <span class="method-name">str_to_bool</span><span class="method-args">(val)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Converts a string into a boolean value Strings matching 1,y,yes,true or <a
+href="Util.html#M000309">t</a> will return TrueClass Any other value will
+return FalseClass
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000308-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000308-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 477</span>
+477:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">str_to_bool</span>(<span class="ruby-identifier">val</span>)
+478:       <span class="ruby-identifier">clean_val</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">strip</span>
+479:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">clean_val</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^(1|yes|true|y|t)$/i</span>
+480:         <span class="ruby-keyword kw">return</span>  <span class="ruby-keyword kw">true</span>
+481:       <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">clean_val</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^(0|no|false|n|f)$/i</span>
+482:         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
+483:       <span class="ruby-keyword kw">else</span>
+484:         <span class="ruby-identifier">raise_code</span>(<span class="ruby-identifier">:PLMC42</span>, <span class="ruby-value str">&quot;Cannot convert string value '%{value}' into a boolean.&quot;</span>, <span class="ruby-identifier">:error</span>, <span class="ruby-identifier">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">clean_val</span>)
+485:       <span class="ruby-keyword kw">end</span>
+486:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000293" class="method-detail">
+        <a name="M000293"></a>
+
+        <div class="method-heading">
+          <a href="#M000293" class="method-signature">
+          <span class="method-name">subscribe</span><span class="method-args">(targets)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Helper to <a href="Util.html#M000293">subscribe</a> to a topic on multiple
+collectives or just one
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000293-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000293-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 202</span>
+202:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">subscribe</span>(<span class="ruby-identifier">targets</span>)
+203:       <span class="ruby-identifier">connection</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;connector_plugin&quot;</span>]
+204: 
+205:       <span class="ruby-identifier">targets</span> = [<span class="ruby-identifier">targets</span>].<span class="ruby-identifier">flatten</span>
+206: 
+207:       <span class="ruby-identifier">targets</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">target</span><span class="ruby-operator">|</span>
+208:         <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">subscribe</span>(<span class="ruby-identifier">target</span>[<span class="ruby-identifier">:agent</span>], <span class="ruby-identifier">target</span>[<span class="ruby-identifier">:type</span>], <span class="ruby-identifier">target</span>[<span class="ruby-identifier">:collective</span>])
+209:       <span class="ruby-keyword kw">end</span>
+210:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000309" class="method-detail">
+        <a name="M000309"></a>
+
+        <div class="method-heading">
+          <a href="#M000309" class="method-signature">
+          <span class="method-name">t</span><span class="method-args">(msgid, args={})</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Looks up and interprolate the hash values into a i18n string
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000309-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000309-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 489</span>
+489:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">t</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">args</span>={})
+490:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">msgid</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>)
+491:         <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">t</span>(<span class="ruby-value str">&quot;%s.pattern&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">args</span>)
+492:       <span class="ruby-keyword kw">else</span>
+493:         <span class="ruby-constant">I18n</span>.<span class="ruby-identifier">t</span>(<span class="ruby-identifier">msgid</span>, <span class="ruby-identifier">args</span>)
+494:       <span class="ruby-keyword kw">end</span>
+495:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000310" class="method-detail">
+        <a name="M000310"></a>
+
+        <div class="method-heading">
+          <a href="#M000310" class="method-signature">
+          <span class="method-name">templatepath</span><span class="method-args">(template_file)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Looks up the template directory and returns its full path
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000310-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000310-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 498</span>
+498:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">templatepath</span>(<span class="ruby-identifier">template_file</span>)
+499:       <span class="ruby-identifier">config_dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">configfile</span>)
+500:       <span class="ruby-identifier">template_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">config_dir</span>, <span class="ruby-identifier">template_file</span>)
+501:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">template_path</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">template_path</span>)
+502: 
+503:       <span class="ruby-identifier">template_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;/etc/mcollective&quot;</span>, <span class="ruby-identifier">template_file</span>)
+504:       <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">template_path</span>
+505:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000304" class="method-detail">
+        <a name="M000304"></a>
+
+        <div class="method-heading">
+          <a href="#M000304" class="method-signature">
+          <span class="method-name">terminal_dimensions</span><span class="method-args">(stdout = STDOUT, environment = ENV)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Figures out the columns and lines of the current tty
+</p>
+<p>
+Returns [0, 0] if it can&#8216;<a href="Util.html#M000309">t</a> figure it
+out or if you&#8216;re not running on a tty
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000304-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000304-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 396</span>
+396:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">terminal_dimensions</span>(<span class="ruby-identifier">stdout</span> = <span class="ruby-constant">STDOUT</span>, <span class="ruby-identifier">environment</span> = <span class="ruby-constant">ENV</span>)
+397:       <span class="ruby-keyword kw">return</span> [<span class="ruby-value">0</span>, <span class="ruby-value">0</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">stdout</span>.<span class="ruby-identifier">tty?</span>
+398: 
+399:       <span class="ruby-keyword kw">return</span> [<span class="ruby-value">80</span>, <span class="ruby-value">40</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">windows?</span>
+400: 
+401:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">environment</span>[<span class="ruby-value str">&quot;COLUMNS&quot;</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">environment</span>[<span class="ruby-value str">&quot;LINES&quot;</span>]
+402:         <span class="ruby-keyword kw">return</span> [<span class="ruby-identifier">environment</span>[<span class="ruby-value str">&quot;COLUMNS&quot;</span>].<span class="ruby-identifier">to_i</span>, <span class="ruby-identifier">environment</span>[<span class="ruby-value str">&quot;LINES&quot;</span>].<span class="ruby-identifier">to_i</span>]
+403: 
+404:       <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">environment</span>[<span class="ruby-value str">&quot;TERM&quot;</span>] <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">command_in_path?</span>(<span class="ruby-value str">&quot;tput&quot;</span>)
+405:         <span class="ruby-keyword kw">return</span> [<span class="ruby-value">`tput cols`</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-value">`tput lines`</span>.<span class="ruby-identifier">to_i</span>]
+406: 
+407:       <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">command_in_path?</span>(<span class="ruby-value str">'stty'</span>)
+408:         <span class="ruby-keyword kw">return</span> <span class="ruby-value">`stty size`</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/\d+/</span>).<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">to_i</span> }
+409:       <span class="ruby-keyword kw">else</span>
+410:         <span class="ruby-keyword kw">return</span> [<span class="ruby-value">0</span>, <span class="ruby-value">0</span>]
+411:       <span class="ruby-keyword kw">end</span>
+412:     <span class="ruby-keyword kw">rescue</span>
+413:       [<span class="ruby-value">0</span>, <span class="ruby-value">0</span>]
+414:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000294" class="method-detail">
+        <a name="M000294"></a>
+
+        <div class="method-heading">
+          <a href="#M000294" class="method-signature">
+          <span class="method-name">unsubscribe</span><span class="method-args">(targets)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Helper to <a href="Util.html#M000294">unsubscribe</a> to a topic on
+multiple collectives or just one
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000294-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000294-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 213</span>
+213:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unsubscribe</span>(<span class="ruby-identifier">targets</span>)
+214:       <span class="ruby-identifier">connection</span> = <span class="ruby-constant">PluginManager</span>[<span class="ruby-value str">&quot;connector_plugin&quot;</span>]
+215: 
+216:       <span class="ruby-identifier">targets</span> = [<span class="ruby-identifier">targets</span>].<span class="ruby-identifier">flatten</span>
+217: 
+218:       <span class="ruby-identifier">targets</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">target</span><span class="ruby-operator">|</span>
+219:         <span class="ruby-identifier">connection</span>.<span class="ruby-identifier">unsubscribe</span>(<span class="ruby-identifier">target</span>[<span class="ruby-identifier">:agent</span>], <span class="ruby-identifier">target</span>[<span class="ruby-identifier">:type</span>], <span class="ruby-identifier">target</span>[<span class="ruby-identifier">:collective</span>])
+220:       <span class="ruby-keyword kw">end</span>
+221:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000306" class="method-detail">
+        <a name="M000306"></a>
+
+        <div class="method-heading">
+          <a href="#M000306" class="method-signature">
+          <span class="method-name">versioncmp</span><span class="method-args">(version_a, version_b)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+compare two software versions as commonly found in package versions.
+</p>
+<p>
+returns 0 if a == b returns -1 if a &lt; b returns 1 if a &gt; b
+</p>
+<p>
+Code originally from Puppet
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000306-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000306-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 433</span>
+433:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">versioncmp</span>(<span class="ruby-identifier">version_a</span>, <span class="ruby-identifier">version_b</span>)
+434:       <span class="ruby-identifier">vre</span> = <span class="ruby-regexp re">/[-.]|\d+|[^-.\d]+/</span>
+435:       <span class="ruby-identifier">ax</span> = <span class="ruby-identifier">version_a</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-identifier">vre</span>)
+436:       <span class="ruby-identifier">bx</span> = <span class="ruby-identifier">version_b</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-identifier">vre</span>)
+437: 
+438:       <span class="ruby-keyword kw">while</span> (<span class="ruby-identifier">ax</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">&gt;</span><span class="ruby-value">0</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">bx</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">&gt;</span><span class="ruby-value">0</span>)
+439:         <span class="ruby-identifier">a</span> = <span class="ruby-identifier">ax</span>.<span class="ruby-identifier">shift</span>
+440:         <span class="ruby-identifier">b</span> = <span class="ruby-identifier">bx</span>.<span class="ruby-identifier">shift</span>
+441: 
+442:         <span class="ruby-keyword kw">if</span>( <span class="ruby-identifier">a</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">b</span> )                 <span class="ruby-keyword kw">then</span> <span class="ruby-keyword kw">next</span>
+443:         <span class="ruby-keyword kw">elsif</span> (<span class="ruby-identifier">a</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'-'</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">b</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'-'</span>) <span class="ruby-keyword kw">then</span> <span class="ruby-keyword kw">next</span>
+444:         <span class="ruby-keyword kw">elsif</span> (<span class="ruby-identifier">a</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'-'</span>)             <span class="ruby-keyword kw">then</span> <span class="ruby-keyword kw">return</span> <span class="ruby-value">-1</span>
+445:         <span class="ruby-keyword kw">elsif</span> (<span class="ruby-identifier">b</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'-'</span>)             <span class="ruby-keyword kw">then</span> <span class="ruby-keyword kw">return</span> <span class="ruby-value">1</span>
+446:         <span class="ruby-keyword kw">elsif</span> (<span class="ruby-identifier">a</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'.'</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">b</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'.'</span>) <span class="ruby-keyword kw">then</span> <span class="ruby-keyword kw">next</span>
+447:         <span class="ruby-keyword kw">elsif</span> (<span class="ruby-identifier">a</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'.'</span> )            <span class="ruby-keyword kw">then</span> <span class="ruby-keyword kw">return</span> <span class="ruby-value">-1</span>
+448:         <span class="ruby-keyword kw">elsif</span> (<span class="ruby-identifier">b</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'.'</span> )            <span class="ruby-keyword kw">then</span> <span class="ruby-keyword kw">return</span> <span class="ruby-value">1</span>
+449:         <span class="ruby-keyword kw">elsif</span> (<span class="ruby-identifier">a</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\d+$/</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">b</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\d+$/</span>) <span class="ruby-keyword kw">then</span>
+450:           <span class="ruby-keyword kw">if</span>( <span class="ruby-identifier">a</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^0/</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">b</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^0/</span> ) <span class="ruby-keyword kw">then</span>
+451:             <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">upcase</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">b</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">upcase</span>
+452:           <span class="ruby-keyword kw">end</span>
+453:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">b</span>.<span class="ruby-identifier">to_i</span>
+454:         <span class="ruby-keyword kw">else</span>
+455:           <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">upcase</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">b</span>.<span class="ruby-identifier">upcase</span>
+456:         <span class="ruby-keyword kw">end</span>
+457:       <span class="ruby-keyword kw">end</span>
+458: 
+459:       <span class="ruby-identifier">version_a</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">version_b</span>;
+460:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000298" class="method-detail">
+        <a name="M000298"></a>
+
+        <div class="method-heading">
+          <a href="#M000298" class="method-signature">
+          <span class="method-name">windows?</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000298-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000298-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 264</span>
+264:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">windows?</span>
+265:       <span class="ruby-operator">!</span><span class="ruby-operator">!</span>(<span class="ruby-constant">RbConfig</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'host_os'</span>] <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/mswin|win32|dos|mingw|cygwin/i</span>)
+266:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000289" class="method-detail">
+        <a name="M000289"></a>
+
+        <div class="method-heading">
+          <a href="#M000289" class="method-signature">
+          <span class="method-name">windows_prefix</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns the PuppetLabs mcollective path for windows
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000289-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000289-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/util.rb, line 141</span>
+141:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">windows_prefix</span>
+142:       <span class="ruby-identifier">require</span> <span class="ruby-value str">'win32/dir'</span>
+143:       <span class="ruby-identifier">prefix</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">Dir</span><span class="ruby-operator">::</span><span class="ruby-constant">COMMON_APPDATA</span>, <span class="ruby-value str">&quot;PuppetLabs&quot;</span>, <span class="ruby-value str">&quot;mcollective&quot;</span>)
+144:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/Validator.html b/doc/classes/MCollective/Validator.html
new file mode 100644 (file)
index 0000000..6c4c70a
--- /dev/null
@@ -0,0 +1,342 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Module: MCollective::Validator</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Module</strong></td>
+          <td class="class-name-in-header">MCollective::Validator</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/validator_rb.html">
+                lib/mcollective/validator.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000217">[]</a>&nbsp;&nbsp;
+      <a href="#M000219">has_validator?</a>&nbsp;&nbsp;
+      <a href="#M000216">load_validators</a>&nbsp;&nbsp;
+      <a href="#M000221">load_validators?</a>&nbsp;&nbsp;
+      <a href="#M000218">method_missing</a>&nbsp;&nbsp;
+      <a href="#M000222">validate</a>&nbsp;&nbsp;
+      <a href="#M000220">validator_class</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000217" class="method-detail">
+        <a name="M000217"></a>
+
+        <div class="method-heading">
+          <a href="#M000217" class="method-signature">
+          <span class="method-name">[]</span><span class="method-args">(klass)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns and instance of the Plugin class from which objects can be created.
+Valid plugin names are
+</p>
+<pre>
+  :valplugin
+  &quot;valplugin&quot;
+  &quot;ValpluginValidator&quot;
+</pre>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000217-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000217-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/validator.rb, line 18</span>
+18:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-operator">[]</span>(<span class="ruby-identifier">klass</span>)
+19:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>)
+20:         <span class="ruby-identifier">klass</span> = <span class="ruby-identifier">validator_class</span>(<span class="ruby-identifier">klass</span>)
+21:       <span class="ruby-keyword kw">elsif</span> <span class="ruby-operator">!</span>(<span class="ruby-identifier">klass</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/.*Validator$/</span>))
+22:         <span class="ruby-identifier">klass</span> = <span class="ruby-identifier">validator_class</span>(<span class="ruby-identifier">klass</span>)
+23:       <span class="ruby-keyword kw">end</span>
+24: 
+25:       <span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">klass</span>)
+26:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000219" class="method-detail">
+        <a name="M000219"></a>
+
+        <div class="method-heading">
+          <a href="#M000219" class="method-signature">
+          <span class="method-name">has_validator?</span><span class="method-args">(validator)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000219-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000219-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/validator.rb, line 37</span>
+37:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">has_validator?</span>(<span class="ruby-identifier">validator</span>)
+38:       <span class="ruby-identifier">const_defined?</span>(<span class="ruby-identifier">validator_class</span>(<span class="ruby-identifier">validator</span>))
+39:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000216" class="method-detail">
+        <a name="M000216"></a>
+
+        <div class="method-heading">
+          <a href="#M000216" class="method-signature">
+          <span class="method-name">load_validators</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Loads the validator plugins. Validators will only be loaded every 5 minutes
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000216-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000216-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/validator.rb, line 6</span>
+ 6:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load_validators</span>
+ 7:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">load_validators?</span>
+ 8:         <span class="ruby-ivar">@last_load</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_i</span>
+ 9:         <span class="ruby-constant">PluginManager</span>.<span class="ruby-identifier">find_and_load</span>(<span class="ruby-value str">&quot;validator&quot;</span>)
+10:       <span class="ruby-keyword kw">end</span>
+11:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000221" class="method-detail">
+        <a name="M000221"></a>
+
+        <div class="method-heading">
+          <a href="#M000221" class="method-signature">
+          <span class="method-name">load_validators?</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000221-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000221-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/validator.rb, line 45</span>
+45:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">load_validators?</span>
+46:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@last_load</span>.<span class="ruby-identifier">nil?</span>
+47: 
+48:       (<span class="ruby-ivar">@last_load</span> <span class="ruby-operator">-</span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_i</span>) <span class="ruby-operator">&gt;</span> <span class="ruby-value">300</span>
+49:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000218" class="method-detail">
+        <a name="M000218"></a>
+
+        <div class="method-heading">
+          <a href="#M000218" class="method-signature">
+          <span class="method-name">method_missing</span><span class="method-args">(method, *args, &amp;block)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Allows validation plugins to be called like module methods : <a
+href="Validator.html#M000222">Validator.validate</a>()
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000218-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000218-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/validator.rb, line 29</span>
+29:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">method</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+30:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">has_validator?</span>(<span class="ruby-identifier">method</span>)
+31:         <span class="ruby-identifier">validator</span> = <span class="ruby-constant">Validator</span>[<span class="ruby-identifier">method</span>].<span class="ruby-identifier">validate</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
+32:       <span class="ruby-keyword kw">else</span>
+33:         <span class="ruby-identifier">raise</span> <span class="ruby-constant">ValidatorError</span>, <span class="ruby-node">&quot;Unknown validator: '#{method}'.&quot;</span>
+34:       <span class="ruby-keyword kw">end</span>
+35:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000222" class="method-detail">
+        <a name="M000222"></a>
+
+        <div class="method-heading">
+          <a href="#M000222" class="method-signature">
+          <span class="method-name">validate</span><span class="method-args">(validator, validation)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Generic <a href="Validator.html#M000222">validate</a> method that will call
+the correct validator plugin based on the type of the validation parameter
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000222-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000222-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/validator.rb, line 53</span>
+53:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">validate</span>(<span class="ruby-identifier">validator</span>, <span class="ruby-identifier">validation</span>)
+54:       <span class="ruby-constant">Validator</span>.<span class="ruby-identifier">load_validators</span>
+55: 
+56:       <span class="ruby-keyword kw">begin</span>
+57:         <span class="ruby-keyword kw">if</span> [<span class="ruby-identifier">:integer</span>, <span class="ruby-identifier">:boolean</span>, <span class="ruby-identifier">:float</span>, <span class="ruby-identifier">:number</span>, <span class="ruby-identifier">:string</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">validation</span>)
+58:           <span class="ruby-constant">Validator</span>.<span class="ruby-identifier">typecheck</span>(<span class="ruby-identifier">validator</span>, <span class="ruby-identifier">validation</span>)
+59: 
+60:         <span class="ruby-keyword kw">else</span>
+61:           <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">validation</span>
+62:             <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Regexp</span>,<span class="ruby-constant">String</span>
+63:               <span class="ruby-constant">Validator</span>.<span class="ruby-identifier">regex</span>(<span class="ruby-identifier">validator</span>, <span class="ruby-identifier">validation</span>)
+64: 
+65:             <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Symbol</span>
+66:               <span class="ruby-constant">Validator</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">validation</span>, <span class="ruby-identifier">validator</span>)
+67: 
+68:             <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Array</span>
+69:               <span class="ruby-constant">Validator</span>.<span class="ruby-identifier">array</span>(<span class="ruby-identifier">validator</span>, <span class="ruby-identifier">validation</span>)
+70: 
+71:             <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Class</span>
+72:               <span class="ruby-constant">Validator</span>.<span class="ruby-identifier">typecheck</span>(<span class="ruby-identifier">validator</span>, <span class="ruby-identifier">validation</span>)
+73:           <span class="ruby-keyword kw">end</span>
+74:         <span class="ruby-keyword kw">end</span>
+75:       <span class="ruby-keyword kw">rescue</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+76:         <span class="ruby-identifier">raise</span> <span class="ruby-constant">ValidatorError</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>
+77:       <span class="ruby-keyword kw">end</span>
+78:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000220" class="method-detail">
+        <a name="M000220"></a>
+
+        <div class="method-heading">
+          <a href="#M000220" class="method-signature">
+          <span class="method-name">validator_class</span><span class="method-args">(validator)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000220-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000220-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/validator.rb, line 41</span>
+41:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">validator_class</span>(<span class="ruby-identifier">validator</span>)
+42:       <span class="ruby-node">&quot;#{validator.to_s.capitalize}Validator&quot;</span>
+43:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/ValidatorError.html b/doc/classes/MCollective/ValidatorError.html
new file mode 100644 (file)
index 0000000..3245935
--- /dev/null
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::ValidatorError</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::ValidatorError</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/exception_rb.html">
+                lib/mcollective/exception.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                RuntimeError
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/MCollective/WindowsDaemon.html b/doc/classes/MCollective/WindowsDaemon.html
new file mode 100644 (file)
index 0000000..ef3500b
--- /dev/null
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::WindowsDaemon</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::WindowsDaemon</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../files/lib/mcollective/windows_daemon_rb.html">
+                lib/mcollective/windows_daemon.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Win32::Daemon
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000373">daemonize_runner</a>&nbsp;&nbsp;
+      <a href="#M000374">service_main</a>&nbsp;&nbsp;
+      <a href="#M000375">service_stop</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000373" class="method-detail">
+        <a name="M000373"></a>
+
+        <div class="method-heading">
+          <a href="#M000373" class="method-signature">
+          <span class="method-name">daemonize_runner</span><span class="method-args">(pid=nil)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000373-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000373-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/windows_daemon.rb, line 5</span>
+ 5:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">daemonize_runner</span>(<span class="ruby-identifier">pid</span>=<span class="ruby-keyword kw">nil</span>)
+ 6:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Writing pid files are not supported on the Windows Platform&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pid</span>
+ 7:       <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;The Windows Daemonizer should only be used on the Windows Platform&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">Util</span>.<span class="ruby-identifier">windows?</span>
+ 8: 
+ 9:       <span class="ruby-constant">WindowsDaemon</span>.<span class="ruby-identifier">mainloop</span>
+10:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000374" class="method-detail">
+        <a name="M000374"></a>
+
+        <div class="method-heading">
+          <a href="#M000374" class="method-signature">
+          <span class="method-name">service_main</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000374-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000374-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/windows_daemon.rb, line 12</span>
+12:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">service_main</span>
+13:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-value str">&quot;Starting Windows Service Daemon&quot;</span>)
+14: 
+15:       <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">running?</span>
+16:         <span class="ruby-constant">Runner</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">nil</span>).<span class="ruby-identifier">run</span>
+17:       <span class="ruby-keyword kw">end</span>
+18:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000375" class="method-detail">
+        <a name="M000375"></a>
+
+        <div class="method-heading">
+          <a href="#M000375" class="method-signature">
+          <span class="method-name">service_stop</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000375-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000375-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/windows_daemon.rb, line 20</span>
+20:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">service_stop</span>
+21:       <span class="ruby-constant">Log</span>.<span class="ruby-identifier">info</span>(<span class="ruby-value str">&quot;Windows service stopping&quot;</span>)
+22:     <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/String.html b/doc/classes/String.html
new file mode 100644 (file)
index 0000000..65be5bb
--- /dev/null
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: String</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">String</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../files/lib/mcollective/monkey_patches_rb.html">
+                lib/mcollective/monkey_patches.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+<a href="String.html#M000009">start_with?</a> was introduced in 1.8.7, we
+need to support 1.8.5 and 1.8.6
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000010">bytes</a>&nbsp;&nbsp;
+      <a href="#M000009">start_with?</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000010" class="method-detail">
+        <a name="M000010"></a>
+
+        <div class="method-heading">
+          <a href="#M000010" class="method-signature">
+          <span class="method-name">bytes</span><span class="method-args">(&amp;block)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000010-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/monkey_patches.rb, line 63</span>
+63:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">bytes</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+64:     <span class="ruby-comment cmt"># This should not be necessary, really ...</span>
+65:     <span class="ruby-identifier">require</span> <span class="ruby-value str">'enumerator'</span>
+66:     <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">to_enum</span>(<span class="ruby-identifier">:each_byte</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block_given?</span>
+67:     <span class="ruby-identifier">each_byte</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
+68:   <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000009" class="method-detail">
+        <a name="M000009"></a>
+
+        <div class="method-heading">
+          <a href="#M000009" class="method-signature">
+          <span class="method-name">start_with?</span><span class="method-args">(str)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000009-source">
+<pre>
+   <span class="ruby-comment cmt"># File lib/mcollective/monkey_patches.rb, line 4</span>
+4:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start_with?</span>(<span class="ruby-identifier">str</span>)
+5:     <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>[<span class="ruby-value">0</span> <span class="ruby-operator">..</span> (<span class="ruby-identifier">str</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>)] <span class="ruby-operator">==</span> <span class="ruby-identifier">str</span>
+6:   <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/classes/Symbol.html b/doc/classes/Symbol.html
new file mode 100644 (file)
index 0000000..ffaa50a
--- /dev/null
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: Symbol</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">Symbol</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../files/lib/mcollective/monkey_patches_rb.html">
+                lib/mcollective/monkey_patches.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+Make arrays of Symbols sortable
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000014">&lt;=&gt;</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+    <div id="includes">
+      <h3 class="section-bar">Included Modules</h3>
+
+      <div id="includes-list">
+        <span class="include-name">Comparable</span>
+      </div>
+    </div>
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000014" class="method-detail">
+        <a name="M000014"></a>
+
+        <div class="method-heading">
+          <a href="#M000014" class="method-signature">
+          <span class="method-name">&lt;=&gt;</span><span class="method-args">(other)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000014-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/monkey_patches.rb, line 13</span>
+13:   <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;=&gt;</span>(<span class="ruby-identifier">other</span>)
+14:     <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">to_s</span>
+15:   <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/created.rid b/doc/created.rid
new file mode 100644 (file)
index 0000000..d7eade0
--- /dev/null
@@ -0,0 +1 @@
+Fri, 08 Nov 2013 12:58:30 +0000
diff --git a/doc/files/install_rb.html b/doc/files/install_rb.html
new file mode 100644 (file)
index 0000000..4dc8875
--- /dev/null
@@ -0,0 +1,538 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: install.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>install.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>install.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+    <div id="requires-list">
+      <h3 class="section-bar">Required files</h3>
+
+      <div class="name-list">
+      rbconfig&nbsp;&nbsp;
+      find&nbsp;&nbsp;
+      fileutils&nbsp;&nbsp;
+      tempfile&nbsp;&nbsp;
+      optparse&nbsp;&nbsp;
+      ostruct&nbsp;&nbsp;
+      rdoc/rdoc&nbsp;&nbsp;
+      </div>
+    </div>
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000007">build_rdoc</a>&nbsp;&nbsp;
+      <a href="#M000002">check_prereqs</a>&nbsp;&nbsp;
+      <a href="#M000004">do_bins</a>&nbsp;&nbsp;
+      <a href="#M000003">do_configs</a>&nbsp;&nbsp;
+      <a href="#M000005">do_libs</a>&nbsp;&nbsp;
+      <a href="#M000001">glob</a>&nbsp;&nbsp;
+      <a href="#M000008">install_binfile</a>&nbsp;&nbsp;
+      <a href="#M000006">prepare_installation</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+    <div id="includes">
+      <h3 class="section-bar">Included Modules</h3>
+
+      <div id="includes-list">
+        <span class="include-name">FileUtils</span>
+      </div>
+    </div>
+
+    <div id="section">
+
+
+    <div id="constants-list">
+      <h3 class="section-bar">Constants</h3>
+
+      <div class="name-list">
+        <table summary="Constants">
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">PREREQS</td>
+          <td>=</td>
+          <td class="context-item-value">%w{rubygems stomp}</td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">InstallOptions</td>
+          <td>=</td>
+          <td class="context-item-value">OpenStruct.new</td>
+        </tr>
+        </table>
+      </div>
+    </div>
+
+
+
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000007" class="method-detail">
+        <a name="M000007"></a>
+
+        <div class="method-heading">
+          <a href="#M000007" class="method-signature">
+          <span class="method-name">build_rdoc</span><span class="method-args">(files)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Build the rdoc documentation.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000007-source">
+<pre>
+     <span class="ruby-comment cmt"># File install.rb, line 246</span>
+246: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build_rdoc</span>(<span class="ruby-identifier">files</span>)
+247:   <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">$haverdoc</span>
+248:   <span class="ruby-keyword kw">begin</span>
+249:     <span class="ruby-identifier">r</span> = <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">RDoc</span>.<span class="ruby-identifier">new</span>
+250:     <span class="ruby-identifier">r</span>.<span class="ruby-identifier">document</span>([<span class="ruby-value str">&quot;--main&quot;</span>, <span class="ruby-value str">&quot;MCollective&quot;</span>, <span class="ruby-value str">&quot;--line-numbers&quot;</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">files</span>)
+251:   <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">RDoc</span><span class="ruby-operator">::</span><span class="ruby-constant">RDocError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+252:     <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>
+253:   <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+254:     <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Couldn't build RDoc documentation\n#{e.message}&quot;</span>
+255:   <span class="ruby-keyword kw">end</span>
+256: <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000002" class="method-detail">
+        <a name="M000002"></a>
+
+        <div class="method-heading">
+          <a href="#M000002" class="method-signature">
+          <span class="method-name">check_prereqs</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000002-source">
+<pre>
+    <span class="ruby-comment cmt"># File install.rb, line 65</span>
+65: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">check_prereqs</span>
+66:   <span class="ruby-constant">PREREQS</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">pre</span><span class="ruby-operator">|</span>
+67:     <span class="ruby-keyword kw">begin</span>
+68:       <span class="ruby-identifier">require</span> <span class="ruby-identifier">pre</span>
+69:     <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">LoadError</span>
+70:       <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Could not load #{pre} Ruby library; cannot install&quot;</span>
+71:       <span class="ruby-identifier">exit</span>(<span class="ruby-value">-1</span>)
+72:     <span class="ruby-keyword kw">end</span>
+73:   <span class="ruby-keyword kw">end</span>
+74: <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000004" class="method-detail">
+        <a name="M000004"></a>
+
+        <div class="method-heading">
+          <a href="#M000004" class="method-signature">
+          <span class="method-name">do_bins</span><span class="method-args">(bins, target, strip = 's?bin/')</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000004-source">
+<pre>
+    <span class="ruby-comment cmt"># File install.rb, line 86</span>
+86: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">do_bins</span>(<span class="ruby-identifier">bins</span>, <span class="ruby-identifier">target</span>, <span class="ruby-identifier">strip</span> = <span class="ruby-value str">'s?bin/'</span>)
+87:   <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">mkdir</span>(<span class="ruby-identifier">target</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-identifier">target</span>
+88:   <span class="ruby-identifier">bins</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">bf</span><span class="ruby-operator">|</span>
+89:     <span class="ruby-identifier">obf</span> = <span class="ruby-identifier">bf</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/#{strip}/</span>, <span class="ruby-value str">''</span>)
+90:     <span class="ruby-identifier">install_binfile</span>(<span class="ruby-identifier">bf</span>, <span class="ruby-identifier">obf</span>, <span class="ruby-identifier">target</span>)
+91:   <span class="ruby-keyword kw">end</span>
+92: <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000003" class="method-detail">
+        <a name="M000003"></a>
+
+        <div class="method-heading">
+          <a href="#M000003" class="method-signature">
+          <span class="method-name">do_configs</span><span class="method-args">(configs, target, strip = 'etc/')</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000003-source">
+<pre>
+    <span class="ruby-comment cmt"># File install.rb, line 76</span>
+76: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">do_configs</span>(<span class="ruby-identifier">configs</span>, <span class="ruby-identifier">target</span>, <span class="ruby-identifier">strip</span> = <span class="ruby-value str">'etc/'</span>)
+77:   <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">mkdir</span>(<span class="ruby-identifier">target</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-identifier">target</span>
+78:   <span class="ruby-identifier">configs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">cf</span><span class="ruby-operator">|</span>
+79:     <span class="ruby-identifier">ocf</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">target</span>, <span class="ruby-identifier">cf</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">strip</span>), <span class="ruby-value str">''</span>))
+80:     <span class="ruby-identifier">oc</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">ocf</span>)
+81:     <span class="ruby-identifier">makedirs</span>(<span class="ruby-identifier">oc</span>, {<span class="ruby-identifier">:mode</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">0755</span>, <span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>})
+82:     <span class="ruby-identifier">install</span>(<span class="ruby-identifier">cf</span>, <span class="ruby-identifier">ocf</span>, {<span class="ruby-identifier">:mode</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">0644</span>, <span class="ruby-identifier">:preserve</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>})
+83:   <span class="ruby-keyword kw">end</span>
+84: <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000005" class="method-detail">
+        <a name="M000005"></a>
+
+        <div class="method-heading">
+          <a href="#M000005" class="method-signature">
+          <span class="method-name">do_libs</span><span class="method-args">(libs, target, strip = 'lib/')</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000005-source">
+<pre>
+     <span class="ruby-comment cmt"># File install.rb, line 94</span>
+ 94: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">do_libs</span>(<span class="ruby-identifier">libs</span>, <span class="ruby-identifier">target</span>, <span class="ruby-identifier">strip</span> = <span class="ruby-value str">'lib/'</span>)
+ 95:   <span class="ruby-identifier">libs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">lf</span><span class="ruby-operator">|</span>
+ 96:     <span class="ruby-identifier">olf</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">target</span>, <span class="ruby-identifier">lf</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-node">/^#{strip}/</span>, <span class="ruby-value str">''</span>))
+ 97:     <span class="ruby-identifier">op</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">olf</span>)
+ 98:     <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">lf</span>)
+ 99:       <span class="ruby-identifier">makedirs</span>(<span class="ruby-identifier">olf</span>, {<span class="ruby-identifier">:mode</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">0755</span>, <span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>})
+100:     <span class="ruby-keyword kw">else</span>
+101:       <span class="ruby-identifier">makedirs</span>(<span class="ruby-identifier">op</span>, {<span class="ruby-identifier">:mode</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">0755</span>, <span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>})
+102:       <span class="ruby-identifier">install</span>(<span class="ruby-identifier">lf</span>, <span class="ruby-identifier">olf</span>, {<span class="ruby-identifier">:mode</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">0644</span>, <span class="ruby-identifier">:preserve</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>})
+103:     <span class="ruby-keyword kw">end</span>
+104:   <span class="ruby-keyword kw">end</span>
+105: <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000001" class="method-detail">
+        <a name="M000001"></a>
+
+        <div class="method-heading">
+          <a href="#M000001" class="method-signature">
+          <span class="method-name">glob</span><span class="method-args">(list)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000001-source">
+<pre>
+    <span class="ruby-comment cmt"># File install.rb, line 57</span>
+57: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">glob</span>(<span class="ruby-identifier">list</span>)
+58:   <span class="ruby-identifier">g</span> = <span class="ruby-identifier">list</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>(<span class="ruby-identifier">i</span>) }
+59:   <span class="ruby-identifier">g</span>.<span class="ruby-identifier">flatten!</span>
+60:   <span class="ruby-identifier">g</span>.<span class="ruby-identifier">compact!</span>
+61:   <span class="ruby-identifier">g</span>.<span class="ruby-identifier">uniq!</span>
+62:   <span class="ruby-identifier">g</span>
+63: <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000008" class="method-detail">
+        <a name="M000008"></a>
+
+        <div class="method-heading">
+          <a href="#M000008" class="method-signature">
+          <span class="method-name">install_binfile</span><span class="method-args">(from, op_file, target)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Install file(s) from ./bin to RbConfig::CONFIG[&#8216;bindir&#8217;]. Patch
+it on the way to insert a #! line; on a Unix install, the command is named
+as expected
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000008-source">
+<pre>
+     <span class="ruby-comment cmt"># File install.rb, line 261</span>
+261: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">install_binfile</span>(<span class="ruby-identifier">from</span>, <span class="ruby-identifier">op_file</span>, <span class="ruby-identifier">target</span>)
+262:   <span class="ruby-identifier">tmp_file</span> = <span class="ruby-constant">Tempfile</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'mcollective-binfile'</span>)
+263: 
+264:   <span class="ruby-keyword kw">if</span> <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">ruby</span>
+265:     <span class="ruby-identifier">ruby</span> = <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">ruby</span>
+266:   <span class="ruby-keyword kw">else</span>
+267:     <span class="ruby-identifier">ruby</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">RbConfig</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'bindir'</span>], <span class="ruby-constant">RbConfig</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'ruby_install_name'</span>])
+268:   <span class="ruby-keyword kw">end</span>
+269: 
+270:   <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">from</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ip</span><span class="ruby-operator">|</span>
+271:     <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">tmp_file</span>.<span class="ruby-identifier">path</span>, <span class="ruby-value str">&quot;w&quot;</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">op</span><span class="ruby-operator">|</span>
+272:       <span class="ruby-identifier">op</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;#!#{ruby}&quot;</span>
+273:       <span class="ruby-identifier">contents</span> = <span class="ruby-identifier">ip</span>.<span class="ruby-identifier">readlines</span>
+274:       <span class="ruby-identifier">contents</span>.<span class="ruby-identifier">shift</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">contents</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^#!/</span>
+275:       <span class="ruby-identifier">op</span>.<span class="ruby-identifier">write</span> <span class="ruby-identifier">contents</span>.<span class="ruby-identifier">join</span>
+276:     <span class="ruby-keyword kw">end</span>
+277:   <span class="ruby-keyword kw">end</span>
+278: 
+279:   <span class="ruby-identifier">install</span>(<span class="ruby-identifier">tmp_file</span>.<span class="ruby-identifier">path</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">target</span>, <span class="ruby-identifier">op_file</span>), <span class="ruby-identifier">:mode</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">0755</span>, <span class="ruby-identifier">:preserve</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">:verbose</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">true</span>)
+280:   <span class="ruby-identifier">tmp_file</span>.<span class="ruby-identifier">unlink</span>
+281: <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000006" class="method-detail">
+        <a name="M000006"></a>
+
+        <div class="method-heading">
+          <a href="#M000006" class="method-signature">
+          <span class="method-name">prepare_installation</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Prepare the file installation.
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000006-source">
+<pre>
+     <span class="ruby-comment cmt"># File install.rb, line 110</span>
+110: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prepare_installation</span>
+111:   <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">configs</span> = <span class="ruby-keyword kw">true</span>
+112: 
+113:   <span class="ruby-comment cmt"># Only try to do docs if we're sure they have rdoc</span>
+114:   <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$haverdoc</span>
+115:     <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">rdoc</span> = <span class="ruby-keyword kw">true</span>
+116:   <span class="ruby-keyword kw">else</span>
+117:     <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">rdoc</span> = <span class="ruby-keyword kw">false</span>
+118:   <span class="ruby-keyword kw">end</span>
+119: 
+120: 
+121:   <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">options</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">opts</span><span class="ruby-operator">|</span>
+122:     <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">banner</span> = <span class="ruby-node">&quot;Usage: #{File.basename($0)} [options]&quot;</span>
+123:     <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">separator</span> <span class="ruby-value str">&quot;&quot;</span>
+124:     <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--[no-]rdoc'</span>, <span class="ruby-value str">'Creation of RDoc output.'</span>, <span class="ruby-value str">'Default is create rdoc.'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">onrdoc</span><span class="ruby-operator">|</span>
+125:       <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">rdoc</span> = <span class="ruby-identifier">onrdoc</span>
+126:     <span class="ruby-keyword kw">end</span>
+127:     <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--[no-]configs'</span>, <span class="ruby-value str">'Installation of config files'</span>, <span class="ruby-value str">'Default is install configs.'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">onconfigs</span><span class="ruby-operator">|</span>
+128:       <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">configs</span> = <span class="ruby-identifier">onconfigs</span>
+129:     <span class="ruby-keyword kw">end</span>
+130:     <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--destdir[=OPTIONAL]'</span>, <span class="ruby-value str">'Installation prefix for all targets'</span>, <span class="ruby-value str">'Default essentially /'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">destdir</span><span class="ruby-operator">|</span>
+131:       <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">destdir</span> = <span class="ruby-identifier">destdir</span>
+132:     <span class="ruby-keyword kw">end</span>
+133:     <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--configdir[=OPTIONAL]'</span>, <span class="ruby-value str">'Installation directory for config files'</span>, <span class="ruby-value str">'Default /etc/mcollective'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">configdir</span><span class="ruby-operator">|</span>
+134:       <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">configdir</span> = <span class="ruby-identifier">configdir</span>
+135:     <span class="ruby-keyword kw">end</span>
+136:     <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--bindir[=OPTIONAL]'</span>, <span class="ruby-value str">'Installation directory for binaries'</span>, <span class="ruby-value str">'overrides RbConfig::CONFIG[&quot;bindir&quot;]'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">bindir</span><span class="ruby-operator">|</span>
+137:       <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">bindir</span> = <span class="ruby-identifier">bindir</span>
+138:     <span class="ruby-keyword kw">end</span>
+139:     <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--sbindir[=OPTIONAL]'</span>, <span class="ruby-value str">'Installation directory for system binaries'</span>, <span class="ruby-value str">'overrides RbConfig::CONFIG[&quot;sbindir&quot;]'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sbindir</span><span class="ruby-operator">|</span>
+140:       <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">sbindir</span> = <span class="ruby-identifier">sbindir</span>
+141:     <span class="ruby-keyword kw">end</span>
+142:     <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--ruby[=OPTIONAL]'</span>, <span class="ruby-value str">'Ruby interpreter to use with installation'</span>, <span class="ruby-value str">'overrides ruby used to call install.rb'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">ruby</span><span class="ruby-operator">|</span>
+143:       <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">ruby</span> = <span class="ruby-identifier">ruby</span>
+144:     <span class="ruby-keyword kw">end</span>
+145:     <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--sitelibdir[=OPTIONAL]'</span>, <span class="ruby-value str">'Installation directory for libraries'</span>, <span class="ruby-value str">'overrides RbConfig::CONFIG[&quot;sitelibdir&quot;]'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sitelibdir</span><span class="ruby-operator">|</span>
+146:       <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">sitelibdir</span> = <span class="ruby-identifier">sitelibdir</span>
+147:     <span class="ruby-keyword kw">end</span>
+148:     <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--plugindir[=OPTIONAL]'</span>, <span class="ruby-value str">'Installation directory for plugins'</span>, <span class="ruby-value str">'Default /usr/libexec/mcollective'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">plugindir</span><span class="ruby-operator">|</span>
+149:       <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">plugindir</span> = <span class="ruby-identifier">plugindir</span>
+150:     <span class="ruby-keyword kw">end</span>
+151:     <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--quick'</span>, <span class="ruby-value str">'Performs a quick installation. Only the'</span>, <span class="ruby-value str">'installation is done.'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">quick</span><span class="ruby-operator">|</span>
+152:       <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">rdoc</span>    = <span class="ruby-keyword kw">false</span>
+153:       <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">ri</span>      = <span class="ruby-keyword kw">false</span>
+154:       <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">configs</span> = <span class="ruby-keyword kw">true</span>
+155:     <span class="ruby-keyword kw">end</span>
+156:     <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">'--full'</span>, <span class="ruby-value str">'Performs a full installation. All'</span>, <span class="ruby-value str">'optional installation steps are run.'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">full</span><span class="ruby-operator">|</span>
+157:       <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">rdoc</span>    = <span class="ruby-keyword kw">true</span>
+158:       <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">ri</span>      = <span class="ruby-keyword kw">true</span>
+159:       <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">configs</span> = <span class="ruby-keyword kw">true</span>
+160:     <span class="ruby-keyword kw">end</span>
+161:     <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">separator</span>(<span class="ruby-value str">&quot;&quot;</span>)
+162:     <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on_tail</span>(<span class="ruby-value str">'--help'</span>, <span class="ruby-value str">&quot;Shows this help text.&quot;</span>) <span class="ruby-keyword kw">do</span>
+163:       <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">opts</span>
+164:       <span class="ruby-identifier">exit</span>
+165:     <span class="ruby-keyword kw">end</span>
+166: 
+167:     <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">parse!</span>
+168:   <span class="ruby-keyword kw">end</span>
+169: 
+170:   <span class="ruby-identifier">version</span> = [<span class="ruby-constant">RbConfig</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">&quot;MAJOR&quot;</span>], <span class="ruby-constant">RbConfig</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">&quot;MINOR&quot;</span>]].<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;.&quot;</span>)
+171:   <span class="ruby-identifier">libdir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">RbConfig</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">&quot;libdir&quot;</span>], <span class="ruby-value str">&quot;ruby&quot;</span>, <span class="ruby-identifier">version</span>)
+172: 
+173:   <span class="ruby-comment cmt"># Mac OS X 10.5 and higher declare bindir</span>
+174:   <span class="ruby-comment cmt"># /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin</span>
+175:   <span class="ruby-comment cmt"># which is not generally where people expect executables to be installed</span>
+176:   <span class="ruby-comment cmt"># These settings are appropriate defaults for all OS X versions.</span>
+177:   <span class="ruby-keyword kw">if</span> <span class="ruby-constant">RUBY_PLATFORM</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^universal-darwin[\d\.]+$/</span>
+178:     <span class="ruby-constant">RbConfig</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'bindir'</span>] = <span class="ruby-value str">&quot;/usr/bin&quot;</span>
+179:     <span class="ruby-constant">RbConfig</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'sbindir'</span>] = <span class="ruby-value str">&quot;/usr/sbin&quot;</span>
+180:   <span class="ruby-keyword kw">end</span>
+181: 
+182:   <span class="ruby-keyword kw">if</span> <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">configdir</span>
+183:     <span class="ruby-identifier">configdir</span> = <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">configdir</span>
+184:   <span class="ruby-keyword kw">else</span>
+185:     <span class="ruby-identifier">configdir</span> = <span class="ruby-value str">&quot;/etc/mcollective&quot;</span>
+186:   <span class="ruby-keyword kw">end</span>
+187: 
+188:   <span class="ruby-keyword kw">if</span> <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">bindir</span>
+189:     <span class="ruby-identifier">bindir</span> = <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">bindir</span>
+190:   <span class="ruby-keyword kw">else</span>
+191:     <span class="ruby-identifier">bindir</span> = <span class="ruby-constant">RbConfig</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'bindir'</span>]
+192:   <span class="ruby-keyword kw">end</span>
+193: 
+194:   <span class="ruby-keyword kw">if</span> <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">sbindir</span>
+195:     <span class="ruby-identifier">sbindir</span> = <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">sbindir</span>
+196:   <span class="ruby-keyword kw">else</span>
+197:     <span class="ruby-identifier">sbindir</span> = <span class="ruby-constant">RbConfig</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">'sbindir'</span>]
+198:   <span class="ruby-keyword kw">end</span>
+199: 
+200:   <span class="ruby-keyword kw">if</span> <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">sitelibdir</span>
+201:     <span class="ruby-identifier">sitelibdir</span> = <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">sitelibdir</span>
+202:   <span class="ruby-keyword kw">else</span>
+203:     <span class="ruby-identifier">sitelibdir</span> = <span class="ruby-constant">RbConfig</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value str">&quot;sitelibdir&quot;</span>]
+204:     <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sitelibdir</span>.<span class="ruby-identifier">nil?</span>
+205:       <span class="ruby-identifier">sitelibdir</span> = <span class="ruby-identifier">$LOAD_PATH</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/site_ruby/</span> }
+206:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">sitelibdir</span>.<span class="ruby-identifier">nil?</span>
+207:         <span class="ruby-identifier">sitelibdir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">libdir</span>, <span class="ruby-value str">&quot;site_ruby&quot;</span>)
+208:       <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">sitelibdir</span> <span class="ruby-operator">!~</span> <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">quote</span>(<span class="ruby-identifier">version</span>)
+209:         <span class="ruby-identifier">sitelibdir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">sitelibdir</span>, <span class="ruby-identifier">version</span>)
+210:       <span class="ruby-keyword kw">end</span>
+211:     <span class="ruby-keyword kw">end</span>
+212:   <span class="ruby-keyword kw">end</span>
+213: 
+214:   <span class="ruby-keyword kw">if</span> <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">plugindir</span>
+215:     <span class="ruby-identifier">plugindir</span> = <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">plugindir</span>
+216:   <span class="ruby-keyword kw">else</span>
+217:     <span class="ruby-identifier">plugindir</span> = <span class="ruby-value str">&quot;/usr/libexec/mcollective&quot;</span>
+218:   <span class="ruby-keyword kw">end</span>
+219: 
+220:   <span class="ruby-keyword kw">if</span> <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">destdir</span>
+221:     <span class="ruby-identifier">destdir</span> = <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">destdir</span>
+222:   <span class="ruby-keyword kw">else</span>
+223:     <span class="ruby-identifier">destdir</span> = <span class="ruby-value str">''</span>
+224:   <span class="ruby-keyword kw">end</span>
+225: 
+226:   <span class="ruby-identifier">configdir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">destdir</span>, <span class="ruby-identifier">configdir</span>)
+227:   <span class="ruby-identifier">bindir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">destdir</span>, <span class="ruby-identifier">bindir</span>)
+228:   <span class="ruby-identifier">sitelibdir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">destdir</span>, <span class="ruby-identifier">sitelibdir</span>)
+229: 
+230:   <span class="ruby-identifier">makedirs</span>(<span class="ruby-identifier">configdir</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">configs</span>
+231:   <span class="ruby-identifier">makedirs</span>(<span class="ruby-identifier">bindir</span>)
+232:   <span class="ruby-identifier">makedirs</span>(<span class="ruby-identifier">sbindir</span>)
+233:   <span class="ruby-identifier">makedirs</span>(<span class="ruby-identifier">sitelibdir</span>)
+234:   <span class="ruby-identifier">makedirs</span>(<span class="ruby-identifier">plugindir</span>)
+235: 
+236:   <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">sitelibdir</span> = <span class="ruby-identifier">sitelibdir</span>
+237:   <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">configdir</span> = <span class="ruby-identifier">configdir</span>
+238:   <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">bindir</span>  = <span class="ruby-identifier">bindir</span>
+239:   <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">sbindir</span>  = <span class="ruby-identifier">sbindir</span>
+240:   <span class="ruby-constant">InstallOptions</span>.<span class="ruby-identifier">plugindir</span>  = <span class="ruby-identifier">plugindir</span>
+241: <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/agent_rb.html b/doc/files/lib/mcollective/agent_rb.html
new file mode 100644 (file)
index 0000000..cfd6068
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: agent.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>agent.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/agent.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/agents_rb.html b/doc/files/lib/mcollective/agents_rb.html
new file mode 100644 (file)
index 0000000..eeb8802
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: agents.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>agents.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/agents.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/aggregate/base_rb.html b/doc/files/lib/mcollective/aggregate/base_rb.html
new file mode 100644 (file)
index 0000000..2684dbb
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: base.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>base.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/aggregate/base.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/aggregate/result/base_rb.html b/doc/files/lib/mcollective/aggregate/result/base_rb.html
new file mode 100644 (file)
index 0000000..7b47f98
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: base.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>base.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/aggregate/result/base.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/aggregate/result/collection_result_rb.html b/doc/files/lib/mcollective/aggregate/result/collection_result_rb.html
new file mode 100644 (file)
index 0000000..69684fc
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: collection_result.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>collection_result.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/aggregate/result/collection_result.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/aggregate/result/numeric_result_rb.html b/doc/files/lib/mcollective/aggregate/result/numeric_result_rb.html
new file mode 100644 (file)
index 0000000..df9f0e7
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: numeric_result.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>numeric_result.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/aggregate/result/numeric_result.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/aggregate/result_rb.html b/doc/files/lib/mcollective/aggregate/result_rb.html
new file mode 100644 (file)
index 0000000..3621501
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: result.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>result.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/aggregate/result.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/aggregate_rb.html b/doc/files/lib/mcollective/aggregate_rb.html
new file mode 100644 (file)
index 0000000..729498c
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: aggregate.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>aggregate.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/aggregate.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/application_rb.html b/doc/files/lib/mcollective/application_rb.html
new file mode 100644 (file)
index 0000000..517c878
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: application.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>application.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/application.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/applications_rb.html b/doc/files/lib/mcollective/applications_rb.html
new file mode 100644 (file)
index 0000000..c7f9e4e
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: applications.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>applications.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/applications.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/cache_rb.html b/doc/files/lib/mcollective/cache_rb.html
new file mode 100644 (file)
index 0000000..3ca23b6
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: cache.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>cache.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/cache.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/client_rb.html b/doc/files/lib/mcollective/client_rb.html
new file mode 100644 (file)
index 0000000..7fcd31e
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: client.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>client.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/client.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/config_rb.html b/doc/files/lib/mcollective/config_rb.html
new file mode 100644 (file)
index 0000000..8fd13d0
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: config.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>config.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/config.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/connector/base_rb.html b/doc/files/lib/mcollective/connector/base_rb.html
new file mode 100644 (file)
index 0000000..165219b
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: base.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>base.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/connector/base.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/connector_rb.html b/doc/files/lib/mcollective/connector_rb.html
new file mode 100644 (file)
index 0000000..83b2e61
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: connector.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>connector.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/connector.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/data/base_rb.html b/doc/files/lib/mcollective/data/base_rb.html
new file mode 100644 (file)
index 0000000..8642e90
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: base.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>base.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/data/base.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/data/result_rb.html b/doc/files/lib/mcollective/data/result_rb.html
new file mode 100644 (file)
index 0000000..e6e83b8
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: result.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>result.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/data/result.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/data_rb.html b/doc/files/lib/mcollective/data_rb.html
new file mode 100644 (file)
index 0000000..bd5e809
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: data.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>data.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/data.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/ddl/agentddl_rb.html b/doc/files/lib/mcollective/ddl/agentddl_rb.html
new file mode 100644 (file)
index 0000000..6e2597c
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: agentddl.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>agentddl.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/ddl/agentddl.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/ddl/base_rb.html b/doc/files/lib/mcollective/ddl/base_rb.html
new file mode 100644 (file)
index 0000000..ffe12bb
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: base.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>base.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/ddl/base.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/ddl/dataddl_rb.html b/doc/files/lib/mcollective/ddl/dataddl_rb.html
new file mode 100644 (file)
index 0000000..2f49a76
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: dataddl.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>dataddl.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/ddl/dataddl.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/ddl/discoveryddl_rb.html b/doc/files/lib/mcollective/ddl/discoveryddl_rb.html
new file mode 100644 (file)
index 0000000..faa3bd9
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: discoveryddl.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>discoveryddl.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/ddl/discoveryddl.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/ddl/validatorddl_rb.html b/doc/files/lib/mcollective/ddl/validatorddl_rb.html
new file mode 100644 (file)
index 0000000..e912850
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: validatorddl.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>validatorddl.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/ddl/validatorddl.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/ddl_rb.html b/doc/files/lib/mcollective/ddl_rb.html
new file mode 100644 (file)
index 0000000..0fc4f16
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: ddl.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>ddl.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/ddl.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/discovery_rb.html b/doc/files/lib/mcollective/discovery_rb.html
new file mode 100644 (file)
index 0000000..1aa8bb5
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: discovery.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>discovery.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/discovery.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/exception_rb.html b/doc/files/lib/mcollective/exception_rb.html
new file mode 100644 (file)
index 0000000..9c00dcc
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: exception.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>exception.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/exception.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/facts/base_rb.html b/doc/files/lib/mcollective/facts/base_rb.html
new file mode 100644 (file)
index 0000000..3d4f6c0
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: base.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>base.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/facts/base.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/facts_rb.html b/doc/files/lib/mcollective/facts_rb.html
new file mode 100644 (file)
index 0000000..0e15fae
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: facts.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>facts.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/facts.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/generators/agent_generator_rb.html b/doc/files/lib/mcollective/generators/agent_generator_rb.html
new file mode 100644 (file)
index 0000000..53c1de7
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: agent_generator.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>agent_generator.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/generators/agent_generator.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/generators/base_rb.html b/doc/files/lib/mcollective/generators/base_rb.html
new file mode 100644 (file)
index 0000000..8aa9fde
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: base.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>base.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/generators/base.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/generators/data_generator_rb.html b/doc/files/lib/mcollective/generators/data_generator_rb.html
new file mode 100644 (file)
index 0000000..898ea37
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: data_generator.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>data_generator.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/generators/data_generator.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/generators_rb.html b/doc/files/lib/mcollective/generators_rb.html
new file mode 100644 (file)
index 0000000..6aae7da
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: generators.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>generators.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/generators.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/log_rb.html b/doc/files/lib/mcollective/log_rb.html
new file mode 100644 (file)
index 0000000..9d920da
--- /dev/null
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: log.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>log.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/log.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+    <div id="requires-list">
+      <h3 class="section-bar">Required files</h3>
+
+      <div class="name-list">
+      mcollective/logger/%s_logger&nbsp;&nbsp;
+      </div>
+    </div>
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/logger/base_rb.html b/doc/files/lib/mcollective/logger/base_rb.html
new file mode 100644 (file)
index 0000000..0df66fe
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: base.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>base.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/logger/base.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/logger/console_logger_rb.html b/doc/files/lib/mcollective/logger/console_logger_rb.html
new file mode 100644 (file)
index 0000000..a0adb4b
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: console_logger.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>console_logger.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/logger/console_logger.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/logger/file_logger_rb.html b/doc/files/lib/mcollective/logger/file_logger_rb.html
new file mode 100644 (file)
index 0000000..afbb235
--- /dev/null
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: file_logger.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>file_logger.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/logger/file_logger.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+    <div id="requires-list">
+      <h3 class="section-bar">Required files</h3>
+
+      <div class="name-list">
+      logger&nbsp;&nbsp;
+      </div>
+    </div>
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/logger/syslog_logger_rb.html b/doc/files/lib/mcollective/logger/syslog_logger_rb.html
new file mode 100644 (file)
index 0000000..a23b2f4
--- /dev/null
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: syslog_logger.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>syslog_logger.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/logger/syslog_logger.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+    <div id="requires-list">
+      <h3 class="section-bar">Required files</h3>
+
+      <div class="name-list">
+      syslog&nbsp;&nbsp;
+      </div>
+    </div>
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/logger_rb.html b/doc/files/lib/mcollective/logger_rb.html
new file mode 100644 (file)
index 0000000..60c8a56
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: logger.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>logger.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/logger.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/matcher/parser_rb.html b/doc/files/lib/mcollective/matcher/parser_rb.html
new file mode 100644 (file)
index 0000000..2dde3e1
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: parser.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>parser.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/matcher/parser.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/matcher/scanner_rb.html b/doc/files/lib/mcollective/matcher/scanner_rb.html
new file mode 100644 (file)
index 0000000..ac90650
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: scanner.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>scanner.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/matcher/scanner.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/matcher_rb.html b/doc/files/lib/mcollective/matcher_rb.html
new file mode 100644 (file)
index 0000000..451f187
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: matcher.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>matcher.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/matcher.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/message_rb.html b/doc/files/lib/mcollective/message_rb.html
new file mode 100644 (file)
index 0000000..83f4c7d
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: message.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>message.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/message.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/monkey_patches_rb.html b/doc/files/lib/mcollective/monkey_patches_rb.html
new file mode 100644 (file)
index 0000000..3382b51
--- /dev/null
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: monkey_patches.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>monkey_patches.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/monkey_patches.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+start_with? was introduced in 1.8.7, we need to support 1.8.5 and 1.8.6
+</p>
+
+    </div>
+
+    <div id="requires-list">
+      <h3 class="section-bar">Required files</h3>
+
+      <div class="name-list">
+      enumerator&nbsp;&nbsp;
+      </div>
+    </div>
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+    <div id="constants-list">
+      <h3 class="section-bar">Constants</h3>
+
+      <div class="name-list">
+        <table summary="Constants">
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">RbConfig</td>
+          <td>=</td>
+          <td class="context-item-value">::Config</td>
+        </tr>
+        </table>
+      </div>
+    </div>
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/optionparser_rb.html b/doc/files/lib/mcollective/optionparser_rb.html
new file mode 100644 (file)
index 0000000..ce9e590
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: optionparser.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>optionparser.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/optionparser.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/pluginmanager_rb.html b/doc/files/lib/mcollective/pluginmanager_rb.html
new file mode 100644 (file)
index 0000000..502329c
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: pluginmanager.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>pluginmanager.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/pluginmanager.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/pluginpackager/agent_definition_rb.html b/doc/files/lib/mcollective/pluginpackager/agent_definition_rb.html
new file mode 100644 (file)
index 0000000..de663f6
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: agent_definition.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>agent_definition.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/pluginpackager/agent_definition.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/pluginpackager/standard_definition_rb.html b/doc/files/lib/mcollective/pluginpackager/standard_definition_rb.html
new file mode 100644 (file)
index 0000000..6d5e762
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: standard_definition.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>standard_definition.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/pluginpackager/standard_definition.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/pluginpackager_rb.html b/doc/files/lib/mcollective/pluginpackager_rb.html
new file mode 100644 (file)
index 0000000..c4781c2
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: pluginpackager.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>pluginpackager.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/pluginpackager.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/registration/base_rb.html b/doc/files/lib/mcollective/registration/base_rb.html
new file mode 100644 (file)
index 0000000..845076d
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: base.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>base.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/registration/base.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/registration_rb.html b/doc/files/lib/mcollective/registration_rb.html
new file mode 100644 (file)
index 0000000..667223e
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: registration.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>registration.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/registration.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/rpc/actionrunner_rb.html b/doc/files/lib/mcollective/rpc/actionrunner_rb.html
new file mode 100644 (file)
index 0000000..e5bcaba
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: actionrunner.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>actionrunner.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/rpc/actionrunner.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/rpc/agent_rb.html b/doc/files/lib/mcollective/rpc/agent_rb.html
new file mode 100644 (file)
index 0000000..aa8ddcd
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: agent.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>agent.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/rpc/agent.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/rpc/audit_rb.html b/doc/files/lib/mcollective/rpc/audit_rb.html
new file mode 100644 (file)
index 0000000..f0609b1
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: audit.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>audit.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/rpc/audit.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/rpc/client_rb.html b/doc/files/lib/mcollective/rpc/client_rb.html
new file mode 100644 (file)
index 0000000..dfd5325
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: client.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>client.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/rpc/client.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/rpc/helpers_rb.html b/doc/files/lib/mcollective/rpc/helpers_rb.html
new file mode 100644 (file)
index 0000000..edb1a0f
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: helpers.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>helpers.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/rpc/helpers.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/rpc/progress_rb.html b/doc/files/lib/mcollective/rpc/progress_rb.html
new file mode 100644 (file)
index 0000000..3c94309
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: progress.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>progress.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/rpc/progress.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/rpc/reply_rb.html b/doc/files/lib/mcollective/rpc/reply_rb.html
new file mode 100644 (file)
index 0000000..87f9716
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: reply.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>reply.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/rpc/reply.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/rpc/request_rb.html b/doc/files/lib/mcollective/rpc/request_rb.html
new file mode 100644 (file)
index 0000000..87e39eb
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: request.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>request.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/rpc/request.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/rpc/result_rb.html b/doc/files/lib/mcollective/rpc/result_rb.html
new file mode 100644 (file)
index 0000000..3514b48
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: result.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>result.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/rpc/result.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/rpc/stats_rb.html b/doc/files/lib/mcollective/rpc/stats_rb.html
new file mode 100644 (file)
index 0000000..dcde181
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: stats.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>stats.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/rpc/stats.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/rpc_rb.html b/doc/files/lib/mcollective/rpc_rb.html
new file mode 100644 (file)
index 0000000..2e0ee3c
--- /dev/null
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: rpc.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>rpc.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/rpc.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+    <div id="requires-list">
+      <h3 class="section-bar">Required files</h3>
+
+      <div class="name-list">
+      pp&nbsp;&nbsp;
+      </div>
+    </div>
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/runner_rb.html b/doc/files/lib/mcollective/runner_rb.html
new file mode 100644 (file)
index 0000000..e606906
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: runner.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>runner.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/runner.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/runnerstats_rb.html b/doc/files/lib/mcollective/runnerstats_rb.html
new file mode 100644 (file)
index 0000000..5687dea
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: runnerstats.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>runnerstats.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/runnerstats.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/security/base_rb.html b/doc/files/lib/mcollective/security/base_rb.html
new file mode 100644 (file)
index 0000000..5d9f09c
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: base.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>base.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/security/base.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/security_rb.html b/doc/files/lib/mcollective/security_rb.html
new file mode 100644 (file)
index 0000000..797d733
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: security.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>security.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/security.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/shell_rb.html b/doc/files/lib/mcollective/shell_rb.html
new file mode 100644 (file)
index 0000000..8a399ba
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: shell.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>shell.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/shell.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/ssl_rb.html b/doc/files/lib/mcollective/ssl_rb.html
new file mode 100644 (file)
index 0000000..eed84f5
--- /dev/null
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: ssl.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>ssl.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/ssl.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+    <div id="requires-list">
+      <h3 class="section-bar">Required files</h3>
+
+      <div class="name-list">
+      openssl&nbsp;&nbsp;
+      base64&nbsp;&nbsp;
+      digest/sha1&nbsp;&nbsp;
+      </div>
+    </div>
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/translatable_rb.html b/doc/files/lib/mcollective/translatable_rb.html
new file mode 100644 (file)
index 0000000..82f7763
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: translatable.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>translatable.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/translatable.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/unix_daemon_rb.html b/doc/files/lib/mcollective/unix_daemon_rb.html
new file mode 100644 (file)
index 0000000..5352119
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: unix_daemon.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>unix_daemon.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/unix_daemon.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/util_rb.html b/doc/files/lib/mcollective/util_rb.html
new file mode 100644 (file)
index 0000000..2e26369
--- /dev/null
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: util.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>util.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/util.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+    <div id="requires-list">
+      <h3 class="section-bar">Required files</h3>
+
+      <div class="name-list">
+      win32/dir&nbsp;&nbsp;
+      </div>
+    </div>
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/validator_rb.html b/doc/files/lib/mcollective/validator_rb.html
new file mode 100644 (file)
index 0000000..4edb534
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: validator.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>validator.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/validator.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective/windows_daemon_rb.html b/doc/files/lib/mcollective/windows_daemon_rb.html
new file mode 100644 (file)
index 0000000..9e96c41
--- /dev/null
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: windows_daemon.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>windows_daemon.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective/windows_daemon.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+    <div id="requires-list">
+      <h3 class="section-bar">Required files</h3>
+
+      <div class="name-list">
+      win32/daemon&nbsp;&nbsp;
+      </div>
+    </div>
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/files/lib/mcollective_rb.html b/doc/files/lib/mcollective_rb.html
new file mode 100644 (file)
index 0000000..886f060
--- /dev/null
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>File: mcollective.rb</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+  <div id="fileHeader">
+    <h1>mcollective.rb</h1>
+    <table class="header-table">
+    <tr class="top-aligned-row">
+      <td><strong>Path:</strong></td>
+      <td>lib/mcollective.rb
+      </td>
+    </tr>
+    <tr class="top-aligned-row">
+      <td><strong>Last Update:</strong></td>
+      <td>Fri Nov 08 12:57:19 +0000 2013</td>
+    </tr>
+    </table>
+  </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+
+    <div id="requires-list">
+      <h3 class="section-bar">Required files</h3>
+
+      <div class="name-list">
+      rubygems&nbsp;&nbsp;
+      stomp&nbsp;&nbsp;
+      timeout&nbsp;&nbsp;
+      digest/md5&nbsp;&nbsp;
+      optparse&nbsp;&nbsp;
+      singleton&nbsp;&nbsp;
+      socket&nbsp;&nbsp;
+      erb&nbsp;&nbsp;
+      shellwords&nbsp;&nbsp;
+      stringio&nbsp;&nbsp;
+      rbconfig&nbsp;&nbsp;
+      tempfile&nbsp;&nbsp;
+      tmpdir&nbsp;&nbsp;
+      mcollective/exception&nbsp;&nbsp;
+      mcollective/monkey_patches&nbsp;&nbsp;
+      mcollective/translatable&nbsp;&nbsp;
+      mcollective/cache&nbsp;&nbsp;
+      </div>
+    </div>
+
+   </div>
+
+
+  </div>
+
+
+    <!-- if includes -->
+
+    <div id="section">
+
+
+
+
+
+      
+
+
+    <!-- if method_list -->
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/fr_class_index.html b/doc/fr_class_index.html
new file mode 100644 (file)
index 0000000..9aaf78d
--- /dev/null
@@ -0,0 +1,114 @@
+
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<!--
+
+    Classes
+
+  -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Classes</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
+  <base target="docwin" />
+</head>
+<body>
+<div id="index">
+  <h1 class="section-bar">Classes</h1>
+  <div id="index-entries">
+    <a href="classes/Array.html">Array</a><br />
+    <a href="classes/Dir.html">Dir</a><br />
+    <a href="classes/MCollective.html">MCollective</a><br />
+    <a href="classes/MCollective/Agent.html">MCollective::Agent</a><br />
+    <a href="classes/MCollective/Agents.html">MCollective::Agents</a><br />
+    <a href="classes/MCollective/Aggregate.html">MCollective::Aggregate</a><br />
+    <a href="classes/MCollective/Aggregate/Base.html">MCollective::Aggregate::Base</a><br />
+    <a href="classes/MCollective/Aggregate/Result.html">MCollective::Aggregate::Result</a><br />
+    <a href="classes/MCollective/Aggregate/Result/Base.html">MCollective::Aggregate::Result::Base</a><br />
+    <a href="classes/MCollective/Aggregate/Result/CollectionResult.html">MCollective::Aggregate::Result::CollectionResult</a><br />
+    <a href="classes/MCollective/Aggregate/Result/NumericResult.html">MCollective::Aggregate::Result::NumericResult</a><br />
+    <a href="classes/MCollective/Application.html">MCollective::Application</a><br />
+    <a href="classes/MCollective/Applications.html">MCollective::Applications</a><br />
+    <a href="classes/MCollective/Cache.html">MCollective::Cache</a><br />
+    <a href="classes/MCollective/Client.html">MCollective::Client</a><br />
+    <a href="classes/MCollective/CodedError.html">MCollective::CodedError</a><br />
+    <a href="classes/MCollective/Config.html">MCollective::Config</a><br />
+    <a href="classes/MCollective/Connector.html">MCollective::Connector</a><br />
+    <a href="classes/MCollective/Connector/Base.html">MCollective::Connector::Base</a><br />
+    <a href="classes/MCollective/DDL.html">MCollective::DDL</a><br />
+    <a href="classes/MCollective/DDL/AgentDDL.html">MCollective::DDL::AgentDDL</a><br />
+    <a href="classes/MCollective/DDL/Base.html">MCollective::DDL::Base</a><br />
+    <a href="classes/MCollective/DDL/DataDDL.html">MCollective::DDL::DataDDL</a><br />
+    <a href="classes/MCollective/DDL/DiscoveryDDL.html">MCollective::DDL::DiscoveryDDL</a><br />
+    <a href="classes/MCollective/DDL/ValidatorDDL.html">MCollective::DDL::ValidatorDDL</a><br />
+    <a href="classes/MCollective/DDLValidationError.html">MCollective::DDLValidationError</a><br />
+    <a href="classes/MCollective/Data.html">MCollective::Data</a><br />
+    <a href="classes/MCollective/Data/Base.html">MCollective::Data::Base</a><br />
+    <a href="classes/MCollective/Data/Result.html">MCollective::Data::Result</a><br />
+    <a href="classes/MCollective/Discovery.html">MCollective::Discovery</a><br />
+    <a href="classes/MCollective/Facts.html">MCollective::Facts</a><br />
+    <a href="classes/MCollective/Facts/Base.html">MCollective::Facts::Base</a><br />
+    <a href="classes/MCollective/Generators.html">MCollective::Generators</a><br />
+    <a href="classes/MCollective/Generators/AgentGenerator.html">MCollective::Generators::AgentGenerator</a><br />
+    <a href="classes/MCollective/Generators/Base.html">MCollective::Generators::Base</a><br />
+    <a href="classes/MCollective/Generators/DataGenerator.html">MCollective::Generators::DataGenerator</a><br />
+    <a href="classes/MCollective/InvalidRPCData.html">MCollective::InvalidRPCData</a><br />
+    <a href="classes/MCollective/Log.html">MCollective::Log</a><br />
+    <a href="classes/MCollective/Logger.html">MCollective::Logger</a><br />
+    <a href="classes/MCollective/Logger/Base.html">MCollective::Logger::Base</a><br />
+    <a href="classes/MCollective/Logger/Console_logger.html">MCollective::Logger::Console_logger</a><br />
+    <a href="classes/MCollective/Logger/File_logger.html">MCollective::Logger::File_logger</a><br />
+    <a href="classes/MCollective/Logger/Syslog_logger.html">MCollective::Logger::Syslog_logger</a><br />
+    <a href="classes/MCollective/Matcher.html">MCollective::Matcher</a><br />
+    <a href="classes/MCollective/Matcher/Parser.html">MCollective::Matcher::Parser</a><br />
+    <a href="classes/MCollective/Matcher/Scanner.html">MCollective::Matcher::Scanner</a><br />
+    <a href="classes/MCollective/Message.html">MCollective::Message</a><br />
+    <a href="classes/MCollective/MissingRPCData.html">MCollective::MissingRPCData</a><br />
+    <a href="classes/MCollective/MsgDoesNotMatchRequestID.html">MCollective::MsgDoesNotMatchRequestID</a><br />
+    <a href="classes/MCollective/MsgTTLExpired.html">MCollective::MsgTTLExpired</a><br />
+    <a href="classes/MCollective/NotTargettedAtUs.html">MCollective::NotTargettedAtUs</a><br />
+    <a href="classes/MCollective/Optionparser.html">MCollective::Optionparser</a><br />
+    <a href="classes/MCollective/PluginManager.html">MCollective::PluginManager</a><br />
+    <a href="classes/MCollective/PluginPackager.html">MCollective::PluginPackager</a><br />
+    <a href="classes/MCollective/PluginPackager/AgentDefinition.html">MCollective::PluginPackager::AgentDefinition</a><br />
+    <a href="classes/MCollective/PluginPackager/StandardDefinition.html">MCollective::PluginPackager::StandardDefinition</a><br />
+    <a href="classes/MCollective/RPC.html">MCollective::RPC</a><br />
+    <a href="classes/MCollective/RPC/ActionRunner.html">MCollective::RPC::ActionRunner</a><br />
+    <a href="classes/MCollective/RPC/Agent.html">MCollective::RPC::Agent</a><br />
+    <a href="classes/MCollective/RPC/Audit.html">MCollective::RPC::Audit</a><br />
+    <a href="classes/MCollective/RPC/Client.html">MCollective::RPC::Client</a><br />
+    <a href="classes/MCollective/RPC/Helpers.html">MCollective::RPC::Helpers</a><br />
+    <a href="classes/MCollective/RPC/Progress.html">MCollective::RPC::Progress</a><br />
+    <a href="classes/MCollective/RPC/Reply.html">MCollective::RPC::Reply</a><br />
+    <a href="classes/MCollective/RPC/Request.html">MCollective::RPC::Request</a><br />
+    <a href="classes/MCollective/RPC/Result.html">MCollective::RPC::Result</a><br />
+    <a href="classes/MCollective/RPC/Stats.html">MCollective::RPC::Stats</a><br />
+    <a href="classes/MCollective/RPCAborted.html">MCollective::RPCAborted</a><br />
+    <a href="classes/MCollective/RPCError.html">MCollective::RPCError</a><br />
+    <a href="classes/MCollective/Registration.html">MCollective::Registration</a><br />
+    <a href="classes/MCollective/Registration/Base.html">MCollective::Registration::Base</a><br />
+    <a href="classes/MCollective/Runner.html">MCollective::Runner</a><br />
+    <a href="classes/MCollective/RunnerStats.html">MCollective::RunnerStats</a><br />
+    <a href="classes/MCollective/SSL.html">MCollective::SSL</a><br />
+    <a href="classes/MCollective/Security.html">MCollective::Security</a><br />
+    <a href="classes/MCollective/Security/Base.html">MCollective::Security::Base</a><br />
+    <a href="classes/MCollective/SecurityValidationFailed.html">MCollective::SecurityValidationFailed</a><br />
+    <a href="classes/MCollective/Shell.html">MCollective::Shell</a><br />
+    <a href="classes/MCollective/Translatable.html">MCollective::Translatable</a><br />
+    <a href="classes/MCollective/UnixDaemon.html">MCollective::UnixDaemon</a><br />
+    <a href="classes/MCollective/UnknownRPCAction.html">MCollective::UnknownRPCAction</a><br />
+    <a href="classes/MCollective/UnknownRPCError.html">MCollective::UnknownRPCError</a><br />
+    <a href="classes/MCollective/Util.html">MCollective::Util</a><br />
+    <a href="classes/MCollective/Validator.html">MCollective::Validator</a><br />
+    <a href="classes/MCollective/ValidatorError.html">MCollective::ValidatorError</a><br />
+    <a href="classes/MCollective/WindowsDaemon.html">MCollective::WindowsDaemon</a><br />
+    <a href="classes/String.html">String</a><br />
+    <a href="classes/Symbol.html">Symbol</a><br />
+  </div>
+</div>
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/fr_file_index.html b/doc/fr_file_index.html
new file mode 100644 (file)
index 0000000..d91831c
--- /dev/null
@@ -0,0 +1,100 @@
+
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<!--
+
+    Files
+
+  -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Files</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
+  <base target="docwin" />
+</head>
+<body>
+<div id="index">
+  <h1 class="section-bar">Files</h1>
+  <div id="index-entries">
+    <a href="files/install_rb.html">install.rb</a><br />
+    <a href="files/lib/mcollective_rb.html">lib/mcollective.rb</a><br />
+    <a href="files/lib/mcollective/agent_rb.html">lib/mcollective/agent.rb</a><br />
+    <a href="files/lib/mcollective/agents_rb.html">lib/mcollective/agents.rb</a><br />
+    <a href="files/lib/mcollective/aggregate_rb.html">lib/mcollective/aggregate.rb</a><br />
+    <a href="files/lib/mcollective/aggregate/base_rb.html">lib/mcollective/aggregate/base.rb</a><br />
+    <a href="files/lib/mcollective/aggregate/result_rb.html">lib/mcollective/aggregate/result.rb</a><br />
+    <a href="files/lib/mcollective/aggregate/result/base_rb.html">lib/mcollective/aggregate/result/base.rb</a><br />
+    <a href="files/lib/mcollective/aggregate/result/collection_result_rb.html">lib/mcollective/aggregate/result/collection_result.rb</a><br />
+    <a href="files/lib/mcollective/aggregate/result/numeric_result_rb.html">lib/mcollective/aggregate/result/numeric_result.rb</a><br />
+    <a href="files/lib/mcollective/application_rb.html">lib/mcollective/application.rb</a><br />
+    <a href="files/lib/mcollective/applications_rb.html">lib/mcollective/applications.rb</a><br />
+    <a href="files/lib/mcollective/cache_rb.html">lib/mcollective/cache.rb</a><br />
+    <a href="files/lib/mcollective/client_rb.html">lib/mcollective/client.rb</a><br />
+    <a href="files/lib/mcollective/config_rb.html">lib/mcollective/config.rb</a><br />
+    <a href="files/lib/mcollective/connector_rb.html">lib/mcollective/connector.rb</a><br />
+    <a href="files/lib/mcollective/connector/base_rb.html">lib/mcollective/connector/base.rb</a><br />
+    <a href="files/lib/mcollective/data_rb.html">lib/mcollective/data.rb</a><br />
+    <a href="files/lib/mcollective/data/base_rb.html">lib/mcollective/data/base.rb</a><br />
+    <a href="files/lib/mcollective/data/result_rb.html">lib/mcollective/data/result.rb</a><br />
+    <a href="files/lib/mcollective/ddl_rb.html">lib/mcollective/ddl.rb</a><br />
+    <a href="files/lib/mcollective/ddl/agentddl_rb.html">lib/mcollective/ddl/agentddl.rb</a><br />
+    <a href="files/lib/mcollective/ddl/base_rb.html">lib/mcollective/ddl/base.rb</a><br />
+    <a href="files/lib/mcollective/ddl/dataddl_rb.html">lib/mcollective/ddl/dataddl.rb</a><br />
+    <a href="files/lib/mcollective/ddl/discoveryddl_rb.html">lib/mcollective/ddl/discoveryddl.rb</a><br />
+    <a href="files/lib/mcollective/ddl/validatorddl_rb.html">lib/mcollective/ddl/validatorddl.rb</a><br />
+    <a href="files/lib/mcollective/discovery_rb.html">lib/mcollective/discovery.rb</a><br />
+    <a href="files/lib/mcollective/exception_rb.html">lib/mcollective/exception.rb</a><br />
+    <a href="files/lib/mcollective/facts_rb.html">lib/mcollective/facts.rb</a><br />
+    <a href="files/lib/mcollective/facts/base_rb.html">lib/mcollective/facts/base.rb</a><br />
+    <a href="files/lib/mcollective/generators_rb.html">lib/mcollective/generators.rb</a><br />
+    <a href="files/lib/mcollective/generators/agent_generator_rb.html">lib/mcollective/generators/agent_generator.rb</a><br />
+    <a href="files/lib/mcollective/generators/base_rb.html">lib/mcollective/generators/base.rb</a><br />
+    <a href="files/lib/mcollective/generators/data_generator_rb.html">lib/mcollective/generators/data_generator.rb</a><br />
+    <a href="files/lib/mcollective/log_rb.html">lib/mcollective/log.rb</a><br />
+    <a href="files/lib/mcollective/logger_rb.html">lib/mcollective/logger.rb</a><br />
+    <a href="files/lib/mcollective/logger/base_rb.html">lib/mcollective/logger/base.rb</a><br />
+    <a href="files/lib/mcollective/logger/console_logger_rb.html">lib/mcollective/logger/console_logger.rb</a><br />
+    <a href="files/lib/mcollective/logger/file_logger_rb.html">lib/mcollective/logger/file_logger.rb</a><br />
+    <a href="files/lib/mcollective/logger/syslog_logger_rb.html">lib/mcollective/logger/syslog_logger.rb</a><br />
+    <a href="files/lib/mcollective/matcher_rb.html">lib/mcollective/matcher.rb</a><br />
+    <a href="files/lib/mcollective/matcher/parser_rb.html">lib/mcollective/matcher/parser.rb</a><br />
+    <a href="files/lib/mcollective/matcher/scanner_rb.html">lib/mcollective/matcher/scanner.rb</a><br />
+    <a href="files/lib/mcollective/message_rb.html">lib/mcollective/message.rb</a><br />
+    <a href="files/lib/mcollective/monkey_patches_rb.html">lib/mcollective/monkey_patches.rb</a><br />
+    <a href="files/lib/mcollective/optionparser_rb.html">lib/mcollective/optionparser.rb</a><br />
+    <a href="files/lib/mcollective/pluginmanager_rb.html">lib/mcollective/pluginmanager.rb</a><br />
+    <a href="files/lib/mcollective/pluginpackager_rb.html">lib/mcollective/pluginpackager.rb</a><br />
+    <a href="files/lib/mcollective/pluginpackager/agent_definition_rb.html">lib/mcollective/pluginpackager/agent_definition.rb</a><br />
+    <a href="files/lib/mcollective/pluginpackager/standard_definition_rb.html">lib/mcollective/pluginpackager/standard_definition.rb</a><br />
+    <a href="files/lib/mcollective/registration_rb.html">lib/mcollective/registration.rb</a><br />
+    <a href="files/lib/mcollective/registration/base_rb.html">lib/mcollective/registration/base.rb</a><br />
+    <a href="files/lib/mcollective/rpc_rb.html">lib/mcollective/rpc.rb</a><br />
+    <a href="files/lib/mcollective/rpc/actionrunner_rb.html">lib/mcollective/rpc/actionrunner.rb</a><br />
+    <a href="files/lib/mcollective/rpc/agent_rb.html">lib/mcollective/rpc/agent.rb</a><br />
+    <a href="files/lib/mcollective/rpc/audit_rb.html">lib/mcollective/rpc/audit.rb</a><br />
+    <a href="files/lib/mcollective/rpc/client_rb.html">lib/mcollective/rpc/client.rb</a><br />
+    <a href="files/lib/mcollective/rpc/helpers_rb.html">lib/mcollective/rpc/helpers.rb</a><br />
+    <a href="files/lib/mcollective/rpc/progress_rb.html">lib/mcollective/rpc/progress.rb</a><br />
+    <a href="files/lib/mcollective/rpc/reply_rb.html">lib/mcollective/rpc/reply.rb</a><br />
+    <a href="files/lib/mcollective/rpc/request_rb.html">lib/mcollective/rpc/request.rb</a><br />
+    <a href="files/lib/mcollective/rpc/result_rb.html">lib/mcollective/rpc/result.rb</a><br />
+    <a href="files/lib/mcollective/rpc/stats_rb.html">lib/mcollective/rpc/stats.rb</a><br />
+    <a href="files/lib/mcollective/runner_rb.html">lib/mcollective/runner.rb</a><br />
+    <a href="files/lib/mcollective/runnerstats_rb.html">lib/mcollective/runnerstats.rb</a><br />
+    <a href="files/lib/mcollective/security_rb.html">lib/mcollective/security.rb</a><br />
+    <a href="files/lib/mcollective/security/base_rb.html">lib/mcollective/security/base.rb</a><br />
+    <a href="files/lib/mcollective/shell_rb.html">lib/mcollective/shell.rb</a><br />
+    <a href="files/lib/mcollective/ssl_rb.html">lib/mcollective/ssl.rb</a><br />
+    <a href="files/lib/mcollective/translatable_rb.html">lib/mcollective/translatable.rb</a><br />
+    <a href="files/lib/mcollective/unix_daemon_rb.html">lib/mcollective/unix_daemon.rb</a><br />
+    <a href="files/lib/mcollective/util_rb.html">lib/mcollective/util.rb</a><br />
+    <a href="files/lib/mcollective/validator_rb.html">lib/mcollective/validator.rb</a><br />
+    <a href="files/lib/mcollective/windows_daemon_rb.html">lib/mcollective/windows_daemon.rb</a><br />
+  </div>
+</div>
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/fr_method_index.html b/doc/fr_method_index.html
new file mode 100644 (file)
index 0000000..190f5b3
--- /dev/null
@@ -0,0 +1,523 @@
+
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<!--
+
+    Methods
+
+  -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Methods</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
+  <base target="docwin" />
+</head>
+<body>
+<div id="index">
+  <h1 class="section-bar">Methods</h1>
+  <div id="index-entries">
+    <a href="classes/MCollective/PluginManager.html#M000025"><< (MCollective::PluginManager)</a><br />
+    <a href="classes/Symbol.html#M000014"><=> (Symbol)</a><br />
+    <a href="classes/MCollective/Facts.html#M000018">[] (MCollective::Facts)</a><br />
+    <a href="classes/MCollective/PluginManager.html#M000030">[] (MCollective::PluginManager)</a><br />
+    <a href="classes/MCollective/PluginPackager.html#M000312">[] (MCollective::PluginPackager)</a><br />
+    <a href="classes/MCollective/Applications.html#M000425">[] (MCollective::Applications)</a><br />
+    <a href="classes/MCollective/RPC/Stats.html#M000123">[] (MCollective::RPC::Stats)</a><br />
+    <a href="classes/MCollective/RPC/Reply.html#M000077">[] (MCollective::RPC::Reply)</a><br />
+    <a href="classes/MCollective/RPC/Result.html#M000054">[] (MCollective::RPC::Result)</a><br />
+    <a href="classes/MCollective/Data/Result.html#M000233">[] (MCollective::Data::Result)</a><br />
+    <a href="classes/MCollective/Application.html#M000347">[] (MCollective::Application)</a><br />
+    <a href="classes/MCollective/Validator.html#M000217">[] (MCollective::Validator)</a><br />
+    <a href="classes/MCollective/Data.html#M000225">[] (MCollective::Data)</a><br />
+    <a href="classes/MCollective/RPC/Request.html#M000138">[] (MCollective::RPC::Request)</a><br />
+    <a href="classes/MCollective/RPC/Result.html#M000055">[]= (MCollective::RPC::Result)</a><br />
+    <a href="classes/MCollective/RPC/Reply.html#M000076">[]= (MCollective::RPC::Reply)</a><br />
+    <a href="classes/MCollective/Data/Result.html#M000234">[]= (MCollective::Data::Result)</a><br />
+    <a href="classes/MCollective/Application.html#M000346">[]= (MCollective::Application)</a><br />
+    <a href="classes/MCollective/Util.html#M000307">absolute_path? (MCollective::Util)</a><br />
+    <a href="classes/MCollective/DDL/AgentDDL.html#M000183">action (MCollective::DDL::AgentDDL)</a><br />
+    <a href="classes/MCollective/Generators/AgentGenerator.html#M000252">action_help (MCollective::Generators::AgentGenerator)</a><br />
+    <a href="classes/MCollective/DDL/AgentDDL.html#M000188">action_interface (MCollective::DDL::AgentDDL)</a><br />
+    <a href="classes/MCollective/DDL/AgentDDL.html#M000189">actions (MCollective::DDL::AgentDDL)</a><br />
+    <a href="classes/MCollective/RPC/Agent.html#M000084">actions (MCollective::RPC::Agent)</a><br />
+    <a href="classes/MCollective/Data/Base.html#M000243">activate? (MCollective::Data::Base)</a><br />
+    <a href="classes/MCollective/RPC/Agent.html#M000083">activate? (MCollective::RPC::Agent)</a><br />
+    <a href="classes/MCollective/Agents.html#M000487">activate_agent? (MCollective::Agents)</a><br />
+    <a href="classes/MCollective/Data/Base.html#M000242">activate_when (MCollective::Data::Base)</a><br />
+    <a href="classes/MCollective/Optionparser.html#M000455">add_common_options (MCollective::Optionparser)</a><br />
+    <a href="classes/MCollective/Optionparser.html#M000453">add_filter_options (MCollective::Optionparser)</a><br />
+    <a href="classes/MCollective/Optionparser.html#M000454">add_required_options (MCollective::Optionparser)</a><br />
+    <a href="classes/MCollective/RPC/Helpers.html#M000050">add_simplerpc_options (MCollective::RPC::Helpers)</a><br />
+    <a href="classes/MCollective/SSL.html#M000386">aes_decrypt (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/SSL.html#M000385">aes_encrypt (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/PluginPackager/AgentDefinition.html#M000325">agent (MCollective::PluginPackager::AgentDefinition)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000098">agent_filter (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/Agents.html#M000491">agentlist (MCollective::Agents)</a><br />
+    <a href="classes/MCollective/DDL/AgentDDL.html#M000181">aggregate (MCollective::DDL::AgentDDL)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000112">aggregate_reply (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/Util.html#M000303">align_text (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Application.html#M000362">application_cli_arguments (MCollective::Application)</a><br />
+    <a href="classes/MCollective/Application.html#M000360">application_description (MCollective::Application)</a><br />
+    <a href="classes/MCollective/Application.html#M000363">application_failure (MCollective::Application)</a><br />
+    <a href="classes/MCollective/Application.html#M000359">application_options (MCollective::Application)</a><br />
+    <a href="classes/MCollective/Application.html#M000345">application_options (MCollective::Application)</a><br />
+    <a href="classes/MCollective/Application.html#M000357">application_parse_options (MCollective::Application)</a><br />
+    <a href="classes/MCollective/Application.html#M000361">application_usage (MCollective::Application)</a><br />
+    <a href="classes/MCollective/RPC/Audit.html#M000071">audit_request (MCollective::RPC::Audit)</a><br />
+    <a href="classes/MCollective/Message.html#M000338">base64? (MCollective::Message)</a><br />
+    <a href="classes/MCollective/SSL.html#M000392">base64_decode (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/SSL.html#M000391">base64_decode (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/Message.html#M000336">base64_decode! (MCollective::Message)</a><br />
+    <a href="classes/MCollective/SSL.html#M000390">base64_encode (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/SSL.html#M000389">base64_encode (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/Message.html#M000337">base64_encode! (MCollective::Message)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000108">batch_size= (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000109">batch_sleep_time= (MCollective::RPC::Client)</a><br />
+    <a href="files/install_rb.html#M000007">build_rdoc (install.rb)</a><br />
+    <a href="classes/String.html#M000010">bytes (String)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000117">call_agent (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000116">call_agent_batched (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/Aggregate.html#M000412">call_functions (MCollective::Aggregate)</a><br />
+    <a href="classes/MCollective/Security/Base.html#M000267">callerid (MCollective::Security::Base)</a><br />
+    <a href="classes/MCollective/RPC/ActionRunner.html#M000066">canrun? (MCollective::RPC::ActionRunner)</a><br />
+    <a href="classes/MCollective/DDL/DiscoveryDDL.html#M000164">capabilities (MCollective::DDL::DiscoveryDDL)</a><br />
+    <a href="classes/MCollective/Cache.html#M000273">check_cache! (MCollective::Cache)</a><br />
+    <a href="classes/MCollective/Discovery.html#M000404">check_capabilities (MCollective::Discovery)</a><br />
+    <a href="classes/MCollective/PluginPackager.html#M000314">check_dir_present (MCollective::PluginPackager)</a><br />
+    <a href="classes/MCollective/Log.html#M000440">check_level (MCollective::Log)</a><br />
+    <a href="files/install_rb.html#M000002">check_prereqs (install.rb)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000096">class_filter (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/Agents.html#M000486">class_for_agent (MCollective::Agents)</a><br />
+    <a href="classes/MCollective/PluginManager.html#M000029">clear (MCollective::PluginManager)</a><br />
+    <a href="classes/MCollective/Agents.html#M000483">clear! (MCollective::Agents)</a><br />
+    <a href="classes/MCollective/PluginPackager/AgentDefinition.html#M000326">client (MCollective::PluginPackager::AgentDefinition)</a><br />
+    <a href="classes/MCollective/RPC/Stats.html#M000126">client_stats= (MCollective::RPC::Stats)</a><br />
+    <a href="classes/MCollective/Application.html#M000356">clioptions (MCollective::Application)</a><br />
+    <a href="classes/MCollective/Client.html#M000457">collective (MCollective::Client)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000105">collective= (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/Util.html#M000299">color (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Logger/Console_logger.html#M000210">color (MCollective::Logger::Console_logger)</a><br />
+    <a href="classes/MCollective/Logger/Console_logger.html#M000211">colorize (MCollective::Logger::Console_logger)</a><br />
+    <a href="classes/MCollective/Util.html#M000300">colorize (MCollective::Util)</a><br />
+    <a href="classes/MCollective/PluginPackager.html#M000316">command_available? (MCollective::PluginPackager)</a><br />
+    <a href="classes/MCollective/Util.html#M000305">command_in_path? (MCollective::Util)</a><br />
+    <a href="classes/MCollective/PluginPackager/AgentDefinition.html#M000327">common (MCollective::PluginPackager::AgentDefinition)</a><br />
+    <a href="classes/MCollective/PluginPackager/StandardDefinition.html#M000322">common (MCollective::PluginPackager::StandardDefinition)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000100">compound_filter (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/Registration/Base.html#M000192">config (MCollective::Registration::Base)</a><br />
+    <a href="classes/MCollective/Log.html#M000439">config_and_check_level (MCollective::Log)</a><br />
+    <a href="classes/MCollective/Util.html#M000290">config_file_for_user (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Application.html#M000353">configuration (MCollective::Application)</a><br />
+    <a href="classes/MCollective/Log.html#M000447">configure (MCollective::Log)</a><br />
+    <a href="classes/MCollective/RPC.html#M000043">const_missing (MCollective::RPC)</a><br />
+    <a href="classes/MCollective/Aggregate.html#M000411">contains_output? (MCollective::Aggregate)</a><br />
+    <a href="classes/MCollective/Matcher.html#M000147">create_compound_callstack (MCollective::Matcher)</a><br />
+    <a href="classes/MCollective/Generators/DataGenerator.html#M000254">create_ddl (MCollective::Generators::DataGenerator)</a><br />
+    <a href="classes/MCollective/Generators/AgentGenerator.html#M000250">create_ddl (MCollective::Generators::AgentGenerator)</a><br />
+    <a href="classes/MCollective/Matcher.html#M000143">create_function_hash (MCollective::Matcher)</a><br />
+    <a href="classes/MCollective/Aggregate.html#M000410">create_functions (MCollective::Aggregate)</a><br />
+    <a href="classes/MCollective/PluginManager.html#M000031">create_instance (MCollective::PluginManager)</a><br />
+    <a href="classes/MCollective/Generators/Base.html#M000257">create_metadata_string (MCollective::Generators::Base)</a><br />
+    <a href="classes/MCollective/Generators/AgentGenerator.html#M000251">create_plugin_content (MCollective::Generators::AgentGenerator)</a><br />
+    <a href="classes/MCollective/Generators/DataGenerator.html#M000255">create_plugin_content (MCollective::Generators::DataGenerator)</a><br />
+    <a href="classes/MCollective/Generators/Base.html#M000258">create_plugin_string (MCollective::Generators::Base)</a><br />
+    <a href="classes/MCollective/Security/Base.html#M000263">create_reply (MCollective::Security::Base)</a><br />
+    <a href="classes/MCollective/Message.html#M000344">create_reqid (MCollective::Message)</a><br />
+    <a href="classes/MCollective/Security/Base.html#M000264">create_request (MCollective::Security::Base)</a><br />
+    <a href="classes/MCollective/Client.html#M000460">createreq (MCollective::Client)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000091">custom_request (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/Logger/Base.html#M000204">cycle_level (MCollective::Logger::Base)</a><br />
+    <a href="classes/MCollective/Log.html#M000438">cycle_level (MCollective::Log)</a><br />
+    <a href="classes/MCollective/UnixDaemon.html#M000423">daemonize (MCollective::UnixDaemon)</a><br />
+    <a href="classes/MCollective/WindowsDaemon.html#M000373">daemonize_runner (MCollective::WindowsDaemon)</a><br />
+    <a href="classes/MCollective/UnixDaemon.html#M000424">daemonize_runner (MCollective::UnixDaemon)</a><br />
+    <a href="classes/MCollective/DDL/DataDDL.html#M000160">dataquery (MCollective::DDL::DataDDL)</a><br />
+    <a href="classes/MCollective/DDL/DataDDL.html#M000162">dataquery_interface (MCollective::DDL::DataDDL)</a><br />
+    <a href="classes/MCollective/Data.html#M000227">ddl (MCollective::Data)</a><br />
+    <a href="classes/MCollective/Discovery.html#M000403">ddl (MCollective::Discovery)</a><br />
+    <a href="classes/MCollective/Data.html#M000229">ddl_has_output? (MCollective::Data)</a><br />
+    <a href="classes/MCollective/Data.html#M000230">ddl_transform_input (MCollective::Data)</a><br />
+    <a href="classes/MCollective/Data/Base.html#M000241">ddl_validate (MCollective::Data::Base)</a><br />
+    <a href="classes/MCollective/Data.html#M000228">ddl_validate (MCollective::Data)</a><br />
+    <a href="classes/MCollective/Log.html#M000434">debug (MCollective::Log)</a><br />
+    <a href="classes/MCollective/Message.html#M000341">decode! (MCollective::Message)</a><br />
+    <a href="classes/MCollective/Security/Base.html#M000271">decodemsg (MCollective::Security::Base)</a><br />
+    <a href="classes/MCollective/SSL.html#M000379">decrypt_with_private (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/SSL.html#M000380">decrypt_with_public (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/Util.html#M000291">default_options (MCollective::Util)</a><br />
+    <a href="classes/MCollective/PluginManager.html#M000026">delete (MCollective::PluginManager)</a><br />
+    <a href="classes/MCollective/Cache.html#M000275">delete! (MCollective::Cache)</a><br />
+    <a href="classes/MCollective/Application.html#M000348">description (MCollective::Application)</a><br />
+    <a href="classes/MCollective/Client.html#M000458">disconnect (MCollective::Client)</a><br />
+    <a href="classes/MCollective/Application.html#M000366">disconnect (MCollective::Application)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000086">disconnect (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000103">discover (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/Client.html#M000464">discover (MCollective::Client)</a><br />
+    <a href="classes/MCollective/Discovery.html#M000408">discover (MCollective::Discovery)</a><br />
+    <a href="classes/MCollective/RPC.html#M000039">discovered (MCollective::RPC)</a><br />
+    <a href="classes/MCollective/RPC/Stats.html#M000129">discovered_agents (MCollective::RPC::Stats)</a><br />
+    <a href="classes/MCollective/Client.html#M000471">discovered_req (MCollective::Client)</a><br />
+    <a href="classes/MCollective/DDL/DiscoveryDDL.html#M000165">discovery (MCollective::DDL::DiscoveryDDL)</a><br />
+    <a href="classes/MCollective/Discovery.html#M000402">discovery_class (MCollective::Discovery)</a><br />
+    <a href="classes/MCollective/DDL/DiscoveryDDL.html#M000163">discovery_interface (MCollective::DDL::DiscoveryDDL)</a><br />
+    <a href="classes/MCollective/Discovery.html#M000401">discovery_method (MCollective::Discovery)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000094">discovery_method= (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000095">discovery_options= (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000092">discovery_timeout (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/Discovery.html#M000407">discovery_timeout (MCollective::Discovery)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000093">discovery_timeout= (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/Agents.html#M000490">dispatch (MCollective::Agents)</a><br />
+    <a href="classes/MCollective/DDL/AgentDDL.html#M000182">display (MCollective::DDL::AgentDDL)</a><br />
+    <a href="classes/MCollective/Client.html#M000472">display_stats (MCollective::Client)</a><br />
+    <a href="files/install_rb.html#M000004">do_bins (install.rb)</a><br />
+    <a href="files/install_rb.html#M000003">do_configs (install.rb)</a><br />
+    <a href="files/install_rb.html#M000005">do_libs (install.rb)</a><br />
+    <a href="classes/MCollective/RPC/Result.html#M000057">each (MCollective::RPC::Result)</a><br />
+    <a href="classes/MCollective/Util.html#M000288">empty_filter (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Util.html#M000287">empty_filter? (MCollective::Util)</a><br />
+    <a href="classes/MCollective/RPC.html#M000042">empty_filter? (MCollective::RPC)</a><br />
+    <a href="classes/MCollective/Message.html#M000339">encode! (MCollective::Message)</a><br />
+    <a href="classes/MCollective/Security/Base.html#M000270">encodereply (MCollective::Security::Base)</a><br />
+    <a href="classes/MCollective/Security/Base.html#M000269">encoderequest (MCollective::Security::Base)</a><br />
+    <a href="classes/MCollective/SSL.html#M000378">encrypt_with_private (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/SSL.html#M000377">encrypt_with_public (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/Log.html#M000436">error (MCollective::Log)</a><br />
+    <a href="classes/MCollective/Matcher.html#M000146">eval_compound_fstatement (MCollective::Matcher)</a><br />
+    <a href="classes/MCollective/Matcher.html#M000145">eval_compound_statement (MCollective::Matcher)</a><br />
+    <a href="classes/MCollective/Application.html#M000350">exclude_argument_sections (MCollective::Application)</a><br />
+    <a href="classes/MCollective/Matcher.html#M000144">execute_function (MCollective::Matcher)</a><br />
+    <a href="classes/MCollective/PluginPackager.html#M000315">execute_verbosely (MCollective::PluginPackager)</a><br />
+    <a href="classes/MCollective/Log.html#M000450">execution_stack (MCollective::Log)</a><br />
+    <a href="classes/MCollective/Matcher/Parser.html#M000151">exit_with_paren_errors (MCollective::Matcher::Parser)</a><br />
+    <a href="classes/MCollective/Matcher/Parser.html#M000150">exit_with_parse_errors (MCollective::Matcher::Parser)</a><br />
+    <a href="classes/MCollective/Matcher/Parser.html#M000149">exit_with_token_errors (MCollective::Matcher::Parser)</a><br />
+    <a href="classes/MCollective/Message.html#M000335">expected_msgid= (MCollective::Message)</a><br />
+    <a href="classes/MCollective/RPC/Helpers.html#M000045">extract_hosts_from_array (MCollective::RPC::Helpers)</a><br />
+    <a href="classes/MCollective/RPC/Helpers.html#M000044">extract_hosts_from_json (MCollective::RPC::Helpers)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000097">fact_filter (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/RPC/Reply.html#M000074">fail (MCollective::RPC::Reply)</a><br />
+    <a href="classes/MCollective/RPC/Stats.html#M000125">fail (MCollective::RPC::Stats)</a><br />
+    <a href="classes/MCollective/RPC/Reply.html#M000075">fail! (MCollective::RPC::Reply)</a><br />
+    <a href="classes/MCollective/Log.html#M000435">fatal (MCollective::Log)</a><br />
+    <a href="classes/MCollective/RPC/Reply.html#M000078">fetch (MCollective::RPC::Reply)</a><br />
+    <a href="classes/MCollective/RPC/Request.html#M000139">fetch (MCollective::RPC::Request)</a><br />
+    <a href="classes/MCollective/RPC/Result.html#M000056">fetch (MCollective::RPC::Result)</a><br />
+    <a href="classes/MCollective/PluginPackager.html#M000318">filter_dependencies (MCollective::PluginPackager)</a><br />
+    <a href="classes/MCollective/Applications.html#M000429">filter_extra_options (MCollective::Applications)</a><br />
+    <a href="classes/MCollective/RunnerStats.html#M000476">filtered (MCollective::RunnerStats)</a><br />
+    <a href="classes/MCollective/PluginManager.html#M000032">find (MCollective::PluginManager)</a><br />
+    <a href="classes/MCollective/PluginManager.html#M000033">find_and_load (MCollective::PluginManager)</a><br />
+    <a href="classes/MCollective/Discovery.html#M000398">find_known_methods (MCollective::Discovery)</a><br />
+    <a href="classes/MCollective/Agents.html#M000488">findagentfile (MCollective::Agents)</a><br />
+    <a href="classes/MCollective/DDL/Base.html#M000171">findddlfile (MCollective::DDL::Base)</a><br />
+    <a href="classes/MCollective/RPC/Stats.html#M000130">finish_request (MCollective::RPC::Stats)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000114">fire_and_forget_request (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/Discovery.html#M000400">force_direct_mode? (MCollective::Discovery)</a><br />
+    <a href="classes/MCollective/Discovery.html#M000405">force_discovery_method_by_filter (MCollective::Discovery)</a><br />
+    <a href="classes/MCollective/Facts/Base.html#M000024">force_reload? (MCollective::Facts::Base)</a><br />
+    <a href="classes/MCollective/Log.html#M000449">from (MCollective::Log)</a><br />
+    <a href="classes/MCollective/Facts/Base.html#M000021">get_fact (MCollective::Facts::Base)</a><br />
+    <a href="classes/MCollective/Facts.html#M000017">get_fact (MCollective::Facts)</a><br />
+    <a href="classes/MCollective/Util.html#M000284">get_fact (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Facts/Base.html#M000022">get_facts (MCollective::Facts::Base)</a><br />
+    <a href="classes/MCollective/PluginPackager.html#M000313">get_metadata (MCollective::PluginPackager)</a><br />
+    <a href="classes/MCollective/Matcher/Scanner.html#M000154">get_token (MCollective::Matcher::Scanner)</a><br />
+    <a href="files/install_rb.html#M000001">glob (install.rb)</a><br />
+    <a href="classes/MCollective/PluginManager.html#M000035">grep (MCollective::PluginManager)</a><br />
+    <a href="classes/MCollective/Application.html#M000369">halt (MCollective::Application)</a><br />
+    <a href="classes/MCollective/Application.html#M000368">halt_code (MCollective::Application)</a><br />
+    <a href="classes/MCollective/RPC/Agent.html#M000082">handlemsg (MCollective::RPC::Agent)</a><br />
+    <a href="classes/MCollective/Util.html#M000281">has_agent? (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Cache.html#M000274">has_cache? (MCollective::Cache)</a><br />
+    <a href="classes/MCollective/Util.html#M000283">has_cf_class? (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Facts.html#M000016">has_fact? (MCollective::Facts)</a><br />
+    <a href="classes/MCollective/Facts/Base.html#M000023">has_fact? (MCollective::Facts::Base)</a><br />
+    <a href="classes/MCollective/Util.html#M000285">has_fact? (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Util.html#M000286">has_identity? (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Discovery.html#M000399">has_method? (MCollective::Discovery)</a><br />
+    <a href="classes/MCollective/Validator.html#M000219">has_validator? (MCollective::Validator)</a><br />
+    <a href="classes/MCollective/DDL/Base.html#M000167">help (MCollective::DDL::Base)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000087">help (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/Application.html#M000364">help (MCollective::Application)</a><br />
+    <a href="classes/MCollective/PluginPackager/StandardDefinition.html#M000320">identify_packages (MCollective::PluginPackager::StandardDefinition)</a><br />
+    <a href="classes/MCollective/PluginPackager/AgentDefinition.html#M000324">identify_packages (MCollective::PluginPackager::AgentDefinition)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000099">identity_filter (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000115">identity_filter_discovery_optimization (MCollective::RPC::Client)</a><br />
+    <a href="classes/Array.html#M000013">in_groups_of (Array)</a><br />
+    <a href="classes/MCollective/PluginManager.html#M000027">include? (MCollective::PluginManager)</a><br />
+    <a href="classes/MCollective/Agents.html#M000489">include? (MCollective::Agents)</a><br />
+    <a href="classes/MCollective/RPC/Request.html#M000136">include? (MCollective::RPC::Request)</a><br />
+    <a href="classes/MCollective/Data/Result.html#M000232">include? (MCollective::Data::Result)</a><br />
+    <a href="classes/MCollective/Log.html#M000432">info (MCollective::Log)</a><br />
+    <a href="classes/MCollective/Connector/Base.html#M000328">inherited (MCollective::Connector::Base)</a><br />
+    <a href="classes/MCollective/RPC/Audit.html#M000070">inherited (MCollective::RPC::Audit)</a><br />
+    <a href="classes/MCollective/Registration/Base.html#M000190">inherited (MCollective::Registration::Base)</a><br />
+    <a href="classes/MCollective/Data/Base.html#M000237">inherited (MCollective::Data::Base)</a><br />
+    <a href="classes/MCollective/Facts/Base.html#M000020">inherited (MCollective::Facts::Base)</a><br />
+    <a href="classes/MCollective/Security/Base.html#M000260">inherited (MCollective::Security::Base)</a><br />
+    <a href="classes/MCollective/RPC/Reply.html#M000073">initialize_data (MCollective::RPC::Reply)</a><br />
+    <a href="classes/MCollective/DDL/AgentDDL.html#M000179">input (MCollective::DDL::AgentDDL)</a><br />
+    <a href="classes/MCollective/DDL/DataDDL.html#M000161">input (MCollective::DDL::DataDDL)</a><br />
+    <a href="classes/MCollective/DDL/Base.html#M000174">input (MCollective::DDL::Base)</a><br />
+    <a href="files/install_rb.html#M000008">install_binfile (install.rb)</a><br />
+    <a href="classes/MCollective/Log.html#M000437">instance (MCollective::Log)</a><br />
+    <a href="classes/MCollective/Registration/Base.html#M000195">interval (MCollective::Registration::Base)</a><br />
+    <a href="classes/MCollective/Application.html#M000352">intialize_application_options (MCollective::Application)</a><br />
+    <a href="classes/MCollective/Cache.html#M000280">invalidate! (MCollective::Cache)</a><br />
+    <a href="classes/MCollective/DDL/AgentDDL.html#M000185">is_function? (MCollective::DDL::AgentDDL)</a><br />
+    <a href="classes/MCollective/Data/Result.html#M000235">keys (MCollective::Data::Result)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000107">limit_method= (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000106">limit_targets= (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/Applications.html#M000428">list (MCollective::Applications)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000111">load_aggregate_functions (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/DDL.html#M000156">load_and_cache (MCollective::DDL)</a><br />
+    <a href="classes/MCollective/Applications.html#M000427">load_application (MCollective::Applications)</a><br />
+    <a href="classes/MCollective/Applications.html#M000430">load_config (MCollective::Applications)</a><br />
+    <a href="classes/MCollective/Data.html#M000223">load_data_sources (MCollective::Data)</a><br />
+    <a href="classes/MCollective/RPC/Agent.html#M000081">load_ddl (MCollective::RPC::Agent)</a><br />
+    <a href="classes/MCollective/Aggregate.html#M000414">load_function (MCollective::Aggregate)</a><br />
+    <a href="classes/MCollective/RPC/ActionRunner.html#M000063">load_json_results (MCollective::RPC::ActionRunner)</a><br />
+    <a href="classes/MCollective/PluginPackager.html#M000311">load_packagers (MCollective::PluginPackager)</a><br />
+    <a href="classes/MCollective/RPC/ActionRunner.html#M000062">load_results (MCollective::RPC::ActionRunner)</a><br />
+    <a href="classes/MCollective/Validator.html#M000216">load_validators (MCollective::Validator)</a><br />
+    <a href="classes/MCollective/Validator.html#M000221">load_validators? (MCollective::Validator)</a><br />
+    <a href="classes/MCollective/Agents.html#M000485">loadagent (MCollective::Agents)</a><br />
+    <a href="classes/MCollective/Agents.html#M000484">loadagents (MCollective::Agents)</a><br />
+    <a href="classes/MCollective/PluginManager.html#M000034">loadclass (MCollective::PluginManager)</a><br />
+    <a href="classes/MCollective/Util.html#M000295">loadclass (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Config.html#M000493">loadconfig (MCollective::Config)</a><br />
+    <a href="classes/MCollective/DDL/Base.html#M000170">loadddlfile (MCollective::DDL::Base)</a><br />
+    <a href="classes/MCollective/Logger/Console_logger.html#M000209">log (MCollective::Logger::Console_logger)</a><br />
+    <a href="classes/MCollective/Logger/File_logger.html#M000215">log (MCollective::Logger::File_logger)</a><br />
+    <a href="classes/MCollective/Log.html#M000445">log (MCollective::Log)</a><br />
+    <a href="classes/MCollective/Logger/Syslog_logger.html#M000201">log (MCollective::Logger::Syslog_logger)</a><br />
+    <a href="classes/MCollective/CodedError.html#M000331">log (MCollective::CodedError)</a><br />
+    <a href="classes/MCollective/Translatable.html#M000246">log_code (MCollective::Translatable)</a><br />
+    <a href="classes/MCollective/Log.html#M000443">logexception (MCollective::Log)</a><br />
+    <a href="classes/MCollective/Translatable.html#M000248">logexception (MCollective::Translatable)</a><br />
+    <a href="classes/MCollective/Log.html#M000431">logger (MCollective::Log)</a><br />
+    <a href="classes/MCollective/Log.html#M000444">logmsg (MCollective::Log)</a><br />
+    <a href="classes/MCollective/Data/Base.html#M000239">lookup (MCollective::Data::Base)</a><br />
+    <a href="classes/MCollective/Application.html#M000367">main (MCollective::Application)</a><br />
+    <a href="classes/MCollective/Util.html#M000292">make_subscriptions (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Util.html#M000302">mcollective_version (MCollective::Util)</a><br />
+    <a href="classes/MCollective/SSL.html#M000394">md5 (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/SSL.html#M000393">md5 (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/Log.html#M000442">message_for (MCollective::Log)</a><br />
+    <a href="classes/MCollective/DDL/Base.html#M000177">metadata (MCollective::DDL::Base)</a><br />
+    <a href="classes/MCollective/Data/Result.html#M000236">method_missing (MCollective::Data::Result)</a><br />
+    <a href="classes/MCollective/Data.html#M000226">method_missing (MCollective::Data)</a><br />
+    <a href="classes/MCollective/Validator.html#M000218">method_missing (MCollective::Validator)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000090">method_missing (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/DDL/AgentDDL.html#M000184">method_missing (MCollective::DDL::AgentDDL)</a><br />
+    <a href="classes/Dir.html#M000011">mktmpdir (Dir)</a><br />
+    <a href="classes/MCollective/Registration/Base.html#M000193">msg_filter (MCollective::Registration::Base)</a><br />
+    <a href="classes/MCollective/RPC/Stats.html#M000120">new (MCollective::RPC::Stats)</a><br />
+    <a href="classes/MCollective/RunnerStats.html#M000473">new (MCollective::RunnerStats)</a><br />
+    <a href="classes/MCollective/SSL.html#M000376">new (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/RPC/Request.html#M000135">new (MCollective::RPC::Request)</a><br />
+    <a href="classes/MCollective/Matcher/Parser.html#M000148">new (MCollective::Matcher::Parser)</a><br />
+    <a href="classes/MCollective/Agents.html#M000482">new (MCollective::Agents)</a><br />
+    <a href="classes/MCollective/Data/Result.html#M000231">new (MCollective::Data::Result)</a><br />
+    <a href="classes/MCollective/Shell.html#M000371">new (MCollective::Shell)</a><br />
+    <a href="classes/MCollective/Data/Base.html#M000238">new (MCollective::Data::Base)</a><br />
+    <a href="classes/MCollective/Aggregate.html#M000409">new (MCollective::Aggregate)</a><br />
+    <a href="classes/MCollective/Matcher/Scanner.html#M000153">new (MCollective::Matcher::Scanner)</a><br />
+    <a href="classes/MCollective/Facts/Base.html#M000019">new (MCollective::Facts::Base)</a><br />
+    <a href="classes/MCollective/DDL.html#M000155">new (MCollective::DDL)</a><br />
+    <a href="classes/MCollective/Aggregate/Base.html#M000420">new (MCollective::Aggregate::Base)</a><br />
+    <a href="classes/MCollective/Config.html#M000492">new (MCollective::Config)</a><br />
+    <a href="classes/MCollective/DDL/Base.html#M000166">new (MCollective::DDL::Base)</a><br />
+    <a href="classes/MCollective/Client.html#M000456">new (MCollective::Client)</a><br />
+    <a href="classes/MCollective/Aggregate/Result/Base.html#M000416">new (MCollective::Aggregate::Result::Base)</a><br />
+    <a href="classes/MCollective/RPC/ActionRunner.html#M000059">new (MCollective::RPC::ActionRunner)</a><br />
+    <a href="classes/MCollective/Generators/AgentGenerator.html#M000249">new (MCollective::Generators::AgentGenerator)</a><br />
+    <a href="classes/MCollective/RPC/Reply.html#M000072">new (MCollective::RPC::Reply)</a><br />
+    <a href="classes/MCollective/Optionparser.html#M000451">new (MCollective::Optionparser)</a><br />
+    <a href="classes/MCollective/PluginPackager/StandardDefinition.html#M000319">new (MCollective::PluginPackager::StandardDefinition)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000085">new (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/RPC/Agent.html#M000080">new (MCollective::RPC::Agent)</a><br />
+    <a href="classes/MCollective/RPC/Progress.html#M000051">new (MCollective::RPC::Progress)</a><br />
+    <a href="classes/MCollective/Generators/DataGenerator.html#M000253">new (MCollective::Generators::DataGenerator)</a><br />
+    <a href="classes/MCollective/Logger/Base.html#M000202">new (MCollective::Logger::Base)</a><br />
+    <a href="classes/MCollective/Generators/Base.html#M000256">new (MCollective::Generators::Base)</a><br />
+    <a href="classes/MCollective/RPC/Result.html#M000053">new (MCollective::RPC::Result)</a><br />
+    <a href="classes/MCollective/Discovery.html#M000397">new (MCollective::Discovery)</a><br />
+    <a href="classes/MCollective/DDL/AgentDDL.html#M000178">new (MCollective::DDL::AgentDDL)</a><br />
+    <a href="classes/MCollective/CodedError.html#M000329">new (MCollective::CodedError)</a><br />
+    <a href="classes/MCollective/Runner.html#M000496">new (MCollective::Runner)</a><br />
+    <a href="classes/MCollective/Security/Base.html#M000261">new (MCollective::Security::Base)</a><br />
+    <a href="classes/MCollective/Message.html#M000332">new (MCollective::Message)</a><br />
+    <a href="classes/MCollective/PluginPackager/AgentDefinition.html#M000323">new (MCollective::PluginPackager::AgentDefinition)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000088">new_request (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/RPC/Stats.html#M000134">no_response_report (MCollective::RPC::Stats)</a><br />
+    <a href="classes/MCollective/RPC/Stats.html#M000131">node_responded (MCollective::RPC::Stats)</a><br />
+    <a href="classes/MCollective/RPC/Stats.html#M000124">ok (MCollective::RPC::Stats)</a><br />
+    <a href="classes/MCollective/RPC/Helpers.html#M000049">old_rpcresults (MCollective::RPC::Helpers)</a><br />
+    <a href="classes/MCollective/Application.html#M000351">option (MCollective::Application)</a><br />
+    <a href="classes/MCollective/Application.html#M000354">options (MCollective::Application)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000104">options (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/DDL/Base.html#M000175">output (MCollective::DDL::Base)</a><br />
+    <a href="classes/MCollective/Optionparser.html#M000452">parse (MCollective::Optionparser)</a><br />
+    <a href="classes/MCollective/Matcher/Parser.html#M000152">parse (MCollective::Matcher::Parser)</a><br />
+    <a href="classes/MCollective/Util.html#M000296">parse_fact_string (MCollective::Util)</a><br />
+    <a href="classes/MCollective/RunnerStats.html#M000475">passed (MCollective::RunnerStats)</a><br />
+    <a href="classes/MCollective/RPC/ActionRunner.html#M000069">path_to_command (MCollective::RPC::ActionRunner)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000110">pick_nodes_from_discovered (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/PluginPackager/StandardDefinition.html#M000321">plugin (MCollective::PluginPackager::StandardDefinition)</a><br />
+    <a href="classes/MCollective/PluginManager.html#M000028">pluginlist (MCollective::PluginManager)</a><br />
+    <a href="classes/MCollective/Data.html#M000224">pluginname (MCollective::Data)</a><br />
+    <a href="files/install_rb.html#M000006">prepare_installation (install.rb)</a><br />
+    <a href="classes/MCollective/RPC.html#M000041">printrpc (MCollective::RPC)</a><br />
+    <a href="classes/MCollective/RPC.html#M000040">printrpcstats (MCollective::RPC)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000119">process_results_with_block (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000118">process_results_without_block (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/Message.html#M000343">publish (MCollective::Message)</a><br />
+    <a href="classes/MCollective/Registration/Base.html#M000196">publish (MCollective::Registration::Base)</a><br />
+    <a href="classes/MCollective/Data/Base.html#M000240">query (MCollective::Data::Base)</a><br />
+    <a href="classes/MCollective/Translatable.html#M000247">raise_code (MCollective::Translatable)</a><br />
+    <a href="classes/MCollective/Cache.html#M000277">read (MCollective::Cache)</a><br />
+    <a href="classes/MCollective/SSL.html#M000396">read_key (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/Config.html#M000495">read_plugin_config_dir (MCollective::Config)</a><br />
+    <a href="classes/MCollective/Client.html#M000463">receive (MCollective::Client)</a><br />
+    <a href="classes/MCollective/RunnerStats.html#M000479">received (MCollective::RunnerStats)</a><br />
+    <a href="classes/MCollective/Message.html#M000334">reply_to= (MCollective::Message)</a><br />
+    <a href="classes/MCollective/RPC/Stats.html#M000133">report (MCollective::RPC::Stats)</a><br />
+    <a href="classes/MCollective/Client.html#M000465">req (MCollective::Client)</a><br />
+    <a href="classes/MCollective/DDL/Base.html#M000176">requires (MCollective::DDL::Base)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000101">reset (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/RPC/Stats.html#M000121">reset (MCollective::RPC::Stats)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000102">reset_filter (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/Aggregate/Base.html#M000422">result_class (MCollective::Aggregate::Base)</a><br />
+    <a href="classes/MCollective/Aggregate/Result/Base.html#M000418">result_type (MCollective::Aggregate::Result::Base)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000113">rpc_result_from_reply (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/Application.html#M000370">rpcclient (MCollective::Application)</a><br />
+    <a href="classes/MCollective/RPC.html#M000037">rpcclient (MCollective::RPC)</a><br />
+    <a href="classes/MCollective/RPC.html#M000036">rpcoptions (MCollective::RPC)</a><br />
+    <a href="classes/MCollective/RPC/Helpers.html#M000046">rpcresults (MCollective::RPC::Helpers)</a><br />
+    <a href="classes/MCollective/SSL.html#M000382">rsa_decrypt_with_private (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/SSL.html#M000384">rsa_decrypt_with_public (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/SSL.html#M000383">rsa_encrypt_with_private (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/SSL.html#M000381">rsa_encrypt_with_public (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/Util.html#M000301">ruby_version (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Applications.html#M000426">run (MCollective::Applications)</a><br />
+    <a href="classes/MCollective/Application.html#M000365">run (MCollective::Application)</a><br />
+    <a href="classes/MCollective/Registration/Base.html#M000191">run (MCollective::Registration::Base)</a><br />
+    <a href="classes/MCollective/RPC/ActionRunner.html#M000060">run (MCollective::RPC::ActionRunner)</a><br />
+    <a href="classes/MCollective/Runner.html#M000497">run (MCollective::Runner)</a><br />
+    <a href="classes/MCollective/Shell.html#M000372">runcommand (MCollective::Shell)</a><br />
+    <a href="classes/MCollective/PluginPackager.html#M000317">safe_system (MCollective::PluginPackager)</a><br />
+    <a href="classes/MCollective/RPC/ActionRunner.html#M000065">save_json_request (MCollective::RPC::ActionRunner)</a><br />
+    <a href="classes/MCollective/RPC/ActionRunner.html#M000064">saverequest (MCollective::RPC::ActionRunner)</a><br />
+    <a href="classes/MCollective/Client.html#M000459">sendreq (MCollective::Client)</a><br />
+    <a href="classes/MCollective/RunnerStats.html#M000480">sent (MCollective::RunnerStats)</a><br />
+    <a href="classes/MCollective/WindowsDaemon.html#M000374">service_main (MCollective::WindowsDaemon)</a><br />
+    <a href="classes/MCollective/WindowsDaemon.html#M000375">service_stop (MCollective::WindowsDaemon)</a><br />
+    <a href="classes/MCollective/CodedError.html#M000330">set_backtrace (MCollective::CodedError)</a><br />
+    <a href="classes/MCollective/Config.html#M000494">set_config_defaults (MCollective::Config)</a><br />
+    <a href="classes/MCollective/DDL/AgentDDL.html#M000186">set_default_input_arguments (MCollective::DDL::AgentDDL)</a><br />
+    <a href="classes/MCollective/Logger/Base.html#M000205">set_level (MCollective::Logger::Base)</a><br />
+    <a href="classes/MCollective/Log.html#M000446">set_logger (MCollective::Log)</a><br />
+    <a href="classes/MCollective/Logger/File_logger.html#M000213">set_logging_level (MCollective::Logger::File_logger)</a><br />
+    <a href="classes/MCollective/Logger/Console_logger.html#M000207">set_logging_level (MCollective::Logger::Console_logger)</a><br />
+    <a href="classes/MCollective/Logger/Syslog_logger.html#M000199">set_logging_level (MCollective::Logger::Syslog_logger)</a><br />
+    <a href="classes/MCollective/Cache.html#M000272">setup (MCollective::Cache)</a><br />
+    <a href="classes/MCollective/Util.html#M000282">setup_windows_sleeper (MCollective::Util)</a><br />
+    <a href="classes/MCollective/RPC/ActionRunner.html#M000061">shell (MCollective::RPC::ActionRunner)</a><br />
+    <a href="classes/MCollective/Util.html#M000297">shellescape (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Logger/Base.html#M000203">should_log? (MCollective::Logger::Base)</a><br />
+    <a href="classes/MCollective/Security/Base.html#M000265">should_process_msg? (MCollective::Security::Base)</a><br />
+    <a href="classes/MCollective/RPC/Request.html#M000137">should_respond? (MCollective::RPC::Request)</a><br />
+    <a href="classes/MCollective/SSL.html#M000387">sign (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/Logger/Syslog_logger.html#M000197">start (MCollective::Logger::Syslog_logger)</a><br />
+    <a href="classes/MCollective/Logger/Console_logger.html#M000206">start (MCollective::Logger::Console_logger)</a><br />
+    <a href="classes/MCollective/Logger/File_logger.html#M000212">start (MCollective::Logger::File_logger)</a><br />
+    <a href="classes/MCollective/Client.html#M000468">start_publisher (MCollective::Client)</a><br />
+    <a href="classes/MCollective/Client.html#M000469">start_receiver (MCollective::Client)</a><br />
+    <a href="classes/String.html#M000009">start_with? (String)</a><br />
+    <a href="classes/MCollective/Data/Base.html#M000244">startup_hook (MCollective::Data::Base)</a><br />
+    <a href="classes/MCollective/RPC.html#M000038">stats (MCollective::RPC)</a><br />
+    <a href="classes/MCollective/Util.html#M000308">str_to_bool (MCollective::Util)</a><br />
+    <a href="classes/MCollective/DDL.html#M000157">string_to_boolean (MCollective::DDL)</a><br />
+    <a href="classes/MCollective/DDL.html#M000158">string_to_number (MCollective::DDL)</a><br />
+    <a href="classes/MCollective/Util.html#M000293">subscribe (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Client.html#M000461">subscribe (MCollective::Client)</a><br />
+    <a href="classes/MCollective/DDL/AgentDDL.html#M000180">summarize (MCollective::DDL::AgentDDL)</a><br />
+    <a href="classes/MCollective/Aggregate/Base.html#M000421">summarize (MCollective::Aggregate::Base)</a><br />
+    <a href="classes/MCollective/Aggregate.html#M000413">summarize (MCollective::Aggregate)</a><br />
+    <a href="classes/MCollective/Cache.html#M000279">synchronize (MCollective::Cache)</a><br />
+    <a href="classes/MCollective/Logger/Syslog_logger.html#M000198">syslog_facility (MCollective::Logger::Syslog_logger)</a><br />
+    <a href="classes/MCollective/Translatable.html#M000245">t (MCollective::Translatable)</a><br />
+    <a href="classes/MCollective/Util.html#M000309">t (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Registration/Base.html#M000194">target_collective (MCollective::Registration::Base)</a><br />
+    <a href="classes/MCollective/RPC/ActionRunner.html#M000068">tempfile (MCollective::RPC::ActionRunner)</a><br />
+    <a href="classes/MCollective/DDL/Base.html#M000169">template_for_plugintype (MCollective::DDL::Base)</a><br />
+    <a href="classes/MCollective/Util.html#M000310">templatepath (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Util.html#M000304">terminal_dimensions (MCollective::Util)</a><br />
+    <a href="classes/MCollective/RPC/Stats.html#M000132">text_for_aggregates (MCollective::RPC::Stats)</a><br />
+    <a href="classes/MCollective/RPC/Helpers.html#M000048">text_for_flattened_result (MCollective::RPC::Helpers)</a><br />
+    <a href="classes/MCollective/RPC/Helpers.html#M000047">text_for_result (MCollective::RPC::Helpers)</a><br />
+    <a href="classes/MCollective/Client.html#M000467">threaded_req (MCollective::Client)</a><br />
+    <a href="classes/MCollective/RPC/Stats.html#M000128">time_block_execution (MCollective::RPC::Stats)</a><br />
+    <a href="classes/MCollective/RPC/Stats.html#M000127">time_discovery (MCollective::RPC::Stats)</a><br />
+    <a href="classes/MCollective/Discovery.html#M000406">timeout_for_compound_filter (MCollective::Discovery)</a><br />
+    <a href="classes/Dir.html#M000012">tmpdir (Dir)</a><br />
+    <a href="classes/MCollective/RPC/Request.html#M000140">to_hash (MCollective::RPC::Request)</a><br />
+    <a href="classes/MCollective/RunnerStats.html#M000481">to_hash (MCollective::RunnerStats)</a><br />
+    <a href="classes/MCollective/RPC/Reply.html#M000079">to_hash (MCollective::RPC::Reply)</a><br />
+    <a href="classes/MCollective/RPC/Stats.html#M000122">to_hash (MCollective::RPC::Stats)</a><br />
+    <a href="classes/MCollective/RPC/Result.html#M000058">to_json (MCollective::RPC::Result)</a><br />
+    <a href="classes/MCollective/RPC/Request.html#M000142">to_json (MCollective::RPC::Request)</a><br />
+    <a href="classes/MCollective/Aggregate/Result/NumericResult.html#M000419">to_s (MCollective::Aggregate::Result::NumericResult)</a><br />
+    <a href="classes/MCollective/RPC/ActionRunner.html#M000067">to_s (MCollective::RPC::ActionRunner)</a><br />
+    <a href="classes/MCollective/Aggregate/Result/CollectionResult.html#M000415">to_s (MCollective::Aggregate::Result::CollectionResult)</a><br />
+    <a href="classes/MCollective/Aggregate/Result/Base.html#M000417">to_s (MCollective::Aggregate::Result::Base)</a><br />
+    <a href="classes/MCollective/Cache.html#M000278">ttl (MCollective::Cache)</a><br />
+    <a href="classes/MCollective/RunnerStats.html#M000474">ttlexpired (MCollective::RunnerStats)</a><br />
+    <a href="classes/MCollective/RPC/Progress.html#M000052">twirl (MCollective::RPC::Progress)</a><br />
+    <a href="classes/MCollective/Message.html#M000333">type= (MCollective::Message)</a><br />
+    <a href="classes/MCollective/Log.html#M000448">unconfigure (MCollective::Log)</a><br />
+    <a href="classes/MCollective/Util.html#M000294">unsubscribe (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Client.html#M000462">unsubscribe (MCollective::Client)</a><br />
+    <a href="classes/MCollective/Client.html#M000466">unthreaded_req (MCollective::Client)</a><br />
+    <a href="classes/MCollective/RunnerStats.html#M000478">unvalidated (MCollective::RunnerStats)</a><br />
+    <a href="classes/MCollective/Client.html#M000470">update_stat (MCollective::Client)</a><br />
+    <a href="classes/MCollective/DDL/Base.html#M000168">usage (MCollective::DDL::Base)</a><br />
+    <a href="classes/MCollective/Application.html#M000349">usage (MCollective::Application)</a><br />
+    <a href="classes/MCollective/SSL.html#M000395">uuid (MCollective::SSL)</a><br />
+    <a href="classes/MCollective/Security/Base.html#M000266">valid_callerid? (MCollective::Security::Base)</a><br />
+    <a href="classes/MCollective/Log.html#M000441">valid_level? (MCollective::Log)</a><br />
+    <a href="classes/MCollective/Logger/Console_logger.html#M000208">valid_levels (MCollective::Logger::Console_logger)</a><br />
+    <a href="classes/MCollective/Logger/Syslog_logger.html#M000200">valid_levels (MCollective::Logger::Syslog_logger)</a><br />
+    <a href="classes/MCollective/Logger/File_logger.html#M000214">valid_levels (MCollective::Logger::File_logger)</a><br />
+    <a href="classes/MCollective/Message.html#M000342">validate (MCollective::Message)</a><br />
+    <a href="classes/MCollective/Validator.html#M000222">validate (MCollective::Validator)</a><br />
+    <a href="classes/MCollective/RPC/Request.html#M000141">validate! (MCollective::RPC::Request)</a><br />
+    <a href="classes/MCollective/Application.html#M000358">validate_cli_options (MCollective::Application)</a><br />
+    <a href="classes/MCollective/Message.html#M000340">validate_compound_filter (MCollective::Message)</a><br />
+    <a href="classes/MCollective/Security/Base.html#M000262">validate_filter? (MCollective::Security::Base)</a><br />
+    <a href="classes/MCollective/DDL/Base.html#M000173">validate_input_argument (MCollective::DDL::Base)</a><br />
+    <a href="classes/MCollective/Application.html#M000355">validate_option (MCollective::Application)</a><br />
+    <a href="classes/MCollective/RPC/Client.html#M000089">validate_request (MCollective::RPC::Client)</a><br />
+    <a href="classes/MCollective/DDL/Base.html#M000172">validate_requirements (MCollective::DDL::Base)</a><br />
+    <a href="classes/MCollective/DDL/AgentDDL.html#M000187">validate_rpc_request (MCollective::DDL::AgentDDL)</a><br />
+    <a href="classes/MCollective/RunnerStats.html#M000477">validated (MCollective::RunnerStats)</a><br />
+    <a href="classes/MCollective/DDL.html#M000159">validation_fail! (MCollective::DDL)</a><br />
+    <a href="classes/MCollective/Validator.html#M000220">validator_class (MCollective::Validator)</a><br />
+    <a href="classes/MCollective/Security/Base.html#M000268">validrequest? (MCollective::Security::Base)</a><br />
+    <a href="classes/MCollective/SSL.html#M000388">verify_signature (MCollective::SSL)</a><br />
+    <a href="classes/MCollective.html#M000015">version (MCollective)</a><br />
+    <a href="classes/MCollective/Util.html#M000306">versioncmp (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Log.html#M000433">warn (MCollective::Log)</a><br />
+    <a href="classes/MCollective/Util.html#M000298">windows? (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Util.html#M000289">windows_prefix (MCollective::Util)</a><br />
+    <a href="classes/MCollective/Cache.html#M000276">write (MCollective::Cache)</a><br />
+    <a href="classes/MCollective/Generators/Base.html#M000259">write_plugins (MCollective::Generators::Base)</a><br />
+  </div>
+</div>
+</body>
+</html>
\ No newline at end of file
diff --git a/doc/index.html b/doc/index.html
new file mode 100644 (file)
index 0000000..3887076
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+
+<!--
+
+    The Marionette Collective version 2.3.2
+
+  -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>The Marionette Collective version 2.3.2</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+</head>
+<frameset rows="20%, 80%">
+    <frameset cols="25%,35%,45%">
+        <frame src="fr_file_index.html"   title="Files" name="Files" />
+        <frame src="fr_class_index.html"  name="Classes" />
+        <frame src="fr_method_index.html" name="Methods" />
+    </frameset>
+    <frame src="classes/MCollective.html" name="docwin" />
+</frameset>
+</html>
\ No newline at end of file
diff --git a/doc/rdoc-style.css b/doc/rdoc-style.css
new file mode 100644 (file)
index 0000000..44c7b3d
--- /dev/null
@@ -0,0 +1,208 @@
+
+body {
+    font-family: Verdana,Arial,Helvetica,sans-serif;
+    font-size:   90%;
+    margin: 0;
+    margin-left: 40px;
+    padding: 0;
+    background: white;
+}
+
+h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
+h1 { font-size: 150%; }
+h2,h3,h4 { margin-top: 1em; }
+
+a { background: #eef; color: #039; text-decoration: none; }
+a:hover { background: #039; color: #eef; }
+
+/* Override the base stylesheet's Anchor inside a table cell */
+td > a {
+  background: transparent;
+  color: #039;
+  text-decoration: none;
+}
+
+/* and inside a section title */
+.section-title > a {
+  background: transparent;
+  color: #eee;
+  text-decoration: none;
+}
+
+/* === Structural elements =================================== */
+
+div#index {
+    margin: 0;
+    margin-left: -40px;
+    padding: 0;
+    font-size: 90%;
+}
+
+
+div#index a {
+    margin-left: 0.7em;
+}
+
+div#index .section-bar {
+   margin-left: 0px;
+   padding-left: 0.7em;
+   background: #ccc;
+   font-size: small;
+}
+
+
+div#classHeader, div#fileHeader {
+    width: auto;
+    color: white;
+    padding: 0.5em 1.5em 0.5em 1.5em;
+    margin: 0;
+    margin-left: -40px;
+    border-bottom: 3px solid #006;
+}
+
+div#classHeader a, div#fileHeader a {
+    background: inherit;
+    color: white;
+}
+
+div#classHeader td, div#fileHeader td {
+    background: inherit;
+    color: white;
+}
+
+
+div#fileHeader {
+    background: #057;
+}
+
+div#classHeader {
+    background: #048;
+}
+
+
+.class-name-in-header {
+  font-size:  180%;
+  font-weight: bold;
+}
+
+
+div#bodyContent {
+    padding: 0 1.5em 0 1.5em;
+}
+
+div#description {
+    padding: 0.5em 1.5em;
+    background: #efefef;
+    border: 1px dotted #999;
+}
+
+div#description h1,h2,h3,h4,h5,h6 {
+    color: #125;;
+    background: transparent;
+}
+
+div#validator-badges {
+    text-align: center;
+}
+div#validator-badges img { border: 0; }
+
+div#copyright {
+    color: #333;
+    background: #efefef;
+    font: 0.75em sans-serif;
+    margin-top: 5em;
+    margin-bottom: 0;
+    padding: 0.5em 2em;
+}
+
+
+/* === Classes =================================== */
+
+table.header-table {
+    color: white;
+    font-size: small;
+}
+
+.type-note {
+    font-size: small;
+    color: #DEDEDE;
+}
+
+.xxsection-bar {
+    background: #eee;
+    color: #333;
+    padding: 3px;
+}
+
+.section-bar {
+   color: #333;
+   border-bottom: 1px solid #999;
+    margin-left: -20px;
+}
+
+
+.section-title {
+    background: #79a;
+    color: #eee;
+    padding: 3px;
+    margin-top: 2em;
+    margin-left: -30px;
+    border: 1px solid #999;
+}
+
+.top-aligned-row {  vertical-align: top }
+.bottom-aligned-row { vertical-align: bottom }
+
+/* --- Context section classes ----------------------- */
+
+.context-row { }
+.context-item-name { font-family: monospace; font-weight: bold; color: black; }
+.context-item-value { font-size: small; color: #448; }
+.context-item-desc { color: #333; padding-left: 2em; }
+
+/* --- Method classes -------------------------- */
+.method-detail {
+    background: #efefef;
+    padding: 0;
+    margin-top: 0.5em;
+    margin-bottom: 1em;
+    border: 1px dotted #ccc;
+}
+.method-heading {
+  color: black;
+  background: #ccc;
+  border-bottom: 1px solid #666;
+  padding: 0.2em 0.5em 0 0.5em;
+}
+.method-signature { color: black; background: inherit; }
+.method-name { font-weight: bold; }
+.method-args { font-style: italic; }
+.method-description { padding: 0 0.5em 0 0.5em; }
+
+/* --- Source code sections -------------------- */
+
+a.source-toggle { font-size: 90%; }
+div.method-source-code {
+    background: #262626;
+    color: #ffdead;
+    margin: 1em;
+    padding: 0.5em;
+    border: 1px dashed #999;
+    overflow: hidden;
+}
+
+div.method-source-code pre { color: #ffdead; overflow: hidden; }
+
+/* --- Ruby keyword styles --------------------- */
+
+.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
+
+.ruby-constant  { color: #7fffd4; background: transparent; }
+.ruby-keyword { color: #00ffff; background: transparent; }
+.ruby-ivar    { color: #eedd82; background: transparent; }
+.ruby-operator  { color: #00ffee; background: transparent; }
+.ruby-identifier { color: #ffdead; background: transparent; }
+.ruby-node    { color: #ffa07a; background: transparent; }
+.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
+.ruby-regexp  { color: #ffa07a; background: transparent; }
+.ruby-value   { color: #7fffd4; background: transparent; }
\ No newline at end of file
diff --git a/ext/Makefile.debian b/ext/Makefile.debian
new file mode 100644 (file)
index 0000000..dbb3ac7
--- /dev/null
@@ -0,0 +1,46 @@
+#!/usr/bin/make -f
+
+# This is the makefile used by debian/rules when invoked by rake deb
+
+DESTDIR=
+
+build:
+
+clean:
+
+install: install-bin install-lib install-conf install-plugins install-doc
+
+install-bin:
+       install -d $(DESTDIR)/usr/sbin
+       install -d $(DESTDIR)/usr/bin
+       cp bin/mc-* $(DESTDIR)/usr/sbin
+       cp bin/mco $(DESTDIR)/usr/bin
+       cp bin/mcollectived $(DESTDIR)/usr/sbin/mcollectived
+
+install-lib:
+       install -d $(DESTDIR)/usr/lib/ruby/vendor_ruby/
+       cp -a lib/* $(DESTDIR)/usr/lib/ruby/vendor_ruby/
+
+install-conf:
+       install -d $(DESTDIR)/etc/mcollective/
+       install -d $(DESTDIR)/etc/init.d
+       cp -r etc/* $(DESTDIR)/etc/mcollective/
+       cp mcollective.init $(DESTDIR)/etc/init.d/mcollective
+       rm $(DESTDIR)/etc/mcollective/ssl/PLACEHOLDER
+       rm $(DESTDIR)/etc/mcollective/ssl/clients/PLACEHOLDER
+
+install-plugins:
+       install -d $(DESTDIR)/usr/share/mcollective/
+       cp -a plugins $(DESTDIR)/usr/share/mcollective/
+
+install-doc:
+       install -d $(DESTDIR)/usr/share/doc/
+       cp -a doc  $(DESTDIR)/usr/share/doc/mcollective
+
+uninstall:
+       rm -f $(DESTDIR)/usr/sbin/mcollectived
+       rm -rf $(DESTDIR)/usr/lib/ruby/1.8/mcollective*
+       rm -rf $(DESTDIR)/usr/share/mcollective
+       rm -rf $(DESTDIR)/etc/mcollective
+
+.PHONY: build clean install uninstall
index bc7fe078bde7e6a399b1ddd52a0986e5a93ce2bc..4a4f69176c8ea462f4c34c656f2b3badb0f3c5b0 100755 (executable)
         -->
         <transportConnectors>
             <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
-            <transportConnector name="stomp" uri="stomp://0.0.0.0:61613"/>
+            <transportConnector name="stomp+nio" uri="stomp+nio://0.0.0.0:61613"/>
+            <!-- If using TLS, uncomment this and comment out the previous connector:
+              <transportConnector name="stomp+ssl" uri="stomp+ssl://0.0.0.0:61614?needClientAuth=true"/>
+            -->
         </transportConnectors>
     </broker>
 
index 5f1d027dd59c6a1f9e2df0e2c8704cf3375d6948..3169d7aafa61c3475ef92b5d5121db9fa669e6f3 100755 (executable)
         -->
         <transportConnectors>
             <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
-            <transportConnector name="stomp" uri="stomp://0.0.0.0:61613"/>
+            <transportConnector name="stomp+nio" uri="stomp+nio://0.0.0.0:61613"/>
+            <!-- If using TLS, uncomment this and comment out the previous connector:
+              <transportConnector name="stomp+ssl" uri="stomp+ssl://0.0.0.0:61614?needClientAuth=true"/>
+            -->
         </transportConnectors>
     </broker>
 
index b9366fc10910899023c696dafc30d13db49967a1..7166a2987e79db04b7a67636b1d8de048d4c6a7e 100755 (executable)
         -->
         <transportConnectors>
             <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
-            <transportConnector name="stomp" uri="stomp://0.0.0.0:61613"/>
+            <transportConnector name="stomp+nio" uri="stomp+nio://0.0.0.0:61613"/>
+            <!-- If using TLS, uncomment this and comment out the previous connector:
+              <transportConnector name="stomp+ssl" uri="stomp+ssl://0.0.0.0:61614?needClientAuth=true"/>
+            -->
         </transportConnectors>
     </broker>
 
index 7f9e9f833815bcea67c2679c2fe58e9f6b9d0e05..6779d7397049deac207149b3f1fd716ddcd33fcf 100644 (file)
         -->
         <transportConnectors>
             <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
-            <transportConnector name="stomp" uri="stomp://0.0.0.0:61613"/>
+            <transportConnector name="stomp+nio" uri="stomp+nio://0.0.0.0:61613"/>
+            <!-- If using TLS, uncomment this and comment out the previous connector:
+              <transportConnector name="stomp+ssl" uri="stomp+ssl://0.0.0.0:61614?needClientAuth=true"/>
+            -->
         </transportConnectors>
     </broker>
 
index 7fb71de9437d2733b1f71d6dc889db682017f2be..3d59c8bdf8586ea0d99390e90ab4290b2fc52103 100644 (file)
@@ -24,7 +24,7 @@ Package: mcollective-common
 Replaces: mcollective (<< 2.0.0-1)
 Breaks: mcollective (<< 2.0.0-1), mcollective-client (<< 2.0.0-1)
 Architecture: all
-Depends: ruby (>= 1.8.1) , rubygems
+Depends: ruby (>= 1.8.1) , rubygems, ruby-stomp | libstomp-ruby
 Description: build server orchestration or parallel job execution systems
  The Marionette Collective aka. mcollective is a framework 
  to build server orchestration or parallel job execution systems.
diff --git a/ext/debian/mcollective-common.dirs b/ext/debian/mcollective-common.dirs
new file mode 100644 (file)
index 0000000..2b54b99
--- /dev/null
@@ -0,0 +1 @@
+usr/lib/ruby/vendor_ruby
index 058fa884bbd42208d8b5934459ad69c77aaba22f..5919349ab3825e725f23e9bdd33952ac7d5b71fb 100644 (file)
@@ -1,4 +1,4 @@
-usr/lib/ruby/1.8/* usr/lib/ruby/1.8/
+usr/lib/ruby/vendor_ruby/* usr/lib/ruby/vendor_ruby/
 etc/mcollective/*.erb etc/mcollective
 usr/share/mcollective/plugins/mcollective/agent usr/share/mcollective/plugins/mcollective
 usr/share/mcollective/plugins/mcollective/audit usr/share/mcollective/plugins/mcollective
index 08ee958a90eeddf4a6a2ba65073a5ee607b6e40c..afdb45e4e3049f11d46fafbb340f0ec1b220f8fb 100755 (executable)
@@ -23,8 +23,8 @@ diff -urNad mcollective-0.4.1~/Makefile mcollective-0.4.1/Makefile
 +      cp mcollectived.rb $(DESTDIR)/usr/sbin/mcollectived
 +
 +install-lib:
-+      install -d $(DESTDIR)/usr/lib/ruby/1.8/
-+      cp -a lib/* $(DESTDIR)/usr/lib/ruby/1.8/
++      install -d $(DESTDIR)/usr/lib/ruby/vendor_ruby/
++      cp -a lib/* $(DESTDIR)/usr/lib/ruby/vendor_ruby/
 +
 +install-conf:
 +      install -d $(DESTDIR)/etc/mcollective/
@@ -42,7 +42,7 @@ diff -urNad mcollective-0.4.1~/Makefile mcollective-0.4.1/Makefile
 +
 +uninstall:
 +      rm -f $(DESTDIR)/usr/sbin/mcollectived
-+      rm -rf $(DESTDIR)/usr/lib/ruby/1.8/mcollective*
++      rm -rf $(DESTDIR)/usr/lib/ruby/vendor_ruby/mcollective*
 +      rm -rf $(DESTDIR)/usr/share/mcollective
 +      rm -rf $(DESTDIR)/etc/mcollective
 +
index 2551380d51c7fb4e16acabf394710d3765aa9f74..966ff75c2f3f1624c2b2095dd2078a7f0654e2fd 100755 (executable)
@@ -6,7 +6,7 @@ DEB_MAKE_INSTALL_TARGET  := install DESTDIR=$(CURDIR)/debian/tmp
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/rules/dpatch.mk
 include /usr/share/cdbs/1/class/makefile.mk
-DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) make -f ext/Makefile -C $(DEB_BUILDDIR)
+DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) make -f ext/Makefile.debian -C $(DEB_BUILDDIR)
 
 install/mcollective::
        mv $(CURDIR)/debian/tmp/etc/mcollective/server.cfg.dist $(CURDIR)/debian/tmp/etc/mcollective/server.cfg
index 6f3dc5fe68738337e21f8863641a6abb0391e301..ee34f28ca3170bcbe091fad31f1d484735f81e46 100644 (file)
-#!/bin/bash\r
-\r
-MPATH=''\r
-BETCDIR='/etc/mcollective'\r
-BRUBYDIR='/Library/Ruby/Site/1.8'\r
-BSBINDIR='/usr/sbin'\r
-BBINDIR='/usr/bin'\r
-BLIBEXECDIR='/usr/libexec/mcollective'\r
-BDOCDIR='/usr/share/doc/mcollective'\r
-BLAUNCHDIR='/Library/LaunchDaemons'\r
-\r
-if [ -z $1 ]; then \r
-    echo 'Please give the path to the MCollective source directory'\r
-    exit 1\r
-else\r
-    MPATH=$1\r
-fi\r
-\r
-function msg_stomp {\r
-    echo 'It is recommended to install stomp on this system using ruby gems'\r
-    exit 2\r
-}\r
-\r
-function msg_xcode {\r
-    echo 'It is required to have the latest XCode installed'\r
-    exit 3\r
-}\r
-\r
-#Make sure we have stomp so we can load mcollective\r
-/usr/bin/ruby <<EOF || msg_stomp\r
-require 'rubygems'\r
-require 'stomp'\r
-EOF\r
-\r
-#Make sure we have PackageMaker installed\r
-[ -x /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker ] || msg_xcode\r
-\r
-#Get the MCollective version\r
-export RUBYLIB=$RUBYLIB:$MPATH/lib\r
-mcversion=$(/usr/bin/ruby <<EOF\r
-require 'mcollective'\r
-puts MCollective.version\r
-EOF\r
-)\r
-\r
-#Make our tmp directory\r
-tmpbase=`basename $0`\r
-common_tmpdir=`mktemp -d /tmp/${tmpbase}-common_$mcversion.XXXX` || exit 1\r
-client_tmpdir=`mktemp -d /tmp/${tmpbase}-client_$mcversion.XXXX` || exit 1\r
-tmpdir=`mktemp -d /tmp/${tmpbase}_$mcversion.XXXX` || exit 1\r
-\r
-#Build the common environment\r
-mkdir -p "$common_tmpdir/$BRUBYDIR"\r
-mkdir -p "$common_tmpdir/$BLIBEXECDIR"\r
-mkdir -p "$common_tmpdir/$BDOCDIR"\r
-\r
-cp -r $MPATH/lib/mcollective     $common_tmpdir/$BRUBYDIR/\r
-cp    $MPATH/lib/mcollective.rb  $common_tmpdir/$BRUBYDIR/\r
-cp -r $MPATH/plugins/mcollective $common_tmpdir/$BLIBEXECDIR/\r
-cp    $MPATH/COPYING             $common_tmpdir/$BDOCDIR/\r
-\r
-#Build the server environment\r
-mkdir -p "$tmpdir/$BSBINDIR"\r
-mkdir -p "$tmpdir/$BETCDIR"\r
-mkdir -p "$tmpdir/$BETCDIR/ssl/clients"\r
-mkdir -p "$tmpdir/$BLAUNCHDIR"\r
-\r
-cp $MPATH/mcollectived.rb     $tmpdir/$BSBINDIR/mcollectived\r
-cp $MPATH/etc/facts.yaml.dist $tmpdir/$BETCDIR/facts.yaml\r
-cp $MPATH/etc/server.cfg.dist $tmpdir/$BETCDIR/server.cfg\r
-#This is needed for macs since launchd will handle the daemonizing\r
-perl -i -pe 's/daemonize = 1/daemonize = 0/' $tmpdir/$BETCDIR/server.cfg\r
-\r
-#Build the client environment\r
-mkdir -p "$client_tmpdir/$BETCDIR"\r
-mkdir -p "$client_tmpdir/$BSBINDIR"\r
-\r
-cp $MPATH/etc/client.cfg.dist $client_tmpdir/$BETCDIR/client.cfg\r
-cp $MPATH/etc/rpc-help.erb    $client_tmpdir/$BETCDIR/\r
-cp $MPATH/mc-call-agent       $client_tmpdir/$BSBINDIR/\r
-cp $MPATH/mc-controller       $client_tmpdir/$BSBINDIR/\r
-cp $MPATH/mc-facts            $client_tmpdir/$BSBINDIR/\r
-cp $MPATH/mc-find-hosts       $client_tmpdir/$BSBINDIR/\r
-cp $MPATH/mc-inventory        $client_tmpdir/$BSBINDIR/\r
-cp $MPATH/mc-ping             $client_tmpdir/$BSBINDIR/\r
-cp $MPATH/mc-rpc              $client_tmpdir/$BSBINDIR/\r
-\r
-#Build our launchd property list file\r
-cat - > $tmpdir/$BLAUNCHDIR/org.marionette-collective.mcollective.plist <<EOF\r
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\r
-<plist version="1.0">\r
-<dict>\r
-        <key>EnvironmentVariables</key>\r
-        <dict>\r
-                <key>PATH</key>\r
-                <string>/sbin:/usr/sbin:/bin:/usr/bin</string>\r
-                <key>RUBYLIB</key>\r
-                <string>/Library/Ruby/Site/1.8</string>\r
-        </dict>\r
-        <key>Label</key>\r
-        <string>org.marionette-collective.mcollective</string>\r
-        <key>OnDemand</key>\r
-        <false/>\r
-        <key>KeepAlive</key>\r
-        <true/>\r
-        <key>ProgramArguments</key>\r
-        <array>\r
-                <string>/usr/sbin/mcollectived</string>\r
-                <string>--config=/etc/mcollective/server.cfg</string>\r
-        </array>\r
-        <key>RunAtLoad</key>\r
-        <true/>\r
-        <key>ServiceDescription</key>\r
-        <string>MCollective Server</string>\r
-        <key>ServiceIPC</key>\r
-        <false/>\r
-</dict>\r
-</plist>\r
-EOF\r
-\r
-#launchd complains if the permissions aren't right\r
-chmod 644 $tmpdir/$BLAUNCHDIR/org.marionette-collective.mcollective.plist\r
-\r
-#Make our Packages.  This requires XCode be installed\r
-/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker -r $tmpdir --version $mcversion --title "MCollective" -l / -o MCollective_$mcversion.pkg -i org.marionette-collective.mcollective\r
-/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker -r $common_tmpdir --version $mcversion --title "MCollective Common" -l / -o MCollective-Common_$mcversion.pkg -i org.marionette-collective.mcollective-common\r
-/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker -r $client_tmpdir --version $mcversion --title "MCollective Client" -l / -o MCollective-Client_$mcversion.pkg -i org.marionette-collective.mcollective-client\r
-\r
-#Clean up\r
-rm -rf $tmpdir\r
-rm -rf $common_tmpdir\r
-rm -rf $client_tmpdir\r
+#!/bin/bash
+MPATH="$1"
+BETCDIR='/etc/mcollective'
+BRUBYDIR='/Library/Ruby/Site/1.8'
+BSBINDIR='/usr/sbin'
+BBINDIR='/usr/bin'
+BLIBEXECDIR='/usr/libexec/mcollective'
+BDOCDIR='/usr/share/doc/mcollective'
+BLAUNCHDIR='/Library/LaunchDaemons'
+BLOGDIR='/var/log/mcollective'
+PACKAGEMAKER='/Applications/PackageMaker.app/Contents/MacOS/PackageMaker'
+
+if [ -z $MPATH ]; then
+  echo 'Please give the path to the MCollective source directory'
+  exit 1
+fi
+
+msg_stomp() {
+  echo "It is recommended to install stomp on this system using ruby gems"
+  exit 2
+}
+
+msg_xcode() {
+  echo 'It is required to have the latest XCode installed'
+  exit 3
+}
+
+# Make sure we have stomp so we can load mcollective
+/usr/bin/ruby <<EOF || msg_stomp
+require 'rubygems'
+require 'stomp'
+EOF
+
+# Make sure we have PackageMaker installed
+[ -x $PACKAGEMAKER ] || msg_xcode
+
+# Get the MCollective version
+export RUBYLIB=$RUBYLIB:$MPATH/lib
+mcversion=$(/usr/bin/ruby <<EOF
+require 'mcollective'
+puts MCollective.version
+EOF
+)
+
+# Make our tmp directory
+tmpbase=`basename $0`
+common_tmpdir=`mktemp -d /tmp/${tmpbase}-common_$mcversion.XXXX` || exit 1
+client_tmpdir=`mktemp -d /tmp/${tmpbase}-client_$mcversion.XXXX` || exit 1
+tmpdir=`mktemp -d /tmp/${tmpbase}_$mcversion.XXXX` || exit 1
+pkgdir=`mktemp -d /tmp/${tmpbase}_${mcversion}_packages.XXXX` || exit 1
+
+# Build the common environment
+mkdir -p "$common_tmpdir/$BRUBYDIR"
+mkdir -p "$common_tmpdir/$BLIBEXECDIR"
+mkdir -p "$common_tmpdir/$BDOCDIR"
+mkdir -p "$common_tmpdir/$BLOGDIR"
+
+cp -r $MPATH/lib/mcollective     $common_tmpdir/$BRUBYDIR/
+cp    $MPATH/lib/mcollective.rb  $common_tmpdir/$BRUBYDIR/
+cp -r $MPATH/plugins/mcollective $common_tmpdir/$BLIBEXECDIR/
+cp    $MPATH/COPYING             $common_tmpdir/$BDOCDIR/
+
+# Build the server environment
+mkdir -p "$tmpdir/$BSBINDIR"
+mkdir -p "$tmpdir/$BETCDIR"
+mkdir -p "$tmpdir/$BETCDIR/ssl/clients"
+mkdir -p "$tmpdir/$BLAUNCHDIR"
+
+cp $MPATH/bin/mcollectived    $tmpdir/$BSBINDIR/mcollectived
+cp $MPATH/etc/facts.yaml.dist $tmpdir/$BETCDIR/facts.yaml
+cp $MPATH/etc/server.cfg.dist $tmpdir/$BETCDIR/server.cfg
+
+# This is needed for macs since launcd will handle daemonizing
+perl -i -pe 's/daemonize = 1/daemonize = 0/' $tmpdir/$BETCDIR/server.cfg
+
+# Build the client environment
+mkdir -p "$client_tmpdir/$BETCDIR"
+mkdir -p "$client_tmpdir/$BSBINDIR"
+
+cp $MPATH/etc/client.cfg.dist $client_tmpdir/$BETCDIR/client.cfg
+cp $MPATH/etc/rpc-help.erb    $client_tmpdir/$BETCDIR/
+cp $MPATH/bin/mc-call-agent   $client_tmpdir/$BSBINDIR/
+cp $MPATH/bin/mco             $client_tmpdir/$BSBINDIR/
+
+#Build our launchd property list file
+cat - > $tmpdir/$BLAUNCHDIR/org.marionette-collective.mcollective.plist <<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+        <key>EnvironmentVariables</key>
+        <dict>
+                <key>PATH</key>
+                <string>/sbin:/usr/sbin:/bin:/usr/bin</string>
+                <key>RUBYLIB</key>
+                <string>/Library/Ruby/Site/1.8</string>
+        </dict>
+        <key>Label</key>
+        <string>org.marionette-collective.mcollective</string>
+        <key>OnDemand</key>
+        <false/>
+        <key>KeepAlive</key>
+        <true/>
+        <key>ProgramArguments</key>
+        <array>
+                <string>/usr/sbin/mcollectived</string>
+                <string>--config=/etc/mcollective/server.cfg</string>
+        </array>
+        <key>RunAtLoad</key>
+        <true/>
+        <key>ServiceDescription</key>
+        <string>MCollective Server</string>
+        <key>ServiceIPC</key>
+        <false/>
+</dict>
+</plist>
+EOF
+
+
+#Make our Packages.  This requires XCode be installed
+$PACKAGEMAKER -r $tmpdir --version $mcversion --title "MCollective" -l / -o $pkgdir/MCollective_$mcversion.pkg -i org.marionette-collective.mcollective
+$PACKAGEMAKER -r $common_tmpdir --version $mcversion --title "MCollective Common" -l / -o $pkgdir/MCollective-Common_$mcversion.pkg -i org.marionette-collective.mcollective-common
+$PACKAGEMAKER -r $client_tmpdir --version $mcversion --title "MCollective Client" -l / -o $pkgdir/MCollective-Client_$mcversion.pkg -i org.marionette-collective.mcollective-client
+
+# Make sure that we install the stomp gem, this is ugly and should be part of the package
+cat - > $pkgdir/MCollective-Common_$mcversion.pkg/Contents/Resources/postflight <<EOF
+#!/bin/bash
+/usr/bin/gem install --no-ri --no-rdoc stomp
+EOF
+chmod +x $pkgdir/MCollective-Common_$mcversion.pkg/Contents/Resources/postflight
+
+# launchd complains if the permissions aren't right, this is a dumb hack that
+# I needed since PackageMaker doesn't seem to respect permissions (originally had chmod 644 in the tmpdir)
+cat - > $pkgdir/MCollective_$mcversion.pkg/Contents/Resources/postflight <<EOF
+#!/bin/bash
+chmod 644 /Library/LaunchDaemons/org.marionette-collective.mcollective.plist
+EOF
+chmod +x $pkgdir/MCollective_$mcversion.pkg/Contents/Resources/postflight
+
+# Create a r/o compressed dmg from our pkgs
+hdiutil create -srcfolder $pkgdir -format UDZO -scrub -imagekey zlib-level=9 -volname "mcollective-$mcversion" mcollective-$mcversion.dmg
+
+#Clean up
+rm -rf $tmpdir
+rm -rf $common_tmpdir
+rm -rf $client_tmpdir
+rm -rf $pkgdir
index 2eb54fc35a7937d1750820d9166d97c504bb76de..bd5d9276223aa20e7a24d0ab9ad27c84a91e2022 100644 (file)
@@ -1,4 +1,11 @@
-%{!?ruby_sitelib: %global ruby_sitelib %(ruby -rrbconfig -e "puts RbConfig::CONFIG['sitelibdir']")}
+# Fedora 19 ships with ruby 2, which uses vendorlibdir instead
+# of sitelibdir
+%if 0%{?fedora} >= 19
+%global ruby_libdir %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["vendorlibdir"]')
+%else
+%global ruby_libdir %(ruby -rrbconfig -e "puts RbConfig::CONFIG['sitelibdir']")
+%endif
+
 %define release %{rpm_release}%{?dist}
 
 Summary: Application Server for hosting Ruby code on any capable middleware
@@ -17,8 +24,7 @@ BuildArch: noarch
 %package common
 Summary: Common libraries for the mcollective clients and servers
 Group: System Environment/Libraries
-Requires: ruby
-Requires: ruby(abi) >= 1.8
+Requires: ruby >= 1.8
 Requires: rubygems
 Requires: rubygem(stomp)
 
@@ -49,7 +55,7 @@ Server for the mcollective Application Server
 
 %install
 rm -rf %{buildroot}
-%{__install} -d -m0755  %{buildroot}/%{ruby_sitelib}/mcollective
+%{__install} -d -m0755  %{buildroot}/%{ruby_libdir}/mcollective
 %{__install} -d -m0755  %{buildroot}%{_bindir}
 %{__install} -d -m0755  %{buildroot}%{_sbindir}
 %{__install} -d -m0755  %{buildroot}%{_sysconfdir}/init.d
@@ -74,7 +80,7 @@ rm -rf %{buildroot}
 %endif
 
 
-cp -R lib/* %{buildroot}/%{ruby_sitelib}/
+cp -R lib/* %{buildroot}/%{ruby_libdir}/
 cp -R plugins/* %{buildroot}%{_libexecdir}/mcollective/
 cp bin/mc-* %{buildroot}%{_sbindir}/
 cp bin/mco %{buildroot}%{_bindir}/
@@ -99,8 +105,8 @@ fi
 
 %files common
 %doc COPYING
-%{ruby_sitelib}/mcollective.rb
-%{ruby_sitelib}/mcollective
+%{ruby_libdir}/mcollective.rb
+%{ruby_libdir}/mcollective
 %{_libexecdir}/mcollective/mcollective
 %dir %{_sysconfdir}/mcollective
 %dir %{_sysconfdir}/mcollective/ssl
diff --git a/ext/windows/daemon.bat b/ext/windows/daemon.bat
new file mode 100644 (file)
index 0000000..1035f4c
--- /dev/null
@@ -0,0 +1,6 @@
+@echo off\r
+SETLOCAL\r
+\r
+call "%~dp0..\bin\environment.bat" %0 %*\r
+\r
+ruby -rubygems "%MCOLLECTIVE_DIR%\bin\mcollectived" %*
index 8b1431fe9cbdd7d4cb860fcf736d1565434b0649..3e38f2a7f26251c495c64c37fb1afae70589e993 100644 (file)
@@ -60,7 +60,7 @@ module MCollective
 
   MCollective::Vendor.load_vendored
 
-  VERSION="@DEVELOPMENT_VERSION@"
+  VERSION="2.3.2"
 
   def self.version
     VERSION
index d77eaa5c90fdef7b5f3789705985d7d0d5439c3c..9c8fd83171d40968400609ad75c3867c9687c338 100644 (file)
@@ -37,6 +37,15 @@ module MCollective
     # Sends a request and returns the generated request id, doesn't wait for
     # responses and doesn't execute any passed in code blocks for responses
     def sendreq(msg, agent, filter = {})
+      request = createreq(msg, agent, filter)
+
+      Log.debug("Sending request #{request.requestid} to the #{request.agent} agent with ttl #{request.ttl} in collective #{request.collective}")
+
+      request.publish
+      request.requestid
+    end
+
+    def createreq(msg, agent, filter ={})
       if msg.is_a?(Message)
         request = msg
         agent = request.agent
@@ -47,14 +56,8 @@ module MCollective
       end
 
       request.encode!
-
-      Log.debug("Sending request #{request.requestid} to the #{request.agent} agent with ttl #{request.ttl} in collective #{request.collective}")
-
       subscribe(agent, :reply) unless request.reply_to
-
-      request.publish
-
-      request.requestid
+      request
     end
 
     def subscribe(agent, type)
@@ -91,15 +94,14 @@ module MCollective
         reply.expected_msgid = requestid
 
         reply.decode!
-
-        reply.payload[:senderid] = Digest::MD5.hexdigest(reply.payload[:senderid]) if ENV.include?("MCOLLECTIVE_ANON")
-
-        raise(MsgDoesNotMatchRequestID, "Message reqid #{requestid} does not match our reqid #{reply.requestid}") unless reply.requestid == requestid
+        unless reply.requestid == requestid
+          raise(MsgDoesNotMatchRequestID, "Message reqid #{reply.requestid} does not match our reqid #{requestid}")
+        end
       rescue SecurityValidationFailed => e
         Log.warn("Ignoring a message that did not pass security validations")
         retry
       rescue MsgDoesNotMatchRequestID => e
-        Log.debug("Ignoring a message for some other client")
+        Log.debug("Ignoring a message for some other client : #{e.message}")
         retry
       end
 
@@ -124,7 +126,7 @@ module MCollective
     #
     # It returns a hash of times and timeouts for discovery and total run is taken from the options
     # hash which in turn is generally built using MCollective::Optionparser
-    def req(body, agent=nil, options=false, waitfor=0)
+    def req(body, agent=nil, options=false, waitfor=0, &block)
       if body.is_a?(Message)
         agent = body.agent
         waitfor = body.discovered_hosts.size || 0
@@ -132,46 +134,100 @@ module MCollective
       end
 
       @options = options if options
-
-      stat = {:starttime => Time.now.to_f, :discoverytime => 0, :blocktime => 0, :totaltime => 0}
-
+      threaded = @options[:threaded]
       timeout = @discoverer.discovery_timeout(@options[:timeout], @options[:filter])
-
+      request = createreq(body, agent, @options[:filter])
+      publish_timeout = @options[:publish_timeout]
+      stat = {:starttime => Time.now.to_f, :discoverytime => 0, :blocktime => 0, :totaltime => 0}
       STDOUT.sync = true
-
       hosts_responded = 0
-      reqid = nil
+
 
       begin
-        Log.debug("Publishing request to agent %s with timeout %d" % [agent, timeout])
+        if threaded
+          hosts_responded = threaded_req(request, publish_timeout, timeout, waitfor, &block)
+        else
+          hosts_responded = unthreaded_req(request, publish_timeout, timeout, waitfor, &block)
+        end
+      rescue Interrupt => e
+      ensure
+        unsubscribe(agent, :reply)
+      end
 
-        Timeout.timeout(timeout) do
-          reqid = sendreq(body, agent, @options[:filter])
+      return update_stat(stat, hosts_responded, request.requestid)
+    end
 
-          loop do
-            resp = receive(reqid)
+    # Starts the client receiver and publisher unthreaded.
+    # This is the default client behaviour.
+    def unthreaded_req(request, publish_timeout, timeout, waitfor, &block)
+      start_publisher(request, publish_timeout)
+      start_receiver(request.requestid, waitfor, timeout, &block)
+    end
 
-            hosts_responded += 1
+    # Starts the client receiver and publisher in threads.
+    # This is activated when the 'threader_client' configuration
+    # option is set.
+    def threaded_req(request, publish_timeout, timeout, waitfor, &block)
+      Log.debug("Starting threaded client")
+      publisher = Thread.new do
+        start_publisher(request, publish_timeout)
+      end
 
-            yield(resp.payload)
+      # When the client is threaded we add the publishing timeout to
+      # the agent timeout so that the receiver doesn't time out before
+      # publishing has finished in cases where publish_timeout >= timeout.
+      total_timeout = publish_timeout + timeout
+      hosts_responded = 0
+
+      receiver = Thread.new do
+        hosts_responded = start_receiver(request.requestid, waitfor, total_timeout, &block)
+      end
 
-            break if (waitfor != 0 && hosts_responded >= waitfor)
-          end
+      receiver.join
+      hosts_responded
+    end
+
+    # Starts the request publishing routine
+    def start_publisher(request, publish_timeout)
+      Log.debug("Starting publishing with publish timeout of #{publish_timeout}")
+      begin
+        Timeout.timeout(publish_timeout) do
+          Log.debug("Sending request #{request.requestid} to the #{request.agent} agent with ttl #{request.ttl} in collective #{request.collective}")
+          request.publish
         end
-      rescue Interrupt => e
       rescue Timeout::Error => e
-      ensure
-        unsubscribe(agent, :reply)
+        Log.warn("Could not publish all messages. Publishing timed out.")
       end
+    end
+
+    # Starts the response receiver routine
+    # Expected to return the amount of received responses.
+    def start_receiver(requestid, waitfor, timeout, &block)
+      Log.debug("Starting response receiver with timeout of #{timeout}")
+      hosts_responded = 0
+      begin
+        Timeout.timeout(timeout) do
+          begin
+            resp = receive(requestid)
+            yield resp.payload
+            hosts_responded += 1
+          end while (waitfor == 0 || hosts_responded < waitfor)
+        end
+      rescue Timeout::Error => e
+        Log.warn("Could not receive all responses. Expected : #{waitfor}. Received : #{hosts_responded}")
+      end
+
+      hosts_responded
+    end
 
+    def update_stat(stat, hosts_responded, requestid)
       stat[:totaltime] = Time.now.to_f - stat[:starttime]
       stat[:blocktime] = stat[:totaltime] - stat[:discoverytime]
       stat[:responses] = hosts_responded
       stat[:noresponsefrom] = []
-      stat[:requestid] = reqid
+      stat[:requestid] = requestid
 
       @stats = stat
-      return stat
     end
 
     def discovered_req(body, agent, options=false)
index 7ce3a26714cdf4fc6ed08c224532ed4a923ca30c..3b5dedc5570b9146193f8bdb5dc41917749f815f 100644 (file)
@@ -10,11 +10,12 @@ module MCollective
     attr_reader :identity, :daemonize, :connector, :securityprovider, :factsource
     attr_reader :registration, :registerinterval, :classesfile
     attr_reader :rpcauditprovider, :rpcaudit, :configdir, :rpcauthprovider
-    attr_reader :rpcauthorization, :color, :configfile, :rpchelptemplate
+    attr_reader :rpcauthorization, :color, :configfile
     attr_reader :rpclimitmethod, :logger_type, :fact_cache_time, :collectives
     attr_reader :main_collective, :ssl_cipher, :registration_collective
-    attr_reader :direct_addressing, :direct_addressing_threshold, :ttl, :helptemplatedir
+    attr_reader :direct_addressing, :direct_addressing_threshold, :ttl
     attr_reader :default_discovery_method, :default_discovery_options
+    attr_reader :publish_timeout, :threaded
 
     def initialize
       @configured = false
@@ -31,7 +32,7 @@ module MCollective
 
           unless line =~ /^#|^$/
             if (line =~ /(.+?)\s*=\s*(.+)/)
-              key = $1
+              key = $1.strip
               val = $2
 
               case key
@@ -68,13 +69,13 @@ module MCollective
                 when "identity"
                   @identity = val
                 when "direct_addressing"
-                  @direct_addressing = false unless val =~ /^1|y/i
+                  @direct_addressing = Util.str_to_bool(val)
                 when "direct_addressing_threshold"
                   @direct_addressing_threshold = val.to_i
                 when "color"
-                  val =~ /^1|y/i ? @color = true : @color = false
+                  @color = Util.str_to_bool(val)
                 when "daemonize"
-                  val =~ /^1|y/i ? @daemonize = true : @daemonize = false
+                  @daemonize = Util.str_to_bool(val)
                 when "securityprovider"
                   @securityprovider = val.capitalize
                 when "factsource"
@@ -85,16 +86,16 @@ module MCollective
                   @classesfile = val
                 when /^plugin.(.+)$/
                   @pluginconf[$1] = val
+                when "publish_timeout"
+                  @publish_timeout = val.to_i
                 when "rpcaudit"
-                  val =~ /^1|y/i ? @rpcaudit = true : @rpcaudit = false
+                  @rpcaudit = Util.str_to_bool(val)
                 when "rpcauditprovider"
                   @rpcauditprovider = val.capitalize
                 when "rpcauthorization"
-                  val =~ /^1|y/i ? @rpcauthorization = true : @rpcauthorization = false
+                  @rpcauthorization = Util.str_to_bool(val)
                 when "rpcauthprovider"
                   @rpcauthprovider = val.capitalize
-                when "rpchelptemplate"
-                  @rpchelptemplate = val
                 when "rpclimitmethod"
                   @rpclimitmethod = val.to_sym
                 when "logger_type"
@@ -103,16 +104,16 @@ module MCollective
                   @fact_cache_time = val.to_i
                 when "ssl_cipher"
                   @ssl_cipher = val
+                when "threaded"
+                  @threaded = Util.str_to_bool(val)
                 when "ttl"
                   @ttl = val.to_i
-                when "helptemplatedir"
-                  @helptemplatedir = val
                 when "default_discovery_options"
                   @default_discovery_options << val
                 when "default_discovery_method"
                   @default_discovery_method = val
                 else
-                  raise("Unknown config parameter #{key}")
+                  raise("Unknown config parameter '#{key}'")
               end
             end
           end
@@ -184,13 +185,8 @@ module MCollective
       @default_discovery_options = []
       @ttl = 60
       @mode = :client
-
-      # look in the config dir for the template so users can provide their own and windows
-      # with odd paths will just work more often, but fall back to old behavior if it does
-      # not exist
-      @rpchelptemplate = File.join(File.dirname(configfile), "rpc-help.erb")
-      @rpchelptemplate = "/etc/mcollective/rpc-help.erb" unless File.exists?(@rpchelptemplate)
-      @helptemplatedir = File.dirname(@rpchelptemplate)
+      @publish_timeout = 2
+      @threaded = false
     end
 
     def read_plugin_config_dir(dir)
@@ -205,7 +201,7 @@ module MCollective
           line.gsub!(/\s*$/, "")
           next if line =~ /^#|^$/
           if (line =~ /(.+?)\s*=\s*(.+)/)
-            key = $1
+            key = $1.strip
             val = $2
             @pluginconf["#{plugin}.#{key}"] = val
           end
index 8ffe4d2f34861d8ddd9f347cf63f628f13f5bb81..310156cfdb2da06bdb82dd9a07d9dfab559c5a31 100644 (file)
@@ -10,7 +10,7 @@ module MCollective
         @data = {}
 
         outputs.keys.each do |output|
-          @data[output] = outputs[output].fetch(:default, nil)
+          @data[output] = Marshal.load(Marshal.dump(outputs[output].fetch(:default, nil)))
         end
       end
 
index b4e524d44898df8e4b8355f2e0a322bd73ee3d08..e9a99f931062d09c82bb83c48f7972c67511e97c 100644 (file)
@@ -38,18 +38,19 @@ module MCollective
       #
       # If no template name is provided one will be chosen based
       # on the plugin type.  If the provided template path is
-      # not absolute then the template will be loaded relative to
-      # helptemplatedir configuration parameter
+      # not absolute then the template will be loaded either from
+      # the config dir and if that does not exist, default to
+      # /etc/mcollective
       def help(template=nil)
         template = template_for_plugintype unless template
-        template = File.join(@config.helptemplatedir, template) unless template.start_with?(File::SEPARATOR)
+        template = Util.templatepath(template) unless Util.absolute_path?(template)
 
         template = File.read(template)
         meta = @meta
         entities = @entities
 
         unless template == "metadata-help.erb"
-          metadata_template = File.join(@config.helptemplatedir, "metadata-help.erb")
+          metadata_template = Util.templatepath("metadata-help.erb")
           metadata_template = File.read(metadata_template)
           metastring = ERB.new(metadata_template, 0, '%')
           metastring = metastring.result(binding)
@@ -68,7 +69,7 @@ module MCollective
         when :agent
           return "rpc-help.erb"
         else
-          if File.exists?(File.join(@config.helptemplatedir,"#{@plugintype}-help.erb"))
+          if File.exists?(Util.templatepath("#{@plugintype}-help.erb"))
             return "#{@plugintype}-help.erb"
           else
             # Default help template gets loaded if plugintype-help does not exist.
index 2bfee67bd0ea5ccc25120c66f50827fd374010e4..96c3e213f1e6394dfca7471c66cbdf2a93aaf910 100644 (file)
-en: 
-  PLMC1: 
+en:
+  PLMC1:
     example: "The Marionette Collective version 2.2.2 started by /usr/bin/mco using config file /etc/mcollective/client.cfg"
     expanded: "This message gets logged each time MCollective reads it's config file.  Generally this only happens once per process.  It shows the version, process name and config file as a simple debugging aid"
     pattern: "The Marionette Collective version %{version} started by %{name} using config file %{config}"
-  PLMC10: 
+  PLMC10:
     example: "Failed to handle message: RuntimeError: none.rb:15:in `decodemsg': Could not decrypt message "
     expanded: |-
         When a message arrives from the middleware it gets decoded, security validated and then dispatched to the agent code.
-        
+
         There exist a number of errors that can happen here, some are handled specifically others will be logged by this "catch all" handler.
-        
+
         Generally there should not be many messages logged here but we include a stack trace to assist with debugging these.
-        
+
         The messages here do not tend to originate from your Agents unless they are syntax error related but more likely to be situations like security failures due to incorrect SSL keys and so forth
-        
+
         Should you come across one that is a regular accorance in your logs please open a ticket including your backtrace and we will improve the handling of that situation
     pattern: "Failed to handle message: %{error}"
-  PLMC11: 
+  PLMC11:
     example: "Cache expired on 'ddl' key 'agent/nrpe'"
     expanded: |-
         MCollective has an internal Cache used to speed up operations like parsing of DDL files.  The cache is also usable from the agents and other plugins you write.
-        
+
         Each entry in the cache has an associated TTL or maximum life time, once the maximum time on an item is reached it is considered expired.  Next time anything attempts to read this entry from the cache this log line will be logged.
-        
+
         This is part of the normal operations of MCollective and doesn't indicate any problem.  We log this debug message to help you debug your own use of the cache.
     pattern: "Cache expired on '%{cache_name}' key '%{item}'"
-  PLMC12: 
+  PLMC12:
     example: "Cache hit on 'ddl' key 'agent/nrpe'"
     expanded: |-
         MCollective has an internal Cache used to speed up operations like parsing of DDL files.  The cache is also usable from the agents and other plugins you write.
-        
-        Each entry in the cache has an associated TTL or maximum life time, once the maximum time on an item is reached it is considered expired.  
-        
-        This log line indicates that a request for a cache entry was made, the entry had not yet expired and so the cached data is being returned.  
-        
+
+        Each entry in the cache has an associated TTL or maximum life time, once the maximum time on an item is reached it is considered expired.
+
+        This log line indicates that a request for a cache entry was made, the entry had not yet expired and so the cached data is being returned.
+
         It does not indicate a problem, it's just a debugging aid
     pattern: "Cache hit on '%{cache_name}' key '%{item}'"
-  PLMC13: 
+  PLMC13:
     example: "Could not find a cache called 'my_cache'"
     expanded: |-
         MCollective has an internal Cache used to speed up operations like parsing of DDL files.  The cache is also usable from the agents and other plugins you write.
-        
+
         The cache is made up of many named caches, this error indicates that a cache has not yet been setup prior to trying to use it.
     pattern: "Could not find a cache called '%{cache_name}'"
-  PLMC14: 
+  PLMC14:
     example: "No block supplied to synchronize on cache 'my_cache'"
     expanded: |-
         When using the Cache to synchronize your own code across agents or other plugins you have to supply a block to synchronise.
-        
+
         Correct usage would be:
-        
+
             Cache.setup(:customer, 600)
             Cache(:customer).synchronize do
                # update customer record
             end
-        
+
         This error is raise when the logic to update the customer record is not in a block as in the example
     pattern: "No block supplied to synchronize on cache '%{cache_name}'"
-  PLMC15: 
+  PLMC15:
     example: "No item called 'nrpe_agent' for cache 'ddl'"
     expanded: |-
         MCollective has an internal Cache used to speed up operations like parsing of DDL files.  The cache is also usable from the agents and other plugins you write.
-        
+
         The cache stored items using a key, this error will be logged and raised when you try to access a item that does not yet exist in the cache.
     pattern: "No item called '%{item}' for cache '%{cache_name}'"
-  PLMC16: 
+  PLMC16:
     example: "'hello' does not look like a numeric value"
     expanded: |-
         When MCollective receives an argument from the command line like port=fello it consults the DDL file to determine the desired type of this parameter, it then tries to convert the input string into the correct numeric value.
-        
+
         This error indicates the input you provided could not be converted into the desired format.
-        
+
         You'll usually see this when using the 'mco rpc' command to interact with an agent.  This is usually a fatal error, the request will not be sent if it does not validate against the DDL.
     pattern: "'%{value}' does not look like a numeric value"
-  PLMC17: 
+  PLMC17:
     example: "'flase' does not look like a boolean value"
     expanded: |-
         When MCollective receives an argument from the command line like force=true it consults the DDL file to determine the desired type of this parameter, it then tries to convert the input string into the correct boolean value.
-        
+
         This error indicates the input you provided could not be converted into the desired boolean format.  It wil accept "true", "t", "yes", "y" and "1" as being true.  It will accept "false", "f", "no", "n", "0" as being false.
-        
+
         You'll usually see this when using the 'mco rpc' command to interact with an agent.  This is usually a fatal error, the request will not be sent if it does not validate against the DDL.
     pattern: "'%{value}' does not look like a boolean value"
-  PLMC18: 
+  PLMC18:
     example: "Found 'rpcutil' ddl at '/usr/libexec/mcollective/mcollective/agent/rpcutil.ddl'"
     expanded: |-
         Most plugin types have a DDL file that needs to be correctly installed for the plugin to function.  There can be multiple libdirs that can provide the DDL file for a specific plugin.
-        
+
         This message is a message designed to help you debug issues when you think the wrong DDL file is being used.
     pattern: "Found '%{ddlname}' ddl at '%{ddlfile}'"
-  PLMC19: 
+  PLMC19:
     expanded: |-
         Usually when MCollective run it validates all requirements are met before publishing a request or processing a request against the DDL file for the agent.
-        
-        This can be difficult to satisfy in development perhaps because you are still writing your DDL files or debugging issues.  
-        
+
+        This can be difficult to satisfy in development perhaps because you are still writing your DDL files or debugging issues.
+
         This message indicates that when MCollective detects it's running against an unreleased version of MCollective - like directly out of a Git clone - it will skip the DDL validation steps.  It is logged at a warning level as this significantly changes the behaviour of the client and server.
     pattern: "DDL requirements validation being skipped in development"
-  PLMC2: 
+  PLMC2:
     expanded: "When sending the mcollectived process the USR1 signal on a Unix based machine this message will indicate that the signal got received and all agents are being reloaded from disk\n"
     pattern: "Reloading all agents after receiving USR1 signal"
-  PLMC20: 
+  PLMC20:
     example: "Agent plugin 'example' requires MCollective version 2.2.1 or newer"
     expanded: |-
         MCollective plugins can declare a minimum version of MCollective that they require to be functional.
-        
+
         MCollective validates this when it loads the plugin and this error will be logged or shown to the user when this requirement cannot be satisfied.
     pattern: "%{type} plugin '%{name}' requires MCollective version %{requirement} or newer"
-  PLMC21: 
+  PLMC21:
     example: "Cannot validate input 'service': Input string is longer than 40 character(s)"
     expanded: |-
         Every input you provide to a RPC request is validated against it's DDL file. This error will be shown when the supplied data does not pass validation against the DDL.
-        
+
         Consult the 'mco plugin doc' command to view the DDL file for your action and input.
     pattern: "Cannot validate input '%{input}: %{error}"
-  PLMC22: 
+  PLMC22:
     example: "Cannot determine what entity input 'port' belongs to"
     expanded: |-
         When writing a DDL you declare inputs into plugins using the input keyword.  Each input has to belong to a wrapping entity like in the example below:
-        
+
             action "get_data", :description => "Get data from a data plugin" do
                 input :source,
                       :prompt      => "Data Source",
@@ -128,201 +128,217 @@ en:
                       :optional    => false,
                       :maxlength   => 50
             end
-        
+
         Here the input belongs to the action entity "get_data", this error indicates that an input were found without it belonging to any specific entity
     pattern: "Cannot determine what entity input '%{input}' belongs to"
-  PLMC23: 
+  PLMC23:
     example: "Input needs a :prompt property"
     expanded: "When writing a DDL you declare inputs for all data that you pass into the plugin.  Inputs have a minimally required field set and this error indicate that you did not provide some key field while describing the input."
     pattern: "Input needs a :%{property} property"
-  PLMC24: 
+  PLMC24:
     example: "Failed to load DDL for the 'rpcutil' agent, DDLs are required: RuntimeError: failed to parse DDL file"
     expanded: |-
         As of version 2.0.0 DDL files are required by the MCollective server.  This server indicates that it either could not find the DDL for the rpcutil agent or that there was a syntax error.
-        
+
         Confirm that the DDL file is installed in the agent directory and that it parses correctly using the 'mco plugin doc' command.
     pattern: "Failed to load DDL for the '%{agent}' agent, DDLs are required: %{error_class}: %{error}"
-  PLMC25: 
+  PLMC25:
     example: "aggregate method for action 'rpcutil' is missing a function parameter"
     expanded: |-
         DDL files can declare aggregation rules for the data returned by actions as seen below:
-        
+
                  summarize do
                     aggregate summary(:collectives)
                  end
-        
+
         This error indicates that you did not supply the argument - :collectives in this example.
     pattern: "aggregate method for action '%{action}' is missing a function parameter"
-  PLMC26: 
+  PLMC26:
     expanded: |-
         Internally when MCollective parse the DDL it converts the aggregate functions into a hash with the function name and any arguments.
-        
+
         This error indicates that the internal translation failed, this is a critical error and would probably indicate a structure problem in your DDL or a bug in MCollective
     pattern: "Functions supplied to aggregate should be a hash"
-  PLMC27: 
+  PLMC27:
     expanded: |-
         DDL aggregate functions can take a custom format as in the example below:
-        
+
             aggregate average(:total_resources, :format => "Average: %d")
-        
+
         This error indicate that the :format above could not be correctly parsed.
     pattern: "Formats supplied to aggregation functions must have a :format key"
-  PLMC28: 
+  PLMC28:
     expanded: |-
         DDL aggregate functions can take a custom format as in the example below:
-        
+
             aggregate average(:total_resources, :format => "Average: %d")
-        
+
         This error indicate that the :format above was not supplied as a hash as in the above example
     pattern: "Formats supplied to aggregation functions should be a hash"
-  PLMC29: 
+  PLMC29:
     example: "Attempted to call action 'yum_clean' for 'package' but it's not declared in the DDL"
     expanded: |-
         Every agent has a DDL file that describes valid actions that they can perform
-        
+
         This error indicates you attempted to perform an action that does not exist.  Review the plugin documentation using 'mco plugin doc' for correct usage
     pattern: "Attempted to call action '%{action}' for '%{plugin}' but it's not declared in the DDL"
-  PLMC3: 
+  PLMC3:
     expanded: |-
         When sending the mcollectived process the USR2 signal on a Unix based machine this message indicates that the signal for received and the logging level is being adjusted to the next higher level or back down to debug if it was already at it's highest level.
-        
+
         This message will be followed by another message similar to the one below:
-        
+
             Logging level is now WARN
     pattern: "Cycling logging level due to USR2 signal"
-  PLMC30: 
+  PLMC30:
     example: "Action 'get_fact' needs a 'fact' argument"
     expanded: "Actions can declare that they expect a required input, this error indicates that you did not supply the required input"
     pattern: "Action '%{action}' needs a '%{key}' argument"
-  PLMC31: 
+  PLMC31:
     example: "No dataquery has been defined in the DDL for data plugin 'package'"
     expanded: |-
         Each data plugin requires a DDL that has a 'dataquery' block in it.
-        
+
             dataquery :description => "Agent Meta Data" do
                 .
                 .
             end
-        
+
         This error indicates that the DDL file for a specific data plugin did not contain this block.
     pattern: "No dataquery has been defined in the DDL for data plugin '%{plugin}'"
-  PLMC32: 
+  PLMC32:
     expanded: "Data plugins must return data.  The DDL files for a data plugin must declare at least one output parameter else you will see this error."
     pattern: "No output has been defined in the DDL for data plugin '%{plugin}'"
-  PLMC33: 
+  PLMC33:
     example: "No data plugin argument was declared in the 'puppet' DDL but an input was supplied"
     expanded: |-
         Data plugins can take an optional input argument.  This error indicate that you supplied an input argument but the plugin does not actually expect any input.
-        
+
         Review the documentation for the data plugin using 'mco plugin doc'
     pattern: "No data plugin argument was declared in the '%{plugin}' DDL but an input was supplied"
-  PLMC34: 
+  PLMC34:
     example: "setting meta data in agents have been deprecated, DDL files are now being used for this information. Please update the 'package' agent"
     expanded: |-
         In the past each MCollective agent had a metadata section containing information like the timeout.
-        
+
         As of 2.2.0 the agents will now consult the DDL files that ship with each agent for this purpose so the metadata in agents are not used at all.
-        
+
         In order to remove confusing duplication setting metadata in agents have been deprecated and from version 2.4.0 will not be supported at all.
-        
+
         Please update your agent by removing the metadata section from it and make sure the DDL file has the correct information instead.
     pattern: "setting meta data in agents have been deprecated, DDL files are now being used for this information. Please update the '%{agent}' agent"
-  PLMC35: 
+  PLMC35:
     expanded: |-
         The MCollective client can ask that the agent just performs the action and never respond.  Like when supplying the --no-results option to the 'mco rpc' application.
-        
+
         This log line indicates that the request was received and interpreted as such and no reply will be sent.  This does not indicate a problem generally it's just there to assist with debugging of problems.
     pattern: "Client did not request a response, surpressing reply"
-  PLMC36: 
+  PLMC36:
     example: "Unknown action 'png' for agent 'rpcutil'"
     expanded: |-
         Agents are made up of a number of named actions.  When the MCollective Server receives a request it double checks if the agent in question actually implements the logic for a specific action.
-        
-        When it cannot find the implementation this error will be raised.  This is an unusual situation since at this point on both the client and the server the DDL will already have been used to validate the request and the DDL would have indicated that the action is valid. 
-        
+
+        When it cannot find the implementation this error will be raised.  This is an unusual situation since at this point on both the client and the server the DDL will already have been used to validate the request and the DDL would have indicated that the action is valid.
+
         Check your agent code and make sure you have code like:
-        
+
             action "the_action" do
                 .
                 .
             end
     pattern: "Unknown action '%{action}' for agent '%{agent}'"
-  PLMC37: 
+  PLMC37:
     example: "Starting default activation checks for the 'rpcutil' agent"
     expanded: |-
         Each time the MCollective daemon starts it loads each agent from disk.  It then tries to determine if the agent should start on this node by using the activate_when method or per-agent configuration.
-        
+
         This is a debug statement that shows you it is about to start interacting with the logic in the agent to determine if it should be made available or not.
     pattern: "Starting default activation checks for the '%{agent}' agent"
-  PLMC38: 
+  PLMC38:
     example: "Found plugin configuration 'exim.activate_agent' with value 'y'"
     expanded: |-
         The administrator can choose that a certain agent that is deployed on this machine should not be made available to the network.
-        
+
         To do this you would add a configuration value like this example to the mcollective server.cfg:
-        
+
             plugin.exim.activate_agent = n
-        
+
         If this value is "1", "y" or "true" the agent will be activated else it will be disabled.
     pattern: "Found plugin configuration '%{agent}.activate_agent' with value '%{should_activate}'"
-  PLMC39: 
+  PLMC39:
     example: "Audit failed with an error, processing the request will continue."
     expanded: |-
         Every MCollective request can be audited.  In the event where the auditing fails the processing continues.
-        
+
         At present the failure handling is not configurable, in future the administrator might elect to not run unaudited requests via configuration.
-  PLMC4: 
+  PLMC4:
     example: "Failed to start registration plugin: ArgumentError: meta.rb:6:in `gsub': wrong number of arguments (0 for 2)"
     expanded: |
         Registration plugins are loaded into the MCollective daemon at startup and ran on a regular interval.
-        
+
         This message indicate that on first start this plugin failed to run, it will show the exception class, line and exception message to assist with debugging
     pattern: "Failed to start registration plugin: %{error}"
-  PLMC40: 
+  PLMC40:
     example: "Can't find DDL for agent plugin 'puppet'"
     expanded: |-
         MCollective plugins come with DDL files that describe their behaviours, versions, capabilities and requirements.
-        
+
         This error indicate that a DDL file for the plugin mentioned could not be found - it could be that you have a typing error in your command line or an installation error.
     pattern: "Can't find DDL for %{type} plugin '%{name}'"
-  PLMC5: 
+  PLMC41:
+    example: "Data plugin 'agent()' function does not return a 'foo' value"
+    expanded: |-
+        Data functions return a set of values which can be identified by name.
+
+        This message indicates that the specified value has not been defined in the Data plugin's DDL.
+    pattern: "Data plugin '%{functionname}()' does not return a '%{value}' value"
+  PLMC42:
+    example: "Cannot convert string value 'hello' into a boolean. "
+    expanded: |-
+        This error gets logged when there is an attempt to convert a string value into a boolean, but the string does not match the boolean pattern.
+
+        Strings that match "1", "y", "yes", "YES", "t", "true" and "TRUE" will be transformed into a boolean true.
+
+        Strings that match "0", "n", "no", "NO", "f", "false" and "FALSE" will be transformed into a boolean false.
+    pattern: "Cannot convert string value '%{value}' into a boolean. "
+  PLMC5:
     expanded: |-
         In previous versions of MCollective a application called 'controller' were included that had the ability to request agent reloads and other commands that would control the runner.
-        
+
         Unfortunately this method of controlling the daemon was never considered stable or reliable and has since been deprecate for removal during the 2.3.x development series
     pattern: "Received a control message, possibly via 'mco controller' but this has been deprecated"
-  PLMC6: 
+  PLMC6:
     expanded: |-
         When a specific MCollective daemon receives a message from a network it validates the filter before processing the message.  The filter is the list of classes, facts or other conditions that are associated with any message.
-        
+
         In the case where the filter does not match the specific host this line gets logged.
-        
+
         It's often the case for broadcast messages that all MCollective nodes will receive a message but only a subset of nodes are targetted using the filters, in that situation the nodes that received the request but should not respond to it will see this log line.
-        
+
         It does not indicate anything to be concerned about but if you find debugging a problem and expect a node to have responded when it shouldn't this log line will give you a hint that some condition specified in the filter did not match the local host
     pattern: "Message does not pass filters, ignoring"
-  PLMC7: 
+  PLMC7:
     example: "Exiting after signal: SignalException: runner.rb:6:in `run': Interrupt"
     expanded: |-
         When the MCollective daemon gets a signal from the Operating System that it does not specifically handle it will log this line before exiting.
-        
+
         You would see this whenever the daemon is stopped by init script or when sending it a kill signal, it will then proceed to disconnect from the middleware and exit its main loop
     pattern: "Exiting after signal: %{error}"
-  PLMC8: 
+  PLMC8:
     example: "Handling message for agent 'rpcutil' on collective 'eu_collective' with requestid 'a8a78d0ff555c931f045b6f448129846'"
     expanded: |-
         After receiving a message from the middleware, decoding it, validating it's security credentials and doing other checks on it the MCollective daemon will pass it off to the actual agent code for processing.
-        
+
         Prior to doing so it will log this line indicating the agent name and sub-collective and other information that will assist in correlating the message sent from the client with those in the server logs being processed.
     pattern: "Handling message for agent '%{agent}' on collective '%{collective} with requestid '%{requestid}'"
-  PLMC9: 
+  PLMC9:
     example: "Expired Message: message 8b4fe522f0d0541dabe83ec10b7fa446 from cert=client@node created at 1358840888 is 653 seconds old, TTL is 60"
     expanded: |-
         Requests sent from clients to servers all have a creation time and a maximum validity time called a TTL.
-        
+
         This message indicates that a message was received from the network but that it was determined to be too based on the TTL settings.
-        
+
         Usually this happens because your clocks are not in sync - something that can be fixed by rolling out a tool like ntp across your server estate.
-        
+
         It might also happen during very slow network conditions or when the TTL is set too low for your general network latency.
     pattern: "Expired Message: %{error}"
index 7e3d774c65ef4255a0af9ceb3b2df14ec1719439..efb84d2b52dbcdc0cbc6ffb3dfec16573e417fab 100644 (file)
@@ -67,7 +67,8 @@ module MCollective
       def logexception(msgid, level, e, backtrace=false, args={})
         return false unless config_and_check_level(level)
 
-        origin = File.basename(e.backtrace[1])
+        path, line, method = e.backtrace[1].split(/:(\d+)/)
+        origin = "%s:%s%s" % [File.basename(path), line, method]
 
         if e.is_a?(CodedError)
           msg = "%s: %s" % [e.code, e.to_s]
@@ -161,7 +162,13 @@ module MCollective
 
       # figures out the filename that called us
       def from
-        from = File.basename(caller[2])
+        path, line, method = execution_stack[3].split(/:(\d+)/)
+        "%s:%s%s" % [File.basename(path), line, method]
+      end
+
+      # this method is here to facilitate testing
+      def execution_stack
+        caller
       end
     end
   end
index d374776eb968ffc3454c2c4ed183e5d4b6093dbe..b4ea14167d8fd3906f6847d39f93518eac676d1f 100644 (file)
@@ -96,7 +96,12 @@ module MCollective
       result = Data.send(function_hash["name"], function_hash["params"])
 
       if function_hash["value"]
-        eval_result = result.send(function_hash["value"])
+        begin
+          eval_result = result.send(function_hash["value"])
+        rescue
+          # If data field has not been set we set the comparison result to nil
+          eval_result = nil
+        end
         return eval_result
       else
         return result
@@ -130,6 +135,9 @@ module MCollective
     def self.eval_compound_fstatement(function_hash)
       l_compare = execute_function(function_hash)
 
+      # Break out early and return false if the function returns nil
+      return false unless l_compare
+
       # Prevent unwanted discovery by limiting comparison operators
       # on Strings and Booleans
       if((l_compare.is_a?(String) || l_compare.is_a?(TrueClass) || l_compare.is_a?(FalseClass)) && function_hash["operator"].match(/<|>/))
index f9b5e56a99e4d86f705b74f1bfd4fc6b935b7968..2b31717357d239e0c437e32f3d961d793d9c0f04 100644 (file)
@@ -139,7 +139,7 @@ module MCollective
           @requestid = request.payload[:requestid]
           @payload = PluginManager["security_plugin"].encodereply(agent, payload, requestid, request.payload[:callerid])
         when :request, :direct_request
-          validate_compount_filter(@filter["compound"]) unless @filter["compound"].empty?
+          validate_compound_filter(@filter["compound"]) unless @filter["compound"].empty?
 
           @requestid = create_reqid unless @requestid
           @payload = PluginManager["security_plugin"].encoderequest(Config.instance.identity, payload, requestid, filter, agent, collective, ttl)
@@ -148,7 +148,7 @@ module MCollective
       end
     end
 
-    def validate_compount_filter(compound_filter)
+    def validate_compound_filter(compound_filter)
       compound_filter.each do |filter|
         filter.each do |statement|
           if statement["fstatement"]
@@ -156,11 +156,7 @@ module MCollective
             pluginname = Data.pluginname(functionname)
             value = statement["fstatement"]["value"]
 
-            begin
-              ddl = DDL.new(pluginname, :data)
-            rescue
-              raise DDLValidationError, "Could not find DDL for data plugin #{pluginname}, cannot use #{functionname}() in discovery"
-            end
+            ddl = DDL.new(pluginname, :data)
 
             # parses numbers and booleans entered as strings into proper
             # types of data so that DDL validation will pass
@@ -169,7 +165,7 @@ module MCollective
             Data.ddl_validate(ddl, statement["fstatement"]["params"])
 
             unless value && Data.ddl_has_output?(ddl, value)
-              raise DDLValidationError, "#{functionname}() does not return a #{value} value"
+              DDL.validation_fail!(:PLMC41, "Data plugin '%{functionname}()' does not return a '%{value}' value", :error, {:functionname => functionname, :value => value})
             end
           end
         end
@@ -215,21 +211,16 @@ module MCollective
 
     # publish a reply message by creating a target name and sending it
     def publish
-      Timeout.timeout(2) do
-        # If we've been specificaly told about hosts that were discovered
-        # use that information to do P2P calls if appropriate else just
-        # send it as is.
-        if @discovered_hosts && Config.instance.direct_addressing
-          if @discovered_hosts.size <= Config.instance.direct_addressing_threshold
-            self.type = :direct_request
-            Log.debug("Handling #{requestid} as a direct request")
-          end
-
-          PluginManager["connector_plugin"].publish(self)
-        else
-          PluginManager["connector_plugin"].publish(self)
-        end
+      # If we've been specificaly told about hosts that were discovered
+      # use that information to do P2P calls if appropriate else just
+      # send it as is.
+      config = Config.instance
+      if @discovered_hosts && config.direct_addressing && (@discovered_hosts.size <= config.direct_addressing_threshold)
+        self.type = :direct_request
+        Log.debug("Handling #{requestid} as a direct request")
       end
+
+      PluginManager['connector_plugin'].publish(self)
     end
 
     def create_reqid
index fdb02cc0af82d95ed3894f095315fdc7b8cb5ff6..85f32c0bbeff399184cac6d010af1f978c71f5a3 100644 (file)
@@ -167,7 +167,15 @@ module MCollective
         raise "Cannot read the discovery file #{v}" unless File.readable?(v)
 
         @options[:discovery_method] = "flatfile"
-        @options[:discovery_options] = v
+        @options[:discovery_options] << v
+      end
+
+      @parser.on("--publish_timeout TIMEOUT", Integer, "Timeout for publishing requests to remote agents.") do |pt|
+        @options[:publish_timeout] = pt
+      end
+
+      @parser.on("--threaded", "Start publishing requests and receiving responses in threaded mode.") do |v|
+        @options[:threaded] = true
       end
     end
 
index d0030908095f9c2c779a8710b5e0fd064c61c0f3..0870386f63f2544c57d83fb3ebfae2d7e917faad 100644 (file)
@@ -33,7 +33,7 @@ module MCollective
     end
 
     # Quietly calls a block if verbose parameter is false
-    def self.do_quietly?(verbose, &block)
+    def self.execute_verbosely(verbose, &block)
       unless verbose
         old_stdout = $stdout.clone
         $stdout.reopen(File.new("/dev/null", "w"))
@@ -51,7 +51,7 @@ module MCollective
     end
 
     # Checks if a build tool is present on the system
-    def self.build_tool?(build_tool)
+    def self.command_available?(build_tool)
       ENV["PATH"].split(File::PATH_SEPARATOR).each do |path|
         builder = File.join(path, build_tool)
         if File.exists?(builder)
@@ -62,7 +62,28 @@ module MCollective
     end
 
     def self.safe_system(*args)
-      raise RuntimeError, "Failed: #{args.join(' ')}" unless system *args
+      raise(RuntimeError, "Failed: #{args.join(' ')}") unless system *args
+    end
+
+    # Filter out platform specific dependencies
+    # Given a list of dependencies named -
+    # debian::foo
+    # redhat::bar
+    # PluginPackager.filter_dependencies('debian', dependencies)
+    # will return foo.
+    def self.filter_dependencies(prefix, dependencies)
+      dependencies.map do |dependency|
+        if dependency[:name] =~ /^(\w+)::(\w+)/
+          if prefix == $1
+            dependency[:name] = $2
+            dependency
+          else
+            nil
+          end
+        else
+          dependency
+        end
+      end.reject{ |dependency| dependency == nil }
     end
   end
 end
index d207a728858eda35b818d1389b382e5d39a30078..e5cec3eca615e7d701fbcb18b71e4964ae4379a9 100644 (file)
@@ -2,25 +2,25 @@ module MCollective
   module PluginPackager
     # MCollective Agent Plugin package
     class AgentDefinition
-      attr_accessor :path, :packagedata, :metadata, :target_path, :vendor, :iteration, :preinstall
+      attr_accessor :path, :packagedata, :metadata, :target_path, :vendor, :revision, :preinstall
       attr_accessor :plugintype, :dependencies, :postinstall, :mcname, :mcversion
 
-      def initialize(path, name, vendor, preinstall, postinstall, iteration, dependencies, mcdependency, plugintype)
+      def initialize(configuration, mcdependency, plugintype)
         @plugintype = plugintype
-        @path = path
+        @path = configuration[:target]
         @packagedata = {}
-        @iteration = iteration || 1
-        @preinstall = preinstall
-        @postinstall = postinstall
-        @vendor = vendor || "Puppet Labs"
-        @dependencies = dependencies || []
+        @revision = configuration[:revision] || 1
+        @preinstall = configuration[:preinstall]
+        @postinstall = configuration[:postinstall]
+        @vendor = configuration[:vendor] || "Puppet Labs"
+        @dependencies = configuration[:dependency] || []
         @target_path = File.expand_path(@path)
         @metadata, mcversion = PluginPackager.get_metadata(@path, "agent")
         @mcname = mcdependency[:mcname] ||  "mcollective"
         @mcversion = mcdependency[:mcversion] || mcversion
+        @metadata[:version] = (configuration[:version] || @metadata[:version])
         @dependencies << {:name => "#{@mcname}-common", :version => @mcversion}
-
-        @metadata[:name] = (name || @metadata[:name]).downcase.gsub(/\s+|_/, "-")
+        @metadata[:name] = (configuration[:pluginname] || @metadata[:name]).downcase.gsub(/\s+|_/, "-")
         identify_packages
       end
 
@@ -48,7 +48,7 @@ module MCollective
         else
           return nil
         end
-        agent[:plugindependency] = {:name => "#{@mcname}-#{@metadata[:name]}-common", :version => @metadata[:version], :iteration => @iteration}
+        agent[:plugindependency] = {:name => "#{@mcname}-#{@metadata[:name]}-common", :version => @metadata[:version], :revision => @revision}
         agent
       end
 
@@ -63,7 +63,7 @@ module MCollective
 
         client[:files] += Dir.glob(File.join(clientdir, "*")) if PluginPackager.check_dir_present clientdir
         client[:files] += Dir.glob(File.join(aggregatedir, "*")) if PluginPackager.check_dir_present aggregatedir
-        client[:plugindependency] = {:name => "#{@mcname}-#{@metadata[:name]}-common", :version => @metadata[:version], :iteration => @iteration}
+        client[:plugindependency] = {:name => "#{@mcname}-#{@metadata[:name]}-common", :version => @metadata[:version], :revision => @revision}
         client[:files].empty? ? nil : client
       end
 
index 6c389a1642a782a0d2e121162bfe434222f3d191..09a6464c19b9c979da5e0930301577e8b6cabb49 100644 (file)
@@ -1,25 +1,25 @@
 module MCollective
   module PluginPackager
     class StandardDefinition
-      attr_accessor :path, :packagedata, :metadata, :target_path, :vendor, :iteration
+      attr_accessor :path, :packagedata, :metadata, :target_path, :vendor, :revision
       attr_accessor :plugintype, :preinstall, :postinstall, :dependencies, :mcname, :mcversion
 
-      def initialize(path, name, vendor, preinstall, postinstall, iteration, dependencies, mcdependency, plugintype)
+      def initialize(configuration, mcdependency, plugintype)
         @plugintype = plugintype
-        @path = path
+        @path = configuration[:target]
         @packagedata = {}
-        @iteration = iteration || 1
-        @preinstall = preinstall
-        @postinstall = postinstall
-        @vendor = vendor || "Puppet Labs"
-        @dependencies = dependencies || []
+        @revision = configuration[:revision] || 1
+        @preinstall = configuration[:preinstall]
+        @postinstall = configuration[:postinstall]
+        @vendor = configuration[:vendor] || "Puppet Labs"
+        @dependencies = configuration[:dependency] || []
         @target_path = File.expand_path(@path)
         @metadata, mcversion = PluginPackager.get_metadata(@path, @plugintype)
-
         @mcname = mcdependency[:mcname] || "mcollective"
         @mcversion = mcdependency[:mcversion] || mcversion
         @dependencies << {:name => "#{mcname}-common", :version => @mcversion}
-        @metadata[:name] = (name || @metadata[:name]).downcase.gsub(/\s+|_/, "-")
+        @metadata[:name] = (configuration[:pluginname] || @metadata[:name]).downcase.gsub(/\s+|_/, "-")
+        @metadata[:version] = (configuration[:version] || @metadata[:version])
         identify_packages
       end
 
@@ -28,7 +28,7 @@ module MCollective
         common_package = common
         @packagedata[:common] = common_package if common_package
         plugin_package = plugin
-        @packagedata[@plugintype] = plugin_package if plugin_package
+        @packagedata[@plugintype.to_sym] = plugin_package if plugin_package
       end
 
       # Obtain standard plugin files and dependencies
@@ -46,7 +46,7 @@ module MCollective
 
         plugindata[:plugindependency] = {:name => "#{@mcname}-#{@metadata[:name]}-common",
                                       :version => @metadata[:version],
-                                      :iteration => @iteration} if @packagedata[:common]
+                                      :revision => @revision} if @packagedata[:common]
         plugindata
       end
 
index d2cf043d40c3bd5409440534842133b730b4b1ea..857cc76fc4d736b35b5aeabc2bfd149ba2b3aa9b 100644 (file)
@@ -67,7 +67,7 @@ module MCollective
 
         begin
           # Incoming requests need to be validated against the DDL thus reusing
-          # all the work users put into creating DDLs and creating a consistant
+          # all the work users put into creating DDLs and creating a consistent
           # quality of input validation everywhere with the a simple once off
           # investment of writing a DDL
           @request.validate!
@@ -144,17 +144,13 @@ module MCollective
 
         log_code(:PLMC37, "Starting default activation checks for the '%{agent}' agent", :debug, :agent => agent_name)
 
-        should_activate = Config.instance.pluginconf["#{agent_name}.activate_agent"]
+        should_activate = Util.str_to_bool(Config.instance.pluginconf.fetch("#{agent_name}.activate_agent", true))
 
-        if should_activate
+        unless should_activate
           log_code(:PLMC38, "Found plugin configuration '%{agent}.activate_agent' with value '%{should_activate}'", :debug, :agent => agent_name, :should_activate => should_activate)
-
-          unless should_activate =~ /^1|y|true$/
-            return false
-          end
         end
 
-        return true
+        return should_activate
       end
 
       # Returns an array of actions this agent support
index 21efd74d9ca196ba73ea9704a2c44480b1f78c15..9a5fa85f2d33e6b70845d2402097a496171ec6e8 100644 (file)
@@ -5,7 +5,7 @@ module MCollective
     class Client
       attr_accessor :timeout, :verbose, :filter, :config, :progress, :ttl, :reply_to
       attr_reader :client, :stats, :ddl, :agent, :limit_targets, :limit_method, :output_format, :batch_size, :batch_sleep_time, :batch_mode
-      attr_reader :discovery_options, :discovery_method, :limit_seed
+      attr_reader :discovery_options, :discovery_method, :default_discovery_method, :limit_seed
 
       @@initial_options = nil
 
@@ -57,7 +57,13 @@ module MCollective
         @output_format = initial_options[:output_format] || :console
         @force_direct_request = false
         @reply_to = initial_options[:reply_to]
-        @discovery_method = initial_options[:discovery_method] || Config.instance.default_discovery_method
+        @discovery_method = initial_options[:discovery_method]
+        if !@discovery_method
+          @discovery_method = Config.instance.default_discovery_method
+          @default_discovery_method = true
+        else
+          @default_discovery_method = false
+        end
         @discovery_options = initial_options[:discovery_options] || []
         @force_display_mode = initial_options[:force_display_mode] || false
 
@@ -71,6 +77,8 @@ module MCollective
 
         @collective = @client.collective
         @ttl = initial_options[:ttl] || Config.instance.ttl
+        @publish_timeout = initial_options[:publish_timeout] || Config.instance.publish_timeout
+        @threaded = initial_options[:threaded] || Config.instance.threaded
 
         # if we can find a DDL for the service override
         # the timeout of the client so we always magically
@@ -367,6 +375,7 @@ module MCollective
       # since that is the user supplied timeout either via initial options
       # or via specifically setting it on the client.
       def discovery_method=(method)
+        @default_discovery_method = false
         @discovery_method = method
 
         if @initial_options[:discovery_options]
@@ -387,7 +396,7 @@ module MCollective
 
       # Sets the class filter
       def class_filter(klass)
-        @filter["cf_class"] << klass
+        @filter["cf_class"] = @filter["cf_class"] | [klass]
         @filter["cf_class"].compact!
         reset
       end
@@ -399,10 +408,10 @@ module MCollective
 
         if value.nil?
           parsed = Util.parse_fact_string(fact)
-          @filter["fact"] << parsed unless parsed == false
+          @filter["fact"] = @filter["fact"] | [parsed] unless parsed == false
         else
           parsed = Util.parse_fact_string("#{fact}#{operator}#{value}")
-          @filter["fact"] << parsed unless parsed == false
+          @filter["fact"] = @filter["fact"] | [parsed] unless parsed == false
         end
 
         @filter["fact"].compact!
@@ -411,21 +420,21 @@ module MCollective
 
       # Sets the agent filter
       def agent_filter(agent)
-        @filter["agent"] << agent
+        @filter["agent"] = @filter["agent"] | [agent]
         @filter["agent"].compact!
         reset
       end
 
       # Sets the identity filter
       def identity_filter(identity)
-        @filter["identity"] << identity
+        @filter["identity"] = @filter["identity"] | [identity]
         @filter["identity"].compact!
         reset
       end
 
       # Set a compound filter
       def compound_filter(filter)
-        @filter["compound"] <<  Matcher.create_compound_callstack(filter)
+        @filter["compound"] = @filter["compound"] |  [Matcher.create_compound_callstack(filter)]
         reset
       end
 
@@ -491,24 +500,8 @@ module MCollective
             @discovered_agents = hosts
             @force_direct_request = true
 
-          # if an identity filter is supplied and it is all strings no regex we can use that
-          # as discovery data, technically the identity filter is then redundant if we are
-          # in direct addressing mode and we could empty it out but this use case should
-          # only really be for a few -I's on the CLI
-          #
-          # For safety we leave the filter in place for now, that way we can support this
-          # enhancement also in broadcast mode.
-          #
-          # This is only needed for the 'mc' discovery method, other methods might change
-          # the concept of identity to mean something else so we should pass the full
-          # identity filter to them
-          elsif options[:filter]["identity"].size > 0 && @discovery_method == "mc"
-            regex_filters = options[:filter]["identity"].select{|i| i.match("^\/")}.size
-
-            if regex_filters == 0
-              @discovered_agents = options[:filter]["identity"].clone
-              @force_direct_request = true if Config.instance.direct_addressing
-            end
+          else
+            identity_filter_discovery_optimization
           end
         end
 
@@ -571,7 +564,9 @@ module MCollective
          :discovery_method => @discovery_method,
          :discovery_options => @discovery_options,
          :force_display_mode => @force_display_mode,
-         :config => @config}
+         :config => @config,
+         :publish_timeout => @publish_timeout,
+         :threaded => @threaded}
       end
 
       # Sets the collective we are communicating with
@@ -715,6 +710,8 @@ module MCollective
       def fire_and_forget_request(action, args, filter=nil)
         validate_request(action, args)
 
+        identity_filter_discovery_optimization
+
         req = new_request(action.to_s, args)
 
         filter = options[:filter] unless filter
@@ -722,7 +719,34 @@ module MCollective
         message = Message.new(req, nil, {:agent => @agent, :type => :request, :collective => @collective, :filter => filter, :options => options})
         message.reply_to = @reply_to if @reply_to
 
-        return @client.sendreq(message, nil)
+        if @force_direct_request || @client.discoverer.force_direct_mode?
+          message.discovered_hosts = discover.clone
+          message.type = :direct_request
+        end
+
+        client.sendreq(message, nil)
+      end
+
+      # if an identity filter is supplied and it is all strings no regex we can use that
+      # as discovery data, technically the identity filter is then redundant if we are
+      # in direct addressing mode and we could empty it out but this use case should
+      # only really be for a few -I's on the CLI
+      #
+      # For safety we leave the filter in place for now, that way we can support this
+      # enhancement also in broadcast mode.
+      #
+      # This is only needed for the 'mc' discovery method, other methods might change
+      # the concept of identity to mean something else so we should pass the full
+      # identity filter to them
+      def identity_filter_discovery_optimization
+        if options[:filter]["identity"].size > 0 && @discovery_method == "mc"
+          regex_filters = options[:filter]["identity"].select{|i| i.match("^\/")}.size
+
+          if regex_filters == 0
+            @discovered_agents = options[:filter]["identity"].clone
+            @force_direct_request = true if Config.instance.direct_addressing
+          end
+        end
       end
 
       # Calls an agent in a way very similar to call_agent but it supports batching
index 574be55ef6c202a3dba6dcd9a13d22a478cfa334..0dc8b5a4dde22b7786e3f04793d284fcc8002ec9 100644 (file)
@@ -26,7 +26,9 @@ module MCollective
         interface = @ddl.action_interface(@action)
 
         interface[:output].keys.each do |output|
-          @data[output] = interface[:output][output][:default]
+          # must deep clone this data to avoid accidental updates of the DDL in cases where the
+          # default is for example a string and someone does << on it
+          @data[output] = Marshal.load(Marshal.dump(interface[:output][output].fetch(:default, nil)))
         end
       end
 
index 257fc4b5a951f8c0a6fd7342292bc1cc21183ffc..0f113d51976ba97c71ca7dd0ce3ba8f01d336725 100644 (file)
@@ -67,16 +67,20 @@ module MCollective
 
       opts["stdin"] = @stdin if @stdin
 
-      # Running waitpid on the cid here will start a thread
-      # with the waitpid in it, this way even if the thread
-      # that started this process gets killed due to agent
-      # timeout or such there will still be a waitpid waiting
-      # for the child to exit and not leave zombies.
+      # Check if the parent thread is alive. If it should die,
+      # and the process spawned by systemu is still alive,
+      # fire off a blocking waitpid and wait for the process to
+      # finish so that we can avoid zombies.
+      thread = Thread.current
       @status = systemu(@command, opts) do |cid|
         begin
-          sleep 1
-          Process::waitpid(cid)
+          while(thread.alive?)
+            sleep 0.1
+          end
+
+          Process.waitpid(cid) if Process.getpgid(cid)
         rescue SystemExit
+        rescue Errno::ESRCH
         rescue Errno::ECHILD
         rescue Exception => e
           Log.info("Unexpected exception received while waiting for child process: #{e.class}: #{e}")
index 9095cc330bf0369d9bb769c2a6ec7c8d028fd6af..707df666dd571642342bd79e134cdd84f0ddafb6 100644 (file)
@@ -1,6 +1,8 @@
 module MCollective
   # Some basic utility helper methods useful to clients, agents, runner etc.
   module Util
+    extend Translatable
+
     # Finds out if this MCollective has an agent by the name passed
     #
     # If the passed name starts with a / it's assumed to be regex
@@ -135,6 +137,12 @@ module MCollective
        "compound" => []}
     end
 
+    # Returns the PuppetLabs mcollective path for windows
+    def self.windows_prefix
+      require 'win32/dir'
+      prefix = File.join(Dir::COMMON_APPDATA, "PuppetLabs", "mcollective")
+    end
+
     # Picks a config file defaults to ~/.mcollective
     # else /etc/mcollective/client.cfg
     def self.config_file_for_user
@@ -145,10 +153,18 @@ module MCollective
         config = File.expand_path("~/.mcollective")
 
         unless File.readable?(config) && File.file?(config)
-          config = "/etc/mcollective/client.cfg"
+          if self.windows?
+            config = File.join(self.windows_prefix, "etc", "client.cfg")
+          else
+            config = "/etc/mcollective/client.cfg"
+          end
         end
       rescue Exception => e
-        config = "/etc/mcollective/client.cfg"
+        if self.windows?
+          config = File.join(self.windows_prefix, "etc", "client.cfg")
+        else
+          config = "/etc/mcollective/client.cfg"
+        end
       end
 
       return config
@@ -413,40 +429,41 @@ module MCollective
     # returns -1 if a < b
     # returns 1 if a > b
     #
-    # Code originally from Puppet but refactored to a more
-    # ruby style that fits in better with this code base
+    # Code originally from Puppet
     def self.versioncmp(version_a, version_b)
       vre = /[-.]|\d+|[^-.\d]+/
       ax = version_a.scan(vre)
       bx = version_b.scan(vre)
 
-      until ax.empty? || bx.empty?
+      while (ax.length>0 && bx.length>0)
         a = ax.shift
         b = bx.shift
 
-        next      if a == b
-        next      if a == '-' && b == '-'
-        return -1 if a == '-'
-        return 1  if b == '-'
-        next      if a == '.' && b == '.'
-        return -1 if a == '.'
-        return 1  if b == '.'
-
-        if a =~ /^[^0]\d+$/ && b =~ /^[^0]\d+$/
-          return Integer(a) <=> Integer(b)
+        if( a == b )                 then next
+        elsif (a == '-' && b == '-') then next
+        elsif (a == '-')             then return -1
+        elsif (b == '-')             then return 1
+        elsif (a == '.' && b == '.') then next
+        elsif (a == '.' )            then return -1
+        elsif (b == '.' )            then return 1
+        elsif (a =~ /^\d+$/ && b =~ /^\d+$/) then
+          if( a =~ /^0/ or b =~ /^0/ ) then
+            return a.to_s.upcase <=> b.to_s.upcase
+          end
+          return a.to_i <=> b.to_i
         else
           return a.upcase <=> b.upcase
         end
       end
 
-      version_a <=> version_b
+      version_a <=> version_b;
     end
 
     # we should really use Pathname#absolute? but it's not in all the
     # ruby versions we support and it comes down to roughly this
     def self.absolute_path?(path, separator=File::SEPARATOR, alt_separator=File::ALT_SEPARATOR)
       if alt_separator
-        path_matcher = /^[#{Regexp.quote alt_separator}#{Regexp.quote separator}]/
+        path_matcher = /^([a-zA-Z]:){0,1}[#{Regexp.quote alt_separator}#{Regexp.quote separator}]/
       else
         path_matcher = /^#{Regexp.quote separator}/
       end
@@ -454,6 +471,20 @@ module MCollective
       !!path.match(path_matcher)
     end
 
+    # Converts a string into a boolean value
+    # Strings matching 1,y,yes,true or t will return TrueClass
+    # Any other value will return FalseClass
+    def self.str_to_bool(val)
+      clean_val = val.to_s.strip
+      if clean_val =~ /^(1|yes|true|y|t)$/i
+        return  true
+      elsif clean_val =~ /^(0|no|false|n|f)$/i
+        return false
+      else
+        raise_code(:PLMC42, "Cannot convert string value '%{value}' into a boolean.", :error, :value => clean_val)
+      end
+    end
+
     # Looks up and interprolate the hash values into a i18n string
     def self.t(msgid, args={})
       if msgid.is_a?(Symbol)
@@ -462,5 +493,15 @@ module MCollective
         I18n.t(msgid, args)
       end
     end
+
+    # Looks up the template directory and returns its full path
+    def self.templatepath(template_file)
+      config_dir = File.dirname(Config.instance.configfile)
+      template_path = File.join(config_dir, template_file)
+      return template_path if File.exists?(template_path)
+
+      template_path = File.join("/etc/mcollective", template_file)
+      return template_path
+    end
   end
 end
index 3516730a61e4364bd8edab767000089b227f5488..0c504bcc9069205c0f6eb1bf94bbde897b5cd8c3 100644 (file)
@@ -12,14 +12,13 @@ module MCollective
     def service_main
       Log.debug("Starting Windows Service Daemon")
 
-      runner = Runner.new(nil)
-      runner.run
+      while running?
+        Runner.new(nil).run
+      end
     end
 
     def service_stop
       Log.info("Windows service stopping")
-      PluginManager["connector_plugin"].disconnect
-      exit! 0
     end
   end
 end
old mode 100644 (file)
new mode 100755 (executable)
index 6b02d0b..f599f4a
@@ -24,11 +24,11 @@ uid=`id -u`
 
 
 # PID directory
-pidfile="/var/run/mcollective.pid"
+pidfile="/var/run/mcollectived.pid"
 
 name="mcollective"
 mcollectived=/usr/sbin/mcollectived
-daemonopts="--config=/etc/mcollective/server.cfg"
+daemonopts="--pid=${pidfile}  --config=/etc/mcollective/server.cfg"
 
 
 # Source function library.
@@ -41,30 +41,22 @@ then
     exit 5
 fi
 
+# create pid file if it does not exist
+[ ! -f ${pidfile} ] && { touch ${pidfile} ; }
+
 # See how we were called.
 case "$1" in
     start)
         echo "Starting daemon: " $name
         # start the program
-       if [ -f $pidfile ]; then
-               if [ -f $(cat /proc/$(cat $pidfile)/exe > /dev/null) ] ; then
-                       echo MCollective appears to be running
-                       exit 1
-               else
-                       /sbin/start-stop-daemon --start -b --quiet --oknodo -m --pidfile $pidfile --exec $mcollectived -- $daemonopts
-               [ $? = 0 ] && { exit 0 ; } || { exit 1 ; }
-               fi
-       else
-               /sbin/start-stop-daemon --start -b --quiet --oknodo -m --pidfile $pidfile --exec $mcollectived -- $daemonopts
-       fi
+        start-stop-daemon -S -p ${pidfile} --oknodo -q -a ${mcollectived} -- ${daemonopts}
+        [ $? = 0 ] && { exit 0 ; } || { exit 1 ; }
         log_success_msg "mcollective started"
+        touch $lock
         ;;
     stop)
         echo "Stopping daemon: " $name
-        /sbin/start-stop-daemon --stop -q --pidfile $pidfile
-       if [ -f $pidfile ]; then
-               rm -f $pidfile
-       fi
+        start-stop-daemon -K -R 5 -s "TERM" --oknodo -q -p ${pidfile}
         [ $? = 0 ] && { exit 0 ; } || { exit 1 ; }
         log_success_msg "mcollective stopped"
         ;;
@@ -75,6 +67,14 @@ case "$1" in
         $0 start
         [ $? = 0 ] && { echo "mcollective restarted" ; exit 0 ; }
         ;;
+    condrestart)
+        if [ -f $lock ]; then
+            $0 stop
+            # avoid race
+            sleep 2
+            $0 start
+        fi
+        ;;
     status)
         status_of_proc -p ${pidfile} ${mcollectived} ${name} && exit 0 || exit $?
         ;;
index 140abf837915c8f0938d918724c1f29065622b32..1e6e9056d4baf5aa0cb508acfd0f8755f3c58d85 100644 (file)
@@ -78,6 +78,22 @@ action "get_fact", :description => "Retrieve a single fact from the fact store"
     end
 end
 
+action "get_facts", :description => "Retrieve multiple facts from the fact store" do
+     display :always
+
+     input :facts,
+           :prompt      => "Comma-separated list of facts",
+           :description => "Facts to retrieve",
+           :type        => :string,
+           :validation  => '^\s*[\w\.\-]+(\s*,\s*[\w\.\-]+)*$',
+           :optional    => false,
+           :maxlength   => 200
+
+     output :values,
+            :description => "List of values of the facts",
+            :display_as => "Values"
+end
+
 action "daemon_stats", :description => "Get statistics from the running daemon" do
     display :always
 
index 1c8c71e36d4caa5351c237196cba1ec0ecc1385e..0422286895435956eec66fdb1abcb2fe88bf1605 100644 (file)
@@ -21,6 +21,15 @@ module MCollective
       action "get_fact" do
         reply[:fact] = request[:fact]
         reply[:value] = Facts[request[:fact]]
+      end 
+
+      action "get_facts" do
+        response = {}
+        request[:facts].split(',').map { |x| x.strip }.each do |fact|
+          value = Facts[fact]
+          response[fact] = value
+        end
+        reply[:values] = response
       end
 
       # Get the global stats for this mcollectied
diff --git a/plugins/mcollective/aggregate/average.ddl b/plugins/mcollective/aggregate/average.ddl
new file mode 100644 (file)
index 0000000..4666886
--- /dev/null
@@ -0,0 +1,33 @@
+metadata  :name        => "average",
+          :description => "Displays the average of a set of numeric values",
+          :author      => "Pieter Loubser <pieter.loubser@puppetlabs.com>",
+          :license     => "ASL 2.0",
+          :version     => "1.0",
+          :url         => "http://projects.puppetlabs.com/projects/mcollective-plugins/wiki",
+          :timeout     => 5
+
+usage <<-USAGE
+
+  This aggregate plugin will determine te average of a set of numeric values.
+
+  DDL Example:
+
+    summarize do
+      aggregate average(:value)
+    end
+
+  Sample Output:
+
+    host1.example.com
+      Value: 10
+
+    host2.example.com
+      Value: 20
+
+
+   Summary of Value:
+
+      Average of Value: 15.000000
+
+USAGE
+
diff --git a/plugins/mcollective/aggregate/sum.ddl b/plugins/mcollective/aggregate/sum.ddl
new file mode 100644 (file)
index 0000000..f0626de
--- /dev/null
@@ -0,0 +1,33 @@
+metadata  :name        => "Sum",
+          :description => "Determine the total added value of a set of values",
+          :author      => "Pieter Loubser <pieter.loubser@puppetlabs.com>",
+          :license     => "ASL 2.0",
+          :version     => "1.0",
+          :url         => "http://projects.puppetlabs.com/projects/mcollective-plugins/wiki",
+          :timeout     => 5
+
+usage <<-USAGE
+
+  This aggregate plugin will determine the total added value of a set of values.
+
+  DDL Example:
+
+    summarize do
+      aggregate sum(:value)
+    end
+
+  Sample Output:
+
+    host1.example.com
+      Value: 10
+
+    host2.example.com
+      Value: 20
+
+
+   Summary of Value:
+
+      Sum of Value: 30
+
+USAGE
+
diff --git a/plugins/mcollective/aggregate/summary.ddl b/plugins/mcollective/aggregate/summary.ddl
new file mode 100644 (file)
index 0000000..90a6cd0
--- /dev/null
@@ -0,0 +1,33 @@
+metadata  :name        => "summary",
+          :description => "Displays the summary of a set of results",
+          :author      => "Pieter Loubser <pieter.loubser@puppetlabs.com>",
+          :license     => "ASL 2.0",
+          :version     => "1.0",
+          :url         => "http://projects.puppetlabs.com/projects/mcollective-plugins/wiki",
+          :timeout     => 5
+
+usage <<-USAGE
+
+  This aggregate plugin will display the summary of a set of results.
+
+  DDL Example:
+
+    summarize do
+      aggregate summary(:value)
+    end
+
+  Sample Output:
+
+    host1.example.com
+      Property: collectives
+          Value: ["mcollective", "uk_collective"]
+
+    Summary of Value:
+
+        mcollective = 25
+      uk_collective = 15
+      fr_collective = 9
+      us_collective = 1
+
+USAGE
+
index 07de85b9a996cffb61a0d130701afd6ca72a67d4..bb95c2887670888f7cd204bb9e1967c4da4c5c0b 100644 (file)
@@ -8,7 +8,7 @@ module MCollective
     end
 
     def msg_template
-      File.read(File.join(Config.instance.helptemplatedir, "msg-help.erb"))
+      File.read(Util.templatepath("msg-help.erb"))
     end
 
     def main
index c9afaaa4a978a07052916e22b281c1fc29e9d3a3..0a621c8e3a3a3ff71013b937a5d098d4d17d5af1 100644 (file)
@@ -17,105 +17,115 @@ mco plugin package [options] <directory>
            doc : Display documentation for a specific plugin.
     END_OF_USAGE
 
-    option  :pluginname,
-            :description => "Plugin name",
-            :arguments => ["-n", "--name NAME"],
-            :type => String
+    option :pluginname,
+           :description => 'Plugin name',
+           :arguments   => ['-n', '--name NAME'],
+           :type        => String
 
     option :postinstall,
-           :description => "Post install script",
-           :arguments => ["--postinstall POSTINSTALL"],
-           :type => String
+           :description => 'Post install script',
+           :arguments   => ['--postinstall POSTINSTALL'],
+           :type        => String
 
     option :preinstall,
-           :description => "Pre install script",
-           :arguments => ["--preinstall PREINSTALL"],
-           :type => String
+           :description => 'Pre install script',
+           :arguments   => ['--preinstall PREINSTALL'],
+           :type        => String
+
+    option :revision,
+           :description => 'Revision number',
+           :arguments   => ['--revision REVISION'],
+           :type        => String
 
     option :iteration,
-           :description => "Iteration number",
-           :arguments => ["--iteration ITERATION"],
-           :type => String
+           :description => 'DEPRECATED - Use --revision instead',
+           :arguments   => ['--iteration ITERATION'],
+           :type        => String
 
     option :vendor,
-           :description => "Vendor name",
-           :arguments => ["--vendor VENDOR"],
-           :type => String
+           :description => 'Vendor name',
+           :arguments   => ['--vendor VENDOR'],
+           :type        => String
 
     option :pluginpath,
-           :description => "MCollective plugin path",
-           :arguments => ["--pluginpath PATH"],
-           :type => String
+           :description => 'MCollective plugin path',
+           :arguments   => ['--pluginpath PATH'],
+           :type        => String
 
     option :mcname,
-           :description => "MCollective type (mcollective, pe-mcollective) that the packages depend on",
-           :arguments => ["--mcname NAME"],
-           :type => String
+           :description => 'MCollective type (mcollective, pe-mcollective) that the packages depend on',
+           :arguments   => ['--mcname NAME'],
+           :type        => String
 
     option :mcversion,
-           :description => "Version of MCollective that the packages depend on",
-           :arguments => "--mcversion MCVERSION",
-           :type => String
+           :description => 'Version of MCollective that the packages depend on',
+           :arguments   => ['--mcversion MCVERSION'],
+           :type        => String
 
     option :dependency,
-           :description => "Adds a dependency to the plugin",
-           :arguments => ["--dependency DEPENDENCIES"],
-           :type => :array
+           :description => 'Adds a dependency to the plugin',
+           :arguments   => ['--dependency DEPENDENCIES'],
+           :type        => :array
 
     option :format,
-           :description => "Package output format. Defaults to rpmpackage or debpackage",
-           :arguments => ["--format OUTPUTFORMAT"],
-           :type => String
+           :description => 'Package output format. Defaults to rpmpackage or debpackage',
+           :arguments   => ['--format OUTPUTFORMAT'],
+           :type        => String
 
     option :sign,
-           :description => "Embed a signature in the package",
-           :arguments => ["--sign"],
-           :type => :boolean
+           :description => 'Embed a signature in the package',
+           :arguments   => ['--sign'],
+           :type        => :boolean
 
     option :rpctemplate,
-           :description => "Template to use.",
-           :arguments => ["--template HELPTEMPLATE"],
-           :type => String
+           :description => 'Template to use.',
+           :arguments   => ['--template HELPTEMPLATE'],
+           :type        => String
 
     option :description,
-           :description => "Plugin description",
-           :arguments => ["--description DESCRIPTION"],
-           :type => String
+           :description => 'Plugin description',
+           :arguments   => ['--description DESCRIPTION'],
+           :type        => String
 
     option :author,
-           :description => "The author of the plugin",
-           :arguments => ["--author AUTHOR"],
-           :type => String
+           :description => 'The author of the plugin',
+           :arguments   => ['--author AUTHOR'],
+           :type        => String
 
     option :license,
-           :description => "The license under which the plugin is distributed",
-           :arguments => ["--license LICENSE"],
-           :type => String
+           :description => 'The license under which the plugin is distributed',
+           :arguments   => ['--license LICENSE'],
+           :type        => String
 
     option :version,
-           :description => "The version of the plugin",
-           :arguments => ["--pluginversion VERSION"],
-           :type => String
+           :description => 'The version of the plugin',
+           :arguments   => ['--pluginversion VERSION'],
+           :type        => String
 
     option :url,
-           :description => "Url at which information about the plugin can be found",
-           :arguments => ["--url URL"],
-           :type => String
+           :description => 'Url at which information about the plugin can be found',
+           :arguments   => ['--url URL'],
+           :type        => String
 
     option :timeout,
            :description => "The plugin's timeout",
-           :arguments => ["--timeout TIMEOUT"],
-           :type => Integer
+           :arguments   => ['--timeout TIMEOUT'],
+           :type        => Integer
 
     option :actions,
-           :description => "Actions to be generated for an Agent Plugin",
-           :arguments => ["--actions [ACTIONS]"],
-           :type => Array
+           :description => 'Actions to be generated for an Agent Plugin',
+           :arguments   => ['--actions [ACTIONS]'],
+           :type        => Array
 
     option :outputs,
-           :description => "Outputs to be generated for an Data Plugin",
-           :arguments => ["--outputs [OUTPUTS]"],
-           :type => Array
+           :description => 'Outputs to be generated for an Data Plugin',
+           :arguments   => ['--outputs [OUTPUTS]'],
+           :type        => Array
+
+    option :keep_artifacts,
+           :dsecription => "Don't remove artifacts after building packages",
+           :arguments   => ['--keep-artifacts'],
+           :type        => :boolean
 
     # Handle alternative format that optparser can't parse.
     def post_option_parser(configuration)
@@ -187,7 +197,7 @@ mco plugin package [options] <directory>
       plugin = prepare_plugin
       (configuration[:pluginpath] = configuration[:pluginpath] + "/") if (configuration[:pluginpath] && !configuration[:pluginpath].match(/^.*\/$/))
       packager = PluginPackager["#{configuration[:format].capitalize}Packager"]
-      packager.new(plugin, configuration[:pluginpath], configuration[:sign], options[:verbose]).create_packages
+      packager.new(plugin, configuration[:pluginpath], configuration[:sign], options[:verbose], configuration[:keep_artifacts]).create_packages
     end
 
     # Agents are just called 'agent' but newer plugin types are
@@ -201,11 +211,13 @@ mco plugin package [options] <directory>
           return ddl
         end
       end
+
+      return nil
     end
 
     # Show application list and plugin help
     def doc_command
-      known_plugin_types = [["Agents", :agent], ["Data Queries", :data], ["Discovery Methods", :discovery], ["Validator Plugins", :validator]]
+      known_plugin_types = [["Agents", :agent], ["Aggregate", :aggregate], ["Data Queries", :data], ["Discovery Methods", :discovery], ["Validator Plugins", :validator]]
 
       if configuration.include?(:target) && configuration[:target] != "."
         if configuration[:target] =~ /^(.+?)\/(.+)$/
@@ -223,12 +235,16 @@ mco plugin package [options] <directory>
             end
           end
 
-          abort "Could not find a plugin named %s in any supported plugin type" % configuration[:target] unless found_plugin_type
-
+          abort "Could not find a plugin named '%s' in any supported plugin type" % configuration[:target] unless found_plugin_type
           ddl = load_plugin_ddl(configuration[:target], found_plugin_type)
         end
 
-        puts ddl.help(configuration[:rpctemplate])
+        if ddl
+          puts ddl.help(configuration[:rpctemplate])
+        else
+          abort "Could not find a '%s' plugin named '%s'" % configuration[:target].split('/')
+        end
+
       else
         puts "Please specify a plugin. Available plugins are:"
         puts
@@ -263,18 +279,26 @@ mco plugin package [options] <directory>
 
     # Creates the correct package plugin object.
     def prepare_plugin
-        plugintype = set_plugin_type unless configuration[:plugintype]
-        configuration[:format] = "ospackage" unless configuration[:format]
-        PluginPackager.load_packagers
-        plugin_class = PluginPackager[configuration[:plugintype]]
-        configuration[:dependency] = configuration[:dependency][0].split(" ") if configuration[:dependency] && configuration[:dependency].size == 1
-        configuration[:dependency].map!{|dep| {:name => dep, :version => nil}} if configuration[:dependency]
-        mcdependency = {:mcname => configuration[:mcname], :mcversion => configuration[:mcversion]}
-
-        plugin_class.new(configuration[:target], configuration[:pluginname],
-                         configuration[:vendor], configuration[:preinstall],
-                         configuration[:postinstall], configuration[:iteration],
-                         configuration[:dependency], mcdependency , plugintype)
+      plugintype = set_plugin_type unless configuration[:plugintype]
+      configuration[:format] = "ospackage" unless configuration[:format]
+      PluginPackager.load_packagers
+      plugin_class = PluginPackager[configuration[:plugintype]]
+
+      if configuration[:dependency] && configuration[:dependency].size == 1
+        configuration[:dependency] = configuration[:dependency][0].split(" ")
+      elsif configuration[:dependency]
+        configuration[:dependency].map!{|dep| {:name => dep, :version => nil}}
+      end
+
+      mcdependency = {:mcname => configuration[:mcname], :mcversion => configuration[:mcversion]}
+
+      #Deprecation warning for --iteration
+      if configuration[:iteration]
+        puts 'Warning. The --iteration flag has been deprecated. Please use --revision instead.'
+        configuration[:revision] = configuration[:iteration] unless configuration[:revision]
+      end
+
+      plugin_class.new(configuration, mcdependency, plugintype)
     end
 
     def directory_for_type(type)
index 32d59f97264459ae05c97ef94a53a0deb292fd75..47d5665a123d38218daf5f3f6f0bf36a427297d8 100644 (file)
@@ -95,13 +95,18 @@ class MCollective::Application::Rpc<MCollective::Application
 
       puts "Request sent with id: " + mc.send(configuration[:action], configuration[:arguments])
     else
-      # if there's stuff on STDIN assume its JSON that came from another
-      # rpc or printrpc, we feed that in as discovery data
       discover_args = {:verbose => true}
-
-      unless STDIN.tty?
-        discovery_data = STDIN.read.chomp
-        discover_args = {:json => discovery_data} unless discovery_data == ""
+      # IF the discovery method hasn't been explicitly overridden
+      #  and we're not being run interactively,
+      #  and someone has piped us some data
+      # Then we assume it's a discovery list - this can be either:
+      #  - list of hosts in plaintext
+      #  - JSON that came from another rpc or printrpc
+      if mc.default_discovery_method && !STDIN.tty? && !STDIN.eof?
+          # Then we override discovery to try to grok the data on STDIN
+          mc.discovery_method = 'stdin'
+          mc.discovery_options = 'auto'
+          discover_args = {:verbose => false}
       end
 
       mc.discover discover_args
index eadeb17127d5b498142a296d5325007919530c5d..dee1654ebad301077aa3afaaaf00b4f25f37b3d1 100644 (file)
@@ -75,6 +75,23 @@ module MCollective
     #
     #     plugin.activemq.priority = 4
     #
+    # This plugin supports Stomp protocol 1.1 when combined with the stomp gem version
+    # 1.2.10 or newer.  To enable network heartbeats which will help keep the connection
+    # alive over NAT connections and aggresive session tracking firewalls you can set:
+    #
+    #     plugin.activemq.heartbeat_interval = 30
+    #
+    # which will cause a heartbeat to be sent on 30 second intervals and one to be expected
+    # from the broker every 30 seconds.  The shortest supported period is 30 seconds, if
+    # you set it lower it will get forced to 30 seconds.
+    #
+    # After 2 failures to receive a heartbeat the connection will be reset via the normal
+    # failover mechanism.
+    #
+    # By default if heartbeat_interval is set it will request Stomp 1.1 but support fallback
+    # to 1.0, but you can enable strict Stomp 1.1 only operation
+    #
+    #     plugin.activemq.stomp_1_0_fallback = 0
     class Activemq<Base
       attr_reader :connection
 
@@ -131,6 +148,29 @@ module MCollective
           Log.error("SSL session creation with #{stomp_url(params)} failed: #{params[:ssl_exception]}")
         end
 
+        # Stomp 1.1+ - heart beat read (receive) failed.
+        def on_hbread_fail(params, ticker_data)
+          Log.error("Heartbeat read failed from '%s': %s" % [stomp_url(params), ticker_data.inspect])
+        rescue Exception => e
+        end
+
+        # Stomp 1.1+ - heart beat send (transmit) failed.
+        def on_hbwrite_fail(params, ticker_data)
+          Log.error("Heartbeat write failed from '%s': %s" % [stomp_url(params), ticker_data.inspect])
+        rescue Exception => e
+        end
+
+        # Log heart beat fires
+        def on_hbfire(params, srind, curt)
+          case srind
+            when "receive_fire"
+              Log.debug("Received heartbeat from %s: %s, %s" % [stomp_url(params), srind, curt])
+            when "send_fire"
+              Log.debug("Publishing heartbeat to %s: %s, %s" % [stomp_url(params), srind, curt])
+          end
+        rescue Exception => e
+        end
+
         def stomp_url(params)
           "%s://%s@%s:%d" % [ params[:cur_ssl] ? "stomp+ssl" : "stomp", params[:cur_login], params[:cur_host], params[:cur_port]]
         end
@@ -151,7 +191,7 @@ module MCollective
         end
 
         begin
-          @base64 = get_bool_option("activemq.base64", false)
+          @base64 = get_bool_option("activemq.base64", "false")
           @msgpriority = get_option("activemq.priority", 0).to_i
 
           pools = @config.pluginconf["activemq.pool.size"].to_i
@@ -164,9 +204,9 @@ module MCollective
             host[:port] = get_option("activemq.pool.#{poolnum}.port", 61613).to_i
             host[:login] = get_env_or_option("STOMP_USER", "activemq.pool.#{poolnum}.user")
             host[:passcode] = get_env_or_option("STOMP_PASSWORD", "activemq.pool.#{poolnum}.password")
-            host[:ssl] = get_bool_option("activemq.pool.#{poolnum}.ssl", false)
+            host[:ssl] = get_bool_option("activemq.pool.#{poolnum}.ssl", "false")
 
-            host[:ssl] = ssl_parameters(poolnum, get_bool_option("activemq.pool.#{poolnum}.ssl.fallback", false)) if host[:ssl]
+            host[:ssl] = ssl_parameters(poolnum, get_bool_option("activemq.pool.#{poolnum}.ssl.fallback", "false")) if host[:ssl]
 
             Log.debug("Adding #{host[:host]}:#{host[:port]} to the connection pool")
             hosts << host
@@ -180,14 +220,17 @@ module MCollective
           # these can be guessed, the documentation isn't clear
           connection[:initial_reconnect_delay] = Float(get_option("activemq.initial_reconnect_delay", 0.01))
           connection[:max_reconnect_delay] = Float(get_option("activemq.max_reconnect_delay", 30.0))
-          connection[:use_exponential_back_off] = get_bool_option("activemq.use_exponential_back_off", true)
+          connection[:use_exponential_back_off] = get_bool_option("activemq.use_exponential_back_off", "true")
           connection[:back_off_multiplier] = Integer(get_option("activemq.back_off_multiplier", 2))
           connection[:max_reconnect_attempts] = Integer(get_option("activemq.max_reconnect_attempts", 0))
-          connection[:randomize] = get_bool_option("activemq.randomize", false)
-          connection[:backup] = get_bool_option("activemq.backup", false)
+          connection[:randomize] = get_bool_option("activemq.randomize", "false")
+          connection[:backup] = get_bool_option("activemq.backup", "false")
           connection[:timeout] = Integer(get_option("activemq.timeout", -1))
           connection[:connect_timeout] = Integer(get_option("activemq.connect_timeout", 30))
           connection[:reliable] = true
+          connection[:connect_headers] = connection_headers
+          connection[:max_hbrlck_fails] = Integer(get_option("activemq.max_hbrlck_fails", 2))
+          connection[:max_hbread_fails] = Integer(get_option("activemq.max_hbread_fails", 2))
 
           connection[:logger] = EventLogger.new
 
@@ -197,10 +240,47 @@ module MCollective
         end
       end
 
+      def stomp_version
+        ::Stomp::Version::STRING
+      end
+
+      def connection_headers
+        headers = {:"accept-version" => "1.0"}
+
+        heartbeat_interval = Integer(get_option("activemq.heartbeat_interval", 0))
+        stomp_1_0_fallback = get_bool_option("activemq.stomp_1_0_fallback", true)
+
+        headers[:host] = get_option("activemq.vhost", "mcollective")
+
+        if heartbeat_interval > 0
+          unless Util.versioncmp(stomp_version, "1.2.10") >= 0
+            raise("Setting STOMP 1.1 properties like heartbeat intervals require at least version 1.2.10 of the STOMP gem")
+          end
+
+          if heartbeat_interval < 30
+            Log.warn("Connection heartbeat is set to %d, forcing to minimum value of 30s")
+            heartbeat_interval = 30
+          end
+
+          heartbeat_interval = heartbeat_interval * 1000
+          headers[:"heart-beat"] = "%d,%d" % [heartbeat_interval + 500, heartbeat_interval - 500]
+
+          if stomp_1_0_fallback
+            headers[:"accept-version"] = "1.1,1.0"
+          else
+            headers[:"accept-version"] = "1.1"
+          end
+        else
+          Log.warn("Connecting without STOMP 1.1 heartbeats, if you are using ActiveMQ 5.8 or newer consider setting plugin.activemq.heartbeat_interval")
+        end
+
+        headers
+      end
+
       # Sets the SSL paramaters for a specific connection
       def ssl_parameters(poolnum, fallback)
-        params = {:cert_file => get_option("activemq.pool.#{poolnum}.ssl.cert", false),
-                  :key_file  => get_option("activemq.pool.#{poolnum}.ssl.key", false),
+        params = {:cert_file => get_cert_file(poolnum),
+                  :key_file => get_key_file(poolnum),
                   :ts_files  => get_option("activemq.pool.#{poolnum}.ssl.ca", false)}
 
         raise "cert, key and ca has to be supplied for verified SSL mode" unless params[:cert_file] && params[:key_file] && params[:ts_files]
@@ -228,6 +308,22 @@ module MCollective
         end
       end
 
+      # Returns the name of the private key file used by ActiveMQ
+      # Will first check if an environment variable MCOLLECTIVE_ACTIVEMQ_POOLX_SSL_KEY exists,
+      # where X is the ActiveMQ pool number.
+      # If the environment variable doesn't exist, it will try and load the value from the config.
+      def get_key_file(poolnum)
+        ENV["MCOLLECTIVE_ACTIVEMQ_POOL%s_SSL_KEY" % poolnum] || get_option("activemq.pool.#{poolnum}.ssl.key", false)
+      end
+
+      # Returns the name of the certficate file used by ActiveMQ
+      # Will first check if an environment variable MCOLLECTIVE_ACTIVEMQ_POOLX_SSL_CERT exists,
+      # where X is the ActiveMQ pool number.
+      # If the environment variable doesn't exist, it will try and load the value from the config.
+      def get_cert_file(poolnum)
+        ENV["MCOLLECTIVE_ACTIVEMQ_POOL%s_SSL_CERT" % poolnum] || get_option("activemq.pool.#{poolnum}.ssl.cert", false)
+      end
+
       # Receives a message from the ActiveMQ connection
       def receive
         Log.debug("Waiting for a message from ActiveMQ")
@@ -312,8 +408,15 @@ module MCollective
 
       def headers_for(msg, identity=nil)
         headers = {}
+
         headers = {"priority" => @msgpriority} if @msgpriority > 0
 
+        headers["timestamp"] = (Time.now.utc.to_i * 1000).to_s
+
+        # set the expires header based on the TTL, we build a small additional
+        # timeout of 10 seconds in here to allow for network latency etc
+        headers["expires"] = ((Time.now.utc.to_i + msg.ttl + 10) * 1000).to_s
+
         if [:request, :direct_request].include?(msg.type)
           target = make_target(msg.agent, :reply, msg.collective)
 
@@ -381,19 +484,9 @@ module MCollective
         raise("No plugin.#{opt} configuration option given")
       end
 
-      # gets a boolean option from the config, supports y/n/true/false/1/0
-      def get_bool_option(opt, default)
-        return default unless @config.pluginconf.include?(opt)
-
-        val = @config.pluginconf[opt]
-
-        if val =~ /^1|yes|true/
-          return true
-        elsif val =~ /^0|no|false/
-          return false
-        else
-          return default
-        end
+      # looks up a boolean value in the config
+      def get_bool_option(val, default)
+        Util.str_to_bool(@config.pluginconf.fetch(val, default))
       end
     end
   end
index f3e2dbe94abbcb17d96e144890cb56689f7f7313..f0d479e7a82c4fe75b1fcc05a96736a3ec2f858b 100644 (file)
@@ -45,6 +45,29 @@ module MCollective
           Log.error("SSL session creation with #{stomp_url(params)} failed: #{params[:ssl_exception]}")
         end
 
+        # Stomp 1.1+ - heart beat read (receive) failed.
+        def on_hbread_fail(params, ticker_data)
+          Log.error("Heartbeat read failed from '%s': %s" % [stomp_url(params), ticker_data.inspect])
+        rescue Exception => e
+        end
+
+        # Stomp 1.1+ - heart beat send (transmit) failed.
+        def on_hbwrite_fail(params, ticker_data)
+          Log.error("Heartbeat write failed from '%s': %s" % [stomp_url(params), ticker_data.inspect])
+        rescue Exception => e
+        end
+
+        # Log heart beat fires
+        def on_hbfire(params, srind, curt)
+          case srind
+            when "receive_fire"
+              Log.debug("Received heartbeat from %s: %s, %s" % [stomp_url(params), srind, curt])
+            when "send_fire"
+              Log.debug("Publishing heartbeat to %s: %s, %s" % [stomp_url(params), srind, curt])
+          end
+        rescue Exception => e
+        end
+
         def stomp_url(params)
           "%s://%s@%s:%d" % [ params[:cur_ssl] ? "stomp+ssl" : "stomp", params[:cur_login], params[:cur_host], params[:cur_port]]
         end
@@ -64,7 +87,7 @@ module MCollective
         end
 
         begin
-          @base64 = get_bool_option("rabbitmq.base64", false)
+          @base64 = get_bool_option("rabbitmq.base64", "false")
 
           pools = @config.pluginconf["rabbitmq.pool.size"].to_i
           hosts = []
@@ -76,9 +99,8 @@ module MCollective
             host[:port] = get_option("rabbitmq.pool.#{poolnum}.port", 61613).to_i
             host[:login] = get_env_or_option("STOMP_USER", "rabbitmq.pool.#{poolnum}.user")
             host[:passcode] = get_env_or_option("STOMP_PASSWORD", "rabbitmq.pool.#{poolnum}.password")
-            host[:ssl] = get_bool_option("rabbitmq.pool.#{poolnum}.ssl", false)
-
-            host[:ssl] = ssl_parameters(poolnum, get_bool_option("rabbitmq.pool.#{poolnum}.ssl.fallback", false)) if host[:ssl]
+            host[:ssl] = get_bool_option("rabbitmq.pool.#{poolnum}.ssl", "false")
+            host[:ssl] = ssl_parameters(poolnum, get_bool_option("rabbitmq.pool.#{poolnum}.ssl.fallback", "false")) if host[:ssl]
 
             Log.debug("Adding #{host[:host]}:#{host[:port]} to the connection pool")
             hosts << host
@@ -92,18 +114,19 @@ module MCollective
           # these can be guessed, the documentation isn't clear
           connection[:initial_reconnect_delay] = Float(get_option("rabbitmq.initial_reconnect_delay", 0.01))
           connection[:max_reconnect_delay] = Float(get_option("rabbitmq.max_reconnect_delay", 30.0))
-          connection[:use_exponential_back_off] = get_bool_option("rabbitmq.use_exponential_back_off", true)
+          connection[:use_exponential_back_off] = get_bool_option("rabbitmq.use_exponential_back_off", "true")
           connection[:back_off_multiplier] = Integer(get_option("rabbitmq.back_off_multiplier", 2))
           connection[:max_reconnect_attempts] = Integer(get_option("rabbitmq.max_reconnect_attempts", 0))
-          connection[:randomize] = get_bool_option("rabbitmq.randomize", false)
-          connection[:backup] = get_bool_option("rabbitmq.backup", false)
+          connection[:randomize] = get_bool_option("rabbitmq.randomize", "false")
+          connection[:backup] = get_bool_option("rabbitmq.backup", "false")
+
           connection[:timeout] = Integer(get_option("rabbitmq.timeout", -1))
           connection[:connect_timeout] = Integer(get_option("rabbitmq.connect_timeout", 30))
           connection[:reliable] = true
+          connection[:max_hbrlck_fails] = Integer(get_option("rabbitmq.max_hbrlck_fails", 2))
+          connection[:max_hbread_fails] = Integer(get_option("rabbitmq.max_hbread_fails", 2))
 
-          # RabbitMQ and Stomp supports vhosts, this sets it in a way compatible with RabbitMQ and
-          # force the version to 1.0, 1.1 support will be added in future
-          connection[:connect_headers] = {"accept-version" => '1.0', "host" => get_option("rabbitmq.vhost", "/")}
+          connection[:connect_headers] = connection_headers
 
           connection[:logger] = EventLogger.new
 
@@ -113,10 +136,47 @@ module MCollective
         end
       end
 
+      def connection_headers
+        headers = {:"accept-version" => "1.0"}
+
+        heartbeat_interval = Integer(get_option("rabbitmq.heartbeat_interval", 0))
+        stomp_1_0_fallback = get_bool_option("rabbitmq.stomp_1_0_fallback", true)
+
+        headers[:host] = get_option("rabbitmq.vhost", "/")
+
+        if heartbeat_interval > 0
+          unless Util.versioncmp(stomp_version, "1.2.10") >= 0
+            raise("Setting STOMP 1.1 properties like heartbeat intervals require at least version 1.2.10 of the STOMP gem")
+          end
+
+          if heartbeat_interval < 30
+            Log.warn("Connection heartbeat is set to %d, forcing to minimum value of 30s")
+            heartbeat_interval = 30
+          end
+
+          heartbeat_interval = heartbeat_interval * 1000
+          headers[:"heart-beat"] = "%d,%d" % [heartbeat_interval + 500, heartbeat_interval - 500]
+
+          if stomp_1_0_fallback
+            headers[:"accept-version"] = "1.1,1.0"
+          else
+            headers[:"accept-version"] = "1.1"
+          end
+        else
+          Log.warn("Connecting without STOMP 1.1 heartbeats, consider setting plugin.rabbitmq.heartbeat_interval")
+        end
+
+        headers
+      end
+
+      def stomp_version
+        ::Stomp::Version::STRING
+      end
+
       # Sets the SSL paramaters for a specific connection
       def ssl_parameters(poolnum, fallback)
-        params = {:cert_file => get_option("rabbitmq.pool.#{poolnum}.ssl.cert", false),
-                  :key_file  => get_option("rabbitmq.pool.#{poolnum}.ssl.key", false),
+        params = {:cert_file => get_cert_file(poolnum),
+                  :key_file  => get_key_file(poolnum),
                   :ts_files  => get_option("rabbitmq.pool.#{poolnum}.ssl.ca", false)}
 
         raise "cert, key and ca has to be supplied for verified SSL mode" unless params[:cert_file] && params[:key_file] && params[:ts_files]
@@ -144,6 +204,22 @@ module MCollective
         end
       end
 
+      # Returns the name of the private key file used by RabbitMQ
+      # Will first check if an environment variable MCOLLECTIVE_RABBITMQ_POOLX_SSL_KEY exists,
+      # where X is the RabbitMQ pool number.
+      # If the environment variable doesn't exist, it will try and load the value from the config.
+      def get_key_file(poolnum)
+        ENV["MCOLLECTIVE_RABBITMQ_POOL%s_SSL_KEY" % poolnum] || get_option("rabbitmq.pool.#{poolnum}.ssl.key", false)
+      end
+
+      # Returns the name of the certificate file used by RabbitMQ
+      # Will first check if an environment variable MCOLLECTIVE_RABBITMQ_POOLX_SSL_CERT exists,
+      # where X is the RabbitMQ pool number.
+      # If the environment variable doesn't exist, it will try and load the value from the config.
+      def get_cert_file(poolnum)
+        ENV["MCOLLECTIVE_RABBITMQ_POOL%s_SSL_CERT" % poolnum] || get_option("rabbitmq.pool.#{poolnum}.ssl.cert", false)
+      end
+
       # Receives a message from the RabbitMQ connection
       def receive
         Log.debug("Waiting for a message from RabbitMQ")
@@ -197,6 +273,10 @@ module MCollective
 
         end
 
+        # marks messages as valid for ttl + 10 seconds, we do this here
+        # rather than in make_target as this should only be set on publish
+        target[:headers]["expiration"] = ((msg.ttl + 10) * 1000).to_s
+
         return target
       end
 
@@ -206,9 +286,14 @@ module MCollective
 
         target = {:name => "", :headers => {}, :id => nil}
 
+        if get_bool_option("rabbitmq.use_reply_exchange", false)
+          reply_path = "/exchange/mcollective_reply/%s_%s" % [ @config.identity, $$ ]
+        else
+          reply_path = "/temp-queue/mcollective_reply_%s" % agent
+        end
         case type
           when :reply # receiving replies on a temp queue
-            target[:name] = "/temp-queue/mcollective_reply_%s" % agent
+            target[:name] = reply_path
             target[:id] = "mcollective_%s_replies" % agent
 
           when :broadcast, :request # publishing a request to all nodes with an agent
@@ -216,7 +301,7 @@ module MCollective
             if reply_to
               target[:headers]["reply-to"] = reply_to
             else
-              target[:headers]["reply-to"] = "/temp-queue/mcollective_reply_%s" % agent
+              target[:headers]["reply-to"] = reply_path
             end
             target[:id] = "%s_broadcast_%s" % [collective, agent]
 
@@ -224,11 +309,11 @@ module MCollective
             raise "Directed requests need to have a node identity" unless node
 
             target[:name] = "/exchange/%s_directed/%s" % [ collective, node]
-            target[:headers]["reply-to"] = "/temp-queue/mcollective_reply_%s" % agent
+            target[:headers]["reply-to"] = reply_path
 
           when :directed # subscribing to directed messages
             target[:name] = "/exchange/%s_directed/%s" % [ collective, @config.identity ]
-            target[:id] = "%s_directed_to_identity" % @config.identity
+            target[:id] = "%s_%s_directed_to_identity" % [ collective, @config.identity ]
         end
 
         target
@@ -289,19 +374,9 @@ module MCollective
         raise("No plugin.#{opt} configuration option given")
       end
 
-      # gets a boolean option from the config, supports y/n/true/false/1/0
-      def get_bool_option(opt, default)
-        return default unless @config.pluginconf.include?(opt)
-
-        val = @config.pluginconf[opt]
-
-        if val =~ /^1|yes|true/
-          return true
-        elsif val =~ /^0|no|false/
-          return false
-        else
-          return default
-        end
+      # looks up a boolean value in the config
+      def get_bool_option(val, default)
+        Util.str_to_bool(@config.pluginconf.fetch(val, default))
       end
     end
   end
index 7ce9db7b42dca6bdba8a83afe7e09c9b1c5afa0c..b183a2537c395fcce834aba0cf7c51d0c845bae9 100644 (file)
@@ -15,7 +15,11 @@ module MCollective
 
         discovered = []
 
-        hosts = File.readlines(file).map{|l| l.chomp}
+        hosts = File.readlines(file).map do |host|
+          host = host.chomp
+          raise 'Identities can only match /\w\.\-/' unless host.match(/^[\w\.\-]+$/)
+          host
+        end
 
         # this plugin only supports identity filters, do regex matches etc against
         # the list found in the flatfile
diff --git a/plugins/mcollective/discovery/stdin.ddl b/plugins/mcollective/discovery/stdin.ddl
new file mode 100644 (file)
index 0000000..a90dad7
--- /dev/null
@@ -0,0 +1,11 @@
+metadata    :name        => "stdin",
+            :description => "STDIN based discovery for node identities",
+            :author      => "Tomas Doran <bobtfish@bobtfish.net.net>",
+            :license     => "ASL 2.0",
+            :version     => "0.1",
+            :url         => "http://marionette-collective.org/",
+            :timeout     => 0
+
+discovery do
+    capabilities :identity
+end
diff --git a/plugins/mcollective/discovery/stdin.rb b/plugins/mcollective/discovery/stdin.rb
new file mode 100644 (file)
index 0000000..8a44ef9
--- /dev/null
@@ -0,0 +1,66 @@
+# discovers against stdin instead of the traditional network discovery
+# the input must be a flat file with a node name per line which should match identities as configured,
+# or it should be a json string as output by the -j option of mco rpc
+require 'mcollective/rpc/helpers'
+
+module MCollective
+  class Discovery
+    class Stdin
+      def self.discover(filter, timeout, limit=0, client=nil)
+        unless client.options[:discovery_options].empty?
+          type = client.options[:discovery_options].first.downcase
+        else
+          type = 'auto'
+        end
+
+        discovered = []
+
+        file = STDIN.read
+
+        if file =~ /^\s*$/
+              raise("data piped on STDIN contained only whitespace - could not discover hosts from it.")
+        end
+
+        if type == 'auto'
+          if file =~ /^\s*\[/
+            type = 'json'
+          else
+            type = 'text'
+          end
+        end
+
+        if type == 'json'
+          hosts = MCollective::RPC::Helpers.extract_hosts_from_json(file)
+        elsif type == 'text'
+          hosts = file.split("\n")
+        else
+          raise("stdin discovery plugin only knows the types auto/text/json, not \"#{type}\"")
+        end
+
+        hosts.map do |host|
+          raise 'Identities can only match /\w\.\-/' unless host.match(/^[\w\.\-]+$/)
+          host
+        end
+
+        # this plugin only supports identity filters, do regex matches etc against
+        # the list found in the flatfile
+        unless filter["identity"].empty?
+          filter["identity"].each do |identity|
+            identity = Regexp.new(identity.gsub("\/", "")) if identity.match("^/")
+
+            if identity.is_a?(Regexp)
+              discovered = hosts.grep(identity)
+            elsif hosts.include?(identity)
+              discovered << identity
+            end
+          end
+        else
+          discovered = hosts
+        end
+
+        discovered
+      end
+    end
+  end
+end
+
index d743ca6df23c808be62d7708a6c6e3e8cea71a40..fd680a4b2328385bb0709f7ea523d49e693c71f0 100644 (file)
 module MCollective
   module PluginPackager
     class DebpackagePackager
-
       require 'erb'
-      attr_accessor :plugin, :current_package, :tmpdir, :verbose, :libdir
-      attr_accessor :workingdir, :preinstall, :postinstall, :current_package_type
-      attr_accessor :current_package_data, :current_package_shortname
-      attr_accessor :current_package_fullname, :build_dir, :signature
-
-      def initialize(plugin, pluginpath = nil, signature = nil, verbose = false)
-        raise RuntimeError, "package 'debuild' is not installed" unless PluginPackager.build_tool?("debuild")
-        @plugin = plugin
-        @verbose = verbose
-        @libdir = pluginpath || "/usr/share/mcollective/plugins/mcollective/"
-        @signature = signature
-        @tmpdir = ""
-        @build_dir = ""
-        @targetdir = ""
+
+      def initialize(plugin, pluginpath = nil, signature = nil, verbose = false, keep_artifacts = nil)
+        if PluginPackager.command_available?('debuild')
+          @plugin = plugin
+          @verbose = verbose
+          @libdir = pluginpath || '/usr/share/mcollective/plugins/mcollective/'
+          @signature = signature
+          @package_name = "#{@plugin.mcname}-#{@plugin.metadata[:name]}"
+          @keep_artifacts = keep_artifacts
+        else
+          raise("Cannot build package. 'debuild' is not present on the system.")
+        end
       end
 
+      # Build process :
+      # - create buildroot
+      # - craete buildroot/debian
+      # - create the relative directories with package contents
+      # - create install files for each of the plugins that are going to be built
+      # - create debian build files
+      # - create tarball
+      # - create pre and post install files
+      # - run the build script
+      # - move packages to cwd
+      # - clean up
       def create_packages
-        @plugin.packagedata.each do |type, data|
-          begin
-            @tmpdir = Dir.mktmpdir("mcollective_packager")
-            @current_package_type = type
-            @current_package_data = data
-            @current_package_shortname = "#{@plugin.mcname}-#{@plugin.metadata[:name]}-#{@current_package_type}"
-            @current_package_fullname = "#{@plugin.mcname}-#{@plugin.metadata[:name]}-#{@current_package_type}" +
-                                        "_#{@plugin.metadata[:version]}-#{@plugin.iteration}"
-
-            @build_dir = File.join(@tmpdir, "#{@current_package_shortname}_#{@plugin.metadata[:version]}")
-            Dir.mkdir @build_dir
-
-            prepare_tmpdirs data
-            create_package
-            move_packages
-          rescue Exception => e
-            raise e
-          ensure
+        begin
+          puts "Building packages for #{@package_name} plugin."
+
+          @tmpdir = Dir.mktmpdir('mcollective_packager')
+          @build_dir = File.join(@tmpdir, "#{@package_name}_#{@plugin.metadata[:version]}")
+          Dir.mkdir(@build_dir)
+
+          create_debian_dir
+          @plugin.packagedata.each do |type, data|
+            prepare_tmpdirs(data)
+            create_install_file(type, data)
+            create_pre_and_post_install(type)
+          end
+          create_debian_files
+          create_tar
+          run_build
+          move_packages
+
+          puts "Completed building all packages for #{@package_name} plugin."
+        ensure
+          if @keep_artifacts
+            puts 'Keeping build artifacts.'
+            puts "Build artifacts saved - #{@tmpdir}"
+          else
+            puts 'Removing build artifacts.'
             cleanup_tmpdirs
           end
         end
       end
 
-      def create_package
-        begin
-          ["control", "Makefile", "compat", "rules", "copyright", "changelog"].each do |filename|
-            create_file(filename)
-          end
-          create_tar
-          create_install
-          create_preandpost_install
-
-          FileUtils.cd @build_dir do |f|
-            PluginPackager.do_quietly?(@verbose) do
-              if @signature
-                if @signature.is_a? String
-                  PluginPackager.safe_system "debuild -i -k#{@signature}"
-                else
-                  PluginPackager.safe_system "debuild -i"
-                end
+      private
+
+      def create_debian_files
+        ['control', 'Makefile', 'compat', 'rules', 'copyright', 'changelog'].each do |f|
+          create_file(f)
+        end
+      end
+
+      def run_build
+        FileUtils.cd(@build_dir) do
+          PluginPackager.execute_verbosely(@verbose) do
+            if @signature
+              if @signature.is_a?(String)
+                PluginPackager.safe_system("debuild --no-lintian -i -k#{@signature}")
               else
-                PluginPackager.safe_system "debuild -i -us -uc"
+                PluginPackager.safe_system("debuild --no-lintian -i")
               end
+            else
+              PluginPackager.safe_system("debuild --no-lintian -i -us -uc")
             end
           end
+        end
+      end
+
+      # Creates a string used by the control file to specify dependencies
+      # Dependencies can be formatted as :
+      # foo (>= x.x-x)
+      # foo (>= x.x)
+      # foo
+      def build_dependency_string(data)
+        dependencies = []
+        PluginPackager.filter_dependencies('debian', data[:dependencies]).each do |dep|
+          if dep[:version] && dep[:revision]
+            dependencies << "#{dep[:name]} (>=#{dep[:version]}-#{dep[:revision]})"
+          elsif dep[:version]
+            dependencies << "#{dep[:name]} (>=#{dep[:version]})"
+          else
+            dependencies << dep[:name]
+          end
+        end
 
-          puts "Created package #{@current_package_fullname}"
-        rescue Exception => e
-          raise RuntimeError, "Could not build package - #{e}"
+        if data[:plugindependency]
+          dependencies << "#{data[:plugindependency][:name]} (= ${binary:Version})"
+        end
+
+        dependencies.join(', ')
+      end
+
+      # Creates an install file for each of the packages that are going to be created
+      # for the plugin
+      def create_install_file(type, data)
+        install_file = "#{@package_name}-#{type}"
+        begin
+          install_file = File.join(@build_dir, 'debian', "#{install_file}.install")
+          File.open(install_file, 'w') do |file|
+            data[:files].each do |f|
+              extended_filename = File.join(@libdir, File.expand_path(f).gsub(/^#{@plugin.target_path}/, ''))
+              file.puts "#{extended_filename} #{File.dirname(extended_filename)}"
+            end
+          end
+        rescue Errno::EACCES => e
+          puts "Could not create install file '#{install_file}'. Permission denied"
+          raise e
+        rescue => e
+          puts "Could not create install file '#{install_file}'."
+          raise e
         end
       end
 
+      # Move source package and debs to cwd
       def move_packages
         begin
-          FileUtils.cp(Dir.glob(File.join(@tmpdir, "*.{deb,dsc,diff.gz,orig.tar.gz,changes}")), ".")
-        rescue Exception => e
-          raise RuntimeError, "Could not copy packages to working directory: '#{e}'"
+          files_to_copy = Dir.glob(File.join(@tmpdir, '*.{deb,dsc,diff.gz,orig.tar.gz,changes}'))
+          FileUtils.cp(files_to_copy, '.')
+        rescue => e
+          puts 'Could not copy packages to working directory.'
+          raise e
         end
       end
 
-      def create_preandpost_install
+      # Create pre and post install files in $buildroot/debian
+      # from supplied scripts.
+      # Note that all packages built for the plugin will invoke
+      # the same pre and post install scripts.
+      def create_pre_and_post_install(type)
         if @plugin.preinstall
-          raise RuntimeError, "pre-install script '#{@plugin.preinstall}' not found"  unless File.exists?(@plugin.preinstall)
-          FileUtils.cp(@plugin.preinstall, File.join(@build_dir, 'debian', "#{@current_package_shortname}.preinst"))
+          if !File.exists?(@plugin.preinstall)
+            puts "pre-install script '#{@plugin.preinstall}' not found."
+            raise(Errno::ENOENT, @plugin.preinstall)
+          else
+            FileUtils.cp(@plugin.preinstall, File.join(@build_dir, 'debian', "#{@package_name}-#{type}.preinst"))
+          end
         end
 
         if @plugin.postinstall
-          raise RuntimeError, "post-install script '#{@plugin.postinstall}' not found" unless File.exists?(@plugin.postinstall)
-          FileUtils.cp(@plugin.postinstall, File.join(@build_dir, 'debian', "#{@current_package_shortname}.postinst"))
-        end
-
-      end
-
-      def create_install
-        begin
-          File.open(File.join(@build_dir, "debian", "#{@current_package_shortname}.install"), "w") do |f|
-            @current_package_data[:files].each do |filename|
-              extended_filename = File.join(@libdir, File.expand_path(filename).gsub(/#{File.expand_path(plugin.path)}|\.\//, ''))
-              f.puts "#{extended_filename} #{File.dirname(extended_filename)}"
-            end
+          if !File.exists?(@plugin.postinstall)
+            puts "post-install script '#{@plugin.postinstall}' not found."
+            raise(Errno::ENOENT, @plugin.postinstall)
+          else
+            FileUtils.cp(@plugin.postinstall, File.join(@build_dir, 'debian', "#{@package_name}-#{type}.postinst"))
           end
-        rescue Exception => e
-          raise RuntimeError, "Could not create install file - #{e}"
         end
       end
 
+      # Tar up source
+      # Expects directory : $mcollective-$agent_$version
+      # Creates file : $buildroot/$mcollective-$agent_$version.orig.tar.gz
       def create_tar
+        name_and_version = "#{@package_name}_#{@plugin.metadata[:version]}"
+        tarfile = "#{name_and_version}.orig.tar.gz"
         begin
-          PluginPackager.do_quietly?(@verbose) do
+          PluginPackager.execute_verbosely(@verbose) do
             Dir.chdir(@tmpdir) do
-              PluginPackager.safe_system "tar -Pcvzf #{File.join(@tmpdir,"#{@current_package_shortname}_#{@plugin.metadata[:version]}.orig.tar.gz")} #{@current_package_shortname}_#{@plugin.metadata[:version]}"
+              PluginPackager.safe_system("tar -Pcvzf #{File.join(@tmpdir, tarfile)} #{name_and_version}")
             end
           end
         rescue Exception => e
-          raise "Could not create tarball - #{e}"
+          puts "Could not create tarball - #{tarfile}"
+          raise e
         end
       end
 
       def create_file(filename)
         begin
-          file = ERB.new(File.read(File.join(File.dirname(__FILE__), "templates", "debian", "#{filename}.erb")), nil, "-")
-          File.open(File.join(@build_dir, "debian", filename), "w") do |f|
+          file = ERB.new(File.read(File.join(File.dirname(__FILE__), 'templates', 'debian', "#{filename}.erb")), nil, '-')
+          File.open(File.join(@build_dir, 'debian', filename), 'w') do |f|
             f.puts file.result(binding)
           end
-        rescue Exception => e
-          raise RuntimeError, "could not create #{filename} file - #{e}"
+        rescue => e
+          puts "Could not create file - '#{filename}'"
+          raise e
         end
       end
 
+      # Move files contained in the plugin to the correct directory
+      # relative to the build root.
       def prepare_tmpdirs(data)
         data[:files].each do |file|
-          @targetdir = File.join(@build_dir, @libdir, File.dirname(File.expand_path(file)).gsub(@plugin.target_path, ""))
-          FileUtils.mkdir_p(@targetdir) unless File.directory? @targetdir
-          FileUtils.cp_r(file, @targetdir)
+          begin
+            targetdir = File.join(@build_dir, @libdir, File.dirname(File.expand_path(file)).gsub(/^#{@plugin.target_path}/, ""))
+            FileUtils.mkdir_p(targetdir) unless File.directory?(targetdir)
+            FileUtils.cp_r(file, targetdir)
+          rescue Errno::EACCES => e
+            puts "Could not create directory '#{targetdir}'. Permission denied"
+            raise e
+          rescue Errno::ENOENT => e
+            puts "Could not copy file '#{file}' to '#{targetdir}'. File does not exist"
+            raise e
+          rescue => e
+            puts 'Could not prepare build directory'
+            raise e
+          end
         end
+      end
 
-        FileUtils.mkdir_p(File.join(@build_dir, "debian"))
+      # Create the $buildroot/debian directory
+      def create_debian_dir
+        deb_dir = File.join(@build_dir, 'debian')
+        begin
+          FileUtils.mkdir_p(deb_dir)
+        rescue => e
+          puts "Could not create directory '#{deb_dir}'"
+          raise e
+        end
       end
 
       def cleanup_tmpdirs
-        FileUtils.rm_r @tmpdir if File.directory? @tmpdir
+        begin
+          FileUtils.rm_r(@tmpdir) if File.directory?(@tmpdir)
+        rescue => e
+          puts "Could not remove temporary build directory - '#{@tmpdir}'"
+          raise e
+        end
       end
     end
   end
index c5edc188b29000b849f6443f4e1ea7f02fcced66..7641198cbf812409aa99ed4531228240cd007174 100644 (file)
@@ -7,13 +7,13 @@ module MCollective
 
       # Create packager object with package parameter containing list of files,
       # dependencies and package metadata.
-      def initialize(package, pluginpath = nil, signature = nil, verbose = false)
+      def initialize(package, pluginpath = nil, signature = nil, verbose = false, keep_artifacts = false)
 
         if File.exists?("/etc/redhat-release")
-          @packager = PluginPackager["RpmpackagePackager"].new(package, pluginpath, signature, verbose)
+          @packager = PluginPackager["RpmpackagePackager"].new(package, pluginpath, signature, verbose, keep_artifacts)
           @package_type = "RPM"
         elsif File.exists?("/etc/debian_version")
-          @packager = PluginPackager["DebpackagePackager"].new(package, pluginpath, signature, verbose)
+          @packager = PluginPackager["DebpackagePackager"].new(package, pluginpath, signature, verbose, keep_artifacts)
           @package_type = "Deb"
         else
           raise "cannot identify operating system."
index bb6c62509e7ca79325b59d3cee5cba9fb33cf0d0..f91418ad1cae5922e46d2176fa7d28b3d1749e15 100644 (file)
@@ -1,27 +1,33 @@
 module MCollective
   module PluginPackager
     class RpmpackagePackager
-
       require 'erb'
-      attr_accessor :plugin, :tmpdir, :verbose, :libdir, :workingdir
-      attr_accessor :current_package_type, :current_package_data
-      attr_accessor :current_package_name, :signature
-
-      def initialize(plugin, pluginpath = nil, signature = nil, verbose = false)
-        if(PluginPackager.build_tool?("rpmbuild-md5"))
-          @buildtool = "rpmbuild-md5"
-        elsif(PluginPackager.build_tool?("rpmbuild"))
-          @buildtool = "rpmbuild"
+
+      def initialize(plugin, pluginpath = nil, signature = nil, verbose = false, keep_artifacts = nil)
+        if @buildtool = select_command
+          @plugin = plugin
+          @package_name = "#{@plugin.mcname}-#{@plugin.metadata[:name]}"
+          @package_name_and_version = "#{@package_name}-#{@plugin.metadata[:version]}"
+          @verbose = verbose
+          @libdir = pluginpath || '/usr/libexec/mcollective/mcollective/'
+          @signature = signature
+          @rpmdir = rpmdir
+          @srpmdir = srpmdir
+          @keep_artifacts = keep_artifacts
         else
-          raise RuntimeError, "creating rpms require 'rpmbuild' or 'rpmbuild-md5' to be installed"
+          raise("Cannot build package. 'rpmbuild' or 'rpmbuild-md5' is not present on the system")
         end
+      end
 
-        @plugin = plugin
-        @verbose = verbose
-        @libdir = pluginpath || "/usr/libexec/mcollective/mcollective/"
-        @signature = signature
-        @rpmdir = rpmdir
-        @srpmdir = srpmdir
+      # Determine the build tool present on the system
+      def select_command
+        if PluginPackager.command_available?('rpmbuild-md5')
+          return 'rpmbuild-md5'
+        elsif PluginPackager.command_available?('rpmbuild')
+          return 'rpmbuild'
+        else
+          return nil
+        end
       end
 
       def rpmdir
@@ -32,65 +38,141 @@ module MCollective
         `rpm --eval '%_srcrpmdir'`.chomp
       end
 
+      # Build Process :
+      # - create temporary buildroot
+      # - create the spec file
+      # - create the tarball
+      # - run the build script
+      # - move pacakges to cwd
+      # - clean up
       def create_packages
-        @plugin.packagedata.each do |type, data|
-          begin
-            @current_package_type = type
-            @current_package_data = data
-            @current_package_name = "#{@plugin.mcname}-#{@plugin.metadata[:name]}-#{@current_package_type}"
-            @tmpdir = Dir.mktmpdir("mcollective_packager")
-            prepare_tmpdirs data
-            create_package type, data
-          rescue Exception => e
-            raise e
-          ensure
+        begin
+          puts "Building packages for #{@package_name} plugin."
+
+          @tmpdir = Dir.mktmpdir('mcollective_packager')
+          prepare_tmpdirs
+
+          make_spec_file
+          run_build
+          move_packages
+
+          puts "Completed building all packages for #{@package_name} plugin."
+        ensure
+          if @keep_artifacts
+            puts 'Keeping build artifacts'
+            puts "Build artifacts saved - #{@tmpdir}"
+          else
             cleanup_tmpdirs
           end
         end
       end
 
-      def create_package(type, data)
+      private
+
+      def run_build
         begin
-          tarfile = "#{@current_package_name}-#{@plugin.metadata[:version]}.tgz"
-          make_spec_file
-          PluginPackager.do_quietly?(verbose) do
+          tarfile = create_tar
+          PluginPackager.execute_verbosely(@verbose) do
+            PluginPackager.safe_system("#{@buildtool} -ta#{" --quiet" unless @verbose}#{" --sign" if @signature} #{tarfile}")
+          end
+        rescue => e
+          puts 'Build process has failed'
+          raise e
+        end
+      end
+
+      # Tar up source
+      # Expects directory $mcollective-$agent-$version
+      # Creates file : $tmpbuildroot/$mcollective-$agent-$version
+      def create_tar
+        tarfile = File.join(@tmpdir, "#{@package_name_and_version}.tgz")
+        begin
+         PluginPackager.execute_verbosely(@verbose) do
             Dir.chdir(@tmpdir) do
-              PluginPackager.safe_system("tar -cvzf #{File.join(@tmpdir, tarfile)} #{@current_package_name}-#{@plugin.metadata[:version]}")
+              PluginPackager.safe_system("tar -cvzf #{tarfile} #{@package_name_and_version}")
             end
-
-            PluginPackager.safe_system("#{@buildtool} -ta #{"--quiet" unless verbose} #{"--sign" if @signature} #{File.join(@tmpdir, tarfile)}")
           end
+        rescue => e
+          puts "Could not create tarball - '#{tarfile}'"
+          raise e
+        end
+        tarfile
+      end
 
-          FileUtils.cp(File.join(@rpmdir, "noarch", "#{@current_package_name}-#{@plugin.metadata[:version]}-#{@plugin.iteration}.noarch.rpm"), ".")
-          FileUtils.cp(File.join(@srpmdir, "#{@current_package_name}-#{@plugin.metadata[:version]}-#{@plugin.iteration}.src.rpm"), ".")
-
-          puts "Created RPM and SRPM packages for #{@current_package_name}"
-        rescue Exception => e
-          raise RuntimeError, "Could not build package. Reason - #{e}"
+      # Move rpm's and srpm's to cwd
+      def move_packages
+        begin
+          files_to_copy = Dir.glob(File.join(@rpmdir, 'noarch', "#{@package_name}-*-#{@plugin.metadata[:version]}-#{@plugin.revision}.noarch.rpm"))
+          files_to_copy << File.join(@srpmdir, "#{@package_name}-#{@plugin.metadata[:version]}-#{@plugin.revision}.src.rpm")
+          FileUtils.cp(files_to_copy, '.')
+        rescue => e
+          puts 'Could not copy packages to working directory'
+          raise e
         end
       end
 
+      # Create the specfile and place as $tmpbuildroot/$mcollective-$agent-$version/$mcollective-$agent-$version.spec
       def make_spec_file
+        spec_file = File.join(@tmpdir, @package_name_and_version, "#{@package_name_and_version}.spec")
         begin
-          spec_template = ERB.new(File.read(File.join(File.dirname(__FILE__), "templates", "redhat", "rpm_spec.erb")), nil, "-")
-          File.open(File.join(@tmpdir, "#{@current_package_name}-#{@plugin.metadata[:version]}" ,"#{@current_package_name}-#{@plugin.metadata[:version]}.spec"), "w") do |f|
+          spec_template = ERB.new(File.read(File.join(File.dirname(__FILE__), 'templates', 'redhat', 'rpm_spec.erb')), nil, '-')
+          File.open(spec_file, 'w') do |f|
             f.puts spec_template.result(binding)
           end
-        rescue Exception => e
-          raise RuntimeError, "Could not create specfile - #{e}"
+        rescue => e
+          puts "Could not create specfile - '#{spec_file}'"
+          raise e
         end
       end
 
-      def prepare_tmpdirs(data)
-        data[:files].each do |file|
-          targetdir = File.join(@tmpdir, "#{@current_package_name}-#{@plugin.metadata[:version]}", @libdir, File.dirname(File.expand_path(file)).gsub(@plugin.target_path, ""))
-          FileUtils.mkdir_p(targetdir) unless File.directory? targetdir
-          FileUtils.cp_r(file, targetdir)
+      # Move files contained in the plugin to the correct directory
+      # relative to the build root.
+      def prepare_tmpdirs
+        plugin_files.each do |file|
+          begin
+            targetdir = File.join(@tmpdir, @package_name_and_version, @libdir, File.dirname(File.expand_path(file)).gsub(@plugin.target_path, ""))
+            FileUtils.mkdir_p(targetdir) unless File.directory?(targetdir)
+            FileUtils.cp_r(file, targetdir)
+          rescue Errno::EACCES => e
+            puts "Could not create directory '#{targetdir}'. Permission denied"
+            raise e
+          rescue Errno::ENOENT => e
+            puts "Could not copy file '#{file}' to '#{targetdir}'. File does not exist"
+            raise e
+          rescue => e
+            puts 'Could not prepare temporary build directory'
+            raise e
+          end
         end
       end
 
+      # Extract all the package files from the plugin's package data hash
+      def plugin_files
+        files = []
+        @plugin.packagedata.each do |name, data|
+          files += data[:files].reject{ |f| File.directory?(f) }
+        end
+        files
+      end
+
+      # Extract the package specific files from the file list and omits directories
+      def package_files(files)
+        package_files = []
+        files.each do |f|
+          if !File.directory?(f)
+            package_files << File.join(@libdir, File.expand_path(f).gsub(/#{@plugin.target_path}|\.\//, ''))
+          end
+        end
+        package_files
+      end
+
       def cleanup_tmpdirs
-        FileUtils.rm_r @tmpdir if File.directory? @tmpdir
+        begin
+          FileUtils.rm_r(@tmpdir) if File.directory?(@tmpdir)
+        rescue => e
+          puts "Could not remove temporary build directory - '#{@tmpdir}'"
+          raise e
+        end
       end
     end
   end
index 51ddc4f83ec107b9f0ef9bb226d8b2ed779ce598..dfce1d8e7586a770b8adc8e18ba1e9e57c70d24b 100644 (file)
@@ -1,5 +1,5 @@
-<%= @current_package_shortname -%> (<%= @plugin.metadata[:version]-%>-<%= @plugin.iteration-%>) unstable; urgency=low
+<%= @package_name -%> (<%= @plugin.metadata[:version]-%>-<%= @plugin.revision-%>) unstable; urgency=low
 
-    * Automated release for <%= @current_package_shortname-%> by mco plugin packager.
+  * Automated release for <%= @package_name -%> by mco plugin packager.
 
  -- The Marionette Collective <mcollective-dev@googlegroups.com>  <%= Time.new.strftime('%a, %d %b %Y %H:%M:%S %z') %>
index ed112e313210e6bb1ff7b7d1e93a19f55b310dc8..75f35fcdf6a6b6b00c9f35b78362ff0b37978da6 100644 (file)
@@ -1,27 +1,15 @@
-<%
-  @current_package_data[:dependencies].map! do |dep|
-      if dep[:version] && dep[:iteration]
-        dep[:name] + '(>=' + dep[:version] + '-' + dep[:iteration].to_s + ')'
-      elsif dep[:version]
-        dep[:name] + '(>=' + dep[:version] + ')'
-      else
-        dep[:name]
-      end
-    end
-
-  if @current_package_data[:plugindependency]
-    @current_package_data[:plugindependency] = "#{@current_package_data[:plugindependency][:name]} (= #{current_package_data[:plugindependency][:version]}-#{@current_package_data[:plugindependency][:iteration]})"
-    @current_package_data[:dependencies].push(@current_package_data[:plugindependency])
-  end
--%>
-Source: <%= @current_package_shortname %>
-Homepage: <%= @plugin.metadata[:url]%>
+Source: <%= @package_name %>
+Homepage: <%= @plugin.metadata[:url] %>
 Section: utils
 Priority: extra
+Build-Depends: debhelper (>= 7), cdbs, dpatch
 Maintainer: <%= @plugin.metadata[:author] %>
-Standards-Version: 3.8.0
-
-Package: <%= @current_package_shortname %>
+Standards-Version: 3.9.1
+<% @plugin.packagedata.each do |type, data| %>
+Package: <%= "#{@package_name}-#{type}" %>
 Architecture: all
-Depends: <%= @current_package_data[:dependencies].join(", ") %>
-Description: <%= @plugin.metadata[:description] %>
+Depends: <%= build_dependency_string(data) %>
+Description: <%= @plugin.metadata[:description]%>
+ <%= data[:description]%>
+ .
+<% end -%>
index 03520c90b5f9aef5fc6389a4d0b99637fc627a92..8d74eb19b58bf8ee2e61f947316127084b410720 100644 (file)
@@ -1,21 +1,15 @@
+Name: <%= @package_name %>
 Summary: <%= @plugin.metadata[:description] %>
-Name: <%= @current_package_name%>
 Version: <%= @plugin.metadata[:version] %>
-Release: <%= @plugin.iteration %>
-License: <%= @plugin.metadata[:license] %>
-URL: <%= @plugin.metadata[:url] %>
-Vendor: <%= @plugin.vendor %>
-Packager: <%= @plugin.metadata[:author] %>
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Release: <%= @plugin.revision %>
+License: <%= @plugin.metadata[:license]%>
+URL: <%= @plugin.metadata[:url]%>
+Vendor: <%= @plugin.vendor%>
+Packager: <%= @plugin.metadata[:author]%>
 BuildArch: noarch
 Group: System Tools
-Source0: <%= "#{@current_package_name}-#{@plugin.metadata[:version]}.tgz" %>
-<% @current_package_data[:dependencies].each do |dep|-%>
-Requires: <%= dep[:name] -%> <%= ">= #{dep[:version]}" if dep[:version]%><%="-#{dep[:iteration]}" if dep[:iteration]%>
-<% end -%>
-<% if @current_package_data[:plugindependency] %>
-Requires: <%= @current_package_data[:plugindependency][:name] -%> = <%= @current_package_data[:plugindependency][:version]%>-<%= @current_package_data[:plugindependency][:iteration]%>
-<% end %>
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Source0: <%= @package_name_and_version%>.tgz
 
 %description
 <%= @plugin.metadata[:description] %>
@@ -24,28 +18,36 @@ Requires: <%= @current_package_data[:plugindependency][:name] -%> = <%= @current
 %setup
 
 %build
+<% package_files = plugin_files.map{ |f| File.join(@libdir, File.expand_path(f).gsub(/#{File.expand_path(@plugin.path)}|\.\//, '')) } -%>
+<% dirs = package_files.map{ |f| File.dirname(f) }.uniq -%>
 
 %install
-<% @dirs = [] -%>
-<% @package_files = [] -%>
-<% @current_package_data[:files].each do |file| -%>
-<% @dirs << File.dirname(File.join(@libdir, File.expand_path(file).gsub(/#{File.expand_path(plugin.path)}|\.\//, ''))) -%>
-<% @package_files << File.join(@libdir, File.expand_path(file).gsub(/#{File.expand_path(plugin.path)}|\.\//, '')) -%>
-<% end -%>
 rm -rf %{buildroot}
-<% @dirs.uniq.each do |dir| -%>
+<% dirs.each do |dir| -%>
 %{__install} -d -m0755 %{buildroot}<%= dir%>
 <% end -%>
-<% @package_files -=  @dirs %>
-<% @package_files.each do |package_file| -%>
-%{__install} -m0644 <%= (package_file[0].chr == '/') ? package_file[1..package_file.size-1]: package_file%> %{buildroot}<%=package_file %>
+<% package_files.each do |file| -%>
+%{__install} -m0644 -v <%= (file[0].chr == '/') ? file[1..file.size-1]: file%> %{buildroot}<%=file %>
 <% end -%>
 
-%files
-%defattr(-,root,root,-)
-<% @package_files.each do |file| -%>
+<% @plugin.packagedata.each do |type, data| %>
+%package <%= type %>
+Summary: <%= @plugin.metadata[:description] %>
+<% if data[:plugindependency] %>
+Requires: <%= data[:plugindependency][:name] -%> = <%= data[:plugindependency][:version]%>-<%= data[:plugindependency][:revision]%>
+<% end -%>
+<% PluginPackager.filter_dependencies('redhat', data[:dependencies]).each do |dep|-%>
+Requires: <%= dep[:name] -%> <%= ">= #{dep[:version]}" if dep[:version]%><%="-#{dep[:revision]}" if dep[:revision]%>
+<% end -%>
+%description <%= type %>
+<%= data[:description] %>
+
+%files <%= type %>
+%defattr(-, root, root, -)
+<% package_files(data[:files]).each do |file| -%>
 <%= file %>
 <% end -%>
+<% end -%>
 
 <% if @plugin.preinstall -%>
 %pre
@@ -57,5 +59,5 @@ rm -rf %{buildroot}
 <% end -%>
 
 %changelog
-* <%= Time.now.strftime("%a %b %d %Y") -%> <%= @plugin.metadata[:author]%> - <%= @plugin.metadata[:version]%>-<%= @plugin.iteration%>
-- Built Package <%= @current_package_name-%>
+* <%= Time.now.strftime("%a %b %d %Y") -%> <%= @plugin.metadata[:author]%> - <%= @plugin.metadata[:version]%>-<%= @plugin.revision %>
+- Built Package <%= @plugin.metadata[:name] -%>
diff --git a/spec/Rakefile b/spec/Rakefile
deleted file mode 100644 (file)
index 5afe664..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-require File.join(File.dirname(__FILE__), "spec_helper.rb")
-require 'rake'
-require 'rspec/core/rake_task'
-
-desc "Run all specs"
-RSpec::Core::RakeTask.new(:all) do |t|
-    t.pattern = 'unit/**/*_spec.rb'
-
-    if MCollective::Util.windows?
-      t.rspec_opts = File.read("windows_spec.opts").chomp
-    else
-      t.rspec_opts = File.read("spec.opts").chomp
-    end
-end
-
-task :default => [:all]
diff --git a/spec/fixtures/application/test.rb b/spec/fixtures/application/test.rb
deleted file mode 100644 (file)
index 99772cb..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-module MCollective
-  class Application::Test < Application
-    def run
-      true
-    end
-  end
-end
diff --git a/spec/fixtures/test-cert.pem b/spec/fixtures/test-cert.pem
deleted file mode 100644 (file)
index 0e85e32..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
------BEGIN CERTIFICATE-----
-MIICRDCCAa2gAwIBAgIBAjANBgkqhkiG9w0BAQUFADAfMR0wGwYDVQQDDBRQdXBw
-ZXQgQ0E6IGRldmNvLm5ldDAeFw0xMjAzMzAyMTQ2NDRaFw0xNzAzMjkyMTQ2NDRa
-MA4xDDAKBgNVBAMMA2ZvbzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0X8t
-vvXk9Tmfhw5T87svZ1Oc2xORR1YbPTBCpNR3dvg2Pdurt16dLMXIGT5EeXkZy6cF
-MHG9pg/0ubCA7L/EdPI/Xq6n+O2kUUX8+ca0qwmj9/TwqxMSxVlKGr6SSqcCcHfi
-0hsDsHQaKyzAPbr69gbHhBzskd9bkh51Tyg96JECAwEAAaOBoDCBnTA4BglghkgB
-hvhCAQ0EKxYpUHVwcGV0IFJ1YnkvT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNh
-dGUwDAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQUjZoFfKlgsGXuldlQQPOnBNrX9oMw
-CwYDVR0PBAQDAgWgMCcGA1UdJQQgMB4GCCsGAQUFBwMBBggrBgEFBQcDAgYIKwYB
-BQUHAwQwDQYJKoZIhvcNAQEFBQADgYEApfZYKcYrMUtStJ0jjoZryn4ssghs8mkl
-C+njqTt/X8/7drqiSHB/0WXN0366QfVEgotxh0akhi2GJxs+eD/iCIRSL29hwDjL
-LpcsM/Rk0s8jG/XJDmS+BdY+wGOezasaCaqQlsU/Sjv8TQ+8D89OBfh+ZYW3gL9E
-JWp47gFO/RA=
------END CERTIFICATE-----
diff --git a/spec/fixtures/test-private.pem b/spec/fixtures/test-private.pem
deleted file mode 100644 (file)
index 1ec5535..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIICXQIBAAKBgQDMMGfwPZO8Xwn8XvrOy3Nc4nTkY/8lJrF3wvoGWdrcuQsNjYvZ
-O59PqXGxu/No5Lt5ymMd8orxR3bPRy2uobmZ2yXPP5mh48lZkMazGHPUeZkWOWbR
-7hgAvOVpNGp6NyR7D3PxZ96jzAbH8ttJVZAt/T2ImMJrzUG1Oj0/XO9fNQIDAQAB
-AoGALnA/41KN3ASdZ8lOL2P0C8bxINRhPdjL+dndNT6QWSy4h8+OY8x8kgiOdAaz
-+EI1JSDTZAc6dF91dPTSPepIJH5n+ueBDHFTGUnbxCw25+6X9CaLig52fNh7vs53
-sjtEvpju4Qe49FjnGe+UZ6jhd5b10pFtiuTVhMUTE77HqmECQQD4iSmj5/OVz3qk
-zrJ9Z8z6NjQFjklA1reHWhYal9k+475xOyLQz4yXk+pzq+9uYMo+LBIvDaY+mzDb
-I3Sp8/vJAkEA0lJKANLqkRsGqp2BITzFS3vpoYQxL13pghFfvQPkpD+JbHB0wI4a
-E1xv1kr/4bQ3aMEohJnaLbAf/O20nS3mDQJBAOwZ0Tbl+J7OlSHPQfykCTOBHnZQ
-rwIrd/na+LiWnEiELbx/gxl+sX6lg8oTAceHp1jcoQGWI+HBp+3lhsSVBRECQHz2
-jae9qcc7kpNu79lqvSLjZeYkoACvwN0aK5MnrAL3CVTX4FbEV7PnOT/O4ggdxspD
-8ioPK7X3rpneNnEpY0UCQQCM38gg75soJTS9W3BY04gLdjLd1h5rXe28bTgnwRM2
-Y2HMzPDtCWdjWvmpZMfAg+U4Rkr24Gbd1V3bq6OlJIeB
------END RSA PRIVATE KEY-----
diff --git a/spec/fixtures/test-public.pem b/spec/fixtures/test-public.pem
deleted file mode 100644 (file)
index e89c5e6..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
------BEGIN PUBLIC KEY-----
-MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMMGfwPZO8Xwn8XvrOy3Nc4nTk
-Y/8lJrF3wvoGWdrcuQsNjYvZO59PqXGxu/No5Lt5ymMd8orxR3bPRy2uobmZ2yXP
-P5mh48lZkMazGHPUeZkWOWbR7hgAvOVpNGp6NyR7D3PxZ96jzAbH8ttJVZAt/T2I
-mMJrzUG1Oj0/XO9fNQIDAQAB
------END PUBLIC KEY-----
diff --git a/spec/fixtures/util/1.in b/spec/fixtures/util/1.in
deleted file mode 100644 (file)
index b9df5a2..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-    This is a string This is a string This is a string This is a string This is a string This is a string This is a string
-    This is a string This is a string This is a string This is a string This is a string This is a string This is a string
-    This is a string This is a string This is a string This is a string This is a string This is a string This is a string
-
-        foo
-              bar
-
-    This is a string This is a string This is a string This is a string This is a string This is a string This is a string
-    This is a string This is a string This is a string This is a string This is a string This is a string This is a string
-    This is a string This is a string This is a string This is a string This is a string This is a string This is a string
diff --git a/spec/fixtures/util/1.out b/spec/fixtures/util/1.out
deleted file mode 100644 (file)
index 42bd8bc..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-         This is a string This is a string This is a string This is a string This is a string This is a string This is a string
-         This is a string This is a string This is a string This is a string This is a string This is a string This is a string
-         This is a string This is a string This is a string This is a string This is a string This is a string This is a string
-     
-             foo
-                   bar
-     
-         This is a string This is a string This is a string This is a string This is a string This is a string This is a string
-         This is a string This is a string This is a string This is a string This is a string This is a string This is a string
-         This is a string This is a string This is a string This is a string This is a string This is a string This is a string
diff --git a/spec/fixtures/util/2.in b/spec/fixtures/util/2.in
deleted file mode 100644 (file)
index 2764490..0000000
+++ /dev/null
@@ -1 +0,0 @@
-foooooooooooooooooooooooooooooooooooooooooooooooooooo
diff --git a/spec/fixtures/util/2.out b/spec/fixtures/util/2.out
deleted file mode 100644 (file)
index f5b7175..0000000
+++ /dev/null
@@ -1 +0,0 @@
-     foooooooooooooooooooooooooooooooooooooooooooooooooooo
diff --git a/spec/fixtures/util/3.in b/spec/fixtures/util/3.in
deleted file mode 100644 (file)
index cb0ab12..0000000
+++ /dev/null
@@ -1 +0,0 @@
-  Strings Strings Strings Strings Strings Strings
diff --git a/spec/fixtures/util/3.out b/spec/fixtures/util/3.out
deleted file mode 100644 (file)
index 58f28da..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-  Strings Strings Strings
-  Strings Strings Strings
diff --git a/spec/fixtures/util/4.in b/spec/fixtures/util/4.in
deleted file mode 100644 (file)
index 0335c7e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-this is usage text this is usage text this is usage text this is usage text this is usage text this is usage text this is usage text this is usage text this is usage text this is usage text this is usage text this is usage text
-
-      foo(bar)
-
-this is usage text this is usage text this is usage text this is usage text this is usage text this is usage text this is usage text this is usage text this is usage text this is usage text this is usage text this is usage text
diff --git a/spec/fixtures/util/4.out b/spec/fixtures/util/4.out
deleted file mode 100644 (file)
index c4f7013..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-   this is usage text this is usage text this is usage text this is usage text
-   this is usage text this is usage text this is usage text this is usage text
-   this is usage text this is usage text this is usage text this is usage text  
-   
-         foo(bar)
-   
-   this is usage text this is usage text this is usage text this is usage text
-   this is usage text this is usage text this is usage text this is usage text
-   this is usage text this is usage text this is usage text this is usage text
diff --git a/spec/matchers/exception_matchers.rb b/spec/matchers/exception_matchers.rb
deleted file mode 100644 (file)
index db05751..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-module MCollective
-  module Matchers
-    def raise_code(*args)
-      CodedExceptionMatcher.new(args)
-    end
-
-    class CodedExceptionMatcher
-      def initialize(args)
-        @args = args
-
-        raise "Need at least an exception to match" if args.size == 0
-
-        @expected_code = @args.shift
-        @expected_data = @args.shift
-
-        @failure_type = nil
-        @failure_expected = nil
-        @failure_got = nil
-      end
-
-      def matches?(actual)
-        begin
-          actual.call
-        rescue => e
-          unless e.is_a?(MCollective::CodedError)
-            @failure_type = :type
-            @failure_expected = "MCollective::CodedError"
-            @failure_got = e.class
-            return false
-          end
-
-          unless [e.code, e.default].include?(@expected_code)
-            @failure_type = :code
-            @failure_expected = @expected_code
-            @failure_got = e.code
-            return false
-          end
-
-          if @expected_data
-            unless e.args == @expected_data
-              @failure_type = :arguments
-              @failure_expected = @expected_data.inspect
-              @failure_got = e.args.inspect
-              return false
-            end
-          end
-        end
-
-        true
-      end
-
-      def failure_message
-        case @failure_type
-          when :type
-            "Expected an exception of type %s but got %s" % [@failure_expected, @failure_got]
-          when :code
-            "Expected a message code %s but got %s" % [@failure_expected, @failure_got]
-          when :arguments
-            "Expected arguments %s but got %s" % [@failure_expected, @failure_got]
-        end
-      end
-
-      def negative_failure_message
-        case @failure_type
-          when :type
-            "Expected an exception of type %s but got %s" % [@failure_got, @failure_expected]
-          when :code
-            "Expected a message code %s but got %s" % [@failure_got, @failure_expected]
-          when :arguments
-            "Expected arguments %s but got %s" % [@failure_got, @failure_expected]
-        end
-      end
-    end
-  end
-end
diff --git a/spec/monkey_patches/instance_variable_defined.rb b/spec/monkey_patches/instance_variable_defined.rb
deleted file mode 100644 (file)
index e090327..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-unless Object.respond_to?("instance_variable_defined?")
-  class Object
-    def instance_variable_defined?(meth)
-      instance_variables.include?(meth)
-    end
-  end
-end
diff --git a/spec/spec.opts b/spec/spec.opts
deleted file mode 100644 (file)
index fe2ea32..0000000
+++ /dev/null
@@ -1 +0,0 @@
---colour --backtrace
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
deleted file mode 100644 (file)
index 81193ab..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-dir = File.expand_path(File.dirname(__FILE__))
-$LOAD_PATH.unshift("#{dir}/")
-$LOAD_PATH.unshift("#{dir}/../lib")
-$LOAD_PATH.unshift("#{dir}/../plugins")
-
-require 'rubygems'
-
-gem 'mocha'
-
-require 'rspec'
-require 'mcollective'
-require 'rspec/mocks'
-require 'mocha'
-require 'ostruct'
-require 'tmpdir'
-require 'tempfile'
-require 'fileutils'
-
-require 'monkey_patches/instance_variable_defined'
-require 'matchers/exception_matchers'
-
-RSpec.configure do |config|
-  config.mock_with :mocha
-  config.include(MCollective::Matchers)
-
-  config.before :each do
-    MCollective::Config.instance.set_config_defaults("")
-    MCollective::PluginManager.clear
-    MCollective::Log.stubs(:log)
-    MCollective::Log.stubs(:logmsg)
-    MCollective::Log.stubs(:logexception)
-  end
-end
diff --git a/spec/unit/agents_spec.rb b/spec/unit/agents_spec.rb
deleted file mode 100755 (executable)
index ce01aad..0000000
+++ /dev/null
@@ -1,295 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe Agents do
-    before do
-      tmpfile = Tempfile.new("mc_agents_spec")
-      path = tmpfile.path
-      tmpfile.close!
-
-      @tmpdir = FileUtils.mkdir_p(path)
-      @tmpdir = @tmpdir[0] if @tmpdir.is_a?(Array) # ruby 1.9.2
-
-      @agentsdir = File.join([@tmpdir, "mcollective", "agent"])
-      FileUtils.mkdir_p(@agentsdir)
-
-      logger = mock
-      logger.stubs(:log)
-      logger.stubs(:start)
-      Log.configure(logger)
-    end
-
-    after do
-      FileUtils.rm_r(@tmpdir)
-    end
-
-    describe "#initialize" do
-      it "should fail if configuration has not been loaded" do
-        Config.instance.expects(:configured).returns(false)
-
-        expect {
-          Agents.new
-        }.to raise_error("Configuration has not been loaded, can't load agents")
-      end
-
-      it "should load agents" do
-        Config.instance.expects(:configured).returns(true)
-        Agents.any_instance.expects(:loadagents).once
-
-        Agents.new
-      end
-    end
-
-    describe "#clear!" do
-      it "should delete and unsubscribe all loaded agents" do
-        Config.instance.expects(:configured).returns(true).at_least_once
-        Config.instance.expects(:libdir).returns([@tmpdir])
-        PluginManager.expects(:delete).with("foo_agent").once
-        Util.expects(:make_subscriptions).with("foo", :broadcast).returns("foo_target")
-        Util.expects(:unsubscribe).with("foo_target")
-
-        a = Agents.new({"foo" => 1})
-      end
-    end
-
-    describe "#loadagents" do
-      before do
-        Config.instance.stubs(:configured).returns(true)
-        Config.instance.stubs(:libdir).returns([@tmpdir])
-        Agents.any_instance.stubs("clear!").returns(true)
-      end
-
-      it "should delete all existing agents" do
-        Agents.any_instance.expects("clear!").once
-        a = Agents.new
-      end
-
-      it "should attempt to load agents from all libdirs" do
-        Config.instance.expects(:libdir).returns(["/nonexisting", "/nonexisting"])
-        File.expects("directory?").with("/nonexisting/mcollective/agent").twice
-
-        a = Agents.new
-      end
-
-      it "should load found agents" do
-        Agents.any_instance.expects("loadagent").with("test").once
-
-        FileUtils.touch(File.join([@agentsdir, "test.rb"]))
-
-        a = Agents.new
-      end
-
-      it "should load each agent unless already loaded" do
-        Agents.any_instance.expects("loadagent").with("test").never
-
-        FileUtils.touch(File.join([@agentsdir, "test.rb"]))
-
-        PluginManager << {:type => "test_agent", :class => String.new}
-        a = Agents.new
-      end
-    end
-
-    describe "#loadagent" do
-      before do
-        FileUtils.touch(File.join([@agentsdir, "test.rb"]))
-        Config.instance.stubs(:configured).returns(true)
-        Config.instance.stubs(:libdir).returns([@tmpdir])
-        Agents.any_instance.stubs("clear!").returns(true)
-        PluginManager.stubs(:loadclass).returns(true)
-        PluginManager.stubs("[]").with("test_agent").returns(true)
-        Util.stubs(:make_subscriptions).with("test", :broadcast).returns([{:agent => "test", :type => :broadcast, :collective => "test"}])
-        Util.stubs(:subscribe).with([{:agent => "test", :type => :broadcast, :collective => "test"}]).returns(true)
-        Agents.stubs(:findagentfile).returns(File.join([@agentsdir, "test.rb"]))
-        Agents.any_instance.stubs("activate_agent?").returns(true)
-
-        @a = Agents.new
-      end
-
-      it "should return false if the agent file is missing" do
-        Agents.any_instance.expects(:findagentfile).returns(false).once
-        @a.loadagent("test").should == false
-      end
-
-      it "should delete the agent before loading again" do
-        PluginManager.expects(:delete).with("test_agent").twice
-        @a.loadagent("test")
-      end
-
-      it "should load the agent class from disk" do
-        PluginManager.expects(:loadclass).with("MCollective::Agent::Test")
-        @a.loadagent("test")
-      end
-
-      it "should check if the agent should be activated" do
-        Agents.any_instance.expects(:findagentfile).with("test").returns(File.join([@agentsdir, "test.rb"]))
-        Agents.any_instance.expects("activate_agent?").with("test").returns(true)
-        @a.loadagent("test").should == true
-      end
-
-      it "should set discovery and registration to be single instance plugins" do
-        PluginManager.expects("<<").with({:type => "registration_agent", :class => "MCollective::Agent::Registration", :single_instance => true}).once
-        PluginManager.expects("<<").with({:type => "discovery_agent", :class => "MCollective::Agent::Discovery", :single_instance => true}).once
-        Agents.any_instance.expects("activate_agent?").with("registration").returns(true)
-        Agents.any_instance.expects("activate_agent?").with("discovery").returns(true)
-
-        PluginManager.expects(:loadclass).with("MCollective::Agent::Registration").returns(true).once
-        PluginManager.expects(:loadclass).with("MCollective::Agent::Discovery").returns(true).once
-
-        FileUtils.touch(File.join([@agentsdir, "registration.rb"]))
-        FileUtils.touch(File.join([@agentsdir, "discovery.rb"]))
-
-        @a.loadagent("registration")
-        @a.loadagent("discovery")
-      end
-
-      it "should add general plugins as multiple instance plugins" do
-        PluginManager.expects("<<").with({:type => "test_agent", :class => "MCollective::Agent::Test", :single_instance => false}).once
-        @a.loadagent("test")
-      end
-
-      it "should add the agent to the plugin manager and subscribe" do
-        PluginManager.expects("<<").with({:type => "foo_agent", :class => "MCollective::Agent::Foo", :single_instance => false})
-        Util.stubs(:make_subscriptions).with("foo", :broadcast).returns([{:agent => "foo", :type => :broadcast, :collective => "test"}])
-        Util.expects("subscribe").with([{:type => :broadcast, :agent => 'foo', :collective => 'test'}]).returns(true)
-        Agents.any_instance.expects(:findagentfile).with("foo").returns(File.join([@agentsdir, "foo.rb"]))
-        FileUtils.touch(File.join([@agentsdir, "foo.rb"]))
-        Agents.any_instance.expects("activate_agent?").with("foo").returns(true)
-        PluginManager.stubs("[]").with("foo_agent").returns(true)
-
-        @a.loadagent("foo")
-      end
-
-      it "should check if an agent is loadable and remove it from the list if not" do
-        PluginManager.expects("<<").with({:type => "foo_agent", :class => "MCollective::Agent::Foo", :single_instance => false})
-        Agents.any_instance.expects(:findagentfile).with("foo").returns(File.join([@agentsdir, "foo.rb"]))
-        FileUtils.touch(File.join([@agentsdir, "foo.rb"]))
-        Agents.any_instance.expects("activate_agent?").with("foo").returns(true)
-        PluginManager.stubs("[]").with("foo_agent").raises("rspec")
-
-        Log.expects(:error).once.with("Loading agent foo failed: rspec")
-
-        @a.loadagent("foo").should == false
-        Agents.agentlist.include?("foo").should == false
-      end
-
-      it "should add the agent to the agent list" do
-        Agents.agentlist.should == ["test"]
-      end
-
-      it "should return true on success" do
-        @a.loadagent("test").should == true
-      end
-
-      it "should handle load exceptions" do
-        Agents.any_instance.expects(:findagentfile).with("foo").returns(File.join([@agentsdir, "foo.rb"]))
-        Log.expects(:error).with(regexp_matches(/Loading agent foo failed/))
-        @a.loadagent("foo").should == false
-      end
-
-      it "should delete plugins that failed to load" do
-        Agents.any_instance.expects(:findagentfile).with("foo").returns(File.join([@agentsdir, "foo.rb"]))
-        PluginManager.expects(:delete).with("foo_agent").twice
-
-        @a.loadagent("foo").should == false
-      end
-    end
-
-    describe "#class_for_agent" do
-      it "should return the correct class" do
-        Config.instance.stubs(:configured).returns(true)
-        Agents.any_instance.stubs(:loadagents).returns(true)
-        Agents.new.class_for_agent("foo").should == "MCollective::Agent::Foo"
-      end
-    end
-
-    describe "#activate_agent?" do
-      before do
-        Config.instance.stubs(:configured).returns(true)
-        Agents.any_instance.stubs(:loadagents).returns(true)
-        @a = Agents.new
-
-        module MCollective::Agent;end
-        class MCollective::Agent::Test; end
-      end
-
-      it "should check if the correct class has an activation method" do
-        Agent::Test.expects("respond_to?").with("activate?").once
-
-        @a.activate_agent?("test")
-      end
-
-      it "should call the activation method" do
-        Agent::Test.expects("activate?").returns(true).once
-        @a.activate_agent?("test")
-      end
-
-      it "should log a debug message and return true if the class has no activation method" do
-        Agent::Test.expects("respond_to?").with("activate?").returns(false).once
-        Log.expects(:debug).with("MCollective::Agent::Test does not have an activate? method, activating as default")
-
-        @a.activate_agent?("test").should == true
-      end
-
-      it "should handle exceptions in the activation as false" do
-        Agent::Test.expects("activate?").raises(RuntimeError)
-        @a.activate_agent?("test").should == false
-      end
-    end
-
-    describe "#findagentfile" do
-      before do
-        Config.instance.stubs(:configured).returns(true)
-        Config.instance.stubs(:libdir).returns([@tmpdir])
-        Agents.any_instance.stubs(:loadagents).returns(true)
-        @a = Agents.new
-      end
-
-      it "should support multiple libdirs" do
-        Config.instance.expects(:libdir).returns([@tmpdir, @tmpdir]).once
-        File.expects("exist?").returns(false).twice
-        @a.findagentfile("test")
-      end
-
-      it "should look for the correct filename in the libdir" do
-        File.expects("exist?").with(File.join([@tmpdir, "mcollective", "agent", "test.rb"])).returns(false).once
-        @a.findagentfile("test")
-      end
-
-      it "should return the full path if the agent is found" do
-        agentfile = File.join([@tmpdir, "mcollective", "agent", "test.rb"])
-        File.expects("exist?").with(agentfile).returns(true).once
-        @a.findagentfile("test").should == agentfile
-      end
-
-      it "should return false if no agent is found" do
-        @a.findagentfile("foo").should == false
-      end
-    end
-
-    describe "#include?" do
-      it "should correctly report the plugin state" do
-        Config.instance.stubs(:configured).returns(true)
-        Config.instance.stubs(:libdir).returns([@tmpdir])
-        Agents.any_instance.stubs(:loadagents).returns(true)
-        PluginManager.expects("include?").with("test_agent").returns(true)
-
-        @a = Agents.new
-
-        @a.include?("test").should == true
-      end
-    end
-
-    describe "#agentlist" do
-      it "should return the correct agent list" do
-        Config.instance.stubs(:configured).returns(true)
-        Config.instance.stubs(:libdir).returns([@tmpdir])
-        Agents.any_instance.stubs(:loadagents).returns(true)
-
-        @a = Agents.new("test" => true)
-        Agents.agentlist.should == ["test"]
-      end
-    end
-  end
-end
diff --git a/spec/unit/aggregate/base_spec.rb b/spec/unit/aggregate/base_spec.rb
deleted file mode 100644 (file)
index 29e0dcc..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  class Aggregate
-    describe Base do
-      describe "#initialize" do
-        it "should set the correct instance variables and call the startup hook" do
-          Base.any_instance.expects(:startup_hook).once
-          base = Base.new("value", [], "%s%s", "rspec")
-          base.name.should == "MCollective::Aggregate::Base"
-          base.output_name.should == "value"
-          base.aggregate_format.should == "%s%s"
-          base.action.should == "rspec"
-        end
-      end
-
-      describe "#startup_hook and #process_result" do
-        it "should raise an exception for an unimplemented startup_hook method " do
-          expect{
-            base = Base.new("value", [], "", "rspec")
-          }.to raise_error(RuntimeError, "'startup_hook' method of function class MCollective::Aggregate::Base has not yet been implemented")
-        end
-
-        it "should raise an exception for an unimplemented process_result method" do
-          Base.any_instance.stubs(:startup_hook)
-          base = Base.new("value", [], "", "rspec")
-          expect{
-            base.process_result
-          }.to raise_error(RuntimeError,"'process_result' method of function class MCollective::Aggregate::Base has not yet been implemented")
-        end
-      end
-
-      describe "summarize" do
-        it "should raise and exception if the result type has not been set" do
-          Base.any_instance.stubs(:startup_hook)
-          base = Base.new("value", [], "", "rspec")
-          expect{
-            base.summarize
-          }.to raise_error(RuntimeError, "Result type is not set while trying to summarize aggregate function results")
-        end
-
-        it "should return the correct result class if result type has been set" do
-          result_object = mock
-          result_object.stubs(:new)
-
-          Base.any_instance.stubs(:startup_hook)
-          base = Base.new("value", [], "", "rspec")
-          base.result[:type] = :result_type
-          base.expects(:result_class).with(:result_type).returns(result_object)
-          base.summarize
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/aggregate/result/base_spec.rb b/spec/unit/aggregate/result/base_spec.rb
deleted file mode 100644 (file)
index 9d05b93..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  class Aggregate
-    module Result
-      describe Base do
-        describe "#initialize" do
-          it "should raise an exception if neither the ddl or the aggregate function defines a format" do
-            expect{
-              base = Base.new(:structure, nil, :action)
-            }.to raise_error(RuntimeError, "No aggregate_format defined in ddl or aggregate function")
-          end
-        end
-
-        describe "#to_s" do
-          it "should raise an exception if the to_s method isn't implemented" do
-            base = Base.new(:structure, :aggregate_format, :action)
-            expect{
-              base.to_s
-            }.to raise_error(RuntimeError, "'to_s' method not implemented for result class 'MCollective::Aggregate::Result::Base'")
-          end
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/aggregate/result/collection_result_spec.rb b/spec/unit/aggregate/result/collection_result_spec.rb
deleted file mode 100644 (file)
index c13d540..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  class Aggregate
-    module Result
-      describe CollectionResult do
-        describe "#to_s" do
-         it "should return the correctly formatted string" do
-           result = CollectionResult.new({:output => [:test], :value => {"foo" => 3, "bar" => 2}}, "%s:%s", :action).to_s
-           result.should == "foo:3\nbar:2"
-         end
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/aggregate/result/numeric_result_spec.rb b/spec/unit/aggregate/result/numeric_result_spec.rb
deleted file mode 100644 (file)
index 4c92d91..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  class Aggregate
-    module Result
-      describe NumericResult do
-        describe "#to_s" do
-          it "should return empty string when no results were computed" do
-            NumericResult.new({}, "test %d", :action).to_s.should == ""
-          end
-
-          it "should return the correctly formatted string" do
-            num = NumericResult.new({:value => 1}, "test %d", :action).to_s
-            num.should == "test 1"
-          end
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/aggregate_spec.rb b/spec/unit/aggregate_spec.rb
deleted file mode 100644 (file)
index 633b8ad..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe Aggregate do
-    let(:ddl) do
-      {
-        :aggregate => [{:function => :func, :args=>[:foo, {:format => "%s"}]}],
-        :action => "test_action",
-        :output => {:foo => nil, :bar => nil}
-      }
-    end
-
-    describe '#create_functions' do
-      let(:function){mock}
-
-      it "should load all the functions with a format if defined" do
-        function.expects(:new).with(:foo, {}, "%s", 'test_action')
-        Aggregate.any_instance.expects(:contains_output?).returns(true)
-        Aggregate.any_instance.expects(:load_function).once.returns(function)
-        Aggregate.new(ddl)
-      end
-
-      it "should load all the functions without a format if it isn't defined" do
-        function.expects(:new).with(:foo, {}, nil, 'test_action')
-        Aggregate.any_instance.expects(:load_function).once.returns(function)
-        ddl[:aggregate].first[:args][1][:format] = nil
-        Aggregate.new(ddl)
-      end
-
-      it "should not summarize functions where the output is not specified in the ddl" do
-        invalid_ddl = { :aggregate => [{:function => :func, :args=>[:foo], :format => "%s"}, {:function => :func, :args=>[:fail], :format => "%s"}],
-                        :action => "test_action",
-                        :output => {:foo => nil, :bar => nil}}
-
-        function.stubs(:new).returns("function")
-        Aggregate.any_instance.stubs(:load_function).returns(function)
-
-        Log.expects(:error)
-        aggregate = Aggregate.new(invalid_ddl)
-        aggregate.functions.should == ["function"]
-        aggregate.failed.should == [{:type=>:create, :name=>:fail}]
-      end
-
-      it "should pass additional arguments if specified in the ddl" do
-        function.expects(:new).with(:foo, {:extra => "extra"}, "%s", 'test_action')
-        Aggregate.any_instance.expects(:load_function).once.returns(function)
-        ddl[:aggregate].first[:args][1][:extra] = "extra"
-        Aggregate.new(ddl)
-      end
-
-      it "should not summarize functions if the startup hook raises an exception" do
-        function.stubs(:new).raises("rspec")
-        Aggregate.any_instance.expects(:load_function).returns(function)
-
-        Log.expects(:error)
-        aggregate = Aggregate.new(ddl)
-        aggregate.failed.should == [{:type=>:startup, :name =>:foo }]
-      end
-    end
-
-    describe '#contains_ouput?' do
-      before :all do
-        Aggregate.any_instance.stubs(:create_functions)
-        @aggregate = Aggregate.new(ddl)
-      end
-
-      it "should return false if the ddl output does not include the function's input" do
-        result = @aggregate.contains_output?(:baz)
-        result.should == false
-      end
-
-      it "should return true if the ddl output includes the function's input" do
-        result = @aggregate.contains_output?(:foo)
-        result.should == true
-      end
-    end
-
-    describe '#call_functions' do
-      let(:aggregate){ Aggregate.new(ddl)}
-      let(:result){ RPC::Result.new("rspec", "rspec", :sender => "rspec", :statuscode => 0, :statusmsg => "rspec", :data => {:test => :result})}
-      let(:function) {mock}
-
-      before :each do
-        Aggregate.any_instance.stubs(:create_functions)
-      end
-
-      it "should call all of the functions" do
-        function.expects(:process_result).with(:result, result).once
-        function.expects(:output_name).returns(:test)
-        aggregate.functions = [function]
-
-        aggregate.call_functions(result)
-      end
-
-      it "should not fail if 'process_result' method raises an exception" do
-        aggregate.functions = [function]
-        function.stubs(:output_name).returns(:test)
-        function.stubs(:process_result).raises("Failed")
-
-        Log.expects(:error)
-        aggregate.call_functions(result)
-        aggregate.failed.should == [:name => :test, :type => :process_result]
-      end
-
-      it "should not fail if 'summarize' method raises en exception" do
-        function.stubs(:summarize).raises("Failed")
-        function.stubs(:output_name).returns("rspec")
-        aggregate.functions = [function]
-
-        Log.expects(:error)
-        result = aggregate.summarize
-      end
-    end
-
-    describe '#summarize' do
-      it "should return the ordered function results" do
-        Aggregate.any_instance.stubs(:create_functions)
-        aggregate = Aggregate.new(ddl)
-
-        func1 = mock
-        func1.expects(:summarize).returns(func1)
-        func1.stubs(:result).returns(:output => 5)
-
-        func2 = mock
-        func2.expects(:summarize).returns(func2)
-        func2.stubs(:result).returns(:output => 2)
-
-        aggregate.functions = [func1, func2]
-
-        result = aggregate.summarize
-        result.should == [func2, func1]
-      end
-
-      it "should not summarise data that raises an exception" do
-        Aggregate.any_instance.stubs(:create_functions)
-        aggregate = Aggregate.new(ddl)
-        func = mock
-        func.stubs(:summarize).raises("rspec")
-        func.stubs(:output_name).returns("rspec")
-        aggregate.functions = [func]
-        Log.expects(:error)
-
-        aggregate.summarize
-        aggregate.failed.should == [{:name => "rspec", :type => :summarize}]
-      end
-    end
-
-    describe '#load_function' do
-      before :all do
-        Aggregate.any_instance.stubs(:create_functions)
-        @aggregate = Aggregate.new(ddl)
-      end
-
-      it "should return a class object if it can be loaded" do
-        PluginManager.expects(:loadclass).with("MCollective::Aggregate::Test")
-        Aggregate.expects(:const_get).with("Test")
-        function = @aggregate.load_function("test")
-      end
-
-      it "should raise an exception if the class object cannot be loaded" do
-        PluginManager.expects(:loadclass).with("MCollective::Aggregate::Test")
-        expect {
-          function = @aggregate.load_function("test")
-        }.to raise_error("Aggregate function file 'test.rb' cannot be loaded")
-      end
-    end
-  end
-end
diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb
deleted file mode 100755 (executable)
index d2e64eb..0000000
+++ /dev/null
@@ -1,653 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe Application do
-    before do
-      Application.intialize_application_options
-      @argv_backup = ARGV.clone
-    end
-
-    describe "#application_options" do
-      it "should return the application options" do
-        Application.application_options.should == {:description          => nil,
-                                                   :usage                => [],
-                                                   :cli_arguments        => [],
-                                                   :exclude_arg_sections => []}
-      end
-    end
-
-    describe "#[]=" do
-      it "should set the application option" do
-        Application["foo"] = "bar"
-        Application.application_options["foo"].should == "bar"
-      end
-    end
-
-    describe "#[]" do
-      it "should set the application option" do
-        Application[:cli_arguments].should == []
-      end
-    end
-
-    describe "#intialize_application_options" do
-      it "should initialize application options correctly" do
-        Application.intialize_application_options.should == {:description          => nil,
-                                                             :usage                => [],
-                                                             :cli_arguments        => [],
-                                                             :exclude_arg_sections => []}
-      end
-    end
-
-    describe "#description" do
-      it "should set the description correctly" do
-        Application.description "meh"
-        Application[:description].should == "meh"
-      end
-    end
-
-    describe "#usage" do
-      it "should set the usage correctly" do
-        Application.usage "meh"
-        Application.usage "foo"
-
-        Application[:usage].should == ["meh", "foo"]
-      end
-    end
-
-    describe "#exclude_argument_sections" do
-      it "should set the excluded sections correctly" do
-        Application.exclude_argument_sections "common", "rpc", "filter"
-        Application[:exclude_arg_sections].should == ["common", "rpc", "filter"]
-        Application.exclude_argument_sections ["common", "rpc", "filter"]
-        Application[:exclude_arg_sections].should == ["common", "rpc", "filter"]
-      end
-
-      it "should detect unknown sections" do
-        expect { Application.exclude_argument_sections "rspec" }.to raise_error("Unknown CLI argument section rspec")
-      end
-    end
-
-    describe "#option" do
-      it "should add an option correctly" do
-        Application.option :test,
-                           :description => "description",
-                           :arguments => "--config CONFIG",
-                           :type => Integer,
-                           :required => true
-
-        args = Application[:cli_arguments].first
-        args.delete(:validate)
-
-        args.should == {:name=>:test,
-                        :arguments=>"--config CONFIG",
-                        :required=>true,
-                        :type=>Integer,
-                        :description=>"description"}
-      end
-
-      it "should set correct defaults" do
-        Application.option :test, {}
-
-        args = Application[:cli_arguments].first
-        args.delete(:validate)
-
-        args.should == {:name=>:test,
-                        :arguments=>[],
-                        :required=>false,
-                        :type=>String,
-                        :description=>nil}
-      end
-    end
-
-    describe "#validate_option" do
-      it "should pass validations" do
-        a = Application.new
-        a.validate_option(Proc.new {|v| v == 1}, "key", 1)
-      end
-
-      it "should print an error to STDERR on error" do
-        IO.any_instance.expects(:puts).with("Validation of key failed: failed").at_least_once
-        Application.any_instance.stubs("exit").returns(true)
-
-        a = Application.new
-        a.validate_option(Proc.new {|v| "failed"}, "key", 1)
-      end
-
-      it "should exit on valdation error" do
-        IO.any_instance.expects(:puts).at_least_once
-        Application.any_instance.stubs("exit").returns(true)
-
-        a = Application.new
-        a.validate_option(Proc.new {|v| "failed"}, "key", 1)
-      end
-    end
-
-    describe "#application_parse_options" do
-      it "should pass the requested help value to the clioptions method" do
-        ARGV.clear
-
-        app = Application.new
-        app.expects(:clioptions).with(true)
-        app.application_parse_options(true)
-
-        ARGV.clear
-        @argv_backup.each{|a| ARGV << a}
-      end
-
-      it "should support creating arrays of values" do
-        Application.any_instance.stubs("main").returns(true)
-
-        Application.option :foo,
-                           :description => "meh",
-                           :arguments => "--foo [FOO]",
-                           :type => :array
-
-        ARGV.clear
-        ARGV << "--foo=bar" << "--foo=baz"
-
-        a = Application.new
-        a.run
-        a.configuration.should == {:foo=>["bar", "baz"]}
-
-        ARGV.clear
-        @argv_backup.each{|a| ARGV << a}
-      end
-
-      it "should support boolean options" do
-        Application.any_instance.stubs("main").returns(true)
-
-        Application.option :foo,
-                           :description => "meh",
-                           :arguments => "--foo",
-                           :type => :boolean
-
-        ARGV.clear
-        ARGV << "--foo"
-
-        a = Application.new
-        a.run
-        a.configuration.should == {:foo=>true}
-
-        ARGV.clear
-        @argv_backup.each{|a| ARGV << a}
-      end
-
-      it "should support unsetting boolean options" do
-        Application.any_instance.stubs("main").returns(true)
-
-        Application.option :foo,
-                           :description => "meh",
-                           :arguments => "--[no-]foo",
-                           :type => :boolean
-
-        ARGV.clear
-        ARGV << "--no-foo"
-
-        a = Application.new
-        a.run
-        a.configuration.should == {:foo=>false}
-
-        ARGV.clear
-        @argv_backup.each{|a| ARGV << a}
-      end
-
-      it "should set the application description as head" do
-        OptionParser.any_instance.stubs(:define_head).with("meh")
-
-        ARGV.clear
-
-        Application.description "meh"
-        Application.new.application_parse_options
-
-        ARGV.clear
-        @argv_backup.each{|a| ARGV << a}
-      end
-
-      it "should set the application usage as a banner" do
-        OptionParser.any_instance.stubs(:banner).with("meh")
-
-        ARGV.clear
-
-        Application.usage "meh"
-        Application.new.application_parse_options
-
-        ARGV.clear
-        @argv_backup.each{|a| ARGV << a}
-      end
-
-      it "should support validation" do
-        IO.any_instance.expects(:puts).with("Validation of foo failed: failed").at_least_once
-        Application.any_instance.stubs("exit").returns(true)
-        Application.any_instance.stubs("main").returns(true)
-
-        Application.option :foo,
-                           :description => "meh",
-                           :required => true,
-                           :default => "meh",
-                           :arguments => "--foo [FOO]",
-                           :validate => Proc.new {|v| "failed"}
-
-        ARGV.clear
-        ARGV << "--foo=bar"
-
-        a = Application.new
-        a.run
-
-        ARGV.clear
-        @argv_backup.each{|a| ARGV << a}
-      end
-
-      it "should support default values" do
-        Application.any_instance.stubs("main").returns(true)
-
-        Application.option :foo,
-                           :description => "meh",
-                           :required => true,
-                           :default => "meh",
-                           :arguments => "--foo [FOO]"
-
-        a = Application.new
-        a.run
-        a.configuration.should == {:foo => "meh"}
-      end
-
-      it "should enforce required options" do
-        Application.any_instance.stubs("exit").returns(true)
-        Application.any_instance.stubs("main").returns(true)
-        OptionParser.any_instance.stubs("parse!").returns(true)
-        IO.any_instance.expects(:puts).with(anything).at_least_once
-        IO.any_instance.expects(:puts).with("The foo option is mandatory").at_least_once
-
-        ARGV.clear
-        ARGV << "--foo=bar"
-
-        Application.option :foo,
-                           :description => "meh",
-                           :required => true,
-                           :arguments => "--foo [FOO]"
-
-        Application.new.run
-
-        ARGV.clear
-        @argv_backup.each{|a| ARGV << a}
-      end
-
-      it "should call post_option_parser" do
-        OptionParser.any_instance.stubs("parse!").returns(true)
-        Application.any_instance.stubs("post_option_parser").returns(true).at_least_once
-        Application.any_instance.stubs("main").returns(true)
-
-        ARGV.clear
-        ARGV << "--foo=bar"
-
-        Application.option :foo,
-                           :description => "meh",
-                           :arguments => "--foo [FOO]"
-
-        Application.new.run
-
-        ARGV.clear
-        @argv_backup.each{|a| ARGV << a}
-      end
-
-      it "should create an application option" do
-        OptionParser.any_instance.stubs("parse!").returns(true)
-        OptionParser.any_instance.expects(:on).with(anything, anything, anything, anything).at_least_once
-        OptionParser.any_instance.expects(:on).with('--foo [FOO]', String, 'meh').at_least_once
-        Application.any_instance.stubs("main").returns(true)
-
-        ARGV.clear
-        ARGV << "--foo=bar"
-
-        Application.option :foo,
-                           :description => "meh",
-                           :arguments => "--foo [FOO]"
-
-        Application.new.run
-
-        ARGV.clear
-        @argv_backup.each{|a| ARGV << a}
-      end
-    end
-
-    describe "#initialize" do
-      it "should parse the command line options at application run" do
-        Application.any_instance.expects("application_parse_options").once
-        Application.any_instance.stubs("main").returns(true)
-
-        Application.new.run
-      end
-    end
-
-    describe "#application_options" do
-      it "sshould return the application options" do
-        Application.new.application_options.should == Application.application_options
-      end
-    end
-
-    describe "#application_description" do
-      it "should provide the right description" do
-        Application.description "Foo"
-        Application.new.application_description.should == "Foo"
-      end
-    end
-
-    describe "#application_usage" do
-      it "should provide the right usage" do
-        Application.usage "Foo"
-        Application.new.application_usage.should == ["Foo"]
-      end
-    end
-
-    describe "#application_cli_arguments" do
-      it "should provide the right usage" do
-        Application.option :foo,
-                           :description => "meh",
-                           :arguments => "--foo [FOO]"
-
-        args = Application.new.application_cli_arguments.first
-
-        # need to remove this cos we cant validate procs for equality afaik
-        args.delete(:validate)
-
-        args.should == {:description=>"meh",
-                        :name=>:foo,
-                        :arguments=>"--foo [FOO]",
-                        :type=>String,
-                        :required=>false}
-      end
-    end
-
-    describe "#help" do
-      it "should generate help using the full user supplied options" do
-        app = Application.new
-        app.expects(:clioptions).with(true).once
-        app.help
-      end
-    end
-
-    describe "#main" do
-      it "should detect applications without a #main" do
-        IO.any_instance.expects(:puts).with("Applications need to supply a 'main' method")
-
-        expect {
-          Application.new.run
-        }.to raise_error(SystemExit)
-      end
-
-      it "should raise SystemExit exceptions for exit events" do
-        connector = mock
-        connector.expects(:disconnect)
-        PluginManager.expects("[]").with("connector_plugin").returns(connector)
-
-        a = Application.new
-        a.expects(:main).raises(SystemExit)
-
-        expect {
-          a.run
-        }.to raise_error(SystemExit)
-      end
-    end
-
-    describe "#configuration" do
-      it "should return the correct configuration" do
-        Application.any_instance.stubs("main").returns(true)
-
-        ARGV.clear
-        ARGV << "--foo=bar"
-
-        Application.option :foo,
-                           :description => "meh",
-                           :arguments => "--foo [FOO]"
-
-        a = Application.new
-        a.run
-
-        a.configuration.should == {:foo => "bar"}
-
-        ARGV.clear
-        @argv_backup.each{|a| ARGV << a}
-      end
-    end
-
-    describe "#halt" do
-      before do
-        @stats = {:discoverytime => 0, :discovered => 0, :failcount => 0, :responses => 0, :okcount => 0}
-      end
-
-      it "should exit with code 0 if discovery was done and all responses passed" do
-        app = Application.new
-
-        @stats[:discoverytime] = 2
-        @stats[:discovered] = 2
-        @stats[:responses] = 2
-        @stats[:okcount] = 2
-
-        app.halt_code(@stats).should == 0
-      end
-
-      it "should exit with code 0 if no discovery were done but responses were received" do
-        app = Application.new
-
-        @stats[:responses] = 1
-        @stats[:okcount] = 1
-        @stats[:discovered] = 1
-
-        app.halt_code(@stats).should == 0
-      end
-
-      it "should exit with code 1 if discovery info is missing" do
-        app = Application.new
-
-        app.halt_code({}).should == 1
-      end
-
-      it "should exit with code 1 if no nodes were discovered and discovery was done" do
-        app = Application.new
-
-        @stats[:discoverytime] = 2
-
-        app.halt_code(@stats).should == 1
-      end
-
-      it "should exit with code 2 if a request failed for some nodes" do
-        app = Application.new
-
-        @stats[:discovered] = 2
-        @stats[:failcount] = 1
-        @stats[:discoverytime] = 2
-        @stats[:responses] = 2
-
-        app.halt_code(@stats).should == 2
-      end
-
-      it "should exit with code 2 when no discovery were done and there were failure results" do
-        app = Application.new
-
-        @stats[:discovered] = 1
-        @stats[:failcount] = 1
-        @stats[:discoverytime] = 0
-        @stats[:responses] = 1
-
-        app.halt_code(@stats).should == 2
-      end
-
-      it "should exit with code 3 if no responses were received after discovery" do
-        app = Application.new
-
-        @stats[:discovered] = 1
-        @stats[:discoverytime] = 2
-
-        app.halt_code(@stats).should == 3
-      end
-
-      it "should exit with code 4 if no discovery was done and no responses were received" do
-        app = Application.new
-
-        app.halt_code(@stats).should == 4
-      end
-    end
-
-    describe "#disconnect" do
-      it "should disconnect from the connector plugin" do
-        connector = mock
-        connector.expects(:disconnect)
-        PluginManager.expects("[]").with("connector_plugin").returns(connector)
-
-        Application.new.disconnect
-      end
-    end
-
-    describe "#clioptions" do
-      it "should pass the excluded argument section" do
-        oparser = mock
-        oparser.stubs(:parse)
-
-        Application.exclude_argument_sections "rpc"
-
-        Optionparser.expects(:new).with({:verbose => false, :progress_bar => true}, "filter", ["rpc"]).returns(oparser)
-
-        Application.new.clioptions(false)
-      end
-
-      it "should add the RPC options" do
-        oparser = mock
-        oparser.stubs(:parse).yields(oparser, {})
-        oparser.stubs(:banner=)
-        oparser.stubs(:define_tail)
-
-        Optionparser.stubs(:new).with({:verbose => false, :progress_bar => true}, "filter", []).returns(oparser)
-        RPC::Helpers.expects(:add_simplerpc_options).with(oparser, {})
-
-        Application.new.clioptions(false)
-      end
-
-      it "should support bypassing the RPC options" do
-        oparser = mock
-        oparser.stubs(:parse).yields(oparser, {})
-        oparser.stubs(:banner=)
-        oparser.stubs(:define_tail)
-
-        Application.exclude_argument_sections "rpc"
-
-        Optionparser.stubs(:new).with({:verbose => false, :progress_bar => true}, "filter", ["rpc"]).returns(oparser)
-        RPC::Helpers.expects(:add_simplerpc_options).never
-
-        Application.new.clioptions(false)
-      end
-
-      it "should return the help text if requested" do
-        parser = mock
-        parser.expects(:help)
-
-        oparser = mock
-        oparser.stubs(:parse).yields(oparser, {})
-        oparser.stubs(:banner=)
-        oparser.stubs(:define_tail)
-        oparser.expects(:parser).returns(parser)
-
-        Optionparser.stubs(:new).with({:verbose => false, :progress_bar => true}, "filter", []).returns(oparser)
-        RPC::Helpers.expects(:add_simplerpc_options).with(oparser, {})
-
-        Application.new.clioptions(true)
-      end
-    end
-
-    describe "#application_failure" do
-      before do
-        @app = Application.new
-      end
-
-      it "on SystemExit it should disconnect and exit without backtraces or error messages" do
-        @app.expects(:disconnect)
-        expect { @app.application_failure(SystemExit.new) }.to raise_error(SystemExit)
-      end
-
-      it "should print a single line error message" do
-        out = StringIO.new
-        @app.stubs(:disconnect)
-        @app.stubs(:exit).with(1)
-        @app.stubs(:options).returns({})
-
-        Config.instance.stubs(:color).returns(false)
-        e = mock
-        e.stubs(:backtrace).returns([])
-        e.stubs(:to_s).returns("rspec")
-
-        out.expects(:puts).with(regexp_matches(/rspec application failed to run/))
-
-        @app.application_failure(e, out)
-      end
-
-      it "should print a backtrace if options are unset or verbose is enabled" do
-        out = StringIO.new
-        @app.stubs(:disconnect)
-        @app.stubs(:exit).with(1)
-        @app.stubs(:options).returns(nil)
-
-        Config.instance.stubs(:color).returns(false)
-        e = mock
-        e.stubs(:backtrace).returns(["rspec"])
-        e.stubs(:to_s).returns("rspec")
-
-        @app.expects(:options).returns({:verbose => true}).times(3)
-        out.expects(:puts).with(regexp_matches(/ application failed to run/))
-        out.expects(:puts).with(regexp_matches(/from rspec  <---/))
-        out.expects(:puts).with(regexp_matches(/rspec.+Mocha::Mock/))
-
-        @app.application_failure(e, out)
-      end
-    end
-
-    describe "#run" do
-      before do
-        @app = Application.new
-      end
-
-      it "should parse the application options, run main and disconnect" do
-        @app.expects(:application_parse_options)
-        @app.expects(:main)
-        @app.expects(:disconnect)
-
-        @app.run
-      end
-
-      it "should allow the application plugin to validate configuration variables" do
-        @app.expects("respond_to?").with(:validate_configuration).returns(true)
-        @app.expects(:validate_configuration).once
-
-        @app.stubs(:application_parse_options)
-        @app.stubs(:main)
-        @app.stubs(:disconnect)
-
-        @app.run
-      end
-
-      it "should start the sleeper thread on windows" do
-        Util.expects("windows?").returns(true)
-        Util.expects(:setup_windows_sleeper).once
-
-        @app.stubs(:application_parse_options)
-        @app.stubs(:main)
-        @app.stubs(:disconnect)
-
-        @app.run
-      end
-
-      it "should catch handle exit() correctly" do
-        @app.expects(:main).raises(SystemExit)
-        @app.expects(:disconnect).once
-
-        expect { @app.run }.to raise_error(SystemExit)
-      end
-
-      it "should catch all exceptions and process them correctly" do
-        @app.expects(:main).raises("rspec")
-        @app.expects(:application_failure).once
-        @app.run
-      end
-    end
-  end
-end
diff --git a/spec/unit/applications_spec.rb b/spec/unit/applications_spec.rb
deleted file mode 100755 (executable)
index ddc7225..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe Applications do
-    before do
-      tmpfile = Tempfile.new("mc_applications_spec")
-      path = tmpfile.path
-      tmpfile.close!
-
-      @tmpdir = FileUtils.mkdir_p(path)
-      @tmpdir = @tmpdir[0] if @tmpdir.is_a?(Array) # ruby 1.9.2
-      $LOAD_PATH << @tmpdir
-
-      @appsdir = File.join([@tmpdir, "mcollective", "application"])
-      FileUtils.mkdir_p(@appsdir)
-
-      FileUtils.cp(File.join([File.dirname(__FILE__), "..", "fixtures", "application", "test.rb"]), @appsdir)
-    end
-
-    after do
-      FileUtils.rm_r(@tmpdir)
-    end
-
-    describe "[]" do
-      it "should load the config" do
-        Applications.expects(:load_config).once
-        PluginManager.expects("[]").once
-        Applications["test"]
-      end
-
-      it "should return the correct stored application" do
-        app = mock("app")
-        app.stubs(:run)
-
-        Applications.expects(:load_config).once
-        PluginManager.expects("[]").with("test_application").once.returns(app)
-        Applications["test"].should == app
-      end
-    end
-
-    describe "#run" do
-      it "should load the configuration" do
-        app = mock("app")
-        app.stubs(:run)
-
-        Applications.expects(:load_config).once
-        Applications.expects(:load_application).once
-        PluginManager.expects("[]").once.returns(app)
-
-        Applications.run("test")
-      end
-
-      it "should load the application" do
-        app = mock("app")
-        app.stubs(:run)
-
-        Applications.expects(:load_config).once
-        Applications.expects(:load_application).with("test").once
-        PluginManager.expects("[]").once.returns(app)
-
-        Applications.run("test")
-      end
-
-      it "should invoke the application run method" do
-        app = mock("app")
-        app.stubs(:run).returns("hello world")
-
-        Applications.expects(:load_config).once
-        Applications.expects(:load_application)
-        PluginManager.expects("[]").once.returns(app)
-
-        Applications.run("test").should == "hello world"
-      end
-    end
-
-    describe "#load_application" do
-      it "should return the existing application if already loaded" do
-        app = mock("app")
-        app.stubs(:run)
-
-        PluginManager << {:type => "test_application", :class => app}
-
-        Applications.expects("load_config").never
-
-        Applications.load_application("test")
-      end
-
-      it "should load the config" do
-        Applications.expects("load_config").returns(true).once
-        Applications.load_application("test")
-      end
-
-      it "should load the correct class from disk" do
-        PluginManager.expects("loadclass").with("MCollective::Application::Test")
-        Applications.expects("load_config").returns(true).once
-
-        Applications.load_application("test")
-      end
-
-      it "should add the class to the plugin manager" do
-        Applications.expects("load_config").returns(true).once
-
-        PluginManager.expects("<<").with({:type => "test_application", :class => "MCollective::Application::Test"})
-
-        Applications.load_application("test")
-      end
-    end
-
-    describe "#list" do
-      it "should load the configuration" do
-        Applications.expects("load_config").returns(true).once
-        Config.instance.expects("libdir").returns([@tmpdir])
-        Applications.list
-      end
-
-      it "should add found applications to the list" do
-        Applications.expects("load_config").returns(true).once
-        Config.instance.expects("libdir").returns([@tmpdir])
-
-        Applications.list.should == ["test"]
-      end
-
-      it "should print a friendly error and exit on failure" do
-        Applications.expects("load_config").raises(Exception)
-        IO.any_instance.expects(:puts).with(regexp_matches(/Failed to generate application list/)).once
-
-        expect {
-          Applications.list.should
-        }.to raise_error(SystemExit)
-      end
-    end
-
-    describe "#filter_extra_options" do
-      it "should parse --config=x" do
-        ["--config=x --foo=bar -f -f bar", "--foo=bar --config=x -f -f bar"].each do |t|
-          Applications.filter_extra_options(t).should == "--config=x"
-        end
-      end
-
-      it "should parse --config x" do
-        ["--config x --foo=bar -f -f bar", "--foo=bar --config x -f -f bar"].each do |t|
-          Applications.filter_extra_options(t).should == "--config=x"
-        end
-      end
-
-      it "should parse -c x" do
-        ["-c x --foo=bar -f -f bar", "--foo=bar -c x -f -f bar"].each do |t|
-          Applications.filter_extra_options(t).should == "--config=x"
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/array_spec.rb b/spec/unit/array_spec.rb
deleted file mode 100755 (executable)
index d189922..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-class Array
-  describe "#in_groups_of" do
-    it "should correctly group array members" do
-      [1,2,3,4,5,6,7,8,9,10].in_groups_of(5).should == [[1,2,3,4,5], [6,7,8,9,10]]
-    end
-
-    it "should padd missing data with correctly" do
-      arr = [1,2,3,4,5,6,7,8,9,10]
-
-      arr.in_groups_of(3).should == [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, nil, nil]]
-      arr.in_groups_of(3, 0).should == [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 0, 0]]
-      arr.in_groups_of(11).should == [[1,2,3,4,5, 6,7,8,9,10, nil]]
-      arr.in_groups_of(11, 0).should == [[1,2,3,4,5, 6,7,8,9,10, 0]]
-    end
-
-    it "should indicate when the last abtched was reached" do
-      arr = [1,2,3,4,5,6,7,8,9,10]
-
-      ctr = 0
-
-      [1,2,3,4,5,6,7,8,9,10].in_groups_of(3) {|a, last_batch| ctr += 1 unless last_batch}
-
-      ctr.should == 3
-    end
-  end
-end
diff --git a/spec/unit/cache_spec.rb b/spec/unit/cache_spec.rb
deleted file mode 100644 (file)
index 4dcff11..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe Cache do
-    before do
-      @locks_mutex = Cache.instance_variable_set("@locks_mutex", Mutex.new)
-      @cache_locks = Cache.instance_variable_set("@cache_locks", {})
-      @cache = Cache.instance_variable_set("@cache", {})
-    end
-
-    describe "#check_cache!" do
-      it "should correctly check for valid caches" do
-        Cache.expects(:has_cache?).with("rspec").returns(true)
-        Cache.expects(:has_cache?).with("fail").returns(false)
-
-        Cache.check_cache!("rspec")
-        expect { Cache.check_cache!("fail") }.to raise_code("Could not find a cache called '%{cache_name}'", :cache_name => "fail")
-      end
-    end
-
-    describe "#setup" do
-      it "should use a mutex to manage access to the cache" do
-        @locks_mutex.expects(:synchronize).yields
-        Cache.setup("x").should == true
-        @cache.should == {"x" => {:max_age => 300.0}}
-      end
-
-      it "should correctly setup a new cache" do
-        @locks_mutex.expects(:synchronize).twice.yields
-        Cache.setup("rspec1", 300)
-        @cache["rspec1"].should == {:max_age => 300.0}
-
-        Cache.setup("rspec2")
-        @cache["rspec2"].should == {:max_age => 300.0}
-      end
-    end
-
-    describe "#has_cache?" do
-      it "should correctly report presense of a cache" do
-        Cache.setup("rspec")
-        Cache.has_cache?("rspec").should == true
-        Cache.has_cache?("fail").should == false
-      end
-    end
-
-    describe "#delete!" do
-      it "should delete the cache and return true" do
-        Cache.expects(:check_cache!).with("rspec")
-
-        Cache.setup("rspec")
-        Cache.delete!("rspec").should == true
-      end
-    end
-
-    describe "#write" do
-      it "should write to the cache" do
-        time = Time.now
-        Time.expects(:now).returns(time)
-        Cache.expects(:check_cache!).with("rspec")
-
-        Cache.setup("rspec")
-        Cache.write("rspec", :key, :val).should == :val
-
-        @cache["rspec"][:key][:value].should == :val
-        @cache["rspec"][:key][:cache_create_time].should == time
-      end
-    end
-
-    describe "#read" do
-      it "should read a written entry correctly" do
-        Cache.setup("rspec")
-        Cache.write("rspec", :key, :val)
-
-        Cache.expects(:check_cache!).with("rspec")
-        Cache.expects(:ttl).with("rspec", :key).returns(1)
-
-        Cache.read("rspec", :key).should == :val
-      end
-
-      it "should raise on expired reads" do
-        Cache.setup("rspec")
-        Cache.write("rspec", :key, :val)
-
-        Cache.expects(:ttl).returns(0)
-
-        Cache.expects(:check_cache!).with("rspec")
-
-        expect { Cache.read("rspec", :key) }.to raise_code("Cache expired on '%{cache_name}' key '%{item}'", :cache_name => "rspec", :item => :key)
-      end
-    end
-
-    describe "#invalidate!" do
-      it "should return false for unknown keys" do
-        Cache.expects(:check_cache!).with("rspec")
-
-        @locks_mutex.expects(:synchronize).yields
-
-        Cache.setup("rspec")
-        Cache.invalidate!("rspec", "no_such_key").should == false
-      end
-
-      it "should delete the key" do
-        Cache.setup("rspec")
-        Cache.write("rspec", "valid_key", "rspec")
-
-        Cache.expects(:check_cache!).with("rspec")
-        @cache["rspec"].expects(:delete).with("valid_key")
-
-        Cache.invalidate!("rspec", "valid_key")
-      end
-    end
-
-    describe "#ttl" do
-      it "should detect invalid key names" do
-        Cache.expects(:check_cache!).with("rspec")
-        Cache.setup("rspec", 300)
-        expect { Cache.ttl("rspec", :key) }.to raise_code("No item called '%{item}' for cache '%{cache_name}'", :cache_name => "rspec", :item => :key)
-      end
-
-      it "should return >0 for valid" do
-        Cache.setup("rspec", 300)
-        Cache.write("rspec", :key, :val)
-
-        Cache.expects(:check_cache!).with("rspec")
-        Cache.ttl("rspec", :key).should >= 0
-      end
-
-      it "should return <0 for expired messages" do
-        Cache.setup("rspec", 300)
-        Cache.write("rspec", :key, :val)
-
-        time = Time.now + 600
-        Time.expects(:now).returns(time)
-
-        Cache.expects(:check_cache!).with("rspec")
-        Cache.ttl("rspec", :key).should <= 0
-      end
-    end
-
-    describe "#synchronize" do
-      it "should use the correct mutex" do
-        Cache.expects(:check_cache!).with("rspec")
-        Cache.setup("rspec")
-
-        rspec_lock = @cache_locks["rspec"]
-        rspec_lock.expects(:synchronize).yields
-
-        @cache_locks.expects("[]").with("rspec").returns(rspec_lock)
-
-        ran = 0
-        Cache.synchronize("rspec") do
-          ran = 1
-        end
-
-        ran.should == 1
-      end
-    end
-  end
-end
diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb
deleted file mode 100644 (file)
index 70c0a8f..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe Client do
-    before do
-      @security = mock
-      @security.stubs(:initiated_by=)
-      @connector = mock
-      @connector.stubs(:connect)
-      @connector.stubs(:subscribe)
-      @connector.stubs(:unsubscribe)
-      @ddl = mock
-      @ddl.stubs(:meta).returns({:timeout => 1})
-      @discoverer = mock
-
-      Discovery.expects(:new).returns(@discoverer)
-
-      Config.instance.instance_variable_set("@configured", true)
-      PluginManager.expects("[]").with("connector_plugin").returns(@connector)
-      PluginManager.expects("[]").with("security_plugin").returns(@security)
-
-      @client = Client.new("/nonexisting")
-      @client.options = Util.default_options
-    end
-
-    describe "#sendreq" do
-      it "should send the supplied message" do
-        message = Message.new("rspec", nil, {:agent => "rspec", :type => :request, :collective => "mcollective", :filter => Util.empty_filter, :options => Util.default_options})
-
-        message.expects(:encode!)
-        @client.expects(:subscribe).with("rspec", :reply)
-        message.expects(:publish)
-        message.expects(:requestid).twice
-        @client.sendreq(message, "rspec")
-      end
-
-      it "should not subscribe to a reply queue for a message with a reply-to" do
-        message = Message.new("rspec", nil, {:agent => "rspec", :type => :request, :collective => "mcollective", :filter => Util.empty_filter, :options => Util.default_options})
-        message.reply_to = "rspec"
-
-        message.expects(:encode!)
-        @client.expects(:subscribe).never
-        message.expects(:publish)
-        message.expects(:requestid).twice
-        @client.sendreq(message, "rspec")
-      end
-    end
-    describe "#req" do
-      it "should record the requestid" do
-        message = Message.new("rspec", nil, {:agent => "rspec", :type => :request, :collective => "mcollective", :filter => Util.empty_filter, :options => Util.default_options})
-        message.discovered_hosts = ["rspec"]
-
-        reply = mock
-        reply.stubs("payload").returns("rspec payload")
-
-        @client.expects(:sendreq).returns("823a3419a0975c3facbde121f72ab61f")
-        @client.expects(:receive).returns(reply)
-
-        @discoverer.expects(:discovery_timeout).with(message.options[:timeout], message.options[:filter]).returns(0)
-
-        Time.stubs(:now).returns(Time.at(1340621250), Time.at(1340621251))
-
-        @client.req(message){}.should == {:blocktime => 1.0, :discoverytime => 0, :noresponsefrom => [],
-                                          :requestid => "823a3419a0975c3facbde121f72ab61f", :responses => 1,
-                                          :starttime => 1340621250.0, :totaltime => 1.0}
-      end
-    end
-
-    describe "#discover" do
-      it "should delegate to the discovery plugins" do
-        @discoverer.expects(:discover).with({}, 1, 0).returns([])
-        @client.discover({}, 1).should == []
-      end
-    end
-  end
-end
diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb
deleted file mode 100755 (executable)
index f166f22..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe Config do
-    describe "#loadconfig" do
-      it "should fail when no libdir is set" do
-        File.expects(:exists?).with("/nonexisting").returns(true)
-        File.expects(:readlines).with("/nonexisting").returns([])
-        Config.instance.stubs(:set_config_defaults)
-        expect { Config.instance.loadconfig("/nonexisting") }.to raise_error("The /nonexisting config file does not specify a libdir setting, cannot continue")
-      end
-
-      it "should only test that libdirs are absolute paths" do
-        Util.expects(:absolute_path?).with("/one").returns(true)
-        Util.expects(:absolute_path?).with("/two").returns(true)
-        Util.expects(:absolute_path?).with("/three").returns(true)
-        Util.expects(:absolute_path?).with("four").returns(false)
-
-        File.stubs(:exists?).with("/nonexisting").returns(true)
-        File.stubs(:exists?).with(File.join(File.dirname("/nonexisting"), "rpc-help.erb")).returns(true)
-
-        ["/one:/two", "/three"].each do |path|
-          File.expects(:readlines).with("/nonexisting").returns(["libdir = #{path}"])
-
-          Config.instance.loadconfig("/nonexisting")
-
-          PluginManager.clear
-        end
-
-        File.expects(:readlines).with("/nonexisting").returns(["libdir = four"])
-
-        expect { Config.instance.loadconfig("/nonexisting") }.to raise_error(/should be absolute paths/)
-      end
-
-      it "should not allow any path like construct for identities" do
-        # Taken from puppet test cases
-        ['../foo', '..\\foo', './../foo', '.\\..\\foo',
-          '/foo', '//foo', '\\foo', '\\\\goo',
-          "test\0/../bar", "test\0\\..\\bar",
-          "..\\/bar", "/tmp/bar", "/tmp\\bar", "tmp\\bar",
-          " / bar", " /../ bar", " \\..\\ bar",
-          "c:\\foo", "c:/foo", "\\\\?\\UNC\\bar", "\\\\foo\\bar",
-          "\\\\?\\c:\\foo", "//?/UNC/bar", "//foo/bar",
-          "//?/c:/foo"
-        ].each do |input|
-          File.expects(:readlines).with("/nonexisting").returns(["identity = #{input}", "libdir=/nonexistinglib"])
-          File.expects(:exists?).with("/nonexisting").returns(true)
-          File.expects(:exists?).with(File.join(File.dirname("/nonexisting"), "rpc-help.erb")).returns(true)
-
-          expect {
-            Config.instance.loadconfig("/nonexisting")
-          }.to raise_error('Identities can only match /\w\.\-/')
-        end
-      end
-
-      it "should allow valid identities" do
-        ["foo", "foo_bar", "foo-bar", "foo-bar-123", "foo.bar", "foo_bar_123"].each do |input|
-          File.expects(:readlines).with("/nonexisting").returns(["identity = #{input}", "libdir=/nonexistinglib"])
-          File.expects(:exists?).with("/nonexisting").returns(true)
-          File.expects(:exists?).with(File.join(File.dirname("/nonexisting"), "rpc-help.erb")).returns(true)
-          PluginManager.stubs(:loadclass)
-          PluginManager.stubs("<<")
-
-          Config.instance.loadconfig("/nonexisting")
-        end
-      end
-
-      it "should set direct_addressing to true by default" do
-        File.expects(:readlines).with("/nonexisting").returns(["libdir=/nonexistinglib"])
-        File.expects(:exists?).with("/nonexisting").returns(true)
-        File.expects(:exists?).with(File.join(File.dirname("/nonexisting"), "rpc-help.erb")).returns(true)
-        PluginManager.stubs(:loadclass)
-        PluginManager.stubs("<<")
-
-        Config.instance.loadconfig("/nonexisting")
-        Config.instance.direct_addressing.should == true
-      end
-
-      it "should allow direct_addressing to be disabled in the config file" do
-        File.expects(:readlines).with("/nonexisting").returns(["libdir=/nonexistinglib", "direct_addressing=n"])
-        File.expects(:exists?).with("/nonexisting").returns(true)
-        File.expects(:exists?).with(File.join(File.dirname("/nonexisting"), "rpc-help.erb")).returns(true)
-        PluginManager.stubs(:loadclass)
-        PluginManager.stubs("<<")
-
-        Config.instance.loadconfig("/nonexisting")
-        Config.instance.direct_addressing.should == false
-      end
-
-      it "should not allow the syslog logger type on windows" do
-        Util.expects("windows?").returns(true).twice
-        File.expects(:readlines).with("/nonexisting").returns(["libdir=/nonexistinglib", "logger_type=syslog"])
-        File.expects(:exists?).with("/nonexisting").returns(true)
-        File.expects(:exists?).with(File.join(File.dirname("/nonexisting"), "rpc-help.erb")).returns(true)
-        PluginManager.stubs(:loadclass)
-        PluginManager.stubs("<<")
-
-        expect { Config.instance.loadconfig("/nonexisting") }.to raise_error("The sylog logger is not usable on the Windows platform")
-      end
-
-      it "should default to finding the help template in the same dir as the config file" do
-        path = File.join(File.dirname("/nonexisting"), "rpc-help.erb")
-
-        File.expects(:readlines).with("/nonexisting").returns(["libdir=/nonexistinglib"])
-        File.expects(:exists?).with("/nonexisting").returns(true)
-        PluginManager.stubs(:loadclass)
-        PluginManager.stubs("<<")
-
-        File.expects(:exists?).with(path).returns(true)
-
-        Config.instance.loadconfig("/nonexisting")
-        Config.instance.rpchelptemplate.should == path
-      end
-
-      it "should fall back to old behavior if the help template file does not exist in the config dir" do
-        path = File.join(File.dirname("/nonexisting"), "rpc-help.erb")
-
-        File.expects(:readlines).with("/nonexisting").returns(["libdir=/nonexistinglib"])
-        File.expects(:exists?).with("/nonexisting").returns(true)
-        File.expects(:exists?).with(path).returns(false)
-        PluginManager.stubs(:loadclass)
-        PluginManager.stubs("<<")
-
-        Config.instance.loadconfig("/nonexisting")
-        Config.instance.rpchelptemplate.should == "/etc/mcollective/rpc-help.erb"
-      end
-
-      it "should support multiple default_discovery_options" do
-        File.expects(:readlines).with("/nonexisting").returns(["default_discovery_options = 1", "default_discovery_options = 2", "libdir=/nonexistinglib"])
-        File.expects(:exists?).with("/nonexisting").returns(true)
-        File.expects(:exists?).with(File.join(File.dirname("/nonexisting"), "rpc-help.erb")).returns(true)
-        PluginManager.stubs(:loadclass)
-        PluginManager.stubs("<<")
-
-        Config.instance.loadconfig("/nonexisting")
-        Config.instance.default_discovery_options.should == ["1", "2"]
-      end
-    end
-
-    describe "#read_plugin_config_dir" do
-      before do
-        @plugindir = File.join("/", "nonexisting", "plugin.d")
-
-        File.stubs(:directory?).with(@plugindir).returns(true)
-
-        Config.instance.set_config_defaults("")
-      end
-
-      it "should not fail if the supplied directory is missing" do
-        File.expects(:directory?).with(@plugindir).returns(false)
-        Config.instance.read_plugin_config_dir(@plugindir)
-        Config.instance.pluginconf.should == {}
-      end
-
-      it "should skip files that do not match the expected filename pattern" do
-        Dir.expects(:new).with(@plugindir).returns(["foo.txt"])
-
-        IO.expects(:open).with(File.join(@plugindir, "foo.txt")).never
-
-        Config.instance.read_plugin_config_dir(@plugindir)
-      end
-
-      it "should load the config files" do
-        Dir.expects(:new).with(@plugindir).returns(["foo.cfg"])
-        File.expects(:open).with(File.join(@plugindir, "foo.cfg"), "r").returns([]).once
-        Config.instance.read_plugin_config_dir(@plugindir)
-      end
-
-      it "should set config parameters correctly" do
-        Dir.expects(:new).with(@plugindir).returns(["foo.cfg"])
-        File.expects(:open).with(File.join(@plugindir, "foo.cfg"), "r").returns(["rspec = test"])
-        Config.instance.read_plugin_config_dir(@plugindir)
-        Config.instance.pluginconf.should == {"foo.rspec" => "test"}
-      end
-
-      it "should override main config file" do
-        configfile = File.join(@plugindir, "foo.cfg")
-        servercfg = File.join(File.dirname(@plugindir), "server.cfg")
-
-        PluginManager.stubs(:loadclass)
-
-        File.stubs(:exists?).returns(true)
-        File.stubs(:directory?).with(@plugindir).returns(true)
-        File.stubs(:exists?).with(servercfg).returns(true)
-        File.expects(:readlines).with(servercfg).returns(["plugin.rspec.key = default", "libdir=/nonexisting"])
-        File.stubs(:directory?).with("/nonexisting").returns(true)
-
-        Dir.expects(:new).with(@plugindir).returns(["rspec.cfg"])
-        File.expects(:open).with(File.join(@plugindir, "rspec.cfg"), "r").returns(["key = overridden"])
-
-        Config.instance.loadconfig(servercfg)
-        Config.instance.pluginconf.should == {"rspec.key" => "overridden"}
-      end
-    end
-  end
-end
diff --git a/spec/unit/data/base_spec.rb b/spec/unit/data/base_spec.rb
deleted file mode 100644 (file)
index 80a1504..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module Data
-    describe Base do
-      before do
-        @ddl = mock
-        @ddl.stubs(:dataquery_interface).returns({:output => {'rspec' => {}}})
-        @ddl.stubs(:meta).returns({:timeout => 1})
-      end
-
-      describe "#initialize" do
-        it "should set the plugin name, ddl and timeout and call the startup hook" do
-          DDL.stubs(:new).returns(@ddl)
-          Base.any_instance.expects(:startup_hook).once
-          plugin = Base.new
-          plugin.name.should == "base"
-          plugin.timeout.should == 1
-          plugin.result.class.should == Result
-        end
-      end
-
-      describe "#lookup" do
-        before do
-          DDL.stubs(:new).returns(@ddl)
-          @plugin = Base.new
-        end
-
-        it "should validate the request" do
-          @plugin.expects(:ddl_validate).with("hello world").returns(true)
-          @plugin.stubs(:query_data)
-          @plugin.lookup("hello world")
-        end
-
-        it "should query the plugin" do
-          @plugin.stubs(:ddl_validate)
-          @plugin.expects(:query_data).with("hello world")
-          @plugin.lookup("hello world").class.should == Result
-        end
-
-        it "should raise MsgTTLExpired errors for Timeout errors" do
-          @plugin.stubs(:ddl_validate)
-          @plugin.expects(:query_data).raises(Timeout::Error)
-
-          msg = "Data plugin base timed out on query 'hello world'"
-          Log.expects(:error).with(msg)
-          expect { @plugin.lookup("hello world") }.to raise_error(msg)
-        end
-      end
-
-      describe "#query" do
-        it "should create a new method" do
-          class Rspec_data<Base; end
-          Rspec_data.query { "rspec test" }
-
-          DDL.stubs(:new).returns(@ddl)
-
-          data = Rspec_data.new
-          data.query_data.should == "rspec test"
-        end
-      end
-
-      describe "#ddl_validate" do
-        it "should validate the request using the Data class" do
-          DDL.stubs(:new).returns(@ddl)
-          plugin = Base.new
-          Data.expects(:ddl_validate).with(@ddl, "rspec")
-          plugin.ddl_validate("rspec")
-        end
-      end
-
-      describe "#activate_when" do
-        it "should create a new activate? method" do
-          class Rspec_data<Base;end
-
-          Rspec_data.activate_when { raise "rspec" }
-          DDL.stubs(:new).returns(@ddl)
-          expect { Rspec_data.activate? }.to raise_error("rspec")
-        end
-      end
-
-      describe "#activate?" do
-        it "should default to true" do
-          Base.activate?.should == true
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/data/result_spec.rb b/spec/unit/data/result_spec.rb
deleted file mode 100644 (file)
index 4f88932..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module Data
-    describe Result do
-      before(:each) do
-        @result = Result.new({})
-      end
-
-      describe "#initialize" do
-        it "should initialize empty values for all output fields" do
-          result = Result.new({:rspec1 => {}, :rspec2 => {}})
-          result[:rspec1].should == nil
-          result[:rspec2].should == nil
-        end
-
-        it "should set default values for all output fields" do
-          result = Result.new({:rspec1 => {:default => 1}, :rspec2 => {}})
-          result[:rspec1].should == 1
-          result[:rspec2].should == nil
-        end
-      end
-
-      describe "#[]=" do
-        it "should only allow trusted types of data to be saved" do
-          expect { @result["rspec"] = Time.now }.to raise_error
-          @result["rspec"] = 1
-          @result["rspec"] = 1.1
-          @result["rspec"] = "rspec"
-          @result["rspec"] = true
-          @result["rspec"] = false
-        end
-
-        it "should set the correct value" do
-          @result["rspec"] = "rspec value"
-          @result.instance_variable_get("@data").should == {:rspec => "rspec value"}
-        end
-
-        it "should only allow valid data types" do
-          expect { @result["rspec"] = Time.now }.to raise_error(/Can only store .+ data but got Time for key rspec/)
-        end
-      end
-
-      describe "#include" do
-        it "should return the correct list of keys" do
-          @result["x"] = "1"
-          @result[:y] = "2"
-          @result.keys.sort.should == [:x, :y]
-        end
-      end
-
-      describe "#include?" do
-        it "should correctly report that a key is present or absent" do
-          @result.include?("rspec").should == false
-          @result.include?(:rspec).should == false
-          @result["rspec"] = "rspec"
-          @result.include?("rspec").should == true
-          @result.include?(:rspec).should == true
-        end
-      end
-
-      describe "#[]" do
-        it "should retrieve the correct information" do
-          @result["rspec"].should == nil
-          @result[:rspec].should == nil
-          @result["rspec"] = "rspec value"
-          @result["rspec"].should == "rspec value"
-          @result[:rspec].should == "rspec value"
-        end
-      end
-
-      describe "#method_missing" do
-        it "should raise the correct exception for unknown keys" do
-          expect { @result.nosuchdata }.to raise_error(NoMethodError)
-        end
-
-        it "should retrieve the correct data" do
-          @result["rspec"] = "rspec value"
-          @result.rspec.should == "rspec value"
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/data_spec.rb b/spec/unit/data_spec.rb
deleted file mode 100644 (file)
index cc7dbf8..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe Data do
-    describe "#load_data_sources" do
-      it "should use the pluginmanager to load data sources" do
-        PluginManager.expects(:find_and_load).with("data").returns([])
-        Data.load_data_sources
-      end
-
-      it "should remove plugins that should not be active on this node" do
-        PluginManager.expects(:find_and_load).with("data").returns(["rspec_data"])
-        PluginManager.expects(:grep).returns(["rspec_data"])
-        PluginManager.expects(:delete).with("rspec_data")
-
-        ddl = mock
-        ddl.stubs(:meta).returns({:timeout => 1})
-        ddl.stubs(:dataquery_interface).returns({:rspec => nil})
-        ddl.stubs(:dataquery_interface).returns({:output => {}})
-        DDL.stubs(:new).returns(ddl)
-        Data::Base.expects(:activate?).returns(false)
-        PluginManager.expects("[]").with("rspec_data").returns(Data::Base.new)
-        Data.load_data_sources
-      end
-
-      it "should handle exceptions and delete broken plugins" do
-        PluginManager.expects(:find_and_load).with("data").returns(["rspec_data"])
-        PluginManager.expects(:grep).returns(["rspec_data"])
-        PluginManager.expects(:delete).with("rspec_data")
-
-        ddl = mock
-        ddl.stubs(:meta).returns({:timeout => 1})
-        ddl.stubs(:dataquery_interface).returns({:output => {}})
-        DDL.stubs(:new).returns(ddl)
-        Data::Base.expects(:activate?).raises("rspec failure")
-        Log.expects(:debug).once.with("Disabling data plugin rspec_data due to exception RuntimeError: rspec failure")
-        PluginManager.expects("[]").with("rspec_data").returns(Data::Base.new)
-        Data.load_data_sources
-      end
-    end
-
-    describe "#ddl" do
-      it "should load the right data ddl" do
-        DDL.expects(:new).with("fstat_data", :data).times(3)
-        Data.ddl("fstat")
-        Data.ddl("fstat_data")
-        Data.ddl(:fstat)
-      end
-    end
-
-    describe "#pluginname" do
-      it "should return the correct plugin name" do
-        Data.pluginname("Rspec").should == "rspec_data"
-        Data.pluginname("Rspec_data").should == "rspec_data"
-      end
-    end
-
-    describe "#[]" do
-      it "should return the correct plugin" do
-        PluginManager.expects("[]").with("rspec_data").times(4)
-        Data["Rspec"]
-        Data["rspec"]
-        Data["rspec_data"]
-        Data["rspec_Data"]
-      end
-    end
-
-    describe "#method_missing" do
-      it "should raise errors for unknown plugins" do
-        PluginManager.expects("include?").with("rspec_data").returns(false)
-        expect { Data.rspec_data }.to raise_error(NoMethodError)
-      end
-
-      it "should do a lookup on the right plugin" do
-        rspec_data = mock
-        rspec_data.expects(:lookup).returns("rspec")
-
-        PluginManager.expects("include?").with("rspec_data").returns(true)
-        PluginManager.expects("[]").with("rspec_data").returns(rspec_data)
-
-        Data.rspec_data("rspec").should == "rspec"
-      end
-    end
-
-    describe "#ddl_transform_intput" do
-      it "should convert boolean data" do
-        ddl = mock
-        ddl.stubs(:entities).returns({:data => {:input => {:query => {:type => :boolean}}}})
-        Data.ddl_transform_input(ddl, "1").should == true
-        Data.ddl_transform_input(ddl, "0").should == false
-      end
-
-      it "should conver numeric data" do
-        ddl = mock
-        ddl.stubs(:entities).returns({:data => {:input => {:query => {:type => :number}}}})
-        Data.ddl_transform_input(ddl, "1").should == 1
-        Data.ddl_transform_input(ddl, "0").should == 0
-        Data.ddl_transform_input(ddl, "1.1").should == 1.1
-      end
-
-      it "should return the original input on any failure" do
-        ddl = mock
-        ddl.expects(:entities).raises("rspec failure")
-        Data.ddl_transform_input(ddl, 1).should == 1
-      end
-    end
-
-    describe "#ddl_has_output?" do
-      it "should correctly verify output keys" do
-        ddl = mock
-        ddl.stubs(:entities).returns({:data => {:output => {:rspec => {}}}})
-        Data.ddl_has_output?(ddl, "rspec").should == true
-        Data.ddl_has_output?(ddl, :rspec).should == true
-        Data.ddl_has_output?(ddl, :foo).should == false
-        Data.ddl_has_output?(ddl, "foo").should == false
-      end
-
-      it "should return false for any exception" do
-        ddl = mock
-        ddl.stubs(:entities).returns(nil)
-        Data.ddl_has_output?(ddl, "rspec").should == false
-      end
-    end
-
-    describe "#ddl_validate" do
-      before do
-        @ddl = mock
-        @ddl.expects(:meta).returns({:name => "rspec test"})
-      end
-
-      it "should ensure the ddl has a dataquery" do
-        @ddl.expects(:entities).returns({})
-        expect { Data.ddl_validate(@ddl, "rspec") }.to raise_code(:PLMC31, :plugin => "rspec test")
-      end
-
-      it "should allow ddls without any input defined" do
-        @ddl.expects(:entities).returns({:data => {:input => {}, :output => {:x => {}}}})
-        Data.ddl_validate(@ddl, nil)
-      end
-
-      it "should not allow input arguments when no query were defined" do
-        @ddl.expects(:entities).returns({:data => {:input => {}, :output => {:x => {}}}})
-        expect { Data.ddl_validate(@ddl, "rspec") }.to raise_code(:PLMC33, :plugin => "rspec test")
-      end
-
-      it "should ensure the ddl has output" do
-        @ddl.expects(:entities).returns({:data => {:input => {:query => {}}, :output => {}}})
-        expect { Data.ddl_validate(@ddl, "rspec") }.to raise_code(:PLMC32, :plugin => "rspec test")
-      end
-
-      it "should skip optional arguments that were not supplied" do
-        @ddl.expects(:entities).returns({:data => {:input => {:query => {:optional => true}}, :output => {:test => {}}}})
-        @ddl.expects(:validate_input_argument).never
-        Data.ddl_validate(@ddl, nil).should == true
-      end
-
-      it "should validate the argument" do
-        @ddl.expects(:entities).returns({:data => {:input => {:query => {}}, :output => {:test => {}}}})
-        @ddl.expects(:validate_input_argument).returns("rspec validated")
-        Data.ddl_validate(@ddl, "rspec").should == "rspec validated"
-      end
-    end
-  end
-end
diff --git a/spec/unit/ddl/agentddl_spec.rb b/spec/unit/ddl/agentddl_spec.rb
deleted file mode 100644 (file)
index 615fa10..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module DDL
-    describe AgentDDL do
-      before :each do
-        Cache.delete!(:ddl) rescue nil
-        @ddl = DDL.new("rspec", :agent, false)
-        @ddl.metadata(:name => "name", :description => "description", :author => "author", :license => "license", :version => "version", :url => "url", :timeout => "timeout")
-      end
-
-      describe "#input" do
-        it "should validate that an :optional property is set" do
-          expect { @ddl.input(:x, {:y => 1}) }.to raise_error("Input needs a :optional property")
-        end
-      end
-
-      describe "#set_default_input_arguments" do
-        before do
-          @ddl.action(:test, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :test)
-
-          @ddl.input(:optional, :prompt => "prompt", :description => "descr",
-                     :type => :string, :optional => true, :validation => "",
-                     :maxlength => 1, :default => "default")
-          @ddl.input(:required, :prompt => "prompt", :description => "descr",
-                     :type => :string, :optional => false, :validation => "",
-                     :maxlength => 1, :default => "default")
-        end
-
-        it "should correctly add default arguments to required inputs" do
-          args = {}
-
-          @ddl.set_default_input_arguments(:test, args)
-
-          args.should == {:required => "default"}
-        end
-
-        it "should not override any existing arguments" do
-          args = {:required => "specified"}
-
-          @ddl.set_default_input_arguments(:test, args)
-
-          args.should == {:required => "specified"}
-        end
-      end
-
-      describe "#validate_rpc_request" do
-        it "should ensure the action is known" do
-          @ddl.action(:test, :description => "rspec")
-
-          expect {
-            @ddl.validate_rpc_request(:fail, {})
-          }.to raise_code(:PLMC29, :action => :fail, :plugin => "rspec")
-
-          @ddl.validate_rpc_request(:test, {})
-        end
-
-        it "should check all required arguments are present" do
-          @ddl.action(:test, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :test)
-          @ddl.input(:optional, :prompt => "prompt", :description => "descr",
-                     :type => :string, :optional => true, :validation => "",
-                     :maxlength => 1)
-          @ddl.input(:required, :prompt => "prompt", :description => "descr",
-                     :type => :string, :optional => false, :validation => "",
-                     :maxlength => 1)
-
-          @ddl.stubs(:validate_input_argument).returns(true)
-
-          expect {
-            @ddl.validate_rpc_request(:test, {})
-          }.to raise_code(:PLMC30, :action => :test, :key => :required)
-
-          @ddl.validate_rpc_request(:test, {:required => "f"}).should == true
-        end
-
-        it "should input validate every supplied key" do
-          @ddl.action(:test, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :test)
-          @ddl.input(:optional, :prompt => "prompt", :description => "descr",
-                     :type => :string, :optional => true, :validation => "",
-                     :maxlength => 1)
-          @ddl.input(:required, :prompt => "prompt", :description => "descr",
-                     :type => :string, :optional => false, :validation => "",
-                     :maxlength => 1)
-
-
-          @ddl.expects(:validate_input_argument).with(@ddl.entities[:test][:input], :required, "f")
-          @ddl.expects(:validate_input_argument).with(@ddl.entities[:test][:input], :optional, "f")
-
-          @ddl.validate_rpc_request(:test, {:required => "f", :optional => "f"}).should == true
-        end
-      end
-
-      describe "#is_function" do
-        before :each do
-          PluginManager.expects(:find).with("aggregate").returns(["plugin"])
-        end
-
-        it "should return true if the aggregate function is present" do
-          @ddl.is_function?("plugin").should == true
-        end
-
-        it "should return false if the aggregate function is not present" do
-          @ddl.is_function?("no_plugin").should == false
-        end
-      end
-
-      describe "#method_missing" do
-        it "should call super if the aggregate plugin isn't present" do
-          expect{
-            @ddl.test
-          }.to raise_error(NoMethodError)
-        end
-
-        it "should call super if @process_aggregate_function is false" do
-          expect{
-            result = @ddl.test(:value)
-          }.to raise_error(NoMethodError)
-        end
-
-        it "should return the function hash" do
-          Config.instance.mode = :client
-          @ddl.instance_variable_set(:@process_aggregate_functions, true)
-          result = @ddl.method_missing(:test_function, :rspec)
-          result.should == {:args => [:rspec], :function => :test_function }
-        end
-      end
-
-      describe "#actions" do
-        it "should return the correct list of actions" do
-          @ddl.action(:test1, :description => "rspec")
-          @ddl.action(:test2, :description => "rspec")
-
-          @ddl.actions.sort.should == [:test1, :test2]
-        end
-      end
-
-      describe "#action_interface" do
-        it "should return the correct interface" do
-          @ddl.action(:test1, :description => "rspec")
-          @ddl.action_interface(:test1).should == {:description=>"rspec", :output=>{}, :input=>{}, :action=>:test1, :display=>:failed}
-        end
-      end
-
-      describe "#display" do
-        it "should ensure a valid display property is set" do
-          @ddl.action(:test, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :test)
-
-          [:ok, :failed, :flatten, :always].each do |display|
-            @ddl.display(display)
-
-            action = @ddl.action_interface(:test)
-            action[:display].should == display
-          end
-
-          expect {
-            @ddl.display(:foo)
-          }.to raise_error(/Display preference foo is not valid/)
-        end
-      end
-
-      describe "#summarize" do
-        before :each do
-          @block_result = nil
-          @block = Proc.new{@block_result = :success}
-        end
-
-        after :each do
-          @block_result = nil
-        end
-
-        it "should call the block parameter if config mode is not server" do
-          Config.instance.mode = :client
-          result = @ddl.summarize(&@block)
-          @block_result.should == :success
-        end
-
-        it "should not call the block parameter if config mode is server" do
-          Config.instance.mode = :server
-          result = @ddl.summarize(&@block)
-          @block_result.should == nil
-        end
-      end
-
-      describe "#aggregate" do
-        it "should raise an exception if aggregate format isn't a hash" do
-          expect{
-            @ddl.aggregate(:foo, :format)
-          }.to raise_code(:PLMC28)
-        end
-
-        it "should raise an exception if format hash does not include a :format key" do
-          expect{
-            @ddl.aggregate(:foo, {})
-          }.to raise_code(:PLMC27)
-        end
-
-        it "should raise an exception if aggregate function is not a hash" do
-          expect{
-            @ddl.aggregate(:foo)
-          }.to raise_code(:PLMC26)
-        end
-
-        it "should raise an exception if function hash does not include a :args key" do
-          expect{
-            @ddl.stubs(:entities).returns({nil => {:action => :foo}})
-            @ddl.aggregate({})
-          }.to raise_code(:PLMC25, :action => :foo)
-        end
-
-        it "should correctly add an aggregate function to the function array" do
-          @ddl.stubs(:entities).returns({nil => {:aggregate => nil}})
-          @ddl.aggregate({:function => :foo, :args => [:bar]})
-          @ddl.entities.should == {nil => {:aggregate => [{:function => :foo, :args => [:bar]}]}}
-        end
-      end
-
-      describe "#action" do
-        it "should ensure a description is set" do
-          expect {
-            @ddl.action("act", {})
-          }.to raise_error("Action needs a :description property")
-        end
-
-        it "should create a default action structure" do
-          @ddl.action("act", :description => "rspec")
-
-          action = @ddl.action_interface("act")
-
-          action.class.should == Hash
-          action[:action].should == "act"
-          action[:input].should == {}
-          action[:output].should == {}
-          action[:display].should == :failed
-          action[:description].should == "rspec"
-        end
-
-        it "should call a block if one is given and set the correct action name" do
-          @ddl.action("act", :description => "rspec") { @ddl.instance_variable_get("@current_entity").should == "act" }
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/ddl/base_spec.rb b/spec/unit/ddl/base_spec.rb
deleted file mode 100644 (file)
index 881c066..0000000
+++ /dev/null
@@ -1,403 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module DDL
-    describe Base do
-      before :each do
-        Cache.delete!(:ddl) rescue nil
-        @ddl = DDL.new("rspec", :agent, false)
-        @ddl.metadata(:name => "name", :description => "description", :author => "author", :license => "license", :version => "version", :url => "url", :timeout => "timeout")
-      end
-
-      describe "#template_for_plugintype" do
-        it "should return the backward compat path for agent ddls" do
-          @ddl.template_for_plugintype.should == "rpc-help.erb"
-        end
-
-        it "should return correct new path for other ddls" do
-          @ddl.instance_variable_set("@plugintype", :data)
-          File.expects(:exists?).with("/etc/mcollective/data-help.erb").returns(true)
-          @ddl.template_for_plugintype.should == "data-help.erb"
-        end
-      end
-
-      describe "#help" do
-        it "should use conventional template paths when none is provided" do
-          File.expects(:read).with("/etc/mcollective/rpc-help.erb").returns("rspec")
-          File.expects(:read).with("/etc/mcollective/metadata-help.erb").returns("rspec")
-          @ddl.help.should == "rspec"
-        end
-
-        it "should use template from help template path when provided template name is not an absolute file path" do
-          File.expects(:read).with("/etc/mcollective/foo").returns("rspec")
-          File.expects(:read).with("/etc/mcollective/metadata-help.erb").returns("rspec")
-          @ddl.help("foo").should == "rspec"
-        end
-
-        it "should use supplied template path when one is provided" do
-          File.expects(:read).with("/foo").returns("rspec")
-          File.expects(:read).with("/etc/mcollective/metadata-help.erb").returns("rspec")
-          @ddl.help("/foo").should == "rspec"
-        end
-
-        it "should correctly execute the template with a valid binding" do
-          @ddl.instance_variable_set("@meta", "meta")
-          @ddl.instance_variable_set("@entities", "actions")
-          File.expects(:read).with("/template").returns("<%= meta %>:<%= entities %>")
-          File.expects(:read).with("/etc/mcollective/metadata-help.erb").returns("rspec")
-          @ddl.help("/template").should == "meta:actions"
-        end
-      end
-
-      describe "#validate_input_arguments" do
-        before :all do
-          Config.instance.stubs(:configured).returns(true)
-          Config.instance.stubs(:libdir).returns([File.join(File.dirname(__FILE__), "../../../plugins")])
-        end
-
-        it "should ensure strings are String" do
-          @ddl.action(:string, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :string)
-          @ddl.input(:string, :prompt => "prompt", :description => "descr",
-                     :type => :string, :optional => true, :validation => "",
-                     :maxlength => 1)
-
-          expect {
-            @ddl.validate_input_argument(@ddl.entities[:string][:input], :string, 1)
-          }.to raise_code(:PLMC21, :input => :string, :error => "value should be a string")
-
-          @ddl.validate_input_argument(@ddl.entities[:string][:input], :string, "1")
-        end
-
-        it "should ensure strings are not longer than maxlength" do
-          @ddl.action(:string, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :string)
-          @ddl.input(:string, :prompt => "prompt", :description => "descr",
-                     :type => :string, :optional => true, :validation => "",
-                     :maxlength => 1)
-
-          expect {
-            @ddl.validate_input_argument(@ddl.entities[:string][:input], :string, "too long")
-          }.to raise_code(:PLMC21, :input => :string, :error => "Input string is longer than 1 character(s)")
-
-          @ddl.validate_input_argument(@ddl.entities[:string][:input], :string, "1")
-        end
-
-        it "should validate strings using regular expressions" do
-          @ddl.action(:string, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :string)
-          @ddl.input(:string, :prompt => "prompt", :description => "descr",
-                     :type => :string, :optional => true, :validation => "^regex$",
-                     :maxlength => 100)
-
-          expect {
-            @ddl.validate_input_argument(@ddl.entities[:string][:input], :string, "doesnt validate")
-          }.to raise_code(:PLMC21, :input => :string, :error => "value should match ^regex$")
-
-          @ddl.validate_input_argument(@ddl.entities[:string][:input], :string, "regex")
-        end
-
-        it "should validate list arguments correctly" do
-          @ddl.action(:list, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :list)
-          @ddl.input(:list, :prompt => "prompt", :description => "descr",
-                     :type => :list, :optional => true, :list => [1,2])
-
-          expect {
-            @ddl.validate_input_argument(@ddl.entities[:list][:input], :list, 3)
-          }.to raise_code(:PLMC21, :input => :list, :error => "value should be one of 1, 2")
-
-          @ddl.validate_input_argument(@ddl.entities[:list][:input], :list, 1)
-        end
-
-        it "should validate boolean arguments correctly" do
-          @ddl.action(:bool, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :bool)
-          @ddl.input(:bool, :prompt => "prompt", :description => "descr",
-                     :type => :boolean, :optional => true)
-
-          expect {
-            @ddl.validate_input_argument(@ddl.entities[:bool][:input], :bool, 3)
-          }.to raise_code(:PLMC21, :input => :bool, :error => "value should be a boolean")
-
-          @ddl.validate_input_argument(@ddl.entities[:bool][:input], :bool, true)
-          @ddl.validate_input_argument(@ddl.entities[:bool][:input], :bool, false)
-        end
-
-        it "should validate integer arguments correctly" do
-          @ddl.action(:test, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :test)
-          @ddl.input(:int, :prompt => "prompt", :description => "descr",
-                     :type => :integer, :optional => true)
-
-          expect {
-            @ddl.validate_input_argument(@ddl.entities[:test][:input], :int, "1")
-          }.to raise_code(:PLMC21, :input => :int, :error => "value should be a integer")
-
-          expect {
-            @ddl.validate_input_argument(@ddl.entities[:test][:input], :int, 1.1)
-          }.to raise_code(:PLMC21, :input => :int, :error => "value should be a integer")
-
-          @ddl.validate_input_argument(@ddl.entities[:test][:input], :int, 1)
-        end
-
-        it "should validate float arguments correctly" do
-          @ddl.action(:test, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :test)
-          @ddl.input(:float, :prompt => "prompt", :description => "descr",
-                     :type => :float, :optional => true)
-
-          expect {
-            @ddl.validate_input_argument(@ddl.entities[:test][:input], :float, "1")
-          }.to raise_code(:PLMC21, :input => :float, :error => "value should be a float")
-
-          expect {
-            @ddl.validate_input_argument(@ddl.entities[:test][:input], :float, 1)
-          }.to raise_code(:PLMC21, :input => :float, :error => "value should be a float")
-
-          @ddl.validate_input_argument(@ddl.entities[:test][:input], :float, 1.1)
-        end
-
-        it "should validate number arguments correctly" do
-          @ddl.action(:test, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :test)
-          @ddl.input(:number, :prompt => "prompt", :description => "descr",
-                     :type => :number, :optional => true)
-
-          expect {
-            @ddl.validate_input_argument(@ddl.entities[:test][:input], :number, "1")
-          }.to raise_code(:PLMC21, :input => :number, :error => "value should be a number")
-
-          @ddl.validate_input_argument(@ddl.entities[:test][:input], :number, 1)
-          @ddl.validate_input_argument(@ddl.entities[:test][:input], :number, 1.1)
-        end
-      end
-
-      describe "#requires" do
-        it "should only accept hashes as arguments" do
-          expect { @ddl.requires(1) }.to raise_error(/should be a hash/)
-        end
-
-        it "should only accept valid requirement types" do
-          expect { @ddl.requires(:rspec => "1") }.to raise_error(/is not a valid requirement/)
-          @ddl.requires(:mcollective => "1.0.0")
-        end
-
-        it "should save the requirement" do
-          @ddl.requires(:mcollective => "1.0.0")
-
-          @ddl.requirements.should == {:mcollective => "1.0.0"}
-        end
-      end
-
-      describe "#validate_requirements" do
-        it "should fail for older versions of mcollective" do
-          Util.stubs(:mcollective_version).returns("0.1")
-          expect { @ddl.requires(:mcollective => "2.0") }.to raise_error(/requires.+version 2.0/)
-        end
-
-        it "should pass for newer versions of mcollective" do
-          Util.stubs(:mcollective_version).returns("2.0")
-          @ddl.requires(:mcollective => "0.1")
-          @ddl.validate_requirements.should == true
-        end
-
-        it "should bypass checks in development" do
-          Util.stubs(:mcollective_version).returns("@DEVELOPMENT_VERSION@")
-          @ddl.expects(:log_code).with(:PLMC19, anything, :warn)
-          @ddl.requires(:mcollective => "0.1")
-        end
-      end
-
-      describe "#loaddlfile" do
-        it "should raise the correct error when a ddl isnt present" do
-          @ddl.expects(:findddlfile).returns(false)
-          expect { @ddl.loadddlfile }.to raise_error("Can't find DDL for agent plugin 'rspec'")
-        end
-      end
-
-      describe "#findddlfile" do
-        it "should construct the correct ddl file name" do
-          Config.instance.expects(:libdir).returns(["/nonexisting"])
-          File.expects("exist?").with("/nonexisting/mcollective/agent/foo.ddl").returns(false)
-
-          @ddl.findddlfile("foo").should == false
-        end
-
-        it "should check each libdir for a ddl file" do
-          Config.instance.expects(:libdir).returns(["/nonexisting1", "/nonexisting2"])
-          File.expects("exist?").with("/nonexisting1/mcollective/agent/foo.ddl").returns(false)
-          File.expects("exist?").with("/nonexisting2/mcollective/agent/foo.ddl").returns(false)
-
-          @ddl.findddlfile("foo").should == false
-        end
-
-        it "should return the ddl file path if found" do
-          Config.instance.expects(:libdir).returns(["/nonexisting"])
-          File.expects("exist?").with("/nonexisting/mcollective/agent/foo.ddl").returns(true)
-          @ddl.expects(:log_code).with(:PLMC18, anything, :debug, :ddlname => "foo", :ddlfile => "/nonexisting/mcollective/agent/foo.ddl")
-
-          @ddl.findddlfile("foo").should == "/nonexisting/mcollective/agent/foo.ddl"
-        end
-
-        it "should default to the current plugin and type" do
-          Config.instance.expects(:libdir).returns(["/nonexisting"])
-          File.expects("exist?").with("/nonexisting/mcollective/agent/rspec.ddl").returns(true)
-
-          @ddl.findddlfile.should == "/nonexisting/mcollective/agent/rspec.ddl"
-        end
-      end
-
-      describe "#metadata" do
-        it "should ensure minimum parameters are given" do
-          [:name, :description, :author, :license, :version, :url, :timeout].each do |tst|
-            metadata = {:name => "name", :description => "description", :author => "author",
-                        :license => "license", :version => "version", :url => "url", :timeout => "timeout"}
-
-            metadata.delete(tst)
-
-            expect {
-              @ddl.metadata(metadata)
-            }.to raise_error("Metadata needs a :#{tst} property")
-          end
-        end
-
-        it "should should allow arbitrary metadata" do
-          metadata = {:name => "name", :description => "description", :author => "author", :license => "license",
-                      :version => "version", :url => "url", :timeout => "timeout", :foo => "bar"}
-
-          @ddl.metadata(metadata)
-          @ddl.meta.should == metadata
-        end
-      end
-
-      describe "#input" do
-        it "should ensure required properties are set" do
-          @ddl.action(:test, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :test)
-
-          [:prompt, :description, :type, :optional].each do |arg|
-            args = {:prompt => "prompt", :description => "descr", :type => "type", :optional => true}
-            args.delete(arg)
-
-            expect {
-              @ddl.input(:test, args)
-            }.to raise_error("Input needs a :#{arg} property")
-          end
-
-          @ddl.input(:test, {:prompt => "prompt", :description => "descr", :type => "type", :optional => true})
-        end
-
-        it "should ensure strings have a validation and maxlength" do
-          @ddl.action(:test, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :test)
-
-          expect {
-            @ddl.input(:test, :prompt => "prompt", :description => "descr",
-                       :type => :string, :optional => true)
-          }.to raise_error("Input type :string needs a :validation argument")
-
-          expect {
-            @ddl.input(:test, :prompt => "prompt", :description => "descr",
-                       :type => :string, :optional => true, :validation => 1)
-          }.to raise_error("Input type :string needs a :maxlength argument")
-
-          @ddl.input(:test, :prompt => "prompt", :description => "descr",
-                     :type => :string, :optional => true, :validation => 1, :maxlength => 1)
-        end
-
-        it "should ensure lists have a list argument" do
-          @ddl.action(:test, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :test)
-
-          expect {
-            @ddl.input(:test, :prompt => "prompt", :description => "descr",
-                       :type => :list, :optional => true)
-          }.to raise_error("Input type :list needs a :list argument")
-
-          @ddl.input(:test, :prompt => "prompt", :description => "descr",
-                     :type => :list, :optional => true, :list => [])
-        end
-
-        it "should save correct data for a list input" do
-          @ddl.action(:test, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :test)
-          @ddl.input(:test, :prompt => "prompt", :description => "descr",
-                     :type => :list, :optional => true, :list => [])
-
-          action = @ddl.action_interface(:test)
-
-          action[:input][:test][:prompt].should == "prompt"
-          action[:input][:test][:description].should == "descr"
-          action[:input][:test][:type].should == :list
-          action[:input][:test][:optional].should == true
-          action[:input][:test][:list].should == []
-        end
-
-        it "should save correct data for a string input" do
-          @ddl.action(:test, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :test)
-          @ddl.input(:test, :prompt => "prompt", :description => "descr",
-                     :type => :string, :optional => true, :validation => "",
-                     :maxlength => 1)
-
-          action = @ddl.action_interface(:test)
-
-          action[:input][:test][:prompt].should == "prompt"
-          action[:input][:test][:description].should == "descr"
-          action[:input][:test][:type].should == :string
-          action[:input][:test][:optional].should == true
-          action[:input][:test][:validation].should == ""
-          action[:input][:test][:maxlength].should == 1
-        end
-      end
-
-      describe "#output" do
-        it "should ensure a :description is set" do
-          @ddl.action(:test, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :test)
-
-          expect {
-            @ddl.output(:test, {})
-          }.to raise_error("Output test needs a description argument")
-        end
-
-        it "should ensure a :display_as is set" do
-          @ddl.action(:test, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :test)
-
-          expect {
-            @ddl.output(:test, {:description => "rspec"})
-          }.to raise_error("Output test needs a display_as argument")
-        end
-
-        it "should save correct data for an output" do
-          @ddl.action(:test, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :test)
-
-          @ddl.output(:test, {:description => "rspec", :display_as => "RSpec", :default => "default"})
-
-          action = @ddl.action_interface(:test)
-
-          action[:output][:test][:description].should == "rspec"
-          action[:output][:test][:display_as].should == "RSpec"
-          action[:output][:test][:default].should == "default"
-        end
-
-        it "should set unsupplied defaults to our internal unset representation" do
-          @ddl.action(:test, :description => "rspec")
-          @ddl.instance_variable_set("@current_entity", :test)
-
-          @ddl.output(:test, {:description => "rspec", :display_as => "RSpec"})
-
-          action = @ddl.action_interface(:test)
-
-          action[:output][:test][:default].should == nil
-        end
-      end
-
-    end
-  end
-end
diff --git a/spec/unit/ddl/dataddl_spec.rb b/spec/unit/ddl/dataddl_spec.rb
deleted file mode 100644 (file)
index 915cabc..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module DDL
-    describe DataDDL do
-      before :each do
-        Cache.delete!(:ddl) rescue nil
-        @ddl = DDL.new("rspec", :data, false)
-        @ddl.metadata(:name => "name", :description => "description", :author => "author", :license => "license", :version => "version", :url => "url", :timeout => "timeout")
-      end
-
-      describe "#input" do
-        it "should only allow 'query' as input for data plugins" do
-          ddl = DDL.new("rspec", :data, false)
-          ddl.dataquery(:description => "rspec")
-          ddl.instance_variable_set("@current_entity", :query)
-          ddl.instance_variable_set("@plugintype", :data)
-
-          expect { ddl.input(:rspec, {}) }.to raise_error("The only valid input name for a data query is 'query'")
-        end
-      end
-
-      describe "#dataquery_interface" do
-        it "should return the correct data" do
-          input = {:prompt => "Matcher", :description => "Augeas Matcher", :type => :string, :validation => /.+/, :maxlength => 0}
-          output = {:description=>"rspec", :display_as=>"rspec", :default => nil}
-
-          @ddl.instance_variable_set("@plugintype", :data)
-          @ddl.dataquery(:description => "rspec") do
-            @ddl.output :rspec, output
-            @ddl.input :query, input
-          end
-
-          @ddl.dataquery_interface.should == {:description => "rspec",
-                                              :input => {:query => input.merge(:optional => nil, :default => nil)},
-                                              :output => {:rspec => output}}
-        end
-      end
-
-      describe "#dataquery" do
-        it "should ensure a description is set" do
-          expect { @ddl.dataquery({}) }.to raise_error("Data queries need a :description")
-        end
-
-        it "should ensure only one definition" do
-          @ddl.dataquery(:description => "rspec")
-
-          expect { @ddl.dataquery(:description => "rspec") }.to raise_error("Data queries can only have one definition")
-        end
-
-        it "should create the default structure" do
-          @ddl.dataquery(:description => "rspec")
-          @ddl.instance_variable_set("@plugintype", :data)
-          @ddl.dataquery_interface.should == {:description => "rspec", :input => {}, :output => {}}
-        end
-
-        it "should call the block if given" do
-          @ddl.dataquery(:description => "rspec") { @ddl.instance_variable_get("@current_entity").should == :data }
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/ddl/discoveryddl_spec.rb b/spec/unit/ddl/discoveryddl_spec.rb
deleted file mode 100644 (file)
index 8f54ba0..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module DDL
-    describe DiscoveryDDL do
-      before :each do
-        Cache.delete!(:ddl) rescue nil
-        @ddl = DDL.new("rspec", :discovery, false)
-        @ddl.metadata(:name => "name", :description => "description", :author => "author", :license => "license", :version => "version", :url => "url", :timeout => "timeout")
-      end
-
-      describe "#discovery_interface" do
-        it "should return correct data" do
-          @ddl.instance_variable_set("@plugintype", :discovery)
-          @ddl.discovery do
-            @ddl.capabilities :identity
-          end
-
-          @ddl.discovery_interface.should == {:capabilities => [:identity]}
-        end
-      end
-
-      describe "#capabilities" do
-        it "should support non arrays" do
-          @ddl.instance_variable_set("@plugintype", :discovery)
-          @ddl.discovery do
-            @ddl.capabilities :identity
-          end
-          @ddl.discovery_interface.should == {:capabilities => [:identity]}
-        end
-
-        it "should not accept empty capability lists" do
-          @ddl.instance_variable_set("@plugintype", :discovery)
-          @ddl.discovery do
-            expect { @ddl.capabilities [] }.to raise_error("Discovery plugin capabilities can't be empty")
-          end
-        end
-
-        it "should only accept known capabilities" do
-          @ddl.instance_variable_set("@plugintype", :discovery)
-          @ddl.discovery do
-            expect { @ddl.capabilities :rspec }.to raise_error(/rspec is not a valid capability/)
-          end
-        end
-
-        it "should correctly store the capabilities" do
-          @ddl.instance_variable_set("@plugintype", :discovery)
-          @ddl.discovery do
-            @ddl.capabilities [:identity, :classes]
-          end
-          @ddl.discovery_interface.should == {:capabilities => [:identity, :classes]}
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/ddl_spec.rb b/spec/unit/ddl_spec.rb
deleted file mode 100644 (file)
index f5548d5..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe DDL do
-    before do
-      Cache.delete!(:ddl) rescue nil
-    end
-
-    describe "#new" do
-      it "should default to agent ddls" do
-        DDL::AgentDDL.expects(:new).once
-        DDL.new("rspec")
-      end
-
-      it "should return the correct plugin ddl class" do
-        DDL.new("rspec", :agent, false).class.should == DDL::AgentDDL
-      end
-
-      it "should default to base when no specific class exist" do
-        DDL.new("rspec", :rspec, false).class.should == DDL::Base
-      end
-    end
-
-    describe "#load_and_cache" do
-      it "should setup the cache" do
-        Cache.setup(:ddl)
-
-        Cache.expects(:setup).once.returns(true)
-        DDL.load_and_cache("rspec", :agent, false)
-      end
-
-      it "should attempt to read from the cache and return found ddl" do
-        Cache.expects(:setup)
-        Cache.expects(:read).with(:ddl, "agent/rspec").returns("rspec")
-        DDL.load_and_cache("rspec", :agent, false).should == "rspec"
-      end
-
-      it "should handle cache misses then create and save a new ddl object" do
-        Cache.expects(:setup)
-        Cache.expects(:read).with(:ddl, "agent/rspec").raises("failed")
-        Cache.expects(:write).with(:ddl, "agent/rspec", kind_of(DDL::AgentDDL)).returns("rspec")
-
-        DDL.load_and_cache("rspec", :agent, false).should == "rspec"
-      end
-    end
-
-    describe "#string_to_number" do
-      it "should turn valid strings into numbers" do
-        ["1", "0", "9999"].each do |i|
-          DDL.string_to_number(i).class.should == Fixnum
-        end
-
-        ["1.1", "0.0", "9999.99"].each do |i|
-          DDL.string_to_number(i).class.should == Float
-        end
-      end
-
-      it "should raise errors for invalid values" do
-        expect { DDL.string_to_number("rspec") }.to raise_error
-      end
-    end
-
-    describe "#string_to_boolean" do
-      it "should turn valid strings into boolean" do
-        ["true", "yes", "1"].each do |t|
-          DDL.string_to_boolean(t).should == true
-          DDL.string_to_boolean(t.upcase).should == true
-        end
-
-        ["false", "no", "0"].each do |f|
-          DDL.string_to_boolean(f).should == false
-          DDL.string_to_boolean(f.upcase).should == false
-        end
-      end
-
-      it "should raise errors for invalid values" do
-        expect { DDL.string_to_boolean("rspec") }.to raise_error
-      end
-    end
-
-  end
-end
diff --git a/spec/unit/discovery_spec.rb b/spec/unit/discovery_spec.rb
deleted file mode 100644 (file)
index 4e3a409..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe Discovery do
-    before do
-      Config.instance.stubs(:default_discovery_method).returns("mc")
-      @client = mock
-
-      Discovery.any_instance.stubs(:find_known_methods).returns(["mc"])
-      @discovery = Discovery.new(@client)
-    end
-
-    describe "#timeout_for_compound_filter" do
-      it "should return the correct time" do
-        ddl = mock
-        ddl.stubs(:meta).returns({:timeout => 1})
-
-        filter = [Matcher.create_compound_callstack("test().size=1 and rspec().size=1")]
-
-        DDL.expects(:new).with("test_data", :data).returns(ddl)
-        DDL.expects(:new).with("rspec_data", :data).returns(ddl)
-
-        @discovery.timeout_for_compound_filter(filter).should == 2
-      end
-    end
-
-    describe "#discover" do
-      before do
-        ddl = mock
-        ddl.stubs(:meta).returns({:timeout => 2})
-
-        discoverer = mock
-
-        @discovery.stubs(:force_discovery_method_by_filter).returns(false)
-        @discovery.stubs(:ddl).returns(ddl)
-        @discovery.stubs(:check_capabilities)
-        @discovery.stubs(:discovery_class).returns(discoverer)
-      end
-
-      it "should error for non fixnum limits" do
-        expect { @discovery.discover(nil, 0, 1.1) }.to raise_error("Limit has to be an integer")
-      end
-
-      it "should use the DDL timeout if none is specified" do
-        filter = Util.empty_filter
-        @discovery.discovery_class.expects(:discover).with(filter, 2, 0, @client)
-        @discovery.discover(filter, nil, 0)
-      end
-
-      it "should check the discovery method is capable of serving the filter" do
-        @discovery.expects(:check_capabilities).with("filter").raises("capabilities check failed")
-        expect { @discovery.discover("filter", nil, 0) }.to raise_error("capabilities check failed")
-      end
-
-      it "should call the correct discovery plugin" do
-        @discovery.discovery_class.expects(:discover).with("filter", 2, 0, @client)
-        @discovery.discover("filter", nil, 0)
-      end
-
-      it "should handle limits correctly" do
-        @discovery.discovery_class.stubs(:discover).returns([1,2,3,4,5])
-        @discovery.discover(Util.empty_filter, 1, 1).should == [1]
-        @discovery.discover(Util.empty_filter, 1, 0).should == [1,2,3,4,5]
-      end
-    end
-
-    describe "#force_discovery_method_by_filter" do
-      it "should force mc plugin when needed" do
-        options = {:discovery_method => "rspec"}
-
-        Log.expects(:info).with("Switching to mc discovery method because compound filters are used")
-
-        @discovery.expects(:discovery_method).returns("rspec")
-        @client.expects(:options).returns(options)
-        @discovery.force_discovery_method_by_filter({"compound" => ["rspec"]}).should == true
-
-        options[:discovery_method].should == "mc"
-      end
-
-      it "should not force mc plugin when no compound filter is used" do
-        options = {:discovery_method => "rspec"}
-
-        @discovery.expects(:discovery_method).returns("rspec")
-        @discovery.force_discovery_method_by_filter({"compound" => []}).should == false
-
-        options[:discovery_method].should == "rspec"
-      end
-    end
-
-    describe "#check_capabilities" do
-      before do
-        @ddl = mock
-        @discovery.stubs(:ddl).returns(@ddl)
-        @discovery.stubs(:discovery_method).returns("rspec")
-      end
-
-      it "should fail for unsupported capabilities" do
-        @ddl.stubs(:discovery_interface).returns({:capabilities => []})
-
-        filter = Util.empty_filter
-
-        expect { @discovery.check_capabilities(filter.merge({"cf_class" => ["filter"]})) }.to raise_error(/Cannot use class filters/)
-
-        ["fact", "identity", "compound"].each do |type|
-          expect { @discovery.check_capabilities(filter.merge({type => ["filter"]})) }.to raise_error(/Cannot use #{type} filters/)
-        end
-      end
-    end
-
-    describe "#ddl" do
-      before do
-        @ddl = mock
-        @ddl.stubs(:meta).returns({:name => "mc"})
-      end
-
-      it "should create an instance of the right ddl" do
-        @discovery.instance_variable_set("@ddl", nil)
-        @client.stubs(:options).returns({})
-        DDL.expects(:new).with("mc", :discovery).returns(@ddl)
-        @discovery.ddl
-      end
-
-      it "should reload the ddl if the method has changed" do
-        @discovery.instance_variable_set("@ddl", @ddl)
-        @discovery.stubs(:discovery_method).returns("rspec")
-        DDL.expects(:new).with("rspec", :discovery).returns(@ddl)
-        @discovery.ddl
-      end
-    end
-
-    describe "#discovery_class" do
-      it "should try to load the class if not already loaded" do
-        @discovery.expects(:discovery_method).returns("mc")
-        PluginManager.expects(:loadclass).with("MCollective::Discovery::Mc")
-        Discovery.expects(:const_defined?).with("Mc").returns(false)
-        Discovery.expects(:const_get).with("Mc").returns("rspec")
-        @discovery.discovery_class.should == "rspec"
-      end
-
-      it "should not load the class again if its already loaded" do
-        @discovery.expects(:discovery_method).returns("mc")
-        PluginManager.expects(:loadclass).never
-        Discovery.expects(:const_defined?).with("Mc").returns(true)
-        Discovery.expects(:const_get).with("Mc").returns("rspec")
-        @discovery.discovery_class.should == "rspec"
-      end
-    end
-
-    describe "#initialize" do
-      it "should load all the known methods" do
-        @discovery.instance_variable_get("@known_methods").should == ["mc"]
-      end
-    end
-
-    describe "#find_known_methods" do
-      it "should use the PluginManager to find plugins of type 'discovery'" do
-        @discovery.find_known_methods.should == ["mc"]
-      end
-    end
-
-    describe "#has_method?" do
-      it "should correctly report the availability of a discovery method" do
-        @discovery.has_method?("mc").should == true
-        @discovery.has_method?("rspec").should == false
-      end
-    end
-
-    describe "#descovery_method" do
-      it "should default to 'mc'" do
-        @client.expects(:options).returns({})
-        @discovery.discovery_method.should == "mc"
-      end
-
-      it "should give preference to the client options" do
-        @client.expects(:options).returns({:discovery_method => "rspec"}).twice
-        Config.instance.expects(:direct_addressing).returns(true)
-        @discovery.expects(:has_method?).with("rspec").returns(true)
-        @discovery.discovery_method.should == "rspec"
-      end
-
-      it "should validate the discovery method exists" do
-        @client.expects(:options).returns({:discovery_method => "rspec"}).twice
-        expect { @discovery.discovery_method.should == "rspec" }.to raise_error("Unknown discovery method rspec")
-      end
-
-      it "should only allow custom discovery methods if direct_addressing is enabled" do
-        @client.expects(:options).returns({:discovery_method => "rspec"}).twice
-        Config.instance.expects(:direct_addressing).returns(false)
-        @discovery.expects(:has_method?).with("rspec").returns(true)
-        expect { @discovery.discovery_method.should == "rspec" }.to raise_error("Custom discovery methods require direct addressing mode")
-      end
-    end
-  end
-end
diff --git a/spec/unit/facts/base_spec.rb b/spec/unit/facts/base_spec.rb
deleted file mode 100755 (executable)
index 5ba9640..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective::Facts
-  describe Base do
-    before do
-      class Testfacts<Base; end
-
-      MCollective::PluginManager.delete("facts_plugin")
-      MCollective::PluginManager << {:type => "facts_plugin", :class => "MCollective::Facts::Testfacts"}
-    end
-
-    describe "#inherited" do
-      it "should add classes to the plugin manager" do
-        MCollective::PluginManager.expects("<<").with({:type => "facts_plugin", :class => "MCollective::Facts::Bar"})
-
-        class Bar<Base; end
-      end
-
-      it "should be available in the PluginManager" do
-        MCollective::PluginManager["facts_plugin"].class.should == MCollective::Facts::Testfacts
-      end
-    end
-
-    describe "#get_fact" do
-      it "should call the fact provider #load_facts_from_source" do
-        Testfacts.any_instance.stubs("load_facts_from_source").returns({"foo" => "bar"}).once
-
-        f = Testfacts.new
-        f.get_fact("foo")
-      end
-
-      it "should honor the cache timeout" do
-        Testfacts.any_instance.stubs("load_facts_from_source").returns({"foo" => "bar"}).once
-
-        f = Testfacts.new
-        f.get_fact("foo")
-        f.get_fact("foo")
-      end
-
-      it "should detect empty facts" do
-        Testfacts.any_instance.stubs("load_facts_from_source").returns({})
-        MCollective::Log.expects("error").with("Failed to load facts: RuntimeError: Got empty facts").once
-
-        f = Testfacts.new
-        f.get_fact("foo")
-      end
-
-      it "should convert non string facts to strings" do
-        Testfacts.any_instance.stubs("load_facts_from_source").returns({:foo => "bar"})
-
-        f = Testfacts.new
-        f.get_fact("foo").should == "bar"
-      end
-
-      it "should not create duplicate facts while converting to strings" do
-        Testfacts.any_instance.stubs("load_facts_from_source").returns({:foo => "bar"})
-
-        f = Testfacts.new
-        f.get_fact(nil).include?(:foo).should == false
-      end
-
-      it "should update last_facts_load on success" do
-        Testfacts.any_instance.stubs("load_facts_from_source").returns({"foo" => "bar"}).once
-
-        f = Testfacts.new
-        f.get_fact("foo")
-
-        f.instance_variable_get("@last_facts_load").should_not == 0
-      end
-
-      it "should restore last known good facts on failure" do
-        Testfacts.any_instance.stubs("load_facts_from_source").returns({}).once
-        MCollective::Log.expects("error").with("Failed to load facts: RuntimeError: Got empty facts").once
-
-        f = Testfacts.new
-        f.instance_variable_set("@last_good_facts", {"foo" => "bar"})
-
-        f.get_fact("foo").should == "bar"
-      end
-
-      it "should return all facts for nil parameter" do
-        Testfacts.any_instance.stubs("load_facts_from_source").returns({"foo" => "bar", "bar" => "baz"})
-
-        f = Testfacts.new
-        f.get_fact(nil).keys.size.should == 2
-      end
-
-      it "should return a specific fact when specified" do
-        Testfacts.any_instance.stubs("load_facts_from_source").returns({"foo" => "bar", "bar" => "baz"})
-
-        f = Testfacts.new
-        f.get_fact("bar").should == "baz"
-      end
-    end
-
-    describe "#get_facts" do
-      it "should load and return all facts" do
-        Testfacts.any_instance.stubs("load_facts_from_source").returns({"foo" => "bar", "bar" => "baz"})
-
-        f = Testfacts.new
-        f.get_facts.should == {"foo" => "bar", "bar" => "baz"}
-      end
-    end
-
-    describe "#has_fact?" do
-      it "should correctly report fact presense" do
-        Testfacts.any_instance.stubs("load_facts_from_source").returns({"foo" => "bar"})
-
-        f = Testfacts.new
-        f.has_fact?("foo").should == true
-        f.has_fact?("bar").should == false
-      end
-    end
-
-  end
-end
diff --git a/spec/unit/facts_spec.rb b/spec/unit/facts_spec.rb
deleted file mode 100755 (executable)
index 2705242..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe Facts do
-    before do
-      class Facts::Testfacts<Facts::Base; end
-
-      PluginManager.delete("facts_plugin")
-      PluginManager << {:type => "facts_plugin", :class => "MCollective::Facts::Testfacts"}
-    end
-
-    describe "#has_fact?" do
-      it "should correctly report fact presense" do
-        Facts::Testfacts.any_instance.stubs("load_facts_from_source").returns({"foo" => "bar"})
-
-        Facts.has_fact?("foo", "foo").should == false
-        Facts.has_fact?("foo", "bar").should == true
-      end
-    end
-
-    describe "#get_fact" do
-      it "should return the correct fact" do
-        Facts::Testfacts.any_instance.stubs("load_facts_from_source").returns({"foo" => "bar"})
-
-        Facts.get_fact("foo").should == "bar"
-      end
-    end
-
-    describe "#[]" do
-      it "should return the correct fact" do
-        Facts::Testfacts.any_instance.stubs("load_facts_from_source").returns({"foo" => "bar"})
-
-        Facts["foo"].should == "bar"
-      end
-    end
-  end
-end
diff --git a/spec/unit/generators/agent_generator_spec.rb b/spec/unit/generators/agent_generator_spec.rb
deleted file mode 100644 (file)
index 0bb5b97..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-#! /usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module Generators
-      describe AgentGenerator do
-
-        describe "#create_ddl" do
-
-          before :each do
-            AgentGenerator.any_instance.stubs(:create_plugin_content)
-            AgentGenerator.any_instance.stubs(:create_plugin_string)
-            AgentGenerator.any_instance.stubs(:write_plugins)
-            AgentGenerator.any_instance.expects(:create_metadata_string).returns("metadata\n")
-          end
-
-          it "should create a ddl with nothing but metadata if no actions are specified" do
-            result = AgentGenerator.new("foo").ddl
-            result.should == "metadata\n"
-          end
-
-          it "should add action strings to metadata if there are actions specfied" do
-            result = AgentGenerator.new("foo", ["action1", "action2"]).ddl
-            expected = File.read(File.join(File.dirname(__FILE__), "snippets", "agent_ddl"))
-            result.should == expected
-          end
-        end
-
-        describe "#create_plugin_content" do
-          before :each do
-            AgentGenerator.any_instance.stubs(:create_plugin_string)
-            AgentGenerator.any_instance.stubs(:write_plugins)
-            AgentGenerator.any_instance.stubs(:create_metadata_string).returns("metadata\n")
-            AgentGenerator.any_instance.stubs(:create_ddl)
-          end
-
-          it "should create the correct pluginf ile content with actions if they are specified" do
-            AgentGenerator.any_instance.stubs(:create_metadata_string).returns("meta\n")
-            result = AgentGenerator.new("foo", ["action1", "action2"]).content
-            result.should == "      action \"action1\" do\n      end\n\n      action \"action2\" do\n      end\n"
-          end
-        end
-
-        describe "#action_help" do
-          before :each do
-            AgentGenerator.any_instance.stubs(:create_plugin_content)
-            AgentGenerator.any_instance.stubs(:create_plugin_string)
-            AgentGenerator.any_instance.stubs(:write_plugins)
-            AgentGenerator.any_instance.stubs(:create_metadata_string).returns("metadata\n")
-          end
-
-          it "should load and return the action_help snippet" do
-            erb = mock
-            erb.stubs(:result).returns("result")
-            File.stubs(:dirname).returns("/tmp")
-            File.expects(:read).with("/tmp/templates/action_snippet.erb").returns("result")
-            ERB.expects(:new).with("result").returns(erb)
-            AgentGenerator.new("foo", ["action"])
-          end
-
-          it "should raise an error if the action_help snippet does not exist" do
-            File.stubs(:dirname).returns("/tmp")
-            File.stubs(:read).raises(Errno::ENOENT, "No such file or directory")
-            expect{
-              AgentGenerator.new("foo", ["action"])
-            }.to raise_error(Errno::ENOENT)
-          end
-        end
-      end
-  end
-end
diff --git a/spec/unit/generators/base_spec.rb b/spec/unit/generators/base_spec.rb
deleted file mode 100644 (file)
index a30720d..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/usr/bin/env rspec
-
-require "spec_helper"
-
-module MCollective
-  module Generators
-    describe Base do
-      before :each do
-        @erb = mock
-        @erb.stubs(:result)
-        File.stubs(:dirname).returns("/tmp")
-        @base = Base.new(nil, nil, nil, nil, nil, nil, nil)
-      end
-
-      describe "#initialize" do
-        it "should set the correct metaparameters" do
-          res = Base.new("name", "description", "author", "license", "version", "url", "timeout")
-          res.meta.should == {:name => "name",
-                              :description => "description",
-                              :author => "author",
-                              :license => "license",
-                              :version => "version",
-                              :url => "url",
-                              :timeout => "timeout"}
-        end
-      end
-
-      describe "#create_metadata_string" do
-        it "should load the ddl template if it is present" do
-          File.expects(:read).returns("ddl")
-          ERB.expects(:new).with("ddl", nil, "-").returns(@erb)
-          @base.create_metadata_string
-        end
-
-        it "should raise an error if the template is not present" do
-          File.expects(:read).raises(Errno::ENOENT)
-          expect{
-            @base.create_metadata_string
-          }.to raise_error(Errno::ENOENT)
-        end
-      end
-
-      describe "#create_plugin_string " do
-        it "should load the plugin template if it is present" do
-          File.expects(:read).returns("plugin")
-          ERB.expects(:new).with("plugin", nil, "-").returns(@erb)
-          @base.create_plugin_string
-        end
-
-        it "should raise an error if the template is not present" do
-          File.expects(:read).raises(Errno::ENOENT)
-          expect{
-            @base.create_plugin_string
-          }.to raise_error(Errno::ENOENT)
-        end
-      end
-
-      describe "#write_plugins" do
-        it "should fail if the directory already exists" do
-          Dir.expects(:mkdir).raises(Errno::EEXIST)
-          @base.plugin_name = "foo"
-          expect{
-            @base.write_plugins
-          }.to raise_error(RuntimeError)
-        end
-
-        it "should create the directory and the plugin files if it doesn't exist" do
-          Dir.stubs(:pwd).returns("/tmp")
-          @base.stubs(:puts)
-
-          Dir.expects(:mkdir).with("foo")
-          Dir.expects(:mkdir).with("foo/agent")
-          File.expects(:open).with("foo/agent/foo.ddl", "w")
-          File.expects(:open).with("foo/agent/foo.rb", "w")
-
-          @base.plugin_name = "foo"
-          @base.mod_name = "agent"
-          @base.write_plugins
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/generators/data_generator_spec.rb b/spec/unit/generators/data_generator_spec.rb
deleted file mode 100644 (file)
index 863b6e2..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#! /usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module Generators
-      describe DataGenerator do
-
-        before :each do
-          DataGenerator.stubs(:create_metadata_string).returns("meta\n")
-        end
-
-        describe "#create_ddl" do
-          it "create the correct ddl string" do
-            DataGenerator.any_instance.stubs(:create_plugin_content)
-            DataGenerator.any_instance.stubs(:create_plugin_string)
-            DataGenerator.any_instance.stubs(:write_plugins)
-
-            ddl = DataGenerator.new("foo", ["output"]).ddl
-            expected = File.read(File.join(File.dirname(__FILE__), "snippets", "data_ddl")).chop
-            ddl.should == expected
-          end
-        end
-
-        describe "#create_plugin_content" do
-          it "should create the correct plugin content" do
-            DataGenerator.any_instance.stubs(:create_ddl)
-            DataGenerator.any_instance.stubs(:create_plugin_string)
-            DataGenerator.any_instance.stubs(:write_plugins)
-
-            ddl = DataGenerator.new("foo", ["output"]).content
-            ddl.should == "      query do |what|\n        result[:output] = nil\n      end\n"
-          end
-        end
-      end
-  end
-end
diff --git a/spec/unit/generators/snippets/agent_ddl b/spec/unit/generators/snippets/agent_ddl
deleted file mode 100644 (file)
index e7a3ba0..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-metadata
-action "action1", :description => "%ACTIONDESCRIPTION%" do
-     # Example Input
-     input :name,
-           :prompt => "%PROMPT%",
-           :description => "%DESCRIPTION%",
-           :type => %TYPE%,
-           :validation => '%VALIDATION%',
-           :optional => %OPTIONAL%,
-           :maxlength => %MAXLENGTH%
-
-     # Example output
-     output :name,
-            :description => "%DESCRIPTION%",
-            :display_as => "%DISPLAYAS%"
-end
-
-action "action2", :description => "%ACTIONDESCRIPTION%" do
-end
diff --git a/spec/unit/generators/snippets/data_ddl b/spec/unit/generators/snippets/data_ddl
deleted file mode 100644 (file)
index a37ec10..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-metadata :name => "%FULLNANE%",
-         :description => "%DESCRIPTION%",
-         :author => "%AUTHOR%",
-         :license => "%LICENSE%",
-         :version => "%VERSION%",
-         :url => "%URL%",
-         :timeout => %TIMEOUT%
-
-dataquery :description => "Query information" do
-  input :query,
-        :prompt => "%PROMP%",
-        :description => "%DESCRIPTION%",
-        :type => %TYPE%,
-        :validation => %VALIDATION%,
-        :maxlength => %MAXLENGTH%
-
-  output :output,
-         :description => "%DESCRIPTION%",
-         :display_as => "%DESCRIPTION%"
-end
diff --git a/spec/unit/log_spec.rb b/spec/unit/log_spec.rb
deleted file mode 100755 (executable)
index f984343..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe Log do
-    before do
-      @logger = mock("logger provider")
-      @logger.stubs(:start)
-      @logger.stubs(:set_logging_level)
-      @logger.stubs(:valid_levels)
-      @logger.stubs(:should_log?).returns(true)
-      @logger.stubs(:new).returns(@logger)
-
-      # we stub it out at the top of the test suite
-      Log.unstub(:log)
-      Log.unstub(:logexception)
-      Log.unstub(:logmsg)
-
-      Log.unconfigure
-      Log.set_logger(@logger)
-    end
-
-    describe "#config_and_check_level" do
-      it "should configure then not already configured" do
-        Log.expects(:configure)
-        Log.config_and_check_level(:debug)
-      end
-
-      it "should not reconfigure the logger" do
-        Log.configure(@logger)
-        Log.expects(:configure).never
-        Log.config_and_check_level(:debug)
-      end
-
-      it "should check the level is valid" do
-        Log.configure(@logger)
-        Log.expects(:check_level).with(:debug)
-        Log.config_and_check_level(:debug)
-      end
-
-      it "should respect the loggers decision about levels" do
-        Log.configure(@logger)
-        @logger.expects(:should_log?).returns(false)
-        Log.config_and_check_level(:debug).should == false
-      end
-    end
-
-    describe "#valid_level?" do
-      it "should correctly report for valid levels" do
-        [:error, :fatal, :debug, :warn, :info].each {|level| Log.valid_level?(level).should == true }
-        Log.valid_level?(:rspec).should == false
-      end
-    end
-
-    describe "#message_for" do
-      it "should return the code and retrieved message" do
-        Util.expects(:t).with(:PLMC1, {:rspec => true}).returns("this is PLMC1")
-        Log.message_for(:PLMC1, {:rspec => true}).should == "PLMC1: this is PLMC1"
-      end
-    end
-
-    describe "#logexception" do
-      it "should short circuit messages below current level" do
-        Log.expects(:config_and_check_level).with(:debug).returns(false)
-        Log.expects(:log).never
-        Log.logexception(:PLMC1, :debug, Exception.new, {})
-      end
-
-      it "should request the message including the exception string and log it" do
-        Log.stubs(:config_and_check_level).returns(true)
-        Log.expects(:message_for).with(:PLMC1, {:rspec => "test", :error => "Exception: this is a test"}).returns("This is a test")
-        Log.expects(:log).with(:debug, "This is a test", "test:2")
-
-        e = Exception.new("this is a test")
-        e.set_backtrace ["/some/dir/test:1", "/some/dir/test:2"]
-
-        Log.logexception(:PLMC1, :debug, e, false, {:rspec => "test"})
-      end
-    end
-
-    describe "#logmsg" do
-      it "should short circuit messages below current level" do
-        Log.expects(:config_and_check_level).with(:debug).returns(false)
-        Log.expects(:log).never
-        Log.logmsg(:PLMC1, "", :debug, {})
-      end
-
-      it "should request the message and log it" do
-        Log.stubs(:config_and_check_level).returns(true)
-        Log.expects(:message_for).with(:PLMC1, {:rspec => "test", :default => "default"}).returns("This is a test")
-        Log.expects(:log).with(:debug, "This is a test")
-        Log.logmsg(:PLMC1, "default", :debug, :rspec => "test")
-      end
-    end
-
-    describe "#check_level" do
-      it "should check for valid levels" do
-        Log.expects(:valid_level?).with(:debug).returns(true)
-        Log.check_level(:debug)
-      end
-
-      it "should raise for invalid levels" do
-        expect { Log.check_level(:rspec) }.to raise_error("Unknown log level")
-      end
-    end
-
-    describe "#configure" do
-      it "should default to console logging if called prior to configuration" do
-        Config.instance.instance_variable_set("@configured", false)
-        Log.configure
-        Log.logger.should ==  MCollective::Logger::Console_logger
-      end
-    end
-
-    describe "#instance" do
-      it "should return the correct reference" do
-        Log.configure(@logger)
-        Log.instance.should == MCollective::Log
-      end
-    end
-
-    describe "#log" do
-      it "should log at the right levels" do
-        Log.configure(@logger)
-
-        [:debug, :info, :fatal, :error, :warn].each do |level|
-          @logger.expects(:log).with(level, anything, regexp_matches(/#{level} test/))
-          @logger.expects(:should_log?).with(level).returns(true)
-          Log.send(level, "#{level} test")
-        end
-      end
-    end
-
-    describe "#cycle_level" do
-      it "should cycle logger class levels" do
-        @logger.expects(:cycle_level)
-
-        Log.configure(@logger)
-        Log.cycle_level
-      end
-    end
-  end
-end
diff --git a/spec/unit/logger/base_spec.rb b/spec/unit/logger/base_spec.rb
deleted file mode 100755 (executable)
index e618f65..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective::Logger
-  describe Base do
-    before do
-      Base.any_instance.stubs(:set_logging_level).returns(true)
-      Base.any_instance.stubs(:valid_levels).returns({:info  => :info_test,
-                                                       :warn  => :warning_test,
-                                                       :debug => :debug_test,
-                                                       :fatal => :crit_test,
-                                                       :error => :err_test})
-    end
-
-    describe "#initialize" do
-      it "should check for valid levels" do
-        Base.any_instance.stubs(:valid_levels).returns({})
-
-        expect {
-          Base.new
-        }.to raise_error(/Logger class did not specify a map for/)
-      end
-
-      it "should accept correct levels" do
-        logger = Base.new
-        logger.set_level :warn
-
-        logger.should_log?(:debug).should == false
-        logger.should_log?(:error).should == true
-      end
-    end
-
-    describe "#should_log?" do
-      it "should correctly determine if a line should be logged" do
-      end
-    end
-    describe "#valid_levels" do
-      it "should report if valid_levels was not implimented" do
-        Base.any_instance.unstub(:valid_levels)
-
-        expect {
-          logger = Base.new
-        }.to raise_error("The logging class did not supply a valid_levels method")
-      end
-    end
-
-    describe "#log" do
-      it "should report if log was not implimented" do
-        logger = Base.new
-
-        expect {
-          logger.send(:log, nil, nil, nil)
-        }.to raise_error("The logging class did not supply a log method")
-      end
-    end
-
-    describe "#start" do
-      it "should report if log was not implimented" do
-        logger = Base.new
-
-        expect {
-          logger.send(:start)
-        }.to raise_error("The logging class did not supply a start method")
-      end
-    end
-
-    describe "#map_level" do
-      it "should map levels correctly" do
-        logger = Base.new
-
-        logger.send(:map_level, :info).should == :info_test
-        logger.send(:map_level, :warn).should == :warning_test
-        logger.send(:map_level, :debug).should == :debug_test
-        logger.send(:map_level, :fatal).should == :crit_test
-        logger.send(:map_level, :error).should == :err_test
-      end
-    end
-
-    describe "#get_next_level" do
-      it "should supply the correct next level" do
-        logger = Base.new
-        logger.set_level(:fatal)
-
-        logger.send(:get_next_level).should == :debug
-      end
-    end
-
-    describe "#cycle_level" do
-      it "should set the level to the next one and log the event" do
-        logger = Base.new
-
-        logger.stubs(:get_next_level).returns(:error)
-
-        logger.expects(:set_level).with(:error)
-        logger.expects(:log).with(:error, "", "Logging level is now ERROR")
-
-        logger.cycle_level
-      end
-    end
-
-    describe "#set_level" do
-      it "should set the active level" do
-        logger = Base.new
-
-        logger.set_level(:error)
-
-        logger.active_level.should == :error
-      end
-
-      it "should set the level on the logger" do
-        logger = Base.new
-
-        logger.set_level(:error)
-      end
-    end
-  end
-end
diff --git a/spec/unit/logger/console_logger_spec.rb b/spec/unit/logger/console_logger_spec.rb
deleted file mode 100644 (file)
index 15da7bd..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  require 'mcollective/logger/console_logger'
-
-  module Logger
-    describe Console_logger do
-      describe "#start" do
-        it "should default to :info and allow the config to override" do
-          logger = Console_logger.new
-          logger.expects(:set_level).with(:info)
-          Config.instance.expects(:configured).returns(true)
-          Config.instance.expects(:loglevel).returns("error")
-          logger.expects(:set_level).with(:error)
-          logger.start
-        end
-      end
-
-      describe "#color" do
-        it "should not colorize if color was disabled" do
-          logger = Console_logger.new
-          Config.instance.stubs(:color).returns(false)
-          logger.color(:error).should == ""
-          logger.color(:reset).should == ""
-        end
-
-        it "should correctly colorize by level" do
-          logger = Console_logger.new
-          Config.instance.stubs(:color).returns(true)
-          logger.color(:error).should == Util.color(:red)
-          logger.color(:reset).should == Util.color(:reset)
-        end
-      end
-
-      describe "#log" do
-        it "should log higher than configured levels" do
-          io = StringIO.new
-          io.expects(:puts).with("error 2012/07/03 15:11:35: rspec message")
-
-          time = stub
-          time.expects(:strftime).returns("2012/07/03 15:11:35")
-
-          Time.expects(:new).returns(time)
-
-          Config.instance.stubs(:color).returns(false)
-          logger = Console_logger.new
-          logger.set_level(:warn)
-          logger.log(:error, "rspec", "message", io)
-        end
-
-        it "should resort to STDERR output if all else fails" do
-          io = StringIO.new
-          io.expects(:puts).raises
-
-          last_resort_io = StringIO.new
-          last_resort_io.expects(:puts).with("warn: message")
-
-          logger = Console_logger.new
-          logger.set_level(:debug)
-          logger.log(:warn, "rspec", "message", io, last_resort_io)
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/logger/syslog_logger_spec.rb b/spec/unit/logger/syslog_logger_spec.rb
deleted file mode 100644 (file)
index 283ca5e..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  unless Util.windows?
-    require 'mcollective/logger/syslog_logger'
-
-    module Logger
-      describe Syslog_logger do
-        describe "#start" do
-          before do
-            Config.instance.stubs(:logfacility).returns("user")
-            Config.instance.stubs(:loglevel).returns("error")
-          end
-
-          it "should close the syslog if already opened" do
-            Syslog.expects("opened?").returns(true)
-            Syslog.expects(:close).once
-            Syslog.expects(:open).once
-
-            logger = Syslog_logger.new
-            logger.start
-          end
-
-          it "should open syslog with the correct facility" do
-            logger = Syslog_logger.new
-            Syslog.expects(:open).with("rspec", 3, Syslog::LOG_USER).once
-            logger.start
-          end
-
-          it "should set the logger level correctly" do
-            logger = Syslog_logger.new
-            Syslog.expects(:open).with("rspec", 3, Syslog::LOG_USER).once
-            logger.expects(:set_level).with(:error).once
-            logger.start
-          end
-        end
-
-        describe "#syslog_facility" do
-          it "should support valid facilities" do
-            logger = Syslog_logger.new
-            logger.syslog_facility("LOCAL1").should == Syslog::LOG_LOCAL1
-            logger.syslog_facility("local1").should == Syslog::LOG_LOCAL1
-          end
-
-          it "should set LOG_USER for unknown facilities" do
-            logger = Syslog_logger.new
-            IO.any_instance.expects(:puts).with("Invalid syslog facility rspec supplied, reverting to USER")
-            logger.syslog_facility("rspec").should == Syslog::LOG_USER
-          end
-        end
-
-        describe "#log" do
-          it "should log higher than configured levels" do
-            logger = Syslog_logger.new
-            logger.set_level(:debug)
-            Syslog.expects(:err).once
-            logger.log(:error, "rspec", "rspec")
-          end
-
-          it "should log using the correctly mapped level" do
-            logger = Syslog_logger.new
-            Syslog.expects(:err).with("rspec rspec").once
-            logger.set_level(:debug)
-            logger.log(:error, "rspec", "rspec")
-          end
-
-          it "should resort to STDERR output if all else fails" do
-            logger = Syslog_logger.new
-            IO.any_instance.expects(:puts).with("error: rspec").once
-
-            logger.log(:error, "rspec", "rspec")
-          end
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/matcher/parser_spec.rb b/spec/unit/matcher/parser_spec.rb
deleted file mode 100755 (executable)
index 0a9d52e..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-#! /usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module Matcher
-    describe Parser do
-      before :each do
-        Config.instance.stubs(:color).returns(false)
-      end
-
-      describe '#parse' do
-        it "should parse statements seperated by '='" do
-          parser = Parser.new("foo=bar")
-          parser.execution_stack.should == [{"statement" => "foo=bar"}]
-        end
-
-        it "should parse statements seperated by '<'" do
-          parser = Parser.new("foo<bar")
-          parser.execution_stack.should == [{"statement" => "foo<bar"}]
-        end
-
-        it "should parse statements seperated by '>'" do
-          parser = Parser.new("foo>bar")
-          parser.execution_stack.should == [{"statement" => "foo>bar"}]
-        end
-
-        it "should parse statements seperated by '<='" do
-          parser = Parser.new("foo<=bar")
-          parser.execution_stack.should == [{"statement" => "foo<=bar"}]
-        end
-
-        it "should parse statements seperated by '>='" do
-          parser = Parser.new("foo>=bar")
-          parser.execution_stack.should == [{"statement" => "foo>=bar"}]
-        end
-
-        it "should parse class regex statements" do
-          parser = Parser.new("/foo/")
-          parser.execution_stack.should == [{"statement" => "/foo/"}]
-        end
-
-        it "should parse fact regex statements" do
-          parser = Parser.new("foo=/bar/")
-          parser.execution_stack.should == [{"statement" => "foo=/bar/"}]
-        end
-
-        it "should parse a correct 'and' token" do
-          parser = Parser.new("foo=bar and bar=foo")
-          parser.execution_stack.should == [{"statement" => "foo=bar"}, {"and" => "and"}, {"statement" => "bar=foo"}]
-        end
-
-        it "should not parse an incorrect and token" do
-          expect {
-            parser = Parser.new("and foo=bar")
-          }.to raise_error(RuntimeError, "Parse errors found while parsing -S input and foo=bar")
-        end
-
-        it "should parse a correct 'or' token" do
-          parser = Parser.new("foo=bar or bar=foo")
-          parser.execution_stack.should == [{"statement" => "foo=bar"}, {"or" => "or"}, {"statement" => "bar=foo"}]
-        end
-
-        it "should not parse an incorrect or token" do
-          expect{
-            parser = Parser.new("or foo=bar")
-          }.to raise_error(RuntimeError, "Parse errors found while parsing -S input or foo=bar")
-        end
-
-        it "should parse a correct 'not' token" do
-          parser = Parser.new("! bar=foo")
-          parser.execution_stack.should == [{"not" => "not"}, {"statement" => "bar=foo"}]
-          parser = Parser.new("not bar=foo")
-          parser.execution_stack.should == [{"not" => "not"}, {"statement" => "bar=foo"}]
-        end
-
-        it "should not parse an incorrect 'not' token" do
-          expect{
-            parser = Parser.new("foo=bar !")
-          }.to raise_error(RuntimeError, "Parse errors found while parsing -S input foo=bar !")
-        end
-
-        it "should parse correct parentheses" do
-          parser = Parser.new("(foo=bar)")
-          parser.execution_stack.should == [{"(" => "("}, {"statement" => "foo=bar"}, {")" => ")"}]
-        end
-
-        it "should fail on incorrect parentheses" do
-          expect{
-            parser = Parser.new(")foo=bar(")
-          }.to raise_error(RuntimeError, "Malformed token(s) found while parsing -S input )foo=bar(")
-        end
-
-        it "should fail on missing parentheses" do
-          expect{
-            parser = Parser.new("(foo=bar")
-          }.to raise_error(RuntimeError, "Missing parenthesis found while parsing -S input (foo=bar")
-        end
-
-        it "should parse correctly formatted compound statements" do
-          parser = Parser.new("(foo=bar or foo=rab) and (bar=foo)")
-          parser.execution_stack.should == [{"(" => "("}, {"statement"=>"foo=bar"}, {"or"=>"or"}, {"statement"=>"foo=rab"},
-                                            {")"=>")"}, {"and"=>"and"}, {"("=>"("}, {"statement"=>"bar=foo"},
-                                            {")"=>")"}]
-        end
-
-        it "should parse complex fstatements and statements with operators seperated by whitespaces" do
-          parser = Parser.new("foo('bar').value = 1 and foo=bar or foo  = bar")
-          parser.execution_stack.should == [{"fstatement"=>"foo('bar').value=1"}, {"and"=>"and"}, {"statement"=>"foo=bar"}, {"or"=>"or"}, {"statement"=>"foo=bar"}]
-        end
-
-        it "should parse statements where classes are mixed with fact comparisons and fstatements" do
-          parser = Parser.new("klass and function('param').value = 1 and fact=value")
-          parser.execution_stack.should == [{"statement" => "klass"},
-                                            {"and" => "and"},
-                                            {"fstatement" => "function('param').value=1"},
-                                            {"and" => "and"},
-                                            {"statement" => "fact=value"}]
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/matcher/scanner_spec.rb b/spec/unit/matcher/scanner_spec.rb
deleted file mode 100755 (executable)
index a0bdd14..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-#! /usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module Matcher
-    describe 'scanner' do
-      it "should identify a '(' token" do
-        scanner = Scanner.new("(")
-        token = scanner.get_token
-        token.should == ["(", "("]
-      end
-
-      it "should identify a ')' token" do
-        scanner = Scanner.new(")")
-        token = scanner.get_token
-        token.should == [")", ")"]
-      end
-
-      it "should identify a 'and' token" do
-        scanner = Scanner.new("and ")
-        token = scanner.get_token
-        token.should == ["and", "and"]
-      end
-
-      it "should identify a 'or' token" do
-        scanner = Scanner.new("or ")
-        token = scanner.get_token
-        token.should == ["or", "or"]
-      end
-
-      it "should identify a 'not' token" do
-        scanner = Scanner.new("not ")
-        token = scanner.get_token
-        token.should == ["not", "not"]
-      end
-
-      it "should identify a '!' token" do
-        scanner = Scanner.new("!")
-        token = scanner.get_token
-        token.should == ["not", "not"]
-      end
-
-      it "should identify a fact statement token" do
-        scanner = Scanner.new("foo=bar")
-        token = scanner.get_token
-        token.should == ["statement", "foo=bar"]
-      end
-
-      it "should identify a fact statement token" do
-        scanner = Scanner.new("foo=bar")
-        token = scanner.get_token
-        token.should == ["statement", "foo=bar"]
-      end
-
-      it "should identify a class statement token" do
-        scanner = Scanner.new("/class/")
-        token = scanner.get_token
-        token.should == ["statement", "/class/"]
-      end
-
-      it "should identify a function statement token with a dot value" do
-        scanner = Scanner.new("foo('bar').baz")
-        token = scanner.get_token
-        token.should == ["fstatement", "foo('bar').baz"]
-      end
-
-      it "should identify a function statement token without a dot value" do
-        scanner = Scanner.new("foo('bar')")
-        token = scanner.get_token
-        token.should == ["fstatement", "foo('bar')"]
-      end
-
-      it "should identify a function statement with multiple parameters" do
-        scanner = Scanner.new("foo('bar','baz')")
-        token = scanner.get_token
-        token.should == ["fstatement", "foo('bar','baz')"]
-      end
-
-      it "should identify a bad token when a function is missing its end bracket" do
-        scanner = Scanner.new("foo(")
-        token = scanner.get_token
-        token.should == ["bad_token", [0,3]]
-      end
-
-      it "should identify a bad token when there is a regex before a comparison operator" do
-        scanner = Scanner.new("/foo/=bar")
-        token = scanner.get_token
-        token.should == ["bad_token", [0,8]]
-      end
-
-      it "should identify a bad token where there is a forward slash before a comparison operator" do
-        scanner = Scanner.new("/foo=bar")
-        token = scanner.get_token
-        token.should == ["bad_token", [0,7]]
-      end
-
-      it "should identify a bad token where there is only one forward slash after a comparison operator" do
-        scanner = Scanner.new("foo=/bar")
-        token = scanner.get_token
-        token.should == ["bad_token", [0,7]]
-      end
-
-      it "should identify a bad token where function parameters are not in single quotes" do
-        scanner = Scanner.new("foo(bar)")
-        token = scanner.get_token
-        token.should == ["bad_token", [0,7]]
-      end
-
-      it "should identify a bad token where there are non alphanumerical or underscore chars in the dot value" do
-        scanner = Scanner.new("foo('bar').val-ue")
-        token = scanner.get_token
-        token.should == ["bad_token", [0,16]]
-      end
-
-      it "should identify a bad token where there are chained dot values" do
-        scanner = Scanner.new("foo('bar').a.b")
-        token = scanner.get_token
-        token.should == ["bad_token", [0,13]]
-      end
-
-      it "should identify bad tokens where function parameters are not comma seperated" do
-        scanner = Scanner.new("foo('a' 'b')")
-        token = scanner.get_token
-        token.should == ["bad_token", [0,11]]
-
-        scanner = Scanner.new("foo(\"a\" \"b\")")
-        token = scanner.get_token
-        token.should == ["bad_token", [0,11]]
-
-      end
-
-      it "should identify fstatement tokens where the values and the comparison operator are seperated by whitespaces" do
-        scanner = Scanner.new("foo('a').bar  = 1")
-        token = scanner.get_token
-        token.should == ["fstatement", "foo('a').bar=1"]
-      end
-
-      it "should identify statement tokens where the values and the comparison operator are seperated by whitespaces" do
-        scanner = Scanner.new("a =  c")
-        token = scanner.get_token
-        token.should == ["statement", "a=c"]
-      end
-
-      it "should idenify a function statement where a parameter is an empty string" do
-        scanner = Scanner.new("foo('')")
-        token = scanner.get_token
-        token.should == ["fstatement", "foo('')"]
-      end
-
-      it "should correctly tokenize a statement with escaped qoutes in parameters" do
-        scanner = Scanner.new("foo('\"bar\"')")
-        token = scanner.get_token
-        token.should == ["fstatement", "foo('\"bar\"')"]
-
-        scanner = Scanner.new('foo("\'bar\'")')
-        token =scanner.get_token
-        token.should == ["fstatement", "foo(\"'bar'\")"]
-      end
-
-      it "should correctly tokenize a statement where a regular expression contains parentheses" do
-        scanner = Scanner.new("foo=/bar(1|2)/")
-        token = scanner.get_token
-        token.should == ["statement", "foo=/bar(1|2)/"]
-      end
-
-      it "should correctly tokenize a statement with a comparison operator in a parameter" do
-        scanner = Scanner.new("foo('bar=baz')")
-        token = scanner.get_token
-        token.should == ["fstatement", "foo('bar=baz')"]
-      end
-    end
-  end
-end
diff --git a/spec/unit/matcher_spec.rb b/spec/unit/matcher_spec.rb
deleted file mode 100644 (file)
index 19f0eaa..0000000
+++ /dev/null
@@ -1,260 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe Matcher do
-    describe "#create_function_hash" do
-      it "should create a correct hash for a 'normal' function call using single quotes" do
-        result = Matcher.create_function_hash("foo('bar').res=1")
-        result["value"].should == "res"
-        result["params"].should == "bar"
-        result["r_compare"].should == "1"
-        result["operator"].should == "=="
-        result["name"].should == "foo"
-      end
-
-      it "should create a correct hash for a 'normal' function call using double quotes" do
-        result = Matcher.create_function_hash('foo("bar").res=1')
-        result["value"].should == "res"
-        result["params"].should == "bar"
-        result["r_compare"].should == "1"
-        result["operator"].should == "=="
-        result["name"].should == "foo"
-       end
-
-      it "should create a correct hash when a paramater contains a dot value" do
-        result = Matcher.create_function_hash("foo('bar.1').res=1")
-        result["value"].should == "res"
-        result["params"].should == "bar.1"
-        result["r_compare"].should == "1"
-        result["operator"].should == "=="
-        result["name"].should == "foo"
-      end
-
-      it "should create a correct hash when right compare value is a regex" do
-        result = Matcher.create_function_hash("foo('bar').res=/reg/")
-        result["value"].should == "res"
-        result["params"].should == "bar"
-        result["r_compare"].should == /reg/
-        result["operator"].should == "=~"
-        result["name"].should == "foo"
-      end
-
-      it "should create a correct hash when the operator is >= or <=" do
-        result = Matcher.create_function_hash("foo('bar').res<=1")
-        result["value"].should == "res"
-        result["params"].should == "bar"
-        result["r_compare"].should == "1"
-        result["operator"].should == "<="
-        result["name"].should == "foo"
-
-        result = Matcher.create_function_hash("foo('bar').res>=1")
-        result["value"].should == "res"
-        result["params"].should == "bar"
-        result["r_compare"].should == "1"
-        result["operator"].should == ">="
-        result["name"].should == "foo"
-      end
-
-      it "should create a correct hash when no dot value is present" do
-        result = Matcher.create_function_hash("foo('bar')<=1")
-        result["value"].should == nil
-        result["params"].should == "bar"
-        result["r_compare"].should == "1"
-        result["operator"].should == "<="
-        result["name"].should == "foo"
-      end
-
-      it "should create a correct hash when a dot is present in a parameter but no dot value is present" do
-        result = Matcher.create_function_hash("foo('bar.one')<=1")
-        result["value"].should == nil
-        result["params"].should == "bar.one"
-        result["r_compare"].should == "1"
-        result["operator"].should == "<="
-        result["name"].should == "foo"
-      end
-
-      it "should create a correct hash when multiple dots are present in parameters but no dot value is present" do
-        result = Matcher.create_function_hash("foo('bar.one.two, bar.three.four')<=1")
-        result["value"].should == nil
-        result["params"].should == "bar.one.two, bar.three.four"
-        result["r_compare"].should == "1"
-        result["operator"].should == "<="
-        result["name"].should == "foo"
-      end
-
-      it "should create a correct hash when no parameters are given" do
-        result = Matcher.create_function_hash("foo()<=1")
-        result["value"].should == nil
-        result["params"].should == nil
-        result["r_compare"].should == "1"
-        result["operator"].should == "<="
-        result["name"].should == "foo"
-     end
-
-      it "should create a correct hash parameters are empty strings" do
-        result = Matcher.create_function_hash("foo('')=1")
-        result["value"].should == nil
-        result["params"].should == ""
-        result["r_compare"].should == "1"
-        result["operator"].should == "=="
-        result["name"].should == "foo"
-      end
-    end
-
-    describe "#execute_function" do
-      it "should return the result of an evaluated function with a dot value" do
-        data = mock
-        data.expects(:send).with("value").returns("success")
-        MCollective::Data.expects(:send).with("foo", "bar").returns(data)
-        result = Matcher.execute_function({"name" => "foo", "params" => "bar", "value" => "value"})
-        result.should == "success"
-      end
-
-      it "should return the result of an evaluated function without a dot value" do
-        MCollective::Data.expects(:send).with("foo", "bar").returns("success")
-        result = Matcher.execute_function({"name" => "foo", "params" => "bar"})
-        result.should == "success"
-      end
-    end
-
-    describe "#eval_compound_statement" do
-      it "should return correctly on a regex class statement" do
-        Util.expects(:has_cf_class?).with("/foo/").returns(true)
-        Matcher.eval_compound_statement({"statement" => "/foo/"}).should == true
-        Util.expects(:has_cf_class?).with("/foo/").returns(false)
-        Matcher.eval_compound_statement({"statement" => "/foo/"}).should == false
-      end
-
-      it "should return correcly for string and regex facts" do
-        Util.expects(:has_fact?).with("foo", "bar", "==").returns(true)
-        Matcher.eval_compound_statement({"statement" => "foo=bar"}).should == "true"
-        Util.expects(:has_fact?).with("foo", "/bar/", "=~").returns(false)
-        Matcher.eval_compound_statement({"statement" => "foo=/bar/"}).should == "false"
-      end
-
-      it "should return correctly on a string class statement" do
-        Util.expects(:has_cf_class?).with("foo").returns(true)
-        Matcher.eval_compound_statement({"statement" => "foo"}).should == true
-        Util.expects(:has_cf_class?).with("foo").returns(false)
-        Matcher.eval_compound_statement({"statement" => "foo"}).should == false
-      end
-    end
-
-    describe "#eval_compound_fstatement" do
-      describe "it should return false if a string, true or false are compared with > or <" do
-        let(:function_hash) do
-          {"name" => "foo",
-           "params" => "bar",
-           "value" => "value",
-           "operator" => "<",
-           "r_compare" => "teststring"}
-        end
-
-
-        it "should return false if a string is compare with a < or >" do
-          Matcher.expects(:execute_function).returns("teststring")
-          result = Matcher.eval_compound_fstatement(function_hash)
-          result.should == false
-        end
-
-        it "should return false if a TrueClass is compared with a < or > " do
-          Matcher.expects(:execute_function).returns(true)
-          result = Matcher.eval_compound_fstatement(function_hash)
-          result.should == false
-        end
-
-        it "should return false if a FalseClass is compared with a < or >" do
-          Matcher.expects(:execute_function).returns(false)
-          result = Matcher.eval_compound_fstatement(function_hash)
-          result.should == false
-        end
-      end
-
-      describe "it should return false if backticks are present in parameters and if non strings are compared with regex's" do
-        before :each do
-          @function_hash = {"name" => "foo",
-                           "params" => "bar",
-                           "value" => "value",
-                           "operator" => "=",
-                           "r_compare" => "1"}
-        end
-
-        it "should return false if a backtick is present in a parameter" do
-          @function_hash["params"] = "`bar`"
-          Matcher.expects(:execute_function).returns("teststring")
-          MCollective::Log.expects(:debug).with("Cannot use backticks in function parameters")
-          result = Matcher.eval_compound_fstatement(@function_hash)
-          result.should == false
-        end
-
-        it "should return false if left compare object isn't a string and right compare is a regex" do
-          Matcher.expects(:execute_function).returns(1)
-          @function_hash["r_compare"] = "/foo/"
-          @function_hash["operator"] = "=~"
-          MCollective::Log.expects(:debug).with("Cannot do a regex check on a non string value.")
-          result = Matcher.eval_compound_fstatement(@function_hash)
-          result.should == false
-        end
-      end
-
-      describe "it should return the expected result for valid function hashes" do
-        before :each do
-          @function_hash = {"name" => "foo",
-                            "params" => "bar",
-                            "value" => "value",
-                            "operator" => "=",
-                            "r_compare" => ""}
-        end
-
-        it "should return true if right value is a regex and matches the left value" do
-          Matcher.expects(:execute_function).returns("teststring")
-          @function_hash["r_compare"] = /teststring/
-          @function_hash["operator"] = "=~"
-          result = Matcher.eval_compound_fstatement(@function_hash)
-          result.should == true
-        end
-
-        it "should return false if right value is a regex, operator is != and regex equals left value" do
-          Matcher.expects(:execute_function).returns("teststring")
-          @function_hash["r_compare"] = /teststring/
-          @function_hash["operator"] = "!=~"
-          result = Matcher.eval_compound_fstatement(@function_hash)
-          result.should == false
-        end
-
-        it "should return false if right value is a regex and does not match left value" do
-          Matcher.expects(:execute_function).returns("testsnotstring")
-          @function_hash["r_compare"] = /teststring/
-          @function_hash["operator"] = "=~"
-          result = Matcher.eval_compound_fstatement(@function_hash)
-          result.should == false
-        end
-
-        it "should return true if left value logically compares to the right value" do
-          Matcher.expects(:execute_function).returns(1)
-          @function_hash["r_compare"] = 1
-          @function_hash["operator"] = ">="
-          result = Matcher.eval_compound_fstatement(@function_hash)
-          result.should == true
-       end
-
-        it "should return false if left value does not logically compare to right value" do
-          Matcher.expects(:execute_function).returns("1")
-          @function_hash["r_compare"] = "1"
-          @function_hash["operator"] = ">"
-          result = Matcher.eval_compound_fstatement(@function_hash)
-          result.should == false
-        end
-      end
-    end
-
-    describe "#create_compound_callstack" do
-      it "should create a callstack from a valid call_string" do
-        result = Matcher.create_compound_callstack("foo('bar')=1 and bar=/bar/")
-        result.should == [{"fstatement" => {"params"=>"bar", "name"=>"foo", "operator"=>"==", "r_compare"=>"1"}}, {"and" => "and"}, {"statement" => "bar=/bar/"}]
-      end
-    end
-  end
-end
diff --git a/spec/unit/message_spec.rb b/spec/unit/message_spec.rb
deleted file mode 100755 (executable)
index 46ad7da..0000000
+++ /dev/null
@@ -1,423 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe Message do
-    before do
-      Config.instance.set_config_defaults("")
-    end
-
-    describe "#initialize" do
-      it "should set defaults" do
-        m = Message.new("payload", "message")
-        m.payload.should == "payload"
-        m.message.should == "message"
-        m.request.should == nil
-        m.headers.should == {}
-        m.agent.should == nil
-        m.collective.should == nil
-        m.type.should == :message
-        m.filter.should == Util.empty_filter
-        m.requestid.should == nil
-        m.base64?.should == false
-        m.options.should == {}
-        m.discovered_hosts.should == nil
-        m.ttl.should == 60
-        m.validated.should == false
-        m.msgtime.should == 0
-        m.expected_msgid == nil
-      end
-
-      it "should set all supplied options" do
-        Message.any_instance.expects(:base64_decode!)
-
-        m = Message.new("payload", "message", :base64 => true,
-                        :agent => "rspecagent",
-                        :headers => {:rspec => "test"},
-                        :type => :rspec,
-                        :filter => "filter",
-                        :options => {:ttl => 30},
-                        :collective => "collective")
-        m.payload.should == "payload"
-        m.message.should == "message"
-        m.request.should == nil
-        m.headers.should == {:rspec => "test"}
-        m.agent.should == "rspecagent"
-        m.collective.should == "collective"
-        m.type.should == :rspec
-        m.filter.should == "filter"
-        m.base64?.should == true
-        m.options.should == {:ttl => 30}
-        m.ttl.should == 30
-      end
-
-      it "if given a request it should set options based on the request" do
-        request = mock
-        request.expects(:agent).returns("request")
-        request.expects(:collective).returns("collective")
-
-        m = Message.new("payload", "message", :request => request)
-        m.agent.should == "request"
-        m.collective.should == "collective"
-        m.type.should == :reply
-        m.request.should == request
-      end
-    end
-
-    describe "#reply_to=" do
-      it "should only set the reply-to header for requests" do
-        Config.instance.expects(:direct_addressing).returns(true)
-        m = Message.new("payload", "message", :type => :reply)
-        m.discovered_hosts = ["foo"]
-        expect { m.reply_to = "foo" }.to raise_error(/reply targets/)
-
-        [:request, :direct_request].each do |t|
-          m.type = t
-          m.reply_to = "foo"
-          m.reply_to.should == "foo"
-        end
-      end
-    end
-
-    describe "#expected_msgid=" do
-      it "should correctly set the property" do
-        m = Message.new("payload", "message", :type => :reply)
-        m.expected_msgid = "rspec test"
-        m.expected_msgid.should == "rspec test"
-      end
-
-      it "should only be set for reply messages" do
-        m = Message.new("payload", "message", :type => :request)
-
-        expect {
-          m.expected_msgid = "rspec test"
-        }.to raise_error("Can only store the expected msgid for reply messages")
-      end
-    end
-
-    describe "#base64_decode!" do
-      it "should not decode if not encoded" do
-        SSL.expects(:base64_decode).never
-        m = Message.new("payload", "message")
-      end
-
-      it "should decode encoded messages" do
-        SSL.expects(:base64_decode)
-        m = Message.new("payload", "message", :base64 => true)
-      end
-
-      it "should set base64 to false after decoding" do
-        SSL.expects(:base64_decode).with("payload")
-        m = Message.new("payload", "message", :base64 => true)
-        m.base64?.should == false
-      end
-    end
-
-    describe "#base64_encode" do
-      it "should not encode already encoded messages" do
-        SSL.expects(:base64_encode).never
-        Message.any_instance.stubs(:base64_decode!)
-        m = Message.new("payload", "message", :base64 => true)
-        m.base64_encode!
-      end
-
-      it "should encode plain messages" do
-        SSL.expects(:base64_encode).with("payload")
-        m = Message.new("payload", "message")
-        m.base64_encode!
-      end
-
-      it "should set base64 to false after encoding" do
-        SSL.expects(:base64_encode)
-        m = Message.new("payload", "message")
-        m.base64_encode!
-        m.base64?.should == true
-      end
-    end
-
-    describe "#base64?" do
-      it "should correctly report base64 state" do
-        m = Message.new("payload", "message")
-        m.base64?.should == m.instance_variable_get("@base64")
-      end
-    end
-
-    describe "#type=" do
-      it "should only allow types to be set when discovered hosts were given" do
-        m = Message.new("payload", "message")
-        Config.instance.stubs(:direct_addressing).returns(true)
-
-        expect {
-          m.type = :direct_request
-        }.to raise_error("Can only set type to :direct_request if discovered_hosts have been set")
-      end
-
-      it "should not allow direct_request to be set if direct addressing isnt enabled" do
-        m = Message.new("payload", "message")
-        Config.instance.stubs(:direct_addressing).returns(false)
-
-        expect {
-          m.type = :direct_request
-        }.to raise_error("Direct requests is not enabled using the direct_addressing config option")
-      end
-
-      it "should only accept valid types" do
-        m = Message.new("payload", "message")
-        Config.instance.stubs(:direct_addressing).returns(true)
-
-        expect {
-          m.type = :foo
-        }.to raise_error("Unknown message type foo")
-      end
-
-      it "should clear the filter in direct_request mode and add just an agent filter" do
-        m = Message.new("payload", "message")
-        m.discovered_hosts = ["rspec"]
-        Config.instance.stubs(:direct_addressing).returns(true)
-
-        m.filter = Util.empty_filter.merge({"cf_class" => ["test"]})
-        m.agent = "rspec"
-        m.type = :direct_request
-        m.filter.should == Util.empty_filter.merge({"agent" => ["rspec"]})
-      end
-
-      it "should set the type" do
-        m = Message.new("payload", "message")
-        m.type = :request
-        m.type.should == :request
-      end
-    end
-
-    describe "#encode!" do
-      it "should encode replies using the security plugin #encodereply" do
-        request = mock
-        request.stubs(:agent).returns("rspec_agent")
-        request.stubs(:collective).returns("collective")
-        request.stubs(:payload).returns({:requestid => "123", :callerid => "id=callerid"})
-
-        security = mock
-        security.expects(:encodereply).with('rspec_agent', 'payload', '123', 'id=callerid')
-        security.expects(:valid_callerid?).with("id=callerid").returns(true)
-
-        PluginManager.expects("[]").with("security_plugin").returns(security).twice
-
-        m = Message.new("payload", "message", :request => request, :type => :reply)
-
-        m.encode!
-      end
-
-      it "should encode requests using the security plugin #encoderequest" do
-        security = mock
-        security.expects(:encoderequest).with("identity", 'payload', '123', Util.empty_filter, 'rspec_agent', 'mcollective', 60).twice
-        PluginManager.expects("[]").with("security_plugin").returns(security).twice
-
-        Config.instance.expects(:identity).returns("identity").twice
-
-        Message.any_instance.expects(:requestid).returns("123").twice
-
-        m = Message.new("payload", "message", :type => :request, :agent => "rspec_agent", :collective => "mcollective")
-        m.encode!
-
-        m = Message.new("payload", "message", :type => :direct_request, :agent => "rspec_agent", :collective => "mcollective")
-        m.encode!
-      end
-
-      it "should retain the requestid if it was specifically set" do
-        security = mock
-        security.expects(:encoderequest).with("identity", 'payload', '123', Util.empty_filter, 'rspec_agent', 'mcollective', 60)
-        PluginManager.expects("[]").with("security_plugin").returns(security)
-
-        Config.instance.expects(:identity).returns("identity")
-
-        m = Message.new("payload", "message", :type => :request, :agent => "rspec_agent", :collective => "mcollective")
-        m.expects(:create_reqid).never
-        m.requestid = "123"
-        m.encode!
-        m.requestid.should == "123"
-      end
-
-      it "should not allow bad callerids when replying" do
-        request = mock
-        request.stubs(:agent).returns("rspec_agent")
-        request.stubs(:collective).returns("collective")
-        request.stubs(:payload).returns({:requestid => "123", :callerid => "caller/id"})
-
-        security = mock
-        security.expects(:valid_callerid?).with("caller/id").returns(false)
-        PluginManager.expects("[]").with("security_plugin").returns(security)
-
-        m = Message.new("payload", "message", :request => request, :type => :reply)
-
-        expect {
-          m.encode!
-        }.to raise_error('callerid in original request is not valid, surpressing reply to potentially forged request')
-      end
-    end
-
-    describe "#decode!" do
-      it "should check for valid types" do
-        expect {
-          m = Message.new("payload", "message", :type => :foo)
-          m.decode!
-        }.to raise_error("Cannot decode message type foo")
-      end
-
-      it "should set state based on decoded message" do
-        msg = mock
-        msg.stubs(:include?).returns(true)
-        msg.stubs("[]").with(:collective).returns("collective")
-        msg.stubs("[]").with(:agent).returns("rspecagent")
-        msg.stubs("[]").with(:filter).returns("filter")
-        msg.stubs("[]").with(:requestid).returns("1234")
-        msg.stubs("[]").with(:ttl).returns(30)
-        msg.stubs("[]").with(:msgtime).returns(1314628987)
-
-        security = mock
-        security.expects(:decodemsg).returns(msg)
-        PluginManager.expects("[]").with("security_plugin").returns(security)
-
-        m = Message.new(msg, "message", :type => :reply)
-        m.decode!
-
-        m.collective.should == "collective"
-        m.agent.should == "rspecagent"
-        m.filter.should == "filter"
-        m.requestid.should == "1234"
-        m.ttl.should == 30
-      end
-
-      it "should not allow bad callerids from the security plugin on requests" do
-        security = mock
-        security.expects(:decodemsg).returns({:callerid => "foo/bar"})
-        security.expects(:valid_callerid?).with("foo/bar").returns(false)
-
-        PluginManager.expects("[]").with("security_plugin").returns(security).twice
-
-        m = Message.new("payload", "message", :type => :request)
-
-        expect {
-          m.decode!
-        }.to raise_error('callerid in request is not valid, surpressing reply to potentially forged request')
-      end
-    end
-
-    describe "#validate" do
-      it "should only validate requests" do
-        m = Message.new("msg", "message", :type => :reply)
-        expect {
-          m.validate
-        }.to raise_error("Can only validate request messages")
-      end
-
-      it "should raise an exception for incorrect messages" do
-        sec = mock
-        sec.expects("validate_filter?").returns(false)
-        PluginManager.expects("[]").with("security_plugin").returns(sec)
-
-        payload = mock
-        payload.expects("[]").with(:filter).returns({})
-
-        m = Message.new(payload, "message", :type => :request)
-        m.instance_variable_set("@msgtime", Time.now.to_i)
-
-        expect {
-          m.validate
-        }.to raise_error(NotTargettedAtUs)
-      end
-
-      it "should pass for good messages" do
-        sec = mock
-        sec.expects(:validate_filter?).returns(true)
-        PluginManager.expects("[]").returns(sec)
-
-        payload = mock
-        payload.expects("[]").with(:filter).returns({})
-        m = Message.new(payload, "message", :type => :request)
-        m.instance_variable_set("@msgtime", Time.now.to_i)
-        m.validate
-      end
-
-      it "should set the @validated property" do
-        sec = mock
-        sec.expects(:validate_filter?).returns(true)
-        PluginManager.expects("[]").returns(sec)
-
-        payload = mock
-        payload.expects("[]").with(:filter).returns({})
-        m = Message.new(payload, "message", :type => :request)
-        m.instance_variable_set("@msgtime", Time.now.to_i)
-
-        m.validated.should == false
-        m.validate
-        m.validated.should == true
-      end
-
-      it "should not validate for messages older than TTL" do
-        stats = mock
-        stats.expects(:ttlexpired).once
-
-        MCollective::PluginManager << {:type => "global_stats", :class => stats}
-
-        m = Message.new({:callerid => "caller", :senderid => "sender"}, "message", :type => :request)
-        m.instance_variable_set("@msgtime", (Time.now.to_i - 120))
-
-        expect {
-          m.validate
-        }.to raise_error(MsgTTLExpired)
-      end
-    end
-
-    describe "#publish" do
-      it "should publish itself to the connector" do
-        m = Message.new("msg", "message", :type => :request)
-
-        connector = mock
-        connector.expects(:publish).with(m)
-        PluginManager.expects("[]").returns(connector)
-
-        m.publish
-      end
-
-      it "should support direct addressing" do
-        m = Message.new("msg", "message", :type => :request)
-        m.discovered_hosts = ["one", "two", "three"]
-
-        Config.instance.stubs(:direct_addressing).returns(true)
-        Config.instance.stubs(:direct_addressing_threshold).returns(10)
-
-        connector = mock
-        connector.expects(:publish).with(m)
-        PluginManager.expects("[]").returns(connector)
-
-        m.publish
-        m.type.should == :direct_request
-      end
-
-      it "should only direct publish below the configured threshold" do
-        m = Message.new("msg", "message", :type => :request)
-        m.discovered_hosts = ["one", "two", "three"]
-
-        Config.instance.expects(:direct_addressing).returns(true)
-        Config.instance.expects(:direct_addressing_threshold).returns(1)
-
-        connector = mock
-        connector.expects(:publish).with(m)
-        PluginManager.expects("[]").returns(connector)
-
-        m.publish
-        m.type.should == :request
-      end
-    end
-
-    describe "#create_reqid" do
-      it "should create a valid request id" do
-        m = Message.new("msg", "message", :agent => "rspec", :collective => "mc")
-
-        SSL.expects(:uuid).returns("reqid")
-
-        m.create_reqid.should == "reqid"
-      end
-    end
-  end
-end
diff --git a/spec/unit/optionparser_spec.rb b/spec/unit/optionparser_spec.rb
deleted file mode 100755 (executable)
index 594467f..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe Optionparser do
-    describe "#initialize" do
-      it "should store the included list as an array" do
-        parser = Optionparser.new({}, "included")
-        parser.instance_variable_get("@include").should == ["included"]
-
-        parser = Optionparser.new({}, ["included"])
-        parser.instance_variable_get("@include").should == ["included"]
-      end
-
-      it "should store the excluded list as an array" do
-        parser = Optionparser.new({}, "", "excluded")
-        parser.instance_variable_get("@exclude").should == ["excluded"]
-
-        parser = Optionparser.new({}, "", ["excluded"])
-        parser.instance_variable_get("@exclude").should == ["excluded"]
-      end
-
-      it "should gather default options" do
-        Util.expects(:default_options).returns({})
-        Optionparser.new({})
-      end
-
-      it "should merge supplied options with defaults" do
-        defaults = {}
-        supplied = {}
-
-        Util.expects(:default_options).returns(defaults)
-        defaults.expects(:merge!).with(supplied)
-
-        Optionparser.new(supplied)
-      end
-    end
-
-    describe "#parse" do
-      it "should yield to the caller" do
-        parser = Optionparser.new(defaults={:default => 1})
-
-        block_ran = false
-
-        parser.parse do |p, o|
-          p.class.should == OptionParser
-          o.should == Util.default_options.merge(defaults)
-          block_ran = true
-        end
-
-        block_ran.should == true
-      end
-
-      it "should add required options" do
-        parser = Optionparser.new(defaults={:default => 1})
-        parser.expects(:add_required_options)
-        parser.parse
-      end
-
-      it "should optionally add common options" do
-        parser = Optionparser.new(defaults={:default => 1})
-        parser.stubs(:add_required_options)
-        parser.expects(:add_common_options)
-        parser.parse
-
-        parser = Optionparser.new(defaults={:default => 1}, "", "common")
-        parser.stubs(:add_required_options)
-        parser.expects(:add_common_options).never
-        parser.parse
-      end
-
-      it "should support adding arbitrary named sections of options" do
-        parser = Optionparser.new(defaults={:default => 1}, "filter")
-        parser.stubs(:add_required_options)
-        parser.stubs(:add_common_options)
-        parser.expects(:add_filter_options)
-        parser.parse
-      end
-
-      it "should support excluding sections that was specifically included" do
-        parser = Optionparser.new(defaults={:default => 1}, "filter", "filter")
-        parser.stubs(:add_required_options)
-        parser.stubs(:add_common_options)
-        parser.expects(:add_filter_options).never
-        parser.parse
-      end
-
-      it "should parse MCOLLECTIVE_EXTRA_OPTS" do
-        ENV["MCOLLECTIVE_EXTRA_OPTS"] = "--dt 999"
-        @parser = Optionparser.new
-        @parser.parse[:disctimeout].should == 999
-        ENV.delete("MCOLLECTIVE_EXTRA_OPTS")
-      end
-
-      it "should not set the active collective from the config class if given on the cli" do
-        parser = Optionparser.new(defaults={:collective => "rspec"})
-        parser.stubs(:add_required_options)
-        parser.stubs(:add_common_options)
-        Config.instance.expects(:main_collective).never
-        parser.parse
-      end
-
-      it "should set the active collective from the config class if not given on the cli" do
-        parser = Optionparser.new(defaults={})
-        parser.stubs(:add_required_options)
-        parser.stubs(:add_common_options)
-        Config.instance.expects(:main_collective).returns(:rspec).once
-        parser.parse[:collective].should == :rspec
-      end
-    end
-  end
-end
diff --git a/spec/unit/pluginmanager_spec.rb b/spec/unit/pluginmanager_spec.rb
deleted file mode 100755 (executable)
index be531c8..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe PluginManager do
-    before do
-      class MCollective::Foo; end
-
-      PluginManager.pluginlist.each {|p| PluginManager.delete p}
-    end
-
-    describe "#<<" do
-      it "should store a plugin by name" do
-        PluginManager << {:type => "foo", :class => "MCollective::Foo"}
-        PluginManager.instance_variable_get("@plugins").include?("foo").should == true
-      end
-
-      it "should store a plugin instance" do
-        f = MCollective::Foo.new
-
-        PluginManager << {:type => "foo", :class => f}
-        PluginManager.instance_variable_get("@plugins")["foo"][:instance].object_id.should == f.object_id
-      end
-
-      it "should detect duplicate plugins" do
-        PluginManager << {:type => "foo", :class => "MCollective::Foo"}
-
-        expect {
-          PluginManager << {:type => "foo", :class => "MCollective::Foo"}
-        }.to raise_error("Plugin foo already loaded")
-      end
-
-      it "should store single instance preference correctly" do
-        PluginManager << {:type => "foo", :class => "MCollective::Foo", :single_instance => false}
-        PluginManager.instance_variable_get("@plugins")["foo"][:single].should == false
-      end
-
-      it "should always set single to true when supplied an instance" do
-        PluginManager << {:type => "foo", :class => MCollective::Foo.new, :single_instance => false}
-        PluginManager.instance_variable_get("@plugins")["foo"][:single].should == true
-      end
-    end
-
-    describe "#delete" do
-      it "should remove plugins" do
-        PluginManager << {:type => "foo", :class => MCollective::Foo.new}
-        PluginManager.instance_variable_get("@plugins").include?("foo").should == true
-        PluginManager.delete("foo")
-        PluginManager.instance_variable_get("@plugins").include?("foo").should == false
-      end
-    end
-
-    describe "#include?" do
-      it "should correctly check if plugins were added" do
-        PluginManager << {:type => "foo", :class => MCollective::Foo.new}
-        PluginManager.include?("foo").should == true
-        PluginManager.include?("bar").should == false
-      end
-    end
-
-    describe "#pluginlist" do
-      it "should return the correct list of plugins" do
-        PluginManager << {:type => "foo", :class => MCollective::Foo.new}
-        PluginManager << {:type => "bar", :class => MCollective::Foo.new}
-
-        PluginManager.pluginlist.sort.should == ["bar", "foo"]
-      end
-    end
-
-    describe "#[]" do
-      it "should detect if the requested plugin does not exist" do
-        expect {
-          PluginManager["foo"]
-        }.to raise_error("No plugin foo defined")
-      end
-
-      it "should create new instances on demand" do
-        PluginManager << {:type => "foo", :class => "MCollective::Foo"}
-        PluginManager["foo"].class.should == MCollective::Foo
-      end
-
-      it "should return the cached instance" do
-        f = MCollective::Foo.new
-
-        PluginManager << {:type => "foo", :class => f}
-        PluginManager["foo"].object_id.should == f.object_id
-      end
-
-      it "should create new instances on every request if requested" do
-        PluginManager << {:type => "foo", :class => "MCollective::Foo", :single_instance => false}
-        PluginManager["foo"].object_id.should_not == PluginManager["foo"].object_id
-      end
-    end
-
-    describe "#find" do
-      before do
-        @config.stubs(:libdir).returns(["/libdir/"])
-        Config.stubs(:instance).returns(@config)
-      end
-
-      it "should find all plugins in configured libdirs" do
-        File.expects(:join).with(["/libdir/", "mcollective", "test"]).returns("/plugindir/")
-        File.expects(:directory?).with("/plugindir/").returns(true)
-        Dir.expects(:new).with("/plugindir/").returns(["plugin.rb"])
-        PluginManager.find("test").should == ["plugin"]
-      end
-
-      it "should find all plugins with a given file extension" do
-        File.expects(:join).with(["/libdir/", "mcollective", "test"]).returns("/plugindir/")
-        File.expects(:directory?).with("/plugindir/").returns(true)
-        Dir.expects(:new).with("/plugindir/").returns(["plugin.ddl"])
-        PluginManager.find("test", "ddl").should == ["plugin"]
-      end
-
-      it "should skip libdirs that do not have the plugin type directories" do
-        @config.stubs(:libdir).returns(["/plugindir/", "/tmp/"])
-        File.expects(:join).with(["/plugindir/", "mcollective", "test"]).returns("/plugindir/")
-        File.expects(:join).with(["/tmp/", "mcollective", "test"]).returns("/tmpdir/")
-        File.expects(:directory?).with("/plugindir/").returns(true)
-        File.expects(:directory?).with("/tmpdir/").returns(false)
-        Dir.expects(:new).with("/plugindir/").returns(["plugin.ddl"])
-        PluginManager.find("test", "ddl").should == ["plugin"]
-      end
-    end
-
-    describe "#find_and_load" do
-      before do
-        @config.stubs(:libdir).returns(["/libdir/"])
-        Config.stubs(:instance).returns(@config)
-        PluginManager.expects(:loadclass).with("MCollective::Test::Testplugin", true)
-      end
-
-      it "should find and load all plugins from all libdirs that match the type" do
-        PluginManager.expects(:find).with("test", ".rb").returns(["testplugin"])
-        PluginManager.find_and_load("test")
-      end
-
-      it "should exclude plugins who do not match criteria if block is given" do
-        PluginManager.expects(:find).with("test", ".rb").returns(["testplugin", "failplugin"])
-        PluginManager.find_and_load("test") {|plugin| plugin.match(/^test/)}
-      end
-    end
-
-    describe "#loadclass" do
-      it "should load the correct filename given a ruby class name" do
-        PluginManager.stubs(:load).with("mcollective/foo.rb").once
-        PluginManager.loadclass("MCollective::Foo")
-      end
-
-      it "should raise errors for load errors" do
-        PluginManager.stubs(:load).raises("load failure")
-        Log.expects(:error)
-        expect { PluginManager.loadclass("foo") }.to raise_error(/load failure/)
-      end
-
-      it "should support squashing load errors" do
-        PluginManager.stubs(:load).raises("load failure")
-        Log.expects(:error)
-        PluginManager.loadclass("foo", true)
-      end
-    end
-
-    describe "#grep" do
-      it "should return matching plugins from the list" do
-        PluginManager << {:type => "foo", :class => MCollective::Foo.new}
-        PluginManager << {:type => "bar", :class => MCollective::Foo.new}
-
-        PluginManager.grep(/oo/).should == ["foo"]
-      end
-    end
-  end
-end
diff --git a/spec/unit/pluginpackager/agent_definition_spec.rb b/spec/unit/pluginpackager/agent_definition_spec.rb
deleted file mode 100644 (file)
index 80a65b1..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module PluginPackager
-    describe AgentDefinition do
-      before :each do
-        PluginPackager.expects(:get_metadata).once.returns({:name => "foo", :version => 1})
-      end
-
-      describe "#initialize" do
-
-        before do
-          AgentDefinition.any_instance.expects(:common)
-        end
-
-        it "should replace spaces in the package name with dashes" do
-          agent = AgentDefinition.new(".", "test package", nil, nil, nil, nil, [], {}, "agent")
-          agent.metadata[:name].should == "test-package"
-        end
-
-        it "should set dependencies if present" do
-          agent = AgentDefinition.new(".", "test-package", nil, nil, nil, nil, [:name => "foo", :version => nil], {}, "agent")
-          agent.dependencies.should == [{:name => "foo", :version => nil}, {:name => "mcollective-common", :version => nil}]
-        end
-
-        it "should set mc name and version" do
-          agent = AgentDefinition.new(".", "test-package", nil, nil, nil, nil, [], {:mcname =>"pe-mcollective-common", :mcversion =>"1.2"}, "agent")
-          agent.mcname.should == "pe-mcollective-common"
-          agent.mcversion.should == "1.2"
-        end
-
-        it "should replace underscored with dashes in the name" do
-          agent = AgentDefinition.new(".", "test_package", nil, nil, nil, nil, [], {:mcname =>"pe-mcollective-common", :mcversion =>"1.2"}, "agent")
-          agent.metadata[:name].should == "test-package"
-        end
-
-        it "should replace whitespaces with a single dash in the name" do
-          agent = AgentDefinition.new(".", "test    package", nil, nil, nil, nil, [], {:mcname =>"pe-mcollective-common", :mcversion =>"1.2"}, "agent")
-          agent.metadata[:name].should == "test-package"
-        end
-      end
-
-      describe "#identify_packages" do
-        it "should attempt to identify all agent packages" do
-          AgentDefinition.any_instance.expects(:common).once.returns(:check)
-          AgentDefinition.any_instance.expects(:agent).once.returns(:check)
-          AgentDefinition.any_instance.expects(:client).once.returns(:check)
-
-          agent = AgentDefinition.new(".", nil, nil, nil, nil, nil, [], {}, "agent")
-          agent.packagedata[:common].should == :check
-          agent.packagedata[:agent].should == :check
-          agent.packagedata[:client].should == :check
-        end
-      end
-
-      describe "#agent" do
-        before do
-          AgentDefinition.any_instance.expects(:client).once
-        end
-
-        it "should not populate the agent files if the agent directory is empty" do
-          AgentDefinition.any_instance.expects(:common).returns(nil)
-          PluginPackager.expects(:check_dir_present).returns(false)
-          agent = AgentDefinition.new(".", nil, nil, nil, nil, nil, [], {}, "agent")
-          agent.packagedata[:agent].should == nil
-        end
-
-        it "should add the agent file if the agent directory and implementation file is present" do
-          AgentDefinition.any_instance.expects(:common).returns(nil)
-          PluginPackager.stubs(:check_dir_present).returns(true)
-          File.stubs(:join).with(".", "agent").returns("tmpdir/agent")
-          File.stubs(:join).with("tmpdir/agent", "*.ddl").returns("tmpdir/agent/*.ddl")
-          File.stubs(:join).with("tmpdir/agent", "*").returns("tmpdir/agent/*")
-          Dir.stubs(:glob).with("tmpdir/agent/*.ddl").returns([])
-          Dir.stubs(:glob).with("tmpdir/agent/*").returns(["implementation.rb"])
-
-          agent = AgentDefinition.new(".", nil, nil, nil, nil, nil, [], {}, "agent")
-          agent.packagedata[:agent][:files].should == ["implementation.rb"]
-        end
-
-        it "should add common package as dependency if present" do
-          AgentDefinition.any_instance.expects(:common).returns({:files=> ["test.rb"]})
-          PluginPackager.expects(:check_dir_present).with("tmpdir/agent").returns(true)
-          File.stubs(:join).returns("/tmp")
-          File.stubs(:join).with(".", "agent").returns("tmpdir/agent")
-          File.stubs(:join).with(".", "aggregate").returns("tmpdir/aggregate")
-          Dir.stubs(:glob).returns([])
-
-          agent = AgentDefinition.new(".", nil, nil, nil, nil, nil, [], {}, "agent")
-          agent.packagedata[:agent][:dependencies].should == [{:name => "mcollective-common", :version => nil}]
-          agent.packagedata[:agent][:plugindependency].should == {:name => "mcollective-foo-common", :version =>1, :iteration => 1}
-        end
-      end
-
-      describe "#common" do
-        it "should populate the common files if there are any" do
-          AgentDefinition.any_instance.expects(:agent)
-          AgentDefinition.any_instance.expects(:client)
-          File.expects(:join).with(".", "data", "**").returns("datadir")
-          File.expects(:join).with(".", "util", "**", "**").returns("utildir")
-          File.expects(:join).with(".", "agent", "*.ddl").returns("ddldir")
-          File.expects(:join).with(".", "validator", "**").returns("validatordir")
-          Dir.expects(:glob).with("datadir").returns(["data.rb"])
-          Dir.expects(:glob).with("utildir").returns(["util.rb"])
-          Dir.expects(:glob).with("validatordir").returns(["validator.rb"])
-          Dir.expects(:glob).with("ddldir").returns(["agent.ddl"])
-
-          common = AgentDefinition.new(".", nil, nil, nil, nil, nil, [], {}, "agent")
-          common.packagedata[:common][:files].should == ["data.rb", "util.rb", "validator.rb", "agent.ddl"]
-        end
-
-        it "should raise an exception if the ddl file isn't present" do
-          File.expects(:join).with(".", "data", "**").returns("datadir")
-          File.expects(:join).with(".", "util", "**", "**").returns("utildir")
-          File.expects(:join).with(".", "agent", "*.ddl").returns("ddldir")
-          File.expects(:join).with(".", "agent").returns("ddldir")
-          File.expects(:join).with(".", "validator", "**").returns("validatordir")
-          Dir.expects(:glob).with("datadir").returns(["data.rb"])
-          Dir.expects(:glob).with("utildir").returns(["util.rb"])
-          Dir.expects(:glob).with("validatordir").returns(["validator.rb"])
-          Dir.expects(:glob).with("ddldir").returns([])
-
-          expect{
-            common = AgentDefinition.new(".", nil, nil, nil, nil, nil, [], {}, "agent")
-          }.to raise_error(RuntimeError, "cannot create package - No ddl file found in ddldir")
-        end
-      end
-
-      describe "#client" do
-        before do
-          AgentDefinition.any_instance.expects(:agent).returns(nil)
-          File.expects(:join).with(".", "application").returns("clientdir")
-          File.expects(:join).with(".", "aggregate").returns("aggregatedir")
-        end
-
-        it "should populate client files if all directories are present" do
-          AgentDefinition.any_instance.expects(:common).returns(nil)
-          PluginPackager.expects(:check_dir_present).times(2).returns(true)
-          File.expects(:join).with("clientdir", "*").returns("clientdir/*")
-          File.expects(:join).with("aggregatedir", "*").returns("aggregatedir/*")
-          Dir.expects(:glob).with("clientdir/*").returns(["client.rb"])
-          Dir.expects(:glob).with("aggregatedir/*").returns(["aggregate.rb"])
-
-          client = AgentDefinition.new(".", nil, nil, nil, nil, nil, [], {}, "agent")
-          client.packagedata[:client][:files].should == ["client.rb",  "aggregate.rb"]
-        end
-
-        it "should not populate client files if directories are not present" do
-          AgentDefinition.any_instance.expects(:common).returns(nil)
-          PluginPackager.expects(:check_dir_present).times(2).returns(false)
-
-          client = AgentDefinition.new(".", nil, nil, nil, nil, nil, [], {}, "agent")
-          client.packagedata[:client].should == nil
-        end
-
-        it "should add common package as dependency if present" do
-          AgentDefinition.any_instance.expects(:common).returns("common")
-          PluginPackager.expects(:check_dir_present).times(2).returns(true)
-          File.expects(:join).with("clientdir", "*").returns("clientdir/*")
-          File.expects(:join).with("aggregatedir", "*").returns("aggregatedir/*")
-          Dir.expects(:glob).with("clientdir/*").returns(["client.rb"])
-          Dir.expects(:glob).with("aggregatedir/*").returns(["aggregate.rb"])
-
-          client = AgentDefinition.new(".", nil, nil, nil, nil, nil, [], {}, "agent")
-          client.packagedata[:client][:dependencies].should == [{:name => "mcollective-common", :version => nil}]
-          client.packagedata[:client][:plugindependency].should == {:name => "mcollective-foo-common", :version => 1, :iteration => 1}
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/pluginpackager/standard_definition_spec.rb b/spec/unit/pluginpackager/standard_definition_spec.rb
deleted file mode 100644 (file)
index 381c993..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module PluginPackager
-    describe StandardDefinition do
-      before :each do
-        PluginPackager.expects(:get_metadata).once.returns({:name => "foo", :version => 1})
-      end
-
-      describe "#initialize" do
-        it "should replace spaces in the package name with dashes" do
-          plugin = StandardDefinition.new(".", "test plugin", nil, nil, nil, nil, [], {}, "testplugin")
-          plugin.metadata[:name].should == "test-plugin"
-        end
-
-        it "should set dependencies if present" do
-          plugin = StandardDefinition.new(".", "test plugin", nil, nil, nil, nil, [{:name => "foo", :version => nil}], {}, "testplugin")
-          plugin.dependencies.should == [{:name => "foo", :version => nil},
-                                         {:name => "mcollective-common", :version => nil}]
-        end
-
-        it "should set mc name and version dependencies" do
-          plugin = StandardDefinition.new(".", "test plugin", nil, nil, nil, nil, [], {:mcname => "pe-mcollective", :mcversion => "1"}, "testplugin")
-          plugin.mcname.should == "pe-mcollective"
-          plugin.mcversion.should == "1"
-        end
-
-        it "should replace underscores with dashes in the name" do
-          plugin = StandardDefinition.new(".", "test_plugin", nil, nil, nil, nil, [], {:mcname => "pe-mcollective", :mcversion => "1"}, "testplugin")
-          plugin.metadata[:name].should == "test-plugin"
-        end
-
-        it "should replace whitespaces with a single dash in the name" do
-          plugin = StandardDefinition.new(".", "test  plugin", nil, nil, nil, nil, [], {:mcname => "pe-mcollective", :mcversion => "1"}, "testplugin")
-          plugin.metadata[:name].should == "test-plugin"
-        end
-      end
-
-      describe "#identify_packages" do
-        it "should attempt to identify all packages" do
-          StandardDefinition.any_instance.expects(:common).once.returns(:check)
-          StandardDefinition.any_instance.expects(:plugin).once.returns(:check)
-
-          plugin = StandardDefinition.new(".", nil, nil, nil, nil, nil, [], {}, "testplugin")
-          plugin.packagedata[:common].should == :check
-          plugin.packagedata["testplugin"].should == :check
-        end
-      end
-
-      describe "#plugin" do
-
-        it "should return nil if the plugin doesn't contain any files" do
-          StandardDefinition.any_instance.expects(:common).returns(nil)
-          PluginPackager.expects(:check_dir_present).returns(false)
-          plugin = StandardDefinition.new(".", nil, nil, nil, nil, nil, [], {}, "testplugin")
-          plugin.packagedata["testplugin"].should == nil
-        end
-
-        it "should add plugin files to the file list" do
-          StandardDefinition.any_instance.expects(:common).returns(nil)
-          PluginPackager.expects(:check_dir_present).returns(true)
-          Dir.expects(:glob).with("./testplugin/*").returns(["file.rb"])
-          plugin = StandardDefinition.new(".", nil, nil, nil, nil, nil, [], {}, "testplugin")
-          plugin.packagedata["testplugin"][:files].should == ["file.rb"]
-        end
-
-        it "should add common package as dependency if present" do
-          StandardDefinition.any_instance.expects(:common).returns(true)
-          PluginPackager.expects(:check_dir_present).returns(true)
-          Dir.expects(:glob).with("./testplugin/*").returns(["file.rb"])
-          plugin = StandardDefinition.new(".", nil, nil, nil, nil, nil, [], {}, "testplugin")
-          plugin.packagedata["testplugin"][:files].should == ["file.rb"]
-          plugin.packagedata["testplugin"][:dependencies].should == [{:name => "mcollective-common", :version => nil}]
-          plugin.packagedata["testplugin"][:plugindependency].should == {:name => "mcollective-foo-common", :version => 1, :iteration => 1}
-        end
-      end
-
-      describe "#common" do
-        before do
-          StandardDefinition.any_instance.expects(:plugin).returns(false)
-        end
-
-        it "should return nil if common doesn't contain any files" do
-          PluginPackager.expects(:check_dir_present).returns(false)
-          plugin = StandardDefinition.new(".", nil, nil, nil, nil, nil, [], {}, "testplugin")
-          plugin.packagedata[:common].should == nil
-        end
-
-        it "should add common files to the file list" do
-          PluginPackager.expects(:check_dir_present).returns(true)
-          Dir.expects(:glob).with("./util/*").returns(["common.rb"])
-          plugin = StandardDefinition.new(".", nil, nil, nil, nil, nil, [], {}, "testplugin")
-          plugin.packagedata[:common][:files].should == ["common.rb"]
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/pluginpackager_spec.rb b/spec/unit/pluginpackager_spec.rb
deleted file mode 100644 (file)
index 0477bb0..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/usr/bin/enn rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe PluginPackager do
-    describe "#load_packagers" do
-      it "should load all PluginPackager plugins" do
-        PluginManager.expects(:find_and_load).with("pluginpackager")
-        PluginPackager.load_packagers
-      end
-    end
-
-    describe "#[]" do
-      it "should return the correct class" do
-        PluginPackager.expects(:const_get).with("Foo").returns(:foo)
-        result = PluginPackager["Foo"]
-        result.should == :foo
-      end
-
-      it "should do something else" do
-        expect{
-          PluginPackager["Bar"]
-        }.to raise_error(NameError, 'uninitialized constant MCollective::PluginPackager::Bar')
-      end
-    end
-
-    describe "#get_metadata" do
-      it "should raise an exception if the ddl file can't be loaded" do
-        DDL.expects(:new).with("package", :foo, false)
-        File.stubs(:join)
-        Dir.stubs(:glob).returns('')
-        expect{
-          PluginPackager.get_metadata("/tmp", "foo")
-        }.to raise_error(RuntimeError)
-      end
-
-      it "should load the ddl file and return the metadata" do
-        ddl = mock
-        DDL.expects(:new).with("package", :foo, false).returns(ddl)
-        File.stubs(:join)
-        Dir.stubs(:glob).returns(["foo.ddl"])
-        File.expects(:read).with("foo.ddl").returns("foo_ddl")
-        ddl.expects(:instance_eval).with("foo_ddl")
-        ddl.expects(:meta).returns("metadata")
-        ddl.expects(:requirements).returns({:mcollective => 1})
-
-        meta, requirements = PluginPackager.get_metadata("/tmp", "foo")
-        meta.should == "metadata"
-        requirements.should == 1
-      end
-    end
-
-    describe "#check_dir_present" do
-      it "should return true if the directory is present and not empty" do
-        File.expects(:directory?).with("/tmp").returns(true)
-        File.expects(:join).with("/tmp", "*")
-        Dir.expects(:glob).returns([1])
-        result = PluginPackager.check_dir_present("/tmp")
-        result.should == true
-      end
-
-      it "should return false if the directory is not present" do
-        File.expects(:directory?).with("/tmp").returns(false)
-        result = PluginPackager.check_dir_present("/tmp")
-        result.should == false
-      end
-
-      it "should return false if the direcotry is present but empty" do
-        File.expects(:directory?).with("/tmp").returns(true)
-        File.expects(:join).with("/tmp", "*")
-        Dir.expects(:glob).returns([])
-        result = PluginPackager.check_dir_present("/tmp")
-        result.should == false
-      end
-    end
-
-    describe "#do_quietly?" do
-      it "should call the block parameter if verbose is true" do
-        result = PluginPackager.do_quietly?(true) {:success}
-        result.should == :success
-      end
-
-      it "should call the block parameter quietly if verbose is false" do
-        std_out = Tempfile.new("mc_pluginpackager_spec")
-        File.expects(:new).with("/dev/null", "w").returns(std_out)
-        PluginPackager.do_quietly?(false) {puts "success"}
-        std_out.rewind
-        std_out.read.should == "success\n"
-        std_out.close
-        std_out.unlink
-      end
-
-      it "should raise an exception and reset stdout if the block raises an execption" do
-        expect{
-          PluginPackager.do_quietly?(false) {raise Exception, "exception"}
-        }.to raise_error(Exception, "exception")
-      end
-    end
-
-    describe "#build_tool?" do
-      it "should return true if the given build tool is present on the system" do
-        File.expects(:join).returns("foo")
-        File.expects(:exists?).with("foo").returns(true)
-        result = PluginPackager.build_tool?("foo")
-        result.should == true
-      end
-
-      it "should return false if the given build tool is not present on the system" do
-        File.stubs(:join).returns("foo")
-        File.stubs(:exists?).with("foo").returns(false)
-        result = PluginPackager.build_tool?("foo")
-        result.should == false
-      end
-    end
-
-    describe "#safe_system" do
-      it "should not raise any exceptions if a command ran" do
-        PluginPackager.expects(:system).with("foo").returns(true)
-        lambda{PluginPackager.safe_system("foo")}.should_not raise_error
-      end
-
-      it "should raise a RuntimeError if command cannot be run" do
-        PluginPackager.expects(:system).with("foo").returns(false)
-        expect{
-          PluginPackager.safe_system("foo")
-        }.to raise_error(RuntimeError, "Failed: foo")
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/aggregate/average_spec.rb b/spec/unit/plugins/mcollective/aggregate/average_spec.rb
deleted file mode 100644 (file)
index 1047d8e..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-require File.dirname(__FILE__) + "/../../../../../plugins/mcollective/aggregate/average.rb"
-
-module MCollective
-  class Aggregate
-    describe Average do
-      describe "#startup_hook" do
-        it "should set the correct result hash" do
-          result = Average.new(:test, [], "%d", :test_action)
-          result.result.should == {:value => 0, :type => :numeric, :output => :test}
-          result.aggregate_format.should == "%d"
-        end
-
-        it "should set a defauly aggregate_format if one isn't defined" do
-          result = Average.new(:test, [], nil, :test_action)
-          result.aggregate_format.should == "Average of test: %f"
-        end
-      end
-
-      describe "#process_result" do
-        it "should add the reply value to the result hash" do
-          average = Average.new([:test], [], "%d", :test_action)
-          average.process_result(1, {:test => 1})
-          average.result[:value].should == 1
-        end
-      end
-
-      describe "#summarize" do
-        it "should calculate the average and return a result class" do
-          result_obj = mock
-          result_obj.stubs(:new).returns(:success)
-
-          average = Average.new([:test], [], "%d", :test_action)
-          average.process_result(10, {:test => 10})
-          average.process_result(20, {:test => 20})
-          average.stubs(:result_class).returns(result_obj)
-          average.summarize.should == :success
-          average.result[:value].should == 15
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/aggregate/sum_spec.rb b/spec/unit/plugins/mcollective/aggregate/sum_spec.rb
deleted file mode 100644 (file)
index c3325a2..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-require File.dirname(__FILE__) + "/../../../../../plugins/mcollective/aggregate/sum.rb"
-
-module MCollective
-  class Aggregate
-    describe Sum do
-      describe "#startup_hook" do
-        it "should set the correct result hash" do
-          result = Sum.new(:test, [], "%d", :test_action)
-          result.result.should == {:value => 0, :type => :numeric, :output => :test}
-          result.aggregate_format.should == "%d"
-        end
-
-        it "should set a defauly aggregate_format if one isn't defined" do
-          result = Sum.new(:test, [], nil, :test_action)
-          result.aggregate_format.should == "Sum of test: %f"
-        end
-      end
-
-      describe "#process_result" do
-        it "should add the reply value to the result hash" do
-          average = Sum.new([:test], [], "%d", :test_action)
-          average.process_result(1, {:test => 1})
-          average.result[:value].should == 1
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/aggregate/summary_spec.rb b/spec/unit/plugins/mcollective/aggregate/summary_spec.rb
deleted file mode 100644 (file)
index 1f6f71c..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-require File.dirname(__FILE__) + "/../../../../../plugins/mcollective/aggregate/summary.rb"
-
-module MCollective
-  class Aggregate
-    describe Summary do
-      describe "#startup_hook" do
-        it "should set the correct result hash" do
-          result = Summary.new(:test, [], "%d", :test_action)
-          result.result.should == {:value => {}, :type => :collection, :output => :test}
-          result.aggregate_format.should == "%d"
-        end
-
-        it "should set a defauly aggregate_format if one isn't defined" do
-          result = Summary.new(:test, [], nil, :test_action)
-          result.aggregate_format.should == :calculate
-        end
-      end
-
-      describe "#process_result" do
-        it "should add the value to the result hash" do
-          sum = Summary.new(:test, [], "%d", :test_action)
-          sum.process_result(:foo, {:test => :foo})
-          sum.result[:value].should == {:foo => 1}
-        end
-
-        it "should add the reply values to the result hash if value is an array" do
-          sum = Summary.new(:test, [], "%d", :test_action)
-          sum.process_result([:foo, :foo, :bar], {:test => [:foo, :foo, :bar]})
-          sum.result[:value].should == {:foo => 2, :bar => 1}
-        end
-      end
-
-      describe "#summarize" do
-        it "should calculate an attractive format" do
-          sum = Summary.new(:test, [], nil, :test_action)
-          sum.result[:value] = {"shrt" => 1, "long key" => 1}
-          sum.summarize.aggregate_format.should == "%8s = %s"
-        end
-
-        it "should calculate an attractive format when result type is not a string" do
-          sum1 = Summary.new(:test, [], nil, :test_action)
-          sum1.result[:value] = {true => 4, false => 5}
-          sum1.summarize.aggregate_format.should == "%5s = %s"
-
-          sum2 = Summary.new(:test, [], nil, :test_action)
-          sum2.result[:value] = {1 => 1, 10 => 2}
-          sum2.summarize.aggregate_format.should == "%2s = %s"
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/connector/activemq_spec.rb b/spec/unit/plugins/mcollective/connector/activemq_spec.rb
deleted file mode 100644 (file)
index bb06bbe..0000000
+++ /dev/null
@@ -1,534 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-MCollective::PluginManager.clear
-
-require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/connector/activemq.rb'
-
-# create the stomp error class here as it does not always exist
-# all versions of the stomp gem and we do not want to tie tests
-# to the stomp gem
-module Stomp
-  module Error
-    class DuplicateSubscription < RuntimeError; end
-  end
-end
-
-module MCollective
-  module Connector
-    describe Activemq do
-      before do
-        unless ::Stomp::Error.constants.map{|c| c.to_s}.include?("NoCurrentConnection")
-          class ::Stomp::Error::NoCurrentConnection < RuntimeError ; end
-        end
-
-        @config = mock
-        @config.stubs(:configured).returns(true)
-        @config.stubs(:identity).returns("rspec")
-        @config.stubs(:collectives).returns(["mcollective"])
-
-        logger = mock
-        logger.stubs(:log)
-        logger.stubs(:start)
-        Log.configure(logger)
-
-        Config.stubs(:instance).returns(@config)
-
-        @msg = mock
-        @msg.stubs(:base64_encode!)
-        @msg.stubs(:payload).returns("msg")
-        @msg.stubs(:agent).returns("agent")
-        @msg.stubs(:type).returns(:reply)
-        @msg.stubs(:collective).returns("mcollective")
-
-        @subscription = mock
-        @subscription.stubs("<<").returns(true)
-        @subscription.stubs("include?").returns(false)
-        @subscription.stubs("delete").returns(false)
-
-        @connection = mock
-        @connection.stubs(:subscribe).returns(true)
-        @connection.stubs(:unsubscribe).returns(true)
-
-        @c = Activemq.new
-        @c.instance_variable_set("@subscriptions", @subscription)
-        @c.instance_variable_set("@connection", @connection)
-      end
-
-      describe "#initialize" do
-        it "should set the @config variable" do
-          c = Activemq.new
-          c.instance_variable_get("@config").should == @config
-        end
-
-        it "should set @subscriptions to an empty list" do
-          c = Activemq.new
-          c.instance_variable_get("@subscriptions").should == []
-        end
-      end
-
-      describe "#connect" do
-        it "should not try to reconnect if already connected" do
-          Log.expects(:debug).with("Already connection, not re-initializing connection").once
-          @c.connect
-        end
-
-        it "should support new style config" do
-          pluginconf = {"activemq.pool.size" => "2",
-                        "activemq.pool.1.host" => "host1",
-                        "activemq.pool.1.port" => "6163",
-                        "activemq.pool.1.user" => "user1",
-                        "activemq.pool.1.password" => "password1",
-                        "activemq.pool.1.ssl" => "false",
-                        "activemq.pool.2.host" => "host2",
-                        "activemq.pool.2.port" => "6164",
-                        "activemq.pool.2.user" => "user2",
-                        "activemq.pool.2.password" => "password2",
-                        "activemq.pool.2.ssl" => "true",
-                        "activemq.pool.2.ssl.fallback" => "true",
-                        "activemq.initial_reconnect_delay" => "0.02",
-                        "activemq.max_reconnect_delay" => "40",
-                        "activemq.use_exponential_back_off" => "false",
-                        "activemq.back_off_multiplier" => "3",
-                        "activemq.max_reconnect_attempts" => "5",
-                        "activemq.randomize" => "true",
-                        "activemq.backup" => "true",
-                        "activemq.timeout" => "1",
-                        "activemq.connect_timeout" => "5"}
-
-
-          ENV.delete("STOMP_USER")
-          ENV.delete("STOMP_PASSWORD")
-
-          @config.expects(:pluginconf).returns(pluginconf).at_least_once
-
-          Activemq::EventLogger.expects(:new).returns("logger")
-
-          connector = mock
-          connector.expects(:new).with(:backup => true,
-                                       :back_off_multiplier => 3,
-                                       :max_reconnect_delay => 40.0,
-                                       :timeout => 1,
-                                       :connect_timeout => 5,
-                                       :use_exponential_back_off => false,
-                                       :max_reconnect_attempts => 5,
-                                       :initial_reconnect_delay => 0.02,
-                                       :randomize => true,
-                                       :reliable => true,
-                                       :logger => "logger",
-                                       :hosts => [{:passcode => 'password1',
-                                                   :host => 'host1',
-                                                   :port => 6163,
-                                                   :ssl => false,
-                                                   :login => 'user1'},
-                                                  {:passcode => 'password2',
-                                                   :host => 'host2',
-                                                   :port => 6164,
-                                                   :ssl => true,
-                                                   :login => 'user2'}
-          ])
-
-          @c.expects(:ssl_parameters).with(2, true).returns(true)
-
-          @c.instance_variable_set("@connection", nil)
-          @c.connect(connector)
-        end
-      end
-
-      describe "#ssl_paramaters" do
-        it "should ensure all settings are provided" do
-          pluginconf = {"activemq.pool.1.host" => "host1",
-                        "activemq.pool.1.port" => "6164",
-                        "activemq.pool.1.user" => "user1",
-                        "activemq.pool.1.password" => "password1",
-                        "activemq.pool.1.ssl" => "true",
-                        "activemq.pool.1.ssl.cert" => "rspec"}
-
-          @config.expects(:pluginconf).returns(pluginconf).at_least_once
-
-          expect { @c.ssl_parameters(1, false) }.to raise_error("cert, key and ca has to be supplied for verified SSL mode")
-        end
-
-        it "should verify the ssl files exist" do
-          pluginconf = {"activemq.pool.1.host" => "host1",
-                        "activemq.pool.1.port" => "6164",
-                        "activemq.pool.1.user" => "user1",
-                        "activemq.pool.1.password" => "password1",
-                        "activemq.pool.1.ssl" => "true",
-                        "activemq.pool.1.ssl.cert" => "rspec.cert",
-                        "activemq.pool.1.ssl.key" => "rspec.key",
-                        "activemq.pool.1.ssl.ca" => "rspec1.ca,rspec2.ca"}
-
-          @config.expects(:pluginconf).returns(pluginconf).at_least_once
-
-          File.expects(:exist?).with("rspec.cert").twice.returns(true)
-          File.expects(:exist?).with("rspec.key").twice.returns(true)
-          File.expects(:exist?).with("rspec1.ca").twice.returns(true)
-          File.expects(:exist?).with("rspec2.ca").twice.returns(false)
-
-          expect { @c.ssl_parameters(1, false) }.to raise_error("Cannot find CA file rspec2.ca")
-
-          @c.ssl_parameters(1, true).should == true
-        end
-
-        it "should support fallback mode when there are errors" do
-          pluginconf = {"activemq.pool.1.host" => "host1",
-                        "activemq.pool.1.port" => "6164",
-                        "activemq.pool.1.user" => "user1",
-                        "activemq.pool.1.password" => "password1",
-                        "activemq.pool.1.ssl" => "true"}
-
-          @config.expects(:pluginconf).returns(pluginconf).at_least_once
-
-          @c.ssl_parameters(1, true).should == true
-        end
-
-        it "should fail if fallback isnt enabled" do
-          pluginconf = {"activemq.pool.1.host" => "host1",
-                        "activemq.pool.1.port" => "6164",
-                        "activemq.pool.1.user" => "user1",
-                        "activemq.pool.1.password" => "password1",
-                        "activemq.pool.1.ssl" => "true"}
-
-          @config.expects(:pluginconf).returns(pluginconf).at_least_once
-
-          expect { @c.ssl_parameters(1, false) }.to raise_error
-        end
-      end
-
-      describe "#receive" do
-        it "should receive from the middleware" do
-          payload = mock
-          payload.stubs(:body).returns("msg")
-          payload.stubs(:headers).returns("headers")
-
-          @connection.expects(:receive).returns(payload)
-
-          Message.expects(:new).with("msg", payload, :base64 => true, :headers => "headers").returns("message")
-          @c.instance_variable_set("@base64", true)
-
-          received = @c.receive
-          received.should == "message"
-        end
-
-        it "should sleep and retry if recieving while disconnected" do
-          payload = mock
-          payload.stubs(:body).returns("msg")
-          payload.stubs(:headers).returns("headers")
-
-          Message.stubs(:new).returns("rspec")
-          @connection.expects(:receive).raises(::Stomp::Error::NoCurrentConnection).returns(payload).twice
-          @c.expects(:sleep).with(1)
-
-          @c.receive.should == "rspec"
-        end
-      end
-
-      describe "#publish" do
-        before do
-          @connection.stubs(:publish).with("test", "msg", {}).returns(true)
-        end
-
-        it "should base64 encode a message if configured to do so" do
-          @c.instance_variable_set("@base64", true)
-          @c.expects(:headers_for).returns({})
-          @c.expects(:target_for).returns({:name => "test", :headers => {}})
-          @connection.expects(:publish).with("test", "msg", {})
-          @msg.expects(:base64_encode!)
-
-          @c.publish(@msg)
-        end
-
-        it "should not base64 encode if not configured to do so" do
-          @c.instance_variable_set("@base64", false)
-          @c.expects(:headers_for).returns({})
-          @c.expects(:target_for).returns({:name => "test", :headers => {}})
-          @connection.expects(:publish).with("test", "msg", {})
-          @msg.expects(:base64_encode!).never
-
-          @c.publish(@msg)
-        end
-
-        it "should publish the correct message to the correct target with msgheaders" do
-          @connection.expects(:publish).with("test", "msg", {"test" => "test"}).once
-          @c.expects(:headers_for).returns({"test" => "test"})
-          @c.expects(:target_for).returns({:name => "test", :headers => {}})
-
-          @c.publish(@msg)
-        end
-
-        it "should publish direct messages based on discovered_hosts" do
-          msg = mock
-          msg.stubs(:base64_encode!)
-          msg.stubs(:payload).returns("msg")
-          msg.stubs(:agent).returns("agent")
-          msg.stubs(:collective).returns("mcollective")
-          msg.stubs(:type).returns(:direct_request)
-          msg.expects(:discovered_hosts).returns(["one", "two"])
-
-          @c.expects(:headers_for).with(msg, "one")
-          @c.expects(:headers_for).with(msg, "two")
-          @connection.expects(:publish).with('/queue/mcollective.nodes', 'msg', nil).twice
-
-          @c.publish(msg)
-        end
-      end
-
-      describe "#subscribe" do
-        it "should handle duplicate subscription errors" do
-          @connection.expects(:subscribe).raises(::Stomp::Error::DuplicateSubscription)
-          Log.expects(:error).with(regexp_matches(/already had a matching subscription, ignoring/))
-          @c.subscribe("test", :broadcast, "mcollective")
-        end
-
-        it "should use the make_target correctly" do
-          @c.expects("make_target").with("test", :broadcast, "mcollective").returns({:name => "test", :headers => {}})
-          @c.subscribe("test", :broadcast, "mcollective")
-        end
-
-        it "should check for existing subscriptions" do
-          @c.expects("make_target").with("test", :broadcast, "mcollective").returns({:name => "test", :headers => {}, :id => "rspec"})
-          @subscription.expects("include?").with("rspec").returns(false)
-          @connection.expects(:subscribe).never
-
-          @c.subscribe("test", :broadcast, "mcollective")
-        end
-
-        it "should subscribe to the middleware" do
-          @c.expects("make_target").with("test", :broadcast, "mcollective").returns({:name => "test", :headers => {}, :id => "rspec"})
-          @connection.expects(:subscribe).with("test", {}, "rspec")
-          @c.subscribe("test", :broadcast, "mcollective")
-        end
-
-        it "should add to the list of subscriptions" do
-          @c.expects("make_target").with("test", :broadcast, "mcollective").returns({:name => "test", :headers => {}, :id => "rspec"})
-          @subscription.expects("<<").with("rspec")
-          @c.subscribe("test", :broadcast, "mcollective")
-        end
-      end
-
-      describe "#unsubscribe" do
-        it "should use make_target correctly" do
-          @c.expects("make_target").with("test", :broadcast, "mcollective").returns({:name => "test", :headers => {}})
-          @c.unsubscribe("test", :broadcast, "mcollective")
-        end
-
-        it "should unsubscribe from the target" do
-          @c.expects("make_target").with("test", :broadcast, "mcollective").returns({:name => "test", :headers => {}, :id => "rspec"})
-          @connection.expects(:unsubscribe).with("test", {}, "rspec").once
-
-          @c.unsubscribe("test", :broadcast, "mcollective")
-        end
-
-        it "should delete the source from subscriptions" do
-          @c.expects("make_target").with("test", :broadcast, "mcollective").returns({:name => "test", :headers => {}, :id => "rspec"})
-          @subscription.expects(:delete).with("rspec").once
-
-          @c.unsubscribe("test", :broadcast, "mcollective")
-        end
-      end
-
-      describe "#target_for" do
-        it "should create reply targets based on reply-to headers in requests" do
-          message = mock
-          message.expects(:type).returns(:reply)
-
-          request = mock
-          request.expects(:headers).returns({"reply-to" => "foo"})
-
-          message.expects(:request).returns(request)
-
-          @c.target_for(message).should == {:name => "foo", :headers => {}}
-        end
-
-        it "should create new request targets" do
-          message = mock
-          message.expects(:type).returns(:request).times(3)
-          message.expects(:agent).returns("rspecagent")
-          message.expects(:collective).returns("mcollective")
-
-          @c.expects(:make_target).with("rspecagent", :request, "mcollective")
-          @c.target_for(message)
-        end
-
-        it "should support direct requests" do
-          message = mock
-          message.expects(:type).returns(:direct_request).times(3)
-          message.expects(:agent).returns("rspecagent")
-          message.expects(:collective).returns("mcollective")
-
-          @c.expects(:make_target).with("rspecagent", :direct_request, "mcollective")
-          @c.target_for(message)
-        end
-
-        it "should fail for unknown message types" do
-          message = mock
-          message.stubs(:type).returns(:fail)
-
-          expect {
-            @c.target_for(message)
-          }.to raise_error("Don't now how to create a target for message type fail")
-        end
-      end
-
-      describe "#disconnect" do
-        it "should disconnect from the stomp connection" do
-          @connection.expects(:disconnect)
-          @c.disconnect
-          @c.connection.should == nil
-        end
-      end
-
-      describe "#headers_for" do
-        it "should return empty headers if priority is 0" do
-          message = mock
-          message.expects(:type).returns(:foo)
-
-          @c.instance_variable_set("@msgpriority", 0)
-          @c.headers_for(message).should == {}
-        end
-
-        it "should return a priority if priority is non 0" do
-          message = mock
-          message.expects(:type).returns(:foo)
-
-          @c.instance_variable_set("@msgpriority", 1)
-          @c.headers_for(message).should == {"priority" => 1}
-        end
-
-        it "should set mc_identity for direct requests" do
-          message = mock
-          message.expects(:type).returns(:direct_request).twice
-          message.expects(:agent).returns("rspecagent")
-          message.expects(:collective).returns("mcollective")
-          message.expects(:reply_to).returns(nil)
-
-          @c.instance_variable_set("@msgpriority", 0)
-          @c.expects(:make_target).with("rspecagent", :reply, "mcollective").returns({:name => "test"})
-          @c.headers_for(message, "some.node").should == {"mc_identity"=>"some.node", "reply-to"=>"test"}
-        end
-
-        it "should set a reply-to header for :request type messages" do
-          message = mock
-          message.expects(:type).returns(:request).twice
-          message.expects(:agent).returns("rspecagent")
-          message.expects(:collective).returns("mcollective")
-          message.expects(:reply_to).returns(nil)
-
-          @c.instance_variable_set("@msgpriority", 0)
-          @c.expects(:make_target).with("rspecagent", :reply, "mcollective").returns({:name => "test"})
-          @c.headers_for(message).should == {"reply-to" => "test"}
-        end
-
-        it "should set reply-to correctly if the message defines it" do
-          message = mock
-          message.expects(:type).returns(:request).twice
-          message.expects(:agent).returns("rspecagent")
-          message.expects(:collective).returns("mcollective")
-          message.expects(:reply_to).returns("rspec").twice
-
-          @c.headers_for(message).should == {"reply-to" => "rspec"}
-
-        end
-      end
-
-      describe "#make_target" do
-        it "should create correct targets" do
-          @c.make_target("test", :reply, "mcollective").should == {:name => "/queue/mcollective.reply.rspec_#{$$}", :headers => {}, :id => "/queue/mcollective.reply.rspec_#{$$}"}
-          @c.make_target("test", :broadcast, "mcollective").should == {:name => "/topic/mcollective.test.agent", :headers => {}, :id => "/topic/mcollective.test.agent"}
-          @c.make_target("test", :request, "mcollective").should == {:name => "/topic/mcollective.test.agent", :headers => {}, :id => "/topic/mcollective.test.agent"}
-          @c.make_target("test", :direct_request, "mcollective").should == {:headers=>{}, :name=>"/queue/mcollective.nodes", :id => "/queue/mcollective.nodes"}
-          @c.make_target("test", :directed, "mcollective").should == {:name => "/queue/mcollective.nodes", :headers=>{"selector"=>"mc_identity = 'rspec'"}, :id => "mcollective_directed_to_identity"}
-        end
-
-        it "should raise an error for unknown collectives" do
-          expect {
-            @c.make_target("test", :broadcast, "foo")
-          }.to raise_error("Unknown collective 'foo' known collectives are 'mcollective'")
-        end
-
-        it "should raise an error for unknown types" do
-          expect {
-            @c.make_target("test", :test, "mcollective")
-          }.to raise_error("Unknown target type test")
-        end
-      end
-
-
-      describe "#get_env_or_option" do
-        it "should return the environment variable if set" do
-          ENV["test"] = "rspec_env_test"
-
-          @c.get_env_or_option("test", nil, nil).should == "rspec_env_test"
-
-          ENV.delete("test")
-        end
-
-        it "should return the config option if set" do
-          @config.expects(:pluginconf).returns({"test" => "rspec_test"}).twice
-          @c.get_env_or_option("test", "test", "test").should == "rspec_test"
-        end
-
-        it "should return default if nothing else matched" do
-          @config.expects(:pluginconf).returns({}).once
-          @c.get_env_or_option("test", "test", "test").should == "test"
-        end
-
-        it "should raise an error if no default is supplied" do
-          @config.expects(:pluginconf).returns({}).once
-
-          expect {
-            @c.get_env_or_option("test", "test")
-          }.to raise_error("No test environment or plugin.test configuration option given")
-        end
-      end
-
-      describe "#get_option" do
-        it "should return the config option if set" do
-          @config.expects(:pluginconf).returns({"test" => "rspec_test"}).twice
-          @c.get_option("test").should == "rspec_test"
-        end
-
-        it "should return default option was not found" do
-          @config.expects(:pluginconf).returns({}).once
-          @c.get_option("test", "test").should == "test"
-        end
-
-        it "should raise an error if no default is supplied" do
-          @config.expects(:pluginconf).returns({}).once
-
-          expect {
-            @c.get_option("test")
-          }.to raise_error("No plugin.test configuration option given")
-        end
-      end
-
-      describe "#get_bool_option" do
-        it "should return the default if option isnt set" do
-          @config.expects(:pluginconf).returns({}).once
-          @c.get_bool_option("test", "default").should == "default"
-        end
-
-        ["1", "yes", "true"].each do |boolean|
-          it "should map options to true correctly" do
-            @config.expects(:pluginconf).returns({"test" => boolean}).twice
-            @c.get_bool_option("test", "default").should == true
-          end
-        end
-
-        ["0", "no", "false"].each do |boolean|
-          it "should map options to false correctly" do
-            @config.expects(:pluginconf).returns({"test" => boolean}).twice
-            @c.get_bool_option("test", "default").should == false
-          end
-        end
-
-        it "should return default for non boolean options" do
-          @config.expects(:pluginconf).returns({"test" => "foo"}).twice
-          @c.get_bool_option("test", "default").should == "default"
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/connector/rabbitmq_spec.rb b/spec/unit/plugins/mcollective/connector/rabbitmq_spec.rb
deleted file mode 100644 (file)
index bf09704..0000000
+++ /dev/null
@@ -1,483 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-MCollective::PluginManager.clear
-
-require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/connector/rabbitmq.rb'
-
-# create the stomp error class here as it does not always exist
-# all versions of the stomp gem and we do not want to tie tests
-# to the stomp gem
-module Stomp
-  module Error
-    class DuplicateSubscription < RuntimeError; end
-  end
-end
-
-module MCollective
-  module Connector
-    describe Rabbitmq do
-      before do
-        unless ::Stomp::Error.constants.map{|c| c.to_s}.include?("NoCurrentConnection")
-          class ::Stomp::Error::NoCurrentConnection < RuntimeError ; end
-        end
-
-        @config = mock
-        @config.stubs(:configured).returns(true)
-        @config.stubs(:identity).returns("rspec")
-        @config.stubs(:collectives).returns(["mcollective"])
-
-        logger = mock
-        logger.stubs(:log)
-        logger.stubs(:start)
-        Log.configure(logger)
-
-        Config.stubs(:instance).returns(@config)
-
-        @msg = mock
-        @msg.stubs(:base64_encode!)
-        @msg.stubs(:payload).returns("msg")
-        @msg.stubs(:agent).returns("agent")
-        @msg.stubs(:type).returns(:reply)
-        @msg.stubs(:collective).returns("mcollective")
-
-        @subscription = mock
-        @subscription.stubs("<<").returns(true)
-        @subscription.stubs("include?").returns(false)
-        @subscription.stubs("delete").returns(false)
-
-        @connection = mock
-        @connection.stubs(:subscribe).returns(true)
-        @connection.stubs(:unsubscribe).returns(true)
-
-        @c = Rabbitmq.new
-        @c.instance_variable_set("@subscriptions", @subscription)
-        @c.instance_variable_set("@connection", @connection)
-      end
-
-      describe "#initialize" do
-        it "should set the @config variable" do
-          c = Rabbitmq.new
-          c.instance_variable_get("@config").should == @config
-        end
-
-        it "should set @subscriptions to an empty list" do
-          c = Rabbitmq.new
-          c.instance_variable_get("@subscriptions").should == []
-        end
-      end
-
-      describe "#connect" do
-        it "should not try to reconnect if already connected" do
-          Log.expects(:debug).with("Already connection, not re-initializing connection").once
-          @c.connect
-        end
-
-        it "should support new style config" do
-          pluginconf = {"rabbitmq.pool.size" => "2",
-                        "rabbitmq.pool.1.host" => "host1",
-                        "rabbitmq.pool.1.port" => "6163",
-                        "rabbitmq.pool.1.user" => "user1",
-                        "rabbitmq.pool.1.password" => "password1",
-                        "rabbitmq.pool.1.ssl" => "false",
-                        "rabbitmq.pool.2.host" => "host2",
-                        "rabbitmq.pool.2.port" => "6164",
-                        "rabbitmq.pool.2.user" => "user2",
-                        "rabbitmq.pool.2.password" => "password2",
-                        "rabbitmq.pool.2.ssl" => "true",
-                        "rabbitmq.pool.2.ssl.fallback" => "true",
-                        "rabbitmq.initial_reconnect_delay" => "0.02",
-                        "rabbitmq.max_reconnect_delay" => "40",
-                        "rabbitmq.use_exponential_back_off" => "false",
-                        "rabbitmq.back_off_multiplier" => "3",
-                        "rabbitmq.max_reconnect_attempts" => "5",
-                        "rabbitmq.randomize" => "true",
-                        "rabbitmq.backup" => "true",
-                        "rabbitmq.timeout" => "1",
-                        "rabbitmq.vhost" => "mcollective",
-                        "rabbitmq.connect_timeout" => "5"}
-
-
-          ENV.delete("STOMP_USER")
-          ENV.delete("STOMP_PASSWORD")
-
-          @config.expects(:pluginconf).returns(pluginconf).at_least_once
-
-          Rabbitmq::EventLogger.expects(:new).returns("logger")
-
-          connector = mock
-          connector.expects(:new).with(:backup => true,
-                                       :back_off_multiplier => 3,
-                                       :max_reconnect_delay => 40.0,
-                                       :timeout => 1,
-                                       :connect_timeout => 5,
-                                       :use_exponential_back_off => false,
-                                       :max_reconnect_attempts => 5,
-                                       :initial_reconnect_delay => 0.02,
-                                       :randomize => true,
-                                       :reliable => true,
-                                       :logger => "logger",
-                                       :connect_headers => {'accept-version' => '1.0', 'host' => 'mcollective'},
-                                       :hosts => [{:passcode => 'password1',
-                                                   :host => 'host1',
-                                                   :port => 6163,
-                                                   :ssl => false,
-                                                   :login => 'user1'},
-                                                  {:passcode => 'password2',
-                                                   :host => 'host2',
-                                                   :port => 6164,
-                                                   :ssl => true,
-                                                   :login => 'user2'}
-          ])
-
-          @c.expects(:ssl_parameters).with(2, true).returns(true)
-
-          @c.instance_variable_set("@connection", nil)
-          @c.connect(connector)
-        end
-      end
-
-      describe "#ssl_paramaters" do
-        it "should ensure all settings are provided" do
-          pluginconf = {"rabbitmq.pool.1.host" => "host1",
-                        "rabbitmq.pool.1.port" => "6164",
-                        "rabbitmq.pool.1.user" => "user1",
-                        "rabbitmq.pool.1.password" => "password1",
-                        "rabbitmq.pool.1.ssl" => "true",
-                        "rabbitmq.pool.1.ssl.cert" => "rspec"}
-
-          @config.expects(:pluginconf).returns(pluginconf).at_least_once
-
-          expect { @c.ssl_parameters(1, false) }.to raise_error("cert, key and ca has to be supplied for verified SSL mode")
-        end
-
-        it "should verify the ssl files exist" do
-          pluginconf = {"rabbitmq.pool.1.host" => "host1",
-                        "rabbitmq.pool.1.port" => "6164",
-                        "rabbitmq.pool.1.user" => "user1",
-                        "rabbitmq.pool.1.password" => "password1",
-                        "rabbitmq.pool.1.ssl" => "true",
-                        "rabbitmq.pool.1.ssl.cert" => "rspec.cert",
-                        "rabbitmq.pool.1.ssl.key" => "rspec.key",
-                        "rabbitmq.pool.1.ssl.ca" => "rspec1.ca,rspec2.ca"}
-
-          @config.expects(:pluginconf).returns(pluginconf).at_least_once
-
-          File.expects(:exist?).with("rspec.cert").twice.returns(true)
-          File.expects(:exist?).with("rspec.key").twice.returns(true)
-          File.expects(:exist?).with("rspec1.ca").twice.returns(true)
-          File.expects(:exist?).with("rspec2.ca").twice.returns(false)
-
-          expect { @c.ssl_parameters(1, false) }.to raise_error("Cannot find CA file rspec2.ca")
-
-          @c.ssl_parameters(1, true).should == true
-        end
-
-        it "should support fallback mode when there are errors" do
-          pluginconf = {"rabbitmq.pool.1.host" => "host1",
-                        "rabbitmq.pool.1.port" => "6164",
-                        "rabbitmq.pool.1.user" => "user1",
-                        "rabbitmq.pool.1.password" => "password1",
-                        "rabbitmq.pool.1.ssl" => "true"}
-
-          @config.expects(:pluginconf).returns(pluginconf).at_least_once
-
-          @c.ssl_parameters(1, true).should == true
-        end
-
-        it "should fail if fallback isnt enabled" do
-          pluginconf = {"rabbitmq.pool.1.host" => "host1",
-                        "rabbitmq.pool.1.port" => "6164",
-                        "rabbitmq.pool.1.user" => "user1",
-                        "rabbitmq.pool.1.password" => "password1",
-                        "rabbitmq.pool.1.ssl" => "true"}
-
-          @config.expects(:pluginconf).returns(pluginconf).at_least_once
-
-          expect { @c.ssl_parameters(1, false) }.to raise_error
-        end
-      end
-
-      describe "#receive" do
-        it "should receive from the middleware" do
-          payload = mock
-          payload.stubs(:body).returns("msg")
-          payload.stubs(:headers).returns("headers")
-
-          @connection.expects(:receive).returns(payload)
-
-          Message.expects(:new).with("msg", payload, :base64 => true, :headers => "headers").returns("message")
-          @c.instance_variable_set("@base64", true)
-
-          received = @c.receive
-          received.should == "message"
-        end
-
-        it "should sleep and retry if recieving while disconnected" do
-          payload = mock
-          payload.stubs(:body).returns("msg")
-          payload.stubs(:headers).returns("headers")
-
-          Message.stubs(:new).returns("rspec")
-          @connection.expects(:receive).raises(::Stomp::Error::NoCurrentConnection).returns(payload).twice
-          @c.expects(:sleep).with(1)
-
-          @c.receive.should == "rspec"
-        end
-      end
-
-      describe "#publish" do
-        before do
-          @connection.stubs(:publish).with("test", "msg", {}).returns(true)
-        end
-
-        it "should base64 encode a message if configured to do so" do
-          @c.instance_variable_set("@base64", true)
-          @c.expects(:target_for).returns({:name => "test", :headers => {}})
-          @connection.expects(:publish).with("test", "msg", {})
-          @msg.expects(:base64_encode!)
-
-          @c.publish(@msg)
-        end
-
-        it "should not base64 encode if not configured to do so" do
-          @c.instance_variable_set("@base64", false)
-          @c.expects(:target_for).returns({:name => "test", :headers => {}})
-          @connection.expects(:publish).with("test", "msg", {})
-          @msg.expects(:base64_encode!).never
-
-          @c.publish(@msg)
-        end
-
-        it "should publish the correct message to the correct target with msgheaders" do
-          @connection.expects(:publish).with("test", "msg", {}).once
-          @c.expects(:target_for).returns({:name => "test", :headers => {}})
-
-          @c.publish(@msg)
-        end
-
-        it "should publish direct messages based on discovered_hosts" do
-          msg = mock
-          msg.stubs(:base64_encode!)
-          msg.stubs(:payload).returns("msg")
-          msg.stubs(:agent).returns("agent")
-          msg.stubs(:collective).returns("mcollective")
-          msg.stubs(:type).returns(:direct_request)
-          msg.stubs(:reply_to).returns("/topic/mcollective")
-          msg.expects(:discovered_hosts).returns(["one", "two"])
-
-          @connection.expects(:publish).with('/exchange/mcollective_directed/one', 'msg', {'reply-to' => '/temp-queue/mcollective_reply_agent'})
-          @connection.expects(:publish).with('/exchange/mcollective_directed/two', 'msg', {'reply-to' => '/temp-queue/mcollective_reply_agent'})
-
-          @c.publish(msg)
-        end
-      end
-
-      describe "#subscribe" do
-        it "should handle duplicate subscription errors" do
-          @connection.expects(:subscribe).raises(::Stomp::Error::DuplicateSubscription)
-          Log.expects(:error).with(regexp_matches(/already had a matching subscription, ignoring/))
-          @c.subscribe("test", :broadcast, "mcollective")
-        end
-
-        it "should use the make_target correctly" do
-          @c.expects("make_target").with("test", :broadcast, "mcollective").returns({:name => "test", :headers => {}})
-          @c.subscribe("test", :broadcast, "mcollective")
-        end
-
-        it "should check for existing subscriptions" do
-          @c.expects("make_target").with("test", :broadcast, "mcollective").returns({:name => "test", :headers => {}, :id => "rspec"})
-          @subscription.expects("include?").with("rspec").returns(false)
-          @connection.expects(:subscribe).never
-
-          @c.subscribe("test", :broadcast, "mcollective")
-        end
-
-        it "should subscribe to the middleware" do
-          @c.expects("make_target").with("test", :broadcast, "mcollective").returns({:name => "test", :headers => {}, :id => "rspec"})
-          @connection.expects(:subscribe).with("test", {}, "rspec")
-          @c.subscribe("test", :broadcast, "mcollective")
-        end
-
-        it "should add to the list of subscriptions" do
-          @c.expects("make_target").with("test", :broadcast, "mcollective").returns({:name => "test", :headers => {}, :id => "rspec"})
-          @subscription.expects("<<").with("rspec")
-          @c.subscribe("test", :broadcast, "mcollective")
-        end
-      end
-
-      describe "#unsubscribe" do
-        it "should use make_target correctly" do
-          @c.expects("make_target").with("test", :broadcast, "mcollective").returns({:name => "test", :headers => {}})
-          @c.unsubscribe("test", :broadcast, "mcollective")
-        end
-
-        it "should unsubscribe from the target" do
-          @c.expects("make_target").with("test", :broadcast, "mcollective").returns({:name => "test", :headers => {}, :id => "rspec"})
-          @connection.expects(:unsubscribe).with("test", {}, "rspec").once
-
-          @c.unsubscribe("test", :broadcast, "mcollective")
-        end
-
-        it "should delete the source from subscriptions" do
-          @c.expects("make_target").with("test", :broadcast, "mcollective").returns({:name => "test", :headers => {}, :id => "rspec"})
-          @subscription.expects(:delete).with("rspec").once
-
-          @c.unsubscribe("test", :broadcast, "mcollective")
-        end
-      end
-
-      describe "#target_for" do
-        it "should create reply targets based on reply-to headers in requests" do
-          message = mock
-          message.expects(:type).returns(:reply)
-
-          request = mock
-          request.expects(:headers).returns({"reply-to" => "foo"})
-
-          message.expects(:request).returns(request)
-
-          @c.target_for(message).should == {:name => "foo", :headers => {}, :id => ""}
-        end
-
-        it "should create new request targets" do
-          message = mock
-          message.expects(:type).returns(:request).times(3)
-          message.expects(:agent).returns("rspecagent")
-          message.expects(:collective).returns("mcollective")
-          message.expects(:reply_to).returns("/topic/rspec")
-
-          @c.expects(:make_target).with("rspecagent", :request, "mcollective", "/topic/rspec", nil)
-          @c.target_for(message)
-        end
-
-        it "should support direct requests" do
-          message = mock
-          message.expects(:type).returns(:direct_request).times(3)
-          message.expects(:agent).returns("rspecagent")
-          message.expects(:collective).returns("mcollective")
-          message.expects(:reply_to).returns("/topic/rspec")
-
-          @c.expects(:make_target).with("rspecagent", :direct_request, "mcollective", "/topic/rspec", nil)
-          @c.target_for(message)
-        end
-
-        it "should fail for unknown message types" do
-          message = mock
-          message.stubs(:type).returns(:fail)
-
-          expect {
-            @c.target_for(message)
-          }.to raise_error("Don't now how to create a target for message type fail")
-        end
-      end
-
-      describe "#disconnect" do
-        it "should disconnect from the stomp connection" do
-          @connection.expects(:disconnect)
-          @c.disconnect
-          @c.connection.should == nil
-        end
-      end
-
-      describe "#make_target" do
-        it "should create correct targets" do
-          @c.make_target("test", :reply, "mcollective").should == {:name => "/temp-queue/mcollective_reply_test", :headers => {}, :id => "mcollective_test_replies"}
-          @c.make_target("test", :broadcast, "mcollective").should == {:name => "/exchange/mcollective_broadcast/test", :headers => {"reply-to"=>"/temp-queue/mcollective_reply_test"}, :id => "mcollective_broadcast_test"}
-          @c.make_target("test", :request, "mcollective").should == {:name => "/exchange/mcollective_broadcast/test", :headers => {"reply-to"=>"/temp-queue/mcollective_reply_test"}, :id => "mcollective_broadcast_test"}
-          @c.make_target("test", :direct_request, "mcollective", nil, "rspec").should == {:headers=>{"reply-to"=>"/temp-queue/mcollective_reply_test"}, :name=>"/exchange/mcollective_directed/rspec", :id => nil}
-          @c.make_target("test", :directed, "mcollective").should == {:name => "/exchange/mcollective_directed/rspec", :headers=>{}, :id => "rspec_directed_to_identity"}
-          @c.make_target("test", :request, "mcollective", "/topic/rspec", "rspec").should == {:headers=>{"reply-to"=>"/topic/rspec"}, :name=>"/exchange/mcollective_broadcast/test", :id => "mcollective_broadcast_test"}
-        end
-
-        it "should raise an error for unknown collectives" do
-          expect {
-            @c.make_target("test", :broadcast, "foo")
-          }.to raise_error("Unknown collective 'foo' known collectives are 'mcollective'")
-        end
-
-        it "should raise an error for unknown types" do
-          expect {
-            @c.make_target("test", :test, "mcollective")
-          }.to raise_error("Unknown target type test")
-        end
-      end
-
-
-      describe "#get_env_or_option" do
-        it "should return the environment variable if set" do
-          ENV["test"] = "rspec_env_test"
-
-          @c.get_env_or_option("test", nil, nil).should == "rspec_env_test"
-
-          ENV.delete("test")
-        end
-
-        it "should return the config option if set" do
-          @config.expects(:pluginconf).returns({"test" => "rspec_test"}).twice
-          @c.get_env_or_option("test", "test", "test").should == "rspec_test"
-        end
-
-        it "should return default if nothing else matched" do
-          @config.expects(:pluginconf).returns({}).once
-          @c.get_env_or_option("test", "test", "test").should == "test"
-        end
-
-        it "should raise an error if no default is supplied" do
-          @config.expects(:pluginconf).returns({}).once
-
-          expect {
-            @c.get_env_or_option("test", "test")
-          }.to raise_error("No test environment or plugin.test configuration option given")
-        end
-      end
-
-      describe "#get_option" do
-        it "should return the config option if set" do
-          @config.expects(:pluginconf).returns({"test" => "rspec_test"}).twice
-          @c.get_option("test").should == "rspec_test"
-        end
-
-        it "should return default option was not found" do
-          @config.expects(:pluginconf).returns({}).once
-          @c.get_option("test", "test").should == "test"
-        end
-
-        it "should raise an error if no default is supplied" do
-          @config.expects(:pluginconf).returns({}).once
-
-          expect {
-            @c.get_option("test")
-          }.to raise_error("No plugin.test configuration option given")
-        end
-      end
-
-      describe "#get_bool_option" do
-        it "should return the default if option isnt set" do
-          @config.expects(:pluginconf).returns({}).once
-          @c.get_bool_option("test", "default").should == "default"
-        end
-
-        ["1", "yes", "true"].each do |boolean|
-          it "should map options to true correctly" do
-            @config.expects(:pluginconf).returns({"test" => boolean}).twice
-            @c.get_bool_option("test", "default").should == true
-          end
-        end
-
-        ["0", "no", "false"].each do |boolean|
-          it "should map options to false correctly" do
-            @config.expects(:pluginconf).returns({"test" => boolean}).twice
-            @c.get_bool_option("test", "default").should == false
-          end
-        end
-
-        it "should return default for non boolean options" do
-          @config.expects(:pluginconf).returns({"test" => "foo"}).twice
-          @c.get_bool_option("test", "default").should == "default"
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/data/agent_data_spec.rb b/spec/unit/plugins/mcollective/data/agent_data_spec.rb
deleted file mode 100644 (file)
index 6c8670f..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-require File.dirname(__FILE__) + "/../../../../../plugins/mcollective/data/agent_data.rb"
-
-module MCollective
-  module Data
-    describe Agent_data do
-      describe "#query_data" do
-        before do
-          @ddl = mock
-          @ddl.stubs(:dataquery_interface).returns({:output => {}})
-          @ddl.stubs(:meta).returns({:timeout => 1})
-          DDL.stubs(:new).returns(@ddl)
-          @plugin = Agent_data.new
-        end
-
-        it "should fail for unknown agents" do
-          expect { @plugin.query_data("rspec") }.to raise_error("No agent called rspec found")
-        end
-
-        it "should retrieve the correct agent and data" do
-          agent = mock
-          agent.stubs(:meta).returns({:license => "license",
-                                        :timeout => "timeout",
-                                        :description => "description",
-                                        :url => "url",
-                                        :version => "version",
-                                        :author => "author"})
-
-          PluginManager.stubs(:[]).with("rspec_agent").returns(agent)
-          PluginManager.expects(:include?).with("rspec_agent").returns(true)
-
-          @plugin.query_data("rspec")
-
-          [:license, :timeout, :description, :url, :version, :author].each do |item|
-            @plugin.result[item].should == item.to_s
-          end
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/data/fstat_data_spec.rb b/spec/unit/plugins/mcollective/data/fstat_data_spec.rb
deleted file mode 100644 (file)
index 228c0b1..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-require File.dirname(__FILE__) + "/../../../../../plugins/mcollective/data/fstat_data.rb"
-
-module MCollective
-  module Data
-    describe Fstat_data do
-      describe "#query_data" do
-        before do
-          @ddl = mock
-          @ddl.stubs(:meta).returns({:timeout => 1})
-          @ddl.stubs(:dataquery_interface).returns({:output => {}})
-          DDL.stubs(:new).returns(@ddl)
-          @plugin = Fstat_data.new
-
-          @time = Time.now
-
-          @stat = mock
-          @stat.stubs(:size).returns(123)
-          @stat.stubs(:uid).returns(0)
-          @stat.stubs(:gid).returns(0)
-          @stat.stubs(:mtime).returns(@time)
-          @stat.stubs(:ctime).returns(@time)
-          @stat.stubs(:atime).returns(@time)
-          @stat.stubs(:mode).returns(33188)
-          @stat.stubs(:directory?).returns(false)
-          @stat.stubs(:file?).returns(false)
-          @stat.stubs(:symlink?).returns(false)
-          @stat.stubs(:socket?).returns(false)
-          @stat.stubs(:chardev?).returns(false)
-          @stat.stubs(:blockdev?).returns(false)
-        end
-
-        it "should detect missing files" do
-          File.expects(:exists?).with("/nonexisting").returns(false)
-          @plugin.query_data("/nonexisting")
-          @plugin.result.output.should == "not present"
-        end
-
-        it "should provide correct file stats" do
-          File.expects(:exists?).with("rspec").returns(true)
-          File.expects(:symlink?).with("rspec").returns(false)
-          File.expects(:stat).with("rspec").returns(@stat)
-          File.expects(:read).with("rspec").returns("rspec")
-
-          @stat.stubs(:file?).returns(true)
-
-          @plugin.query_data("rspec")
-          @plugin.result.output.should == "present"
-          @plugin.result.size.should == 123
-          @plugin.result.uid.should == 0
-          @plugin.result.gid.should == 0
-          @plugin.result.mtime.should == @time.strftime("%F %T")
-          @plugin.result.mtime_seconds.should == @time.to_i
-          @plugin.result.mtime_age.should <= 5
-          @plugin.result.ctime.should == @time.strftime("%F %T")
-          @plugin.result.ctime_seconds.should == @time.to_i
-          @plugin.result.ctime_age.should <= 5
-          @plugin.result.atime.should == @time.strftime("%F %T")
-          @plugin.result.atime_seconds.should == @time.to_i
-          @plugin.result.atime_age.should <= 5
-          @plugin.result.mode.should == "100644"
-          @plugin.result.md5.should == "2bc84dc69b73db9383b9c6711d2011b7"
-          @plugin.result.type.should == "file"
-        end
-
-        it "should provide correct link stats" do
-          File.expects(:exists?).with("rspec").returns(true)
-          File.expects(:symlink?).with("rspec").returns(true)
-          File.expects(:lstat).with("rspec").returns(@stat)
-
-          @stat.stubs(:symlink?).returns(true)
-
-          @plugin.query_data("rspec")
-          @plugin.result.output.should == "present"
-          @plugin.result.md5.should == 0
-          @plugin.result.type.should == "symlink"
-        end
-
-        it "should provide correct directory stats" do
-          File.expects(:exists?).with("rspec").returns(true)
-          File.expects(:symlink?).with("rspec").returns(false)
-          File.expects(:stat).with("rspec").returns(@stat)
-
-          @stat.stubs(:directory?).returns(true)
-
-          @plugin.query_data("rspec")
-          @plugin.result.output.should == "present"
-          @plugin.result.md5.should == 0
-          @plugin.result.type.should == "directory"
-        end
-
-        it "should provide correct socket stats" do
-          File.expects(:exists?).with("rspec").returns(true)
-          File.expects(:symlink?).with("rspec").returns(false)
-          File.expects(:stat).with("rspec").returns(@stat)
-
-          @stat.stubs(:socket?).returns(true)
-
-          @plugin.query_data("rspec")
-          @plugin.result.output.should == "present"
-          @plugin.result.md5.should == 0
-          @plugin.result.type.should == "socket"
-        end
-
-        it "should provide correct chardev stats" do
-          File.expects(:exists?).with("rspec").returns(true)
-          File.expects(:symlink?).with("rspec").returns(false)
-          File.expects(:stat).with("rspec").returns(@stat)
-
-          @stat.stubs(:chardev?).returns(true)
-
-          @plugin.query_data("rspec")
-          @plugin.result.output.should == "present"
-          @plugin.result.md5.should == 0
-          @plugin.result.type.should == "chardev"
-        end
-
-        it "should provide correct blockdev stats" do
-          File.expects(:exists?).with("rspec").returns(true)
-          File.expects(:symlink?).with("rspec").returns(false)
-          File.expects(:stat).with("rspec").returns(@stat)
-
-          @stat.stubs(:blockdev?).returns(true)
-
-          @plugin.query_data("rspec")
-          @plugin.result.output.should == "present"
-          @plugin.result.md5.should == 0
-          @plugin.result.type.should == "blockdev"
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/discovery/flatfile_spec.rb b/spec/unit/plugins/mcollective/discovery/flatfile_spec.rb
deleted file mode 100644 (file)
index 73fc25b..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/discovery/flatfile.rb'
-
-module MCollective
-  class Discovery
-    describe Flatfile do
-      describe "#discover" do
-        before do
-          @client = mock
-          @client.stubs(:options).returns({})
-          @client.stubs(:options).returns({:discovery_options => ["/nonexisting"]})
-
-
-          File.stubs(:readable?).with("/nonexisting").returns(true)
-          File.stubs(:readlines).with("/nonexisting").returns(["one", "two"])
-        end
-
-        it "should use a file specified in discovery_options" do
-          File.expects(:readable?).with("/nonexisting").returns(true)
-          File.expects(:readlines).with("/nonexisting").returns(["one", "two"])
-          Flatfile.discover(Util.empty_filter, 0, 0, @client).should == ["one", "two"]
-        end
-
-        it "should fail unless a file is specified" do
-          @client.stubs(:options).returns({:discovery_options => []})
-          expect { Flatfile.discover(Util.empty_filter, 0, 0, @client) }.to raise_error("The flatfile discovery method needs a path to a text file")
-        end
-
-        it "should fail for unreadable files" do
-          File.expects(:readable?).with("/nonexisting").returns(false)
-
-          expect { Flatfile.discover(Util.empty_filter, 0, 0, @client) }.to raise_error("Cannot read the file /nonexisting specified as discovery source")
-        end
-
-        it "should regex filters" do
-          Flatfile.discover(Util.empty_filter.merge("identity" => [/one/]), 0, 0, @client).should == ["one"]
-        end
-
-        it "should filter against non regex nodes" do
-          Flatfile.discover(Util.empty_filter.merge("identity" => ["one"]), 0, 0, @client).should == ["one"]
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/discovery/mc_spec.rb b/spec/unit/plugins/mcollective/discovery/mc_spec.rb
deleted file mode 100644 (file)
index bcba8d3..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/discovery/mc.rb'
-
-module MCollective
-  class Discovery
-    describe Mc do
-      describe "#discover" do
-        before do
-          @reply = mock
-          @reply.stubs(:payload).returns({:senderid => "rspec"})
-
-          @client = mock
-          @client.stubs(:sendreq)
-          @client.stubs(:unsubscribe)
-          @client.stubs(:receive).returns(@reply)
-
-          Log.stubs(:debug)
-        end
-
-        it "should send the ping request via the supplied client" do
-          @client.expects(:sendreq).with("ping", "discovery", Util.empty_filter).returns("123456")
-          Mc.discover(Util.empty_filter, 1, 1, @client)
-        end
-
-        it "should stop early if a limit is supplied" do
-          @client.stubs(:receive).returns(@reply).times(10)
-          Mc.discover(Util.empty_filter, 1, 10, @client).should == ("rspec," * 10).split(",")
-        end
-
-        it "should unsubscribe from the discovery reply source" do
-          @client.expects(:unsubscribe).with("discovery", :reply)
-          Mc.discover(Util.empty_filter, 1, 10, @client).should == ("rspec," * 10).split(",")
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/packagers/debpackage_packager_spec.rb b/spec/unit/plugins/mcollective/packagers/debpackage_packager_spec.rb
deleted file mode 100644 (file)
index 74755d8..0000000
+++ /dev/null
@@ -1,311 +0,0 @@
-#!/usr/bin/env rspec
-require 'spec_helper'
-require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/pluginpackager/debpackage_packager.rb'
-
-module MCollective
-  module PluginPackager
-    describe DebpackagePackager do
-
-      let(:maketmpdir) do
-        tmpdir = Dir.mktmpdir("mc-test")
-        @tmpdirs << tmpdir
-        tmpdir
-      end
-
-      before :all do
-        @tmpdirs = []
-      end
-
-      before :each do
-        PluginPackager.stubs(:build_tool?).with("debuild").returns(true)
-        @plugin = mock()
-        @plugin.stubs(:mcname).returns("mcollective")
-      end
-
-      after :all do
-        @tmpdirs.each{|tmpdir| FileUtils.rm_rf tmpdir if File.directory? tmpdir}
-      end
-
-      describe "#initialize" do
-        it "should raise an exception if debuild isn't present" do
-          PluginPackager.expects(:build_tool?).with("debuild").returns(false)
-          expect{
-            DebpackagePackager.new("plugin")
-          }.to raise_error(RuntimeError, "package 'debuild' is not installed")
-        end
-
-        it "should set the correct libdir and verbose value" do
-          PluginPackager.expects(:build_tool?).with("debuild").returns(true)
-          packager = DebpackagePackager.new("plugin", nil, nil, true)
-          packager.libdir.should == "/usr/share/mcollective/plugins/mcollective/"
-          packager.verbose.should == true
-        end
-      end
-
-      describe "#create_packages" do
-        before :each do
-          @packager = DebpackagePackager.new(@plugin)
-          @plugin.stubs(:packagedata).returns({:test => {:files => ["test.rb"]}})
-          @plugin.stubs(:metadata).returns({:name => "test_plugin", :version => "1"})
-          @plugin.stubs(:iteration).returns("1")
-          @packager.stubs(:prepare_tmpdirs)
-          @packager.stubs(:create_package)
-          @packager.stubs(:move_packages)
-          @packager.stubs(:cleanup_tmpdirs)
-          Dir.stubs(:mktmpdir).with("mcollective_packager").returns("/tmp")
-          Dir.stubs(:mkdir)
-        end
-
-        it "should set the package instance variables" do
-          @packager.create_packages
-          @packager.current_package_type.should == :test
-          @packager.current_package_data.should == {:files => ["test.rb"]}
-          @packager.current_package_shortname.should == "mcollective-test_plugin-test"
-          @packager.current_package_fullname.should == "mcollective-test_plugin-test_1-1"
-        end
-
-        it "Should create the build dir" do
-          Dir.expects(:mkdir).with("/tmp/mcollective-test_plugin-test_1")
-          @packager.create_packages
-        end
-
-        it "should create packages" do
-          @packager.expects(:create_package)
-          @packager.create_packages
-        end
-      end
-
-      describe "#create_package" do
-        it "should raise an exception if the package cannot be created" do
-          packager = DebpackagePackager.new(@plugin)
-          packager.stubs(:create_file).raises("test exception")
-          expect{
-            packager.create_package
-          }.to raise_error(RuntimeError, "Could not build package - test exception")
-        end
-
-        it "should correctly create a package" do
-          packager = DebpackagePackager.new(@plugin, nil, nil, true)
-
-          packager.expects(:create_file).with("control")
-          packager.expects(:create_file).with("Makefile")
-          packager.expects(:create_file).with("compat")
-          packager.expects(:create_file).with("rules")
-          packager.expects(:create_file).with("copyright")
-          packager.expects(:create_file).with("changelog")
-          packager.expects(:create_tar)
-          packager.expects(:create_install)
-          packager.expects(:create_preandpost_install)
-
-          packager.build_dir = "/tmp"
-          packager.tmpdir = "/tmp"
-          packager.current_package_fullname = "test"
-          PluginPackager.expects(:safe_system).with("debuild -i -us -uc")
-          packager.expects(:puts).with("Created package test")
-
-          packager.create_package
-        end
-
-        it "should add a signature if one is given" do
-          packager = DebpackagePackager.new(@plugin, nil, "test", true)
-
-          packager.expects(:create_file).with("control")
-          packager.expects(:create_file).with("Makefile")
-          packager.expects(:create_file).with("compat")
-          packager.expects(:create_file).with("rules")
-          packager.expects(:create_file).with("copyright")
-          packager.expects(:create_file).with("changelog")
-          packager.expects(:create_tar)
-          packager.expects(:create_install)
-          packager.expects(:create_preandpost_install)
-
-          packager.build_dir = "/tmp"
-          packager.tmpdir = "/tmp"
-          packager.current_package_fullname = "test"
-          PluginPackager.expects(:safe_system).with("debuild -i -ktest")
-          packager.expects(:puts).with("Created package test")
-
-          packager.create_package
-        end
-      end
-
-      describe "#create_preandpost_install" do
-        before :each do
-          @packager = DebpackagePackager.new(@plugin)
-        end
-
-        it "should raise an exception if preinstall is not null and preinstall script isn't present" do
-          @plugin.stubs(:preinstall).returns("myscript")
-          File.expects(:exists?).with("myscript").returns(false)
-          expect{
-            @packager.create_preandpost_install
-          }.to raise_error(RuntimeError, "pre-install script 'myscript' not found")
-        end
-
-        it "should raise an exception if postinstall is not null and postinstall script isn't present" do
-          @plugin.stubs(:preinstall).returns(nil)
-          @plugin.stubs(:postinstall).returns("myscript")
-          File.expects(:exists?).with("myscript").returns(false)
-          expect{
-            @packager.create_preandpost_install
-          }.to raise_error(RuntimeError, "post-install script 'myscript' not found")
-        end
-
-        it "should copy the preinstall and postinstall scripts to the correct directory with the correct name" do
-          @plugin.stubs(:postinstall).returns("myscript")
-          @plugin.stubs(:preinstall).returns("myscript")
-          @packager.build_dir = "/tmp/"
-          @packager.current_package_shortname = "test"
-          File.expects(:exists?).with("myscript").twice.returns(true)
-          FileUtils.expects(:cp).with("myscript", "/tmp/debian/test.preinst")
-          FileUtils.expects(:cp).with("myscript", "/tmp/debian/test.postinst")
-          @packager.create_preandpost_install
-        end
-      end
-
-      describe "#create_install" do
-        before :each do
-          @packager = DebpackagePackager.new(@plugin)
-          @plugin.stubs(:path).returns("")
-        end
-
-        it "should raise an exception if the install file can't be created" do
-          File.expects(:join).raises("test error")
-          expect{
-            @packager.create_install
-          }.to raise_error(RuntimeError, "Could not create install file - test error")
-        end
-
-        it "should copy the package install file to the correct location" do
-          tmpdir = maketmpdir
-          Dir.mkdir(File.join(tmpdir, "debian"))
-          @packager.build_dir = tmpdir
-          @packager.current_package_shortname = "test"
-          @packager.current_package_data = {:files => ["foo.rb"]}
-          @packager.create_install
-          install_file = File.read("#{tmpdir}/debian/test.install")
-          install_file.should == "/usr/share/mcollective/plugins/mcollective/foo.rb /usr/share/mcollective/plugins/mcollective\n"
-        end
-      end
-
-      describe "#move_packages" do
-        before :each do
-          @plugin = mock()
-        end
-
-        it "should move the packages to the working directory" do
-          Dir.expects(:glob)
-          File.expects(:join)
-          FileUtils.expects(:cp)
-          @packager = DebpackagePackager.new(@plugin)
-          @packager.move_packages
-        end
-
-        it "should raise an error if the packages could not be moved" do
-          @packager = DebpackagePackager.new(@plugin)
-          File.expects(:join).raises("error")
-          expect{
-            @packager.move_packages
-          }.to raise_error(RuntimeError, "Could not copy packages to working directory: 'error'")
-        end
-      end
-
-      describe "#create_tar" do
-        before :each do
-          @packager = DebpackagePackager.new(@plugin, nil, true)
-        end
-
-        it "should raise an exception if the tarball can't be built" do
-          PluginPackager.expects(:do_quietly?).raises("test error")
-          expect{
-            @packager.create_tar
-          }.to raise_error(RuntimeError, "Could not create tarball - test error")
-        end
-
-        it "should create a tarball containing the package files" do
-          @packager.tmpdir = "/tmp"
-          @packager.build_dir = "/build_dir"
-          @packager.current_package_shortname = "test"
-          @plugin.stubs(:metadata).returns(@plugin)
-          @plugin.stubs(:[]).with(:version).returns("1")
-          @plugin.stubs(:iteration).returns("1")
-          PluginPackager.expects(:safe_system).with("tar -Pcvzf /tmp/test_1.orig.tar.gz test_1")
-          @packager.create_tar
-        end
-      end
-
-      describe "#create_file" do
-        before :each do
-          @packager = DebpackagePackager.new(@plugin)
-        end
-
-        it "should raise an exception if the file can't be created" do
-          File.expects(:dirname).raises("test error")
-          expect{
-            @packager.create_file("test")
-          }.to raise_error(RuntimeError, "could not create test file - test error")
-        end
-
-        it "should place a build file in the debian directory" do
-          tmpdir = maketmpdir
-          Dir.mkdir(File.join(tmpdir, "debian"))
-          @packager.build_dir = tmpdir
-          File.expects(:read).returns("testfile")
-          @packager.create_file("testfile")
-          File.unstub(:read)
-          result = File.read(File.join(tmpdir, "debian", "testfile"))
-          result.stubs(:result)
-          result.should == "testfile\n"
-        end
-      end
-
-      describe "#prepare_tmpdirs" do
-        before :each do
-          @tmpfile = Tempfile.new("mc-file").path
-        end
-
-        after :each do
-          begin
-            FileUtils.rm(@tmpfile)
-          rescue Exception
-          end
-        end
-
-        it "should create the correct tmp dirs and copy package contents to correct dir" do
-          packager = DebpackagePackager.new(@plugin)
-          tmpdir = maketmpdir
-          packager.build_dir = tmpdir
-          @plugin.stubs(:target_path).returns("")
-
-          packager.prepare_tmpdirs({:files => [@tmpfile]})
-          File.directory?(tmpdir).should == true
-          File.directory?(File.join(tmpdir, "debian")).should == true
-          File.exists?(File.join(tmpdir, packager.libdir, "tmp", File.basename(@tmpfile))).should == true
-        end
-      end
-
-      describe "#cleanup_tmpdirs" do
-        before :all do
-          @tmpdir = maketmpdir
-        end
-
-        before :each do
-          @packager = DebpackagePackager.new(@plugin)
-        end
-
-        it "should cleanup temp directories" do
-          @packager.tmpdir = @tmpdir
-          @packager.cleanup_tmpdirs
-          File.directory?(@tmpdir).should == false
-        end
-
-        it "should not delete any directories if @tmpdir isn't present" do
-          @packager = DebpackagePackager.new(@plugin)
-          @packager.tmpdir = rand.to_s
-          FileUtils.expects(:rm_r).never
-          @packager.cleanup_tmpdirs
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/packagers/ospackage_spec.rb b/spec/unit/plugins/mcollective/packagers/ospackage_spec.rb
deleted file mode 100644 (file)
index 5854bb3..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-MCollective::PluginManager.clear
-require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/pluginpackager/ospackage_packager.rb'
-
-module MCollective
-  module PluginPackager
-    describe "#initialize" do
-
-      before :all do
-        @packager = mock()
-        @packager.stubs(:new)
-      end
-
-      it "should correctly set members and create the correct packager on redhat" do
-        File.expects(:exists?).with("/etc/redhat-release").returns(true)
-        PluginPackager.expects(:[]).with("RpmpackagePackager").returns(@packager)
-        ospackager = OspackagePackager.new("package")
-        ospackager.package_type.should == "RPM"
-      end
-
-      it "should correctly set members and create the correct packager on debian" do
-        File.expects(:exists?).with("/etc/redhat-release").returns(false)
-        File.expects(:exists?).with("/etc/debian_version").returns(true)
-        PluginPackager.expects(:[]).with("DebpackagePackager").returns(@packager)
-        ospackager = OspackagePackager.new("package")
-        ospackager.package_type.should == "Deb"
-      end
-
-      it "should raise an exception if the os can't be identified" do
-        File.expects(:exists?).with("/etc/redhat-release").returns(false)
-        File.expects(:exists?).with("/etc/debian_version").returns(false)
-        expect{
-          OspackagePackager.new("package")
-        }.to raise_error(RuntimeError)
-      end
-    end
-
-    describe "#create_packages" do
-      before :all do
-        @packager = mock
-        @packager.stubs(:new).returns(@packager)
-      end
-
-      it "should call a packagers create_packages class" do
-        File.expects(:exists?).with("/etc/redhat-release").returns(true)
-        PluginPackager.expects(:[]).with("RpmpackagePackager").returns(@packager)
-       @packager.expects(:create_packages)
-        ospackager = OspackagePackager.new("package")
-        ospackager.class.should == OspackagePackager
-        ospackager.create_packages
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/packagers/rpmpackage_packager_spec.rb b/spec/unit/plugins/mcollective/packagers/rpmpackage_packager_spec.rb
deleted file mode 100644 (file)
index 9f06e27..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-#!/usr/bin/env rspec
-require 'spec_helper'
-require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/pluginpackager/rpmpackage_packager.rb'
-
-module MCollective
-  module PluginPackager
-    describe RpmpackagePackager do
-      let(:maketmpdir) do
-        tmpdir = Dir.mktmpdir("mc-test")
-        @tmpdirs << tmpdir
-        tmpdir
-      end
-
-      before :all do
-        @tmpdirs = []
-      end
-
-      before :each do
-        PluginPackager.stubs(:build_tool?).with("rpmbuild-md5").returns(true)
-        PluginPackager.stubs(:build_tool?).with("rpmbuild").returns(true)
-        @plugin = mock()
-        @plugin.stubs(:iteration).returns("1")
-        @plugin.stubs(:metadata).returns({:name => "test", :version => "1"})
-        @plugin.stubs(:mcname).returns("mcollective")
-        RpmpackagePackager.any_instance.stubs(:rpmdir).returns('rpmdir')
-        RpmpackagePackager.any_instance.stubs(:srpmdir).returns('srpmdir')
-      end
-
-      after :all do
-        @tmpdirs.each{|tmpdir| FileUtils.rm_rf tmpdir if File.directory? tmpdir}
-      end
-
-      describe "#initialize" do
-
-        it "should raise and exception if neither rpmbuild or rpmbuild-md5 is installed is not present" do
-          PluginPackager.expects(:build_tool?).with("rpmbuild-md5").returns(false)
-          PluginPackager.expects(:build_tool?).with("rpmbuild").returns(false)
-          expect{
-            RpmpackagePackager.new("plugin")
-          }.to raise_exception(RuntimeError, "creating rpms require 'rpmbuild' or 'rpmbuild-md5' to be installed")
-        end
-
-        it "should set the correct libdir" do
-          packager = RpmpackagePackager.new("plugin")
-          packager.libdir.should == "/usr/libexec/mcollective/mcollective/"
-
-          packager = RpmpackagePackager.new("plugin", "/tmp/")
-          packager.libdir.should == "/tmp/"
-        end
-
-      end
-
-      describe "#create_packages" do
-        before :each do
-          @packager = RpmpackagePackager.new(@plugin)
-          @packager.tmpdir = maketmpdir
-          @packager.stubs(:create_package)
-          @packager.stubs(:cleanup_tmpdirs)
-          @plugin.stubs(:packagedata).returns(:test => {:files => ["test.rb"]})
-          @packager.stubs(:prepare_tmpdirs)
-          Dir.stubs(:mktmpdir)
-        end
-
-        it "should set the package instance variables" do
-          @packager.create_packages
-          @packager.current_package_type.should == :test
-          @packager.current_package_data.should == {:files => ["test.rb"]}
-          @packager.current_package_name.should == "mcollective-test-test"
-        end
-
-        it "should create the build dir" do
-          @packager.expects(:prepare_tmpdirs)
-          @packager.create_packages
-        end
-
-        it "should create packages" do
-          @packager.expects(:create_package)
-          @packager.create_packages
-        end
-
-      end
-
-      describe "#create_package" do
-        before :each do
-          @packager = RpmpackagePackager.new(@plugin)
-        end
-
-        it "should create the package" do
-          Dir.expects(:chdir)
-          PluginPackager.expects(:safe_system).with("rpmbuild-md5 -ta   /tmp/mcollective-testplugin-test-1.tgz")
-          FileUtils.expects(:cp).times(2)
-          @packager.tmpdir = "/tmp"
-          @packager.verbose = "true"
-          @packager.expects(:make_spec_file)
-          @packager.current_package_name = "mcollective-testplugin-test"
-          @packager.expects(:puts).with('Created RPM and SRPM packages for mcollective-testplugin-test')
-          @packager.create_package(:test, {:files => ["foo.rb"]})
-        end
-
-        it "should sign the package if a signature is given" do
-          Dir.expects(:chdir)
-          PluginPackager.expects(:safe_system).with("rpmbuild-md5 -ta  --sign /tmp/mcollective-testplugin-test-1.tgz")
-          FileUtils.expects(:cp).times(2)
-          @packager.signature = true
-          @packager.tmpdir = "/tmp"
-          @packager.verbose = "true"
-          @packager.expects(:make_spec_file)
-          @packager.current_package_name = "mcollective-testplugin-test"
-          @packager.expects(:puts).with('Created RPM and SRPM packages for mcollective-testplugin-test')
-          @packager.create_package(:test, {:files => ["foo.rb"]})
-        end
-
-        it "should raise an error if the package can't be built" do
-          @packager = RpmpackagePackager.new(@plugin)
-          @packager.tmpdir = "/tmp"
-          @packager.expects(:make_spec_file)
-          PluginPackager.stubs(:do_quietly?).raises("foo")
-          expect{
-            @packager.create_package("", "")
-          }.to raise_error(RuntimeError, "Could not build package. Reason - foo")
-        end
-      end
-
-      describe "#make_spec_file" do
-        before :each do
-          @plugin = mock
-          @packager = RpmpackagePackager.new(@plugin)
-        end
-
-        it "should raise an exception if specfile cannot be built" do
-          File.expects(:dirname).raises("test error")
-          expect{
-            @packager.make_spec_file
-          }.to raise_error(RuntimeError, "Could not create specfile - test error")
-        end
-
-        it "should create the specfile from the erb" do
-          File.stubs(:read).returns("specfile")
-          @plugin.stubs(:metadata).returns({:version => 2})
-          @packager.current_package_name = "test"
-          @packager.tmpdir = maketmpdir
-          Dir.mkdir(File.join(@packager.tmpdir, "test-2"))
-          @packager.make_spec_file
-          File.read(File.join(@packager.tmpdir, "test-2", "test-2.spec")).should == "specfile"
-        end
-      end
-
-      describe "#prepare_tmpdirs" do
-        it "should create the tmp dirs and cp the package files" do
-          @plugin.stubs(:target_path).returns("")
-          packager = RpmpackagePackager.new(@plugin)
-          FileUtils.expects(:mkdir_p)
-          File.stubs(:join).returns("/target")
-          FileUtils.expects(:cp_r).with("test.rb", "/target")
-          packager.prepare_tmpdirs({:files => ["test.rb"]})
-        end
-      end
-
-      describe "#cleanup_tmpdirs" do
-        it "should remove the temp directories" do
-          packager = RpmpackagePackager.new("package")
-          packager.tmpdir = maketmpdir
-          packager.cleanup_tmpdirs
-          File.directory?(packager.tmpdir).should == false
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/security/psk_spec.rb b/spec/unit/plugins/mcollective/security/psk_spec.rb
deleted file mode 100755 (executable)
index 6c0507e..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/security/psk.rb'
-
-module MCollective::Security
-  describe Psk do
-    before do
-      @config = mock("config")
-      @config.stubs(:identity).returns("test")
-      @config.stubs(:configured).returns(true)
-      @config.stubs(:pluginconf).returns({"psk" => "12345"})
-
-      @stats = mock("stats")
-
-      @time = Time.now.to_i
-      ::Time.stubs(:now).returns(@time)
-
-      MCollective::Log.stubs(:debug).returns(true)
-
-      MCollective::PluginManager << {:type => "global_stats", :class => @stats}
-      MCollective::Config.stubs("instance").returns(@config)
-      MCollective::Util.stubs("empty_filter?").returns(false)
-
-      @plugin = Psk.new
-    end
-
-    describe "#decodemsg" do
-      it "should correctly decode a message" do
-        @plugin.stubs("validrequest?").returns(true).once
-
-        msg = mock("message")
-        msg.stubs(:payload).returns(Marshal.dump({:body => Marshal.dump("foo")}))
-        msg.stubs(:expected_msgid).returns(nil)
-
-        @plugin.decodemsg(msg).should == {:body=>"foo"}
-      end
-
-      it "should return nil on failure" do
-        @plugin.stubs("validrequest?").raises("fail").once
-
-        msg = mock("message")
-        msg.stubs(:payload).returns(Marshal.dump({:body => Marshal.dump("foo"), :requestid => "123"}))
-        msg.stubs(:expected_msgid).returns(nil)
-
-        expect { @plugin.decodemsg(msg) }.to raise_error("fail")
-      end
-
-      it "should not decode messages not addressed to us" do
-        msg = mock("message")
-        msg.stubs(:payload).returns(Marshal.dump({:body => Marshal.dump("foo"), :requestid => "456"}))
-        msg.stubs(:expected_msgid).returns("123")
-
-        expect {
-          @plugin.decodemsg(msg)
-        }.to raise_error("Got a message with id 456 but was expecting 123, ignoring message")
-
-      end
-
-      it "should only decode messages addressed to us" do
-        @plugin.stubs("validrequest?").returns(true).once
-
-        msg = mock("message")
-        msg.stubs(:payload).returns(Marshal.dump({:body => Marshal.dump("foo"), :requestid => "456"}))
-        msg.stubs(:expected_msgid).returns("456")
-
-        @plugin.decodemsg(msg).should == {:body=>"foo", :requestid=>"456"}
-      end
-    end
-
-    describe "#encodereply" do
-      it "should correctly Marshal encode the reply" do
-        @plugin.stubs("create_reply").returns({:test => "test"})
-        Marshal.stubs("dump").with("test message").returns("marshal_test_message").once
-        Marshal.stubs("dump").with({:hash => '2dbeb0d7938a08a34eacd2c1dab25602', :test => 'test'}).returns("marshal_test_reply").once
-
-        @plugin.encodereply("sender", "test message", "requestid", "callerid").should == "marshal_test_reply"
-      end
-    end
-
-    describe "#encoderequest" do
-      it "should correctly Marshal encode the request" do
-        @plugin.stubs("create_request").returns({:test => "test"})
-        Marshal.stubs("dump").with("test message").returns("marshal_test_message").once
-        Marshal.stubs("dump").with({:hash => '2dbeb0d7938a08a34eacd2c1dab25602', :test => 'test'}).returns("marshal_test_request").once
-
-        @plugin.encoderequest("sender", "test message", "requestid", "filter", "agent", "collective").should == "marshal_test_request"
-      end
-    end
-
-    describe "#validrequest?" do
-      it "should correctly validate requests" do
-        @stats.stubs(:validated).once
-        @stats.stubs(:unvalidated).never
-        @plugin.validrequest?({:body => "foo", :hash => "e83ac78027b77b659a49bccbbcfa4849"})
-      end
-
-      it "should raise an exception on failure" do
-        @stats.stubs(:validated).never
-        @stats.stubs(:unvalidated).once
-        expect { @plugin.validrequest?({:body => "foo", :hash => ""}) }.to raise_error("Received an invalid signature in message")
-      end
-    end
-
-    describe "#callerid" do
-      it "should do uid based callerid when unconfigured" do
-        @plugin.callerid.should == "uid=#{Process.uid}"
-      end
-
-      it "should support gid based callerids" do
-        @config.stubs(:pluginconf).returns({"psk.callertype" => "gid"})
-        @plugin.callerid.should == "gid=#{Process.gid}"
-      end
-
-      it "should support group based callerids", :unless => MCollective::Util.windows? do
-        @config.stubs(:pluginconf).returns({"psk.callertype" => "group"})
-        @plugin.callerid.should == "group=#{Etc.getgrgid(Process.gid).name}"
-      end
-
-      it "should raise an error if the group callerid type is used on windows" do
-        MCollective::Util.expects("windows?").returns(true)
-        @config.stubs(:pluginconf).returns({"psk.callertype" => "group"})
-        expect { @plugin.callerid }.to raise_error("Cannot use the 'group' callertype for the PSK security plugin on the Windows platform")
-      end
-
-      it "should support user based callerids" do
-        @config.stubs(:pluginconf).returns({"psk.callertype" => "user"})
-        @plugin.callerid.should == "user=#{Etc.getlogin}"
-      end
-
-      it "should support identity based callerids" do
-        @config.stubs(:pluginconf).returns({"psk.callertype" => "identity"})
-        @plugin.callerid.should == "identity=test"
-      end
-    end
-
-    describe "#makehash" do
-      it "should return the correct md5 digest" do
-        @plugin.send(:makehash, "foo").should == "e83ac78027b77b659a49bccbbcfa4849"
-      end
-
-      it "should fail if no PSK is configured" do
-        @config.stubs(:pluginconf).returns({})
-        expect { @plugin.send(:makehash, "foo") }.to raise_error("No plugin.psk configuration option specified")
-      end
-
-      it "should support reading the PSK from the environment" do
-        ENV["MCOLLECTIVE_PSK"] = "54321"
-
-        @plugin.send(:makehash, "foo").should == "d3fb63cc6b1d47cc4b2012df926c2feb"
-
-        ENV.delete("MCOLLECTIVE_PSK")
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/validator/array_validator_spec.rb b/spec/unit/plugins/mcollective/validator/array_validator_spec.rb
deleted file mode 100644 (file)
index f32fa6d..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env rspec
-require 'spec_helper'
-require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/validator/array_validator.rb'
-
-module MCollective
-  module Validator
-    describe "#validate" do
-      it "should raise an exception if a given element is not defined in a given array" do
-        expect{
-          Validator::ArrayValidator.validate("element1",["element0", "element2"])
-        }.to raise_error(ValidatorError, "value should be one of element0, element2")
-      end
-
-      it "should not raise an exception if a given element is defined in a given array" do
-        Validator::ArrayValidator.validate("element1", ["element1", "element2"])
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/validator/ipv4address_validator_spec.rb b/spec/unit/plugins/mcollective/validator/ipv4address_validator_spec.rb
deleted file mode 100644 (file)
index 49183b8..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env rspec
-require 'spec_helper'
-require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/validator/ipv4address_validator.rb'
-
-module MCollective
-  module Validator
-    describe "#validate" do
-      it "should raise an exception if the supplied value is not an ipv4 address" do
-        expect{
-          Ipv4addressValidator.validate("foobar")
-        }.to raise_error(ValidatorError, "value should be an ipv4 address")
-      end
-
-      it "should not raise an exception if the supplied value is an ipv4 address" do
-        Ipv4addressValidator.validate("1.2.3.4")
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/validator/ipv6address_validator_spec.rb b/spec/unit/plugins/mcollective/validator/ipv6address_validator_spec.rb
deleted file mode 100644 (file)
index a6a2b78..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env rspec
-require 'spec_helper'
-require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/validator/ipv6address_validator.rb'
-
-module MCollective
-  module Validator
-    describe "#validate" do
-      it "should raise an exception if the supplied value is not an ipv6 address" do
-        expect{
-          Ipv6addressValidator.validate("foobar")
-        }.to raise_error(ValidatorError, "value should be an ipv6 address")
-      end
-
-      it "should not raise an exception if the supplied value is an ipv6 address" do
-        Ipv6addressValidator.validate("2001:db8:85a3:8d3:1319:8a2e:370:7348")
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/validator/length_validator_spec.rb b/spec/unit/plugins/mcollective/validator/length_validator_spec.rb
deleted file mode 100644 (file)
index 4aa7e96..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env rspec
-require 'spec_helper'
-require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/validator/length_validator.rb'
-
-module MCollective
-  module Validator
-    describe "#validate" do
-      it "should raise an exception if the given string's length is greater than the given value" do
-        expect{
-          LengthValidator.validate("test", 3)
-        }.to raise_error(ValidatorError, "Input string is longer than 3 character(s)")
-      end
-
-      it "should not raise an exception if the given string's length is less than the given value" do
-        LengthValidator.validate("test", 4)
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/validator/regex_validator_spec.rb b/spec/unit/plugins/mcollective/validator/regex_validator_spec.rb
deleted file mode 100644 (file)
index d7ff653..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env rspec
-require 'spec_helper'
-require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/validator/regex_validator.rb'
-
-module MCollective
-  module Validator
-    describe "#validate" do
-      it "should raise an exception if the given string does not matches the given regular expression" do
-        expect{
-          RegexValidator.validate("test", "nottest")
-        }.to raise_error(ValidatorError, "value should match nottest")
-      end
-
-      it "should not raise an exception if the given string's length is less than the given value" do
-        RegexValidator.validate("test", "test")
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/validator/shellsafe_validator_spec.rb b/spec/unit/plugins/mcollective/validator/shellsafe_validator_spec.rb
deleted file mode 100644 (file)
index 1f804c1..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env rspec
-require 'spec_helper'
-require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/validator/shellsafe_validator.rb'
-
-module MCollective
-  module Validator
-    describe "#validate" do
-      it "should raise an exception if the given string is not shellsafe" do
-        ['`', '$', ';', '|', '&&', '>', '<'].each do |chr|
-          expect{
-            ShellsafeValidator.validate("#{chr}test")
-          }.to raise_error(ValidatorError, "value should not have #{chr} in it")
-        end
-      end
-
-      it "should not raise an exception if the given string is shellsafe" do
-        ShellsafeValidator.validate("test")
-      end
-    end
-  end
-end
diff --git a/spec/unit/plugins/mcollective/validator/typecheck_validator_spec.rb b/spec/unit/plugins/mcollective/validator/typecheck_validator_spec.rb
deleted file mode 100644 (file)
index 248d29e..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env rspec
-require 'spec_helper'
-require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/validator/typecheck_validator.rb'
-
-module MCollective
-  module Validator
-    describe "#validate" do
-      it "should raise an exception if the given value is not of the supplied type" do
-        [[1, String], ['test', :integer], ['test', :float], ['test', :number], [1, :string], ['test', :boolean]].each do |val|
-          expect{
-            TypecheckValidator.validate(*val)
-          }.to raise_error(ValidatorError, "value should be a #{val[1].to_s}")
-        end
-      end
-
-      it "should not raise an exception if the given value is of the supplied type" do
-        [["test", String], [1, :integer], [1.2, :float], [1, :number], ["test", :string], [true, :boolean]].each do |val|
-          TypecheckValidator.validate(*val)
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/registration/base_spec.rb b/spec/unit/registration/base_spec.rb
deleted file mode 100755 (executable)
index 07cb701..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module Registration
-    describe Base do
-      before do
-        @config = mock
-        @config.stubs(:identity).returns("rspec")
-        @config.stubs(:main_collective).returns("main_collective")
-        Config.stubs(:instance).returns(@config)
-
-        @reg = Base.new
-      end
-
-      describe "#config" do
-        it "should provide access the main configuration class" do
-          @reg.config.should == @config
-        end
-
-      end
-
-      describe "#identity" do
-        it "should return the correct identity" do
-          @reg.config.identity.should == "rspec"
-        end
-      end
-
-      describe "#msg_filter" do
-        it "should target the registration agent" do
-          @reg.msg_filter["agent"].should == ["registration"]
-        end
-      end
-
-      describe "#target_collective" do
-        it "should return the configured registration_collective" do
-          @config.expects(:registration_collective).returns("registration").once
-          @config.expects(:collectives).returns(["main_collective", "registration"]).once
-          @reg.target_collective.should == "registration"
-        end
-
-        it "should use the main collective if registration collective is not valid" do
-          @config.expects(:registration_collective).returns("registration").once
-          @config.expects(:collectives).returns(["main_collective"]).once
-
-          Log.expects(:warn).with("Sending registration to main_collective: registration is not a valid collective").once
-
-          @reg.target_collective.should == "main_collective"
-        end
-      end
-
-      describe "#publish" do
-        it "should skip registration for empty messages" do
-          Log.expects(:debug).with("Skipping registration due to nil body")
-          @reg.publish(nil)
-        end
-
-        it "should publish via the message object" do
-          message = mock
-          message.expects(:encode!)
-          message.expects(:publish)
-          message.expects(:requestid).returns("123")
-          message.expects(:collective).returns("mcollective")
-
-          Message.expects(:new).returns(message)
-
-          Log.expects(:debug).with("Sending registration 123 to collective mcollective")
-
-          @reg.expects(:target_collective).returns("mcollective")
-
-          @reg.publish("message")
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/rpc/actionrunner_spec.rb b/spec/unit/rpc/actionrunner_spec.rb
deleted file mode 100755 (executable)
index 456020e..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module RPC
-    describe ActionRunner do
-      before(:each) do
-        @req = mock
-        @req.stubs(:agent).returns("spectester")
-        @req.stubs(:action).returns("tester")
-
-        command = "/bin/echo 1"
-
-        @runner = ActionRunner.new(command, @req, :json)
-      end
-
-      describe "#initialize" do
-        it "should set command" do
-          @runner.command.should == "/bin/echo 1"
-        end
-
-        it "should set agent" do
-          @runner.agent.should == "spectester"
-        end
-
-        it "should set action" do
-          @runner.action.should == "tester"
-        end
-
-        it "should set format" do
-          @runner.format.should == :json
-        end
-
-        it "should set request" do
-          @runner.request.should == @req
-        end
-
-        it "should set stdout" do
-          @runner.stdout.should == ""
-        end
-
-        it "should set stderr" do
-          @runner.stderr.should == ""
-        end
-
-        it "should set the command via path_to_command" do
-          ActionRunner.any_instance.expects(:path_to_command).with("rspec").once
-          ActionRunner.new("rspec", @req, :json)
-        end
-      end
-
-      describe "#shell" do
-        it "should create a shell instance with correct settings" do
-          s = @runner.shell("test", "infile", "outfile")
-
-          s.command.should == "test infile outfile"
-          s.cwd.should == Dir.tmpdir
-          s.stdout.should == ""
-          s.stderr.should == ""
-          s.environment["MCOLLECTIVE_REQUEST_FILE"].should == "infile"
-          s.environment["MCOLLECTIVE_REPLY_FILE"].should == "outfile"
-        end
-      end
-
-      describe "#load_results" do
-        it "should call the correct format loader" do
-          req = mock
-          req.expects(:agent).returns("spectester")
-          req.expects(:action).returns("tester")
-
-          runner = ActionRunner.new("/bin/echo 1", req, :foo)
-          runner.expects("load_foo_results").returns({:foo => :bar})
-          runner.load_results("/dev/null").should == {:foo => :bar}
-        end
-
-        it "should set all keys to Symbol" do
-          data = {"foo" => "bar", "bar" => "baz"}
-          Tempfile.open("mcollective_test", Dir.tmpdir) do |f|
-            f.puts data.to_json
-            f.close
-
-            results = @runner.load_results(f.path)
-            results.should == {:foo => "bar", :bar => "baz"}
-          end
-        end
-      end
-
-      describe "#load_json_results" do
-        it "should load data from a file" do
-          Tempfile.open("mcollective_test", Dir.tmpdir) do |f|
-            f.puts '{"foo":"bar","bar":"baz"}'
-            f.close
-
-            @runner.load_json_results(f.path).should == {"foo" => "bar", "bar" => "baz"}
-          end
-
-        end
-
-        it "should return empty data on JSON parse error" do
-          @runner.load_json_results("/dev/null").should == {}
-        end
-
-        it "should return empty data for missing files" do
-          @runner.load_json_results("/nonexisting").should == {}
-        end
-
-        it "should load complex data correctly" do
-          data = {"foo" => "bar", "bar" => {"one" => "two"}}
-          Tempfile.open("mcollective_test", Dir.tmpdir) do |f|
-            f.puts data.to_json
-            f.close
-
-            @runner.load_json_results(f.path).should == data
-          end
-        end
-
-      end
-
-      describe "#saverequest" do
-        it "should call the correct format serializer" do
-          req = mock
-          req.expects(:agent).returns("spectester")
-          req.expects(:action).returns("tester")
-
-          runner = ActionRunner.new("/bin/echo 1", req, :foo)
-
-          runner.expects("save_foo_request").with(req).returns('{"foo":"bar"}')
-
-          runner.saverequest(req)
-        end
-
-        it "should save to a temp file" do
-          @req.expects(:to_json).returns({:foo => "bar"}.to_json)
-          fname = @runner.saverequest(@req).path
-
-          JSON.load(File.read(fname)).should == {"foo" => "bar"}
-          File.dirname(fname).should == Dir.tmpdir
-        end
-      end
-
-      describe "#save_json_request" do
-        it "should return correct json data" do
-          @req.expects(:to_json).returns({:foo => "bar"}.to_json)
-          @runner.save_json_request(@req).should == '{"foo":"bar"}'
-        end
-      end
-
-      describe "#canrun?" do
-        it "should correctly report executables" do
-          if Util.windows?
-            @runner.canrun?(File.join(ENV['SystemRoot'], "explorer.exe")).should == true
-          else
-            @runner.canrun?("/bin/true").should == true
-          end
-        end
-
-        it "should detect missing files" do
-          @runner.canrun?("/nonexisting").should == false
-        end
-      end
-
-      describe "#to_s" do
-        it "should return correct data" do
-          @runner.to_s.should == "spectester#tester command: /bin/echo 1"
-        end
-      end
-
-      describe "#tempfile" do
-        it "should return a TempFile" do
-          @runner.tempfile("foo").class.should == Tempfile
-        end
-
-        it "should contain the prefix in its name" do
-          @runner.tempfile("foo").path.should match(/foo/)
-        end
-      end
-
-      describe "#path_to_command" do
-        it "should return the command if it starts with separator" do
-          command = "#{File::SEPARATOR}rspec"
-
-          runner = ActionRunner.new(command , @req, :json)
-          runner.path_to_command(command).should == command
-        end
-
-        it "should find the first match in the libdir" do
-          Config.instance.expects(:libdir).returns(["#{File::SEPARATOR}libdir1", "#{File::SEPARATOR}libdir2"])
-
-          action_in_first_dir = File.join(File::SEPARATOR, "libdir1", "agent", "spectester", "action.sh")
-          action_in_last_dir = File.join(File::SEPARATOR, "libdir2", "agent", "spectester", "action.sh")
-
-          File.expects("exist?").with(action_in_first_dir).returns(true)
-          File.expects("exist?").with(action_in_last_dir).never
-
-          ActionRunner.new("action.sh", @req, :json).command.should == action_in_first_dir
-        end
-
-        it "should find the match even in the last libdir" do
-          Config.instance.expects(:libdir).returns(["#{File::SEPARATOR}libdir1", "#{File::SEPARATOR}libdir2"])
-
-          action_in_first_dir = File.join(File::SEPARATOR, "libdir1", "agent", "spectester", "action.sh")
-          action_in_last_dir = File.join(File::SEPARATOR, "libdir2", "agent", "spectester", "action.sh")
-
-          File.expects("exist?").with(action_in_first_dir).returns(false)
-          File.expects("exist?").with(action_in_last_dir).returns(true)
-
-          ActionRunner.new("action.sh", @req, :json).command.should == action_in_last_dir
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/rpc/agent_spec.rb b/spec/unit/rpc/agent_spec.rb
deleted file mode 100755 (executable)
index 76630f2..0000000
+++ /dev/null
@@ -1,260 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module RPC
-    describe Agent do
-      before do
-        ddl = stub
-        ddl.stubs(:meta).returns({})
-        ddl.stubs(:action).returns([])
-        ddl.stubs(:validate_rpc_request).returns(true)
-        DDL.stubs(:new).returns(ddl)
-
-        @agent = Agent.new
-        @agent.reply = {}
-        @agent.request = {}
-      end
-
-      describe "#handlemsg" do
-        before do
-          Reply.any_instance.stubs(:initialize_data)
-
-          @agent.stubs(:respond_to?).with("rspec_action_action").returns(true)
-          @agent.stubs(:respond_to?).with("authorization_hook").returns(false)
-          @agent.stubs(:rspec_action_action).returns(nil)
-
-          @msg = {:msgtime => 1356006671,
-                  :senderid => "example.com",
-                  :requestid => "55f8abe1442328321667877a08bdc586",
-                  :body => {:agent => "rspec_agent",
-                            :action => "rspec_action",
-                            :data => {}},
-                  :caller => "cert=rspec"}
-        end
-
-        it "should or validate the incoming request" do
-          exception = DDLValidationError.new(:RSPEC, "Failed to validate", :error)
-          Request.any_instance.expects(:validate!).raises(exception)
-
-          reply = @agent.handlemsg(@msg, DDL.new)
-
-          reply[:statuscode].should == 4
-          reply[:statusmsg].should == "Failed to validate"
-        end
-
-        it "should call the authorization hook if set" do
-          @agent.expects(:respond_to?).with("authorization_hook").returns(true)
-          @agent.expects(:authorization_hook).raises("authorization denied")
-          Log.stubs(:error)
-
-          reply = @agent.handlemsg(@msg, DDL.new)
-
-          reply[:statuscode].should == 5
-          reply[:statusmsg].should == "authorization denied"
-        end
-
-        it "should audit the request" do
-          @agent.expects(:audit_request)
-
-          reply = @agent.handlemsg(@msg, DDL.new)
-          reply[:statuscode].should == 0
-        end
-
-        it "should call the before_processing_hook" do
-          @agent.expects(:before_processing_hook)
-
-          reply = @agent.handlemsg(@msg, DDL.new)
-          reply[:statuscode].should == 0
-        end
-
-        it "should fail if the action does not exist" do
-          @agent.expects(:respond_to?).with("rspec_action_action").returns(false)
-          reply = @agent.handlemsg(@msg, DDL.new)
-          reply[:statuscode].should == 2
-        end
-
-        it "should call the action correctly" do
-          @agent.expects(:rspec_action_action)
-          reply = @agent.handlemsg(@msg, DDL.new)
-          reply[:statuscode].should == 0
-        end
-
-        it "should handle RPC Aborted errors" do
-          @agent.expects(:rspec_action_action).raises(RPCAborted, "rspec test")
-          reply = @agent.handlemsg(@msg, DDL.new)
-          reply[:statuscode].should == 1
-          reply[:statusmsg].should == "rspec test"
-        end
-
-        it "should handle Unknown Action errors" do
-          @agent.stubs(:respond_to?).with("rspec_action_action").returns(false)
-          reply = @agent.handlemsg(@msg, DDL.new)
-          reply[:statuscode].should == 2
-          reply[:statusmsg].should == "Unknown action 'rspec_action' for agent 'rspec_agent'"
-        end
-
-        it "should handle Missing Data errors" do
-          @agent.expects(:rspec_action_action).raises(MissingRPCData, "rspec test")
-          reply = @agent.handlemsg(@msg, DDL.new)
-          reply[:statuscode].should == 3
-          reply[:statusmsg].should == "rspec test"
-        end
-
-        it "should handle Invalid Data errors" do
-          @agent.expects(:rspec_action_action).raises(InvalidRPCData, "rspec test")
-          reply = @agent.handlemsg(@msg, DDL.new)
-          reply[:statuscode].should == 4
-          reply[:statusmsg].should == "rspec test"
-        end
-
-        it "should handle unknown errors" do
-          @agent.expects(:rspec_action_action).raises(UnknownRPCError, "rspec test")
-          Log.expects(:error).twice
-
-          reply = @agent.handlemsg(@msg, DDL.new)
-          reply[:statuscode].should == 5
-          reply[:statusmsg].should == "rspec test"
-        end
-
-        it "should handle arbitrary exceptions" do
-          @agent.expects(:rspec_action_action).raises(Exception, "rspec test")
-          Log.expects(:error).twice
-
-          reply = @agent.handlemsg(@msg, DDL.new)
-          reply[:statuscode].should == 5
-          reply[:statusmsg].should == "rspec test"
-        end
-
-        it "should call the after_processing_hook" do
-          @agent.expects(:after_processing_hook)
-          reply = @agent.handlemsg(@msg, DDL.new)
-        end
-
-        it "should respond if required" do
-          Request.any_instance.expects(:should_respond?).returns(true)
-          Reply.any_instance.expects(:to_hash).returns({})
-          @agent.handlemsg(@msg, DDL.new).should == {}
-        end
-
-        it "should not respond when not required" do
-          Request.any_instance.expects(:should_respond?).returns(false)
-          Reply.any_instance.expects(:to_hash).never
-          @agent.handlemsg(@msg, DDL.new).should == nil
-        end
-      end
-
-      describe "#meta" do
-        it "should be deprecated" do
-          Agent.expects(:log_code).with(:PLMC34, is_a(String), :warn, has_value(regexp_matches(/agent_spec.rb/)))
-          Agent.metadata("foo")
-        end
-      end
-
-      describe "#load_ddl" do
-        it "should load the correct DDL" do
-          ddl = stub
-          ddl.stubs(:meta).returns({:timeout => 5})
-
-          DDL.expects(:new).with("agent", :agent).returns(ddl)
-
-          Agent.new.timeout.should == 5
-        end
-
-        it "should fail if the DDL isn't loaded" do
-          DDL.expects(:new).raises("failed to load")
-          expect { Agent.new }.to raise_code(:PLMC24)
-        end
-
-        it "should default to 10 second timeout" do
-          ddl = stub
-          ddl.stubs(:meta).returns({})
-
-          DDL.expects(:new).with("agent", :agent).returns(ddl)
-
-          Agent.new.timeout.should == 10
-        end
-      end
-
-      describe "#run" do
-        before do
-          @status = mock
-          @status.stubs(:exitstatus).returns(0)
-          @shell = mock
-          @shell.stubs(:runcommand)
-          @shell.stubs(:status).returns(@status)
-        end
-
-        it "should accept stderr and stdout and force them to be strings" do
-          Shell.expects(:new).with("rspec", {:stderr => "", :stdout => ""}).returns(@shell)
-          @agent.send(:run, "rspec", {:stderr => :err, :stdout => :out})
-          @agent.reply[:err].should == ""
-          @agent.reply[:out].should == ""
-        end
-
-        it "should accept existing variables for stdout and stderr and fail if they dont support <<" do
-          @agent.reply[:err] = "err"
-          @agent.reply[:out] = "out"
-
-          Shell.expects(:new).with("rspec", {:stderr => "err", :stdout => "out"}).returns(@shell)
-          @agent.send(:run, "rspec", {:stderr => @agent.reply[:err], :stdout => @agent.reply[:out]})
-          @agent.reply[:err].should == "err"
-          @agent.reply[:out].should == "out"
-
-          @agent.reply.expects("fail!").with("stderr should support << while calling run(rspec)").raises("stderr fail")
-          expect { @agent.send(:run, "rspec", {:stderr => nil, :stdout => ""}) }.to raise_error("stderr fail")
-
-          @agent.reply.expects("fail!").with("stdout should support << while calling run(rspec)").raises("stdout fail")
-          expect { @agent.send(:run, "rspec", {:stderr => "", :stdout => nil}) }.to raise_error("stdout fail")
-        end
-
-        it "should set stdin, cwd and environment if supplied" do
-          Shell.expects(:new).with("rspec", {:stdin => "stdin", :cwd => "cwd", :environment => "env"}).returns(@shell)
-          @agent.send(:run, "rspec", {:stdin => "stdin", :cwd => "cwd", :environment => "env"})
-        end
-
-        it "should ignore unknown options" do
-          Shell.expects(:new).with("rspec", {}).returns(@shell)
-          @agent.send(:run, "rspec", {:rspec => "rspec"})
-        end
-
-        it "should chomp strings if configured to do so" do
-          Shell.expects(:new).with("rspec", {:stderr => 'err', :stdout => 'out'}).returns(@shell)
-
-          @agent.reply[:err] = "err"
-          @agent.reply[:out] = "out"
-
-          @agent.reply[:err].expects("chomp!")
-          @agent.reply[:out].expects("chomp!")
-
-          @agent.send(:run, "rspec", {:chomp => true, :stdout => @agent.reply[:out], :stderr => @agent.reply[:err]})
-        end
-
-        it "should return the exitstatus" do
-          Shell.expects(:new).with("rspec", {}).returns(@shell)
-          @agent.send(:run, "rspec", {}).should == 0
-        end
-
-        it "should handle nil from the shell handler" do
-          @shell.expects(:status).returns(nil)
-          Shell.expects(:new).with("rspec", {}).returns(@shell)
-          @agent.send(:run, "rspec", {}).should == -1
-        end
-      end
-
-      describe "#validate" do
-        it "should detect missing data" do
-          @agent.request = {}
-          expect { @agent.send(:validate, :foo, String) }.to raise_error(MissingRPCData, "please supply a foo argument")
-        end
-
-        it "should catch validation errors and turn them into use case specific ones" do
-          @agent.request = {:input_key => "should be a number"}
-          Validator.expects(:validate).raises(ValidatorError, "input_key should be a number")
-          expect { @agent.send(:validate, :input_key, :number) }.to raise_error("Input input_key did not pass validation: input_key should be a number")
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/rpc/client_spec.rb b/spec/unit/rpc/client_spec.rb
deleted file mode 100644 (file)
index 5905c02..0000000
+++ /dev/null
@@ -1,861 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module RPC
-    describe Client do
-      before do
-        @coreclient = mock
-        @discoverer = mock
-
-        ddl = DDL.new("foo", "agent", false)
-        ddl.action("rspec", :description => "mock agent")
-
-        ddl.stubs(:meta).returns({:timeout => 2})
-        DDL.stubs(:new).returns(ddl)
-
-        @discoverer.stubs(:force_direct_mode?).returns(false)
-        @discoverer.stubs(:discovery_method).returns("mc")
-        @discoverer.stubs(:force_discovery_method_by_filter).returns(false)
-        @discoverer.stubs(:discovery_timeout).returns(2)
-        @discoverer.stubs(:ddl).returns(ddl)
-
-        @coreclient.stubs("options=")
-        @coreclient.stubs(:collective).returns("mcollective")
-        @coreclient.stubs(:timeout_for_compound_filter).returns(0)
-        @coreclient.stubs(:discoverer).returns(@discoverer)
-
-        Config.instance.stubs(:loadconfig).with("/nonexisting").returns(true)
-        Config.instance.stubs(:direct_addressing).returns(true)
-        Config.instance.stubs(:collectives).returns(["mcollective", "rspec"])
-        MCollective::Client.stubs(:new).returns(@coreclient)
-
-        @stderr = StringIO.new
-        @stdout = StringIO.new
-
-        @client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-        @client.stubs(:ddl).returns(ddl)
-      end
-
-      describe "#initialize" do
-        it "should fail for missing DDLs" do
-          DDL.stubs(:new).raises("DDL failure")
-          expect { Client.new("foo", {:options => {:config => "/nonexisting"}}) }.to raise_error("DDL failure")
-        end
-
-        it "should set a empty filter when none is supplied" do
-          filter = Util.empty_filter
-          Util.expects(:empty_filter).once.returns(filter)
-
-          Client.new("foo", :options => {:config => "/nonexisting"})
-        end
-
-        it "should default the discovery_timeout to nil" do
-          c = Client.new("rspec", :options => {:config => "/nonexisting"})
-          c.instance_variable_get("@discovery_timeout").should == nil
-        end
-
-        it "should accept a supplied discovery_timeout" do
-          c = Client.new("rspec", :options => {:config => "/nonexisting", :disctimeout => 10})
-          c.instance_variable_get("@discovery_timeout").should == 10
-        end
-      end
-
-      describe "#validate_request" do
-        it "should fail when a DDL isn't present" do
-          @client.instance_variable_set("@ddl", nil)
-          expect { @client.validate_request("rspec", {}) }.to raise_error("No DDL found for agent foo cannot validate inputs")
-        end
-
-        it "should validate the input arguments" do
-          @client.ddl.expects(:set_default_input_arguments).with("rspec", {})
-          @client.ddl.expects(:validate_rpc_request).with("rspec", {})
-          @client.validate_request("rspec", {})
-        end
-      end
-
-      describe "#process_results_with_block" do
-        it "should inform the stats object correctly for passed requests" do
-          response = {:senderid => "rspec", :body => {:statuscode => 0}}
-
-          @client.stubs(:rpc_result_from_reply).with("foo", "rspec", response)
-          @client.stats.expects(:ok)
-          @client.stats.expects(:node_responded).with("rspec")
-          @client.stats.expects(:time_block_execution).with(:start)
-          @client.stats.expects(:time_block_execution).with(:end)
-          @client.expects(:aggregate_reply).returns("aggregate stub")
-
-          blk = Proc.new {}
-
-          @client.process_results_with_block("rspec", response, blk, "").should == "aggregate stub"
-        end
-
-        it "should inform the stats object correctly for failed requests" do
-          @client.stats.expects(:fail)
-          @client.stats.expects(:node_responded).with("rspec")
-
-          response = {:senderid => "rspec", :body => {:statuscode => 1}}
-          blk = Proc.new {}
-
-          @client.stubs(:rpc_result_from_reply).with("foo", "rspec", response)
-          @client.process_results_with_block("rspec", response, blk, nil)
-        end
-
-        it "should raise correct exceptions on failure" do
-          blk = Proc.new {}
-
-          @client.stubs(:rpc_result_from_reply)
-
-          [[2, UnknownRPCAction], [3, MissingRPCData], [4, InvalidRPCData], [5, UnknownRPCError]].each do |err|
-            response = {:senderid => "rspec", :body => {:statuscode => err[0]}}
-
-            expect { @client.process_results_with_block("rspec", response, blk, nil) }.to raise_error(err[1])
-          end
-        end
-
-        it "should pass raw results for single arity blocks" do
-          response = {:senderid => "rspec", :body => {:statuscode => 1}}
-          blk = Proc.new {|r| r.should == response}
-
-          @client.stubs(:rpc_result_from_reply).with("foo", "rspec", response)
-          @client.process_results_with_block("rspec", response, blk, nil)
-        end
-
-        it "should pass raw and rpc style results for 2 arity blocks" do
-          response = {:senderid => "rspec", :body => {:statuscode => 1}}
-          blk = Proc.new do |r, s|
-            r.should == response
-            s.should.class == RPC::Result
-          end
-
-          @client.process_results_with_block("rspec", response, blk, nil)
-        end
-      end
-
-      describe "#process_results_without_block" do
-        it "should inform the stats object correctly for passed requests" do
-          response = {:senderid => "rspec", :body => {:statuscode => 0}}
-          @client.stubs(:rpc_result_from_reply).with("foo", "rspec", response)
-          @client.stats.expects(:ok)
-          @client.stats.expects(:node_responded).with("rspec")
-          @client.process_results_without_block(response, "rspec", nil)
-        end
-
-        it "should inform the stats object correctly for failed requests" do
-          @client.stats.expects(:fail).twice
-          @client.stats.expects(:node_responded).with("rspec").twice
-
-          response = {:senderid => "rspec", :body => {:statuscode => 1}}
-          @client.stubs(:rpc_result_from_reply).with("foo", "rspec", response)
-          @client.process_results_without_block(response, "rspec", nil)
-
-          response = {:senderid => "rspec", :body => {:statuscode => 3}}
-          @client.stubs(:rpc_result_from_reply).with("foo", "rspec", response)
-          @client.process_results_without_block(response, "rspec", nil)
-        end
-
-        it "should return the result and the aggregate" do
-          @client.expects(:aggregate_reply).returns("aggregate stub")
-
-          response = {:senderid => "rspec", :body => {:statuscode => 0}}
-          result = @client.rpc_result_from_reply("foo", "rspec", response)
-
-          @client.stubs(:rpc_result_from_reply).with("foo", "rspec", response).returns(result)
-          @client.process_results_without_block(response, "rspec", "").should == [result, "aggregate stub"]
-        end
-      end
-
-      describe "#load_aggregate_functions" do
-        it "should not load if the ddl is not set" do
-          @client.load_aggregate_functions("rspec", nil).should == nil
-        end
-
-        it "should create the aggregate for the right action" do
-          @client.ddl.expects(:action_interface).with("rspec").returns({:aggregate => []}).twice
-          Aggregate.expects(:new).with(:aggregate => []).returns("rspec aggregate")
-          @client.load_aggregate_functions("rspec", @client.ddl).should == "rspec aggregate"
-        end
-
-        it "should log and return nil on failure" do
-          @client.ddl.expects(:action_interface).raises("rspec")
-          Log.expects(:error).with(regexp_matches(/Failed to load aggregate/))
-          @client.load_aggregate_functions("rspec", @client.ddl)
-        end
-      end
-
-      describe "#aggregate_reply" do
-        it "should not call anything if the aggregate isnt set" do
-          @client.aggregate_reply(nil, nil).should == nil
-        end
-
-        it "should call the aggregate functions with the right data" do
-          result = @client.rpc_result_from_reply("rspec", "rspec", {:body => {:data => "rspec"}})
-
-          aggregate = mock
-          aggregate.expects(:call_functions).with(result).returns(aggregate)
-
-          @client.aggregate_reply(result, aggregate).should == aggregate
-        end
-
-        it "should log and return nil on failure" do
-          aggregate = mock
-          aggregate.expects(:call_functions).raises
-
-          Log.expects(:error).with(regexp_matches(/Failed to calculate aggregate summaries/))
-
-          @client.aggregate_reply({}, aggregate).should == nil
-        end
-      end
-
-      describe "#collective=" do
-        it "should validate the collective" do
-          expect { @client.collective = "fail" }.to raise_error("Unknown collective fail")
-          @client.collective = "rspec"
-        end
-
-        it "should set the collective" do
-          @client.options[:collective].should == "mcollective"
-          @client.collective = "rspec"
-          @client.options[:collective].should == "rspec"
-        end
-
-        it "should reset the client" do
-          @client.expects(:reset)
-          @client.collective = "rspec"
-        end
-      end
-
-      describe "#discovery_method=" do
-        it "should set the method" do
-          @client.discovery_method = "rspec"
-          @client.discovery_method.should == "rspec"
-        end
-
-        it "should set initial options if provided" do
-          client = Client.new("rspec", {:options => {:discovery_options => ["rspec"], :filter => Util.empty_filter, :config => "/nonexisting"}})
-          client.discovery_method = "rspec"
-          client.discovery_method.should == "rspec"
-          client.discovery_options.should == ["rspec"]
-        end
-
-        it "should clear the options if none are given initially" do
-          @client.discovery_options = ["rspec"]
-          @client.discovery_method = "rspec"
-          @client.discovery_options.should == []
-        end
-
-        it "should set the client options" do
-          @client.expects(:options).returns("rspec")
-          @client.client.expects(:options=).with("rspec")
-          @client.discovery_method = "rspec"
-        end
-
-        it "should adjust timeout for the new method" do
-          @client.expects(:discovery_timeout).once.returns(1)
-          @client.discovery_method = "rspec"
-          @client.instance_variable_get("@timeout").should == 4
-        end
-
-        it "should preserve any user supplied discovery timeout" do
-          @client.discovery_timeout = 10
-          @client.discovery_method = "rspec"
-          @client.discovery_timeout.should == 10
-        end
-
-        it "should reset the rpc client" do
-          @client.expects(:reset)
-          @client.discovery_method = "rspec"
-        end
-      end
-
-      describe "#discovery_options=" do
-        it "should flatten the options array" do
-          @client.discovery_options = "foo"
-          @client.discovery_options.should == ["foo"]
-        end
-      end
-
-      describe "#discovery_timeout" do
-        it "should favour the initial options supplied timeout" do
-          client = Client.new("rspec", {:options => {:disctimeout => 3, :filter => Util.empty_filter, :config => "/nonexisting"}})
-          client.discovery_timeout.should == 3
-        end
-
-        it "should return the DDL data if no specific options are supplied" do
-          client = Client.new("rspec", {:options => {:disctimeout => nil, :filter => Util.empty_filter, :config => "/nonexisting"}})
-          client.discovery_timeout.should == 2
-        end
-      end
-
-      describe "#discovery_timeout=" do
-        it "should store the discovery timeout" do
-          @client.discovery_timeout = 10
-          @client.discovery_timeout.should == 10
-        end
-
-        it "should update the overall timeout with the new discovery timeout" do
-          @client.instance_variable_get("@timeout").should == 4
-
-          @client.discovery_timeout = 10
-
-          @client.instance_variable_get("@timeout").should == 12
-        end
-      end
-
-      describe "#limit_method" do
-        it "should force strings to symbols" do
-          @client.limit_method = "first"
-          @client.limit_method.should == :first
-        end
-
-        it "should only allow valid methods" do
-          @client.limit_method = :first
-          @client.limit_method.should == :first
-          @client.limit_method = :random
-          @client.limit_method.should == :random
-
-          expect { @client.limit_method = :fail }.to raise_error(/Unknown/)
-          expect { @client.limit_method = "fail" }.to raise_error(/Unknown/)
-        end
-      end
-
-      describe "#method_missing" do
-        it "should reset the stats" do
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-          client.stubs(:call_agent)
-
-          Stats.any_instance.expects(:reset).once
-          client.rspec
-        end
-
-        it "should validate the request against the ddl" do
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-
-          client.stubs(:call_agent)
-
-          client.expects(:validate_request).with("rspec", {:arg => :val}).raises("validation failed")
-
-          expect { client.rspec(:arg => :val) }.to raise_error("validation failed")
-        end
-
-        it "should support limited targets" do
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-          client.limit_targets = 10
-
-          client.expects(:pick_nodes_from_discovered).with(10).returns(["one", "two"])
-          client.expects(:custom_request).with("rspec", {}, ["one", "two"], {"identity" => /^(one|two)$/}).once
-
-          client.rspec
-        end
-
-        describe "batch mode" do
-          before do
-            Config.instance.stubs(:direct_addressing).returns(true)
-            @client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-          end
-
-          it "should support global batch_size" do
-            @client.batch_size = 10
-            @client.expects(:call_agent_batched).with("rspec", {}, @client.options, 10, 1)
-            @client.rspec
-          end
-
-          it "should support custom batch_size" do
-            @client.expects(:call_agent_batched).with("rspec", {}, @client.options, 10, 1)
-            @client.rspec :batch_size => 10
-          end
-
-          it "should allow supplied batch_size override global one" do
-            @client.batch_size = 10
-            @client.expects(:call_agent_batched).with("rspec", {}, @client.options, 20, 1)
-            @client.rspec :batch_size => 20
-          end
-
-          it "should support global batch_sleep_time" do
-            @client.batch_size = 10
-            @client.batch_sleep_time = 20
-            @client.expects(:call_agent_batched).with("rspec", {}, @client.options, 10, 20)
-            @client.rspec
-          end
-
-          it "should support custom batch_sleep_time" do
-            @client.batch_size = 10
-            @client.expects(:call_agent_batched).with("rspec", {}, @client.options, 10, 20)
-            @client.rspec :batch_sleep_time => 20
-          end
-
-          it "should allow supplied batch_sleep_time override global one" do
-            @client.batch_size = 10
-            @client.batch_sleep_time = 10
-            @client.expects(:call_agent_batched).with("rspec", {}, @client.options, 10, 20)
-            @client.rspec :batch_sleep_time => 20
-          end
-        end
-
-        it "should support normal calls" do
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-
-          client.expects(:call_agent).with("rspec", {}, client.options, :auto).once
-
-          client.rspec
-        end
-      end
-
-      describe "#pick_nodes_from_discovered" do
-        before do
-          client = stub
-          discoverer = stub
-          ddl = stub
-
-          ddl.stubs(:meta).returns({:timeout => 2})
-
-          discoverer.stubs(:ddl).returns(ddl)
-
-          client.stubs("options=")
-          client.stubs(:collective).returns("mcollective")
-          client.stubs(:discoverer).returns(discoverer)
-
-          Config.instance.stubs(:loadconfig).with("/nonexisting").returns(true)
-          MCollective::Client.stubs(:new).returns(client)
-          Config.instance.stubs(:direct_addressing).returns(true)
-        end
-
-        it "should return a percentage of discovered hosts" do
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-          client.stubs(:discover).returns((1..10).map{|i| i.to_s})
-          client.limit_method = :first
-          client.pick_nodes_from_discovered("20%").should == ["1", "2"]
-        end
-
-        it "should return the same list when a random seed is supplied" do
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting", :limit_seed => 5}})
-          client.stubs(:discover).returns((1..10).map{|i| i.to_s})
-          client.limit_method = :random
-          client.pick_nodes_from_discovered("30%").should == ["3", "7", "8"]
-          client.pick_nodes_from_discovered("30%").should == ["3", "7", "8"]
-          client.pick_nodes_from_discovered("3").should == ["3", "7", "8"]
-          client.pick_nodes_from_discovered("3").should == ["3", "7", "8"]
-        end
-
-        it "should correctly pick a numeric amount of discovered nodes" do
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting", :limit_seed => 5}})
-          client.stubs(:discover).returns((1..10).map{|i| i.to_s})
-          client.limit_method = :first
-          client.pick_nodes_from_discovered(5).should == (1..5).map{|i| i.to_s}
-          client.pick_nodes_from_discovered(5).should == (1..5).map{|i| i.to_s}
-        end
-      end
-
-      describe "#limit_targets=" do
-        before do
-          client = stub
-          discoverer = stub
-          ddl = stub
-
-          ddl.stubs(:meta).returns({:timeout => 2})
-
-          discoverer.stubs(:force_direct_mode?).returns(false)
-          discoverer.stubs(:ddl).returns(ddl)
-          discoverer.stubs(:discovery_method).returns("mc")
-
-          client.stubs("options=")
-          client.stubs(:collective).returns("mcollective")
-          client.stubs(:discoverer).returns(discoverer)
-
-          Config.instance.stubs(:loadconfig).with("/nonexisting").returns(true)
-          MCollective::Client.expects(:new).returns(client)
-          Config.instance.stubs(:direct_addressing).returns(true)
-
-          @client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-        end
-
-        it "should support percentages" do
-          @client.limit_targets = "10%"
-          @client.limit_targets.should == "10%"
-        end
-
-        it "should support integers" do
-          @client.limit_targets = 10
-          @client.limit_targets.should == 10
-          @client.limit_targets = "20"
-          @client.limit_targets.should == 20
-          @client.limit_targets = 1.1
-          @client.limit_targets.should == 1
-          @client.limit_targets = 1.7
-          @client.limit_targets.should == 1
-        end
-
-        it "should not invalid limits to be set" do
-          expect { @client.limit_targets = "a" }.to raise_error(/Invalid/)
-          expect { @client.limit_targets = "%1" }.to raise_error(/Invalid/)
-          expect { @client.limit_targets = "1.1" }.to raise_error(/Invalid/)
-        end
-      end
-
-      describe "#call_agent_batched" do
-        before do
-          @client = stub
-          @discoverer = stub
-          @ddl = stub
-
-          @ddl.stubs(:meta).returns({:timeout => 2})
-
-          @discoverer.stubs(:force_direct_mode?).returns(false)
-          @discoverer.stubs(:ddl).returns(@ddl)
-          @discoverer.stubs(:discovery_method).returns("mc")
-
-          @client.stubs("options=")
-          @client.stubs(:collective).returns("mcollective")
-          @client.stubs(:discoverer).returns(@discoverer)
-
-          Config.instance.stubs(:loadconfig).with("/nonexisting").returns(true)
-          MCollective::Client.expects(:new).returns(@client)
-          Config.instance.stubs(:direct_addressing).returns(true)
-        end
-
-        it "should require direct addressing" do
-          Config.instance.stubs(:direct_addressing).returns(false)
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-
-          expect {
-            client.send(:call_agent_batched, "foo", {}, {}, 1, 1)
-          }.to raise_error("Batched requests requires direct addressing")
-        end
-
-        it "should require that all results be processed" do
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-
-          expect {
-            client.send(:call_agent_batched, "foo", {:process_results => false}, {}, 1, 1)
-          }.to raise_error("Cannot bypass result processing for batched requests")
-        end
-
-        it "should only accept integer batch sizes" do
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-
-          expect {
-            client.send(:call_agent_batched, "foo", {}, {}, "foo", 1)
-          }.to raise_error(/invalid value for Integer/)
-        end
-
-        it "should only accept float sleep times" do
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-
-          expect {
-            client.send(:call_agent_batched, "foo", {}, {}, 1, "foo")
-          }.to raise_error(/invalid value for Float/)
-        end
-
-        it "should batch hosts in the correct size" do
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting", :stderr => StringIO.new}})
-
-          client.expects(:new_request).returns("req")
-
-          discovered = mock
-          discovered.stubs(:size).returns(1)
-          discovered.expects(:in_groups_of).with(10).raises("spec pass")
-
-          client.instance_variable_set("@client", @coreclient)
-          @coreclient.stubs(:discover).returns(discovered)
-          @coreclient.stubs(:timeout_for_compound_filter).returns(0)
-
-          expect { client.send(:call_agent_batched, "foo", {}, {}, 10, 1) }.to raise_error("spec pass")
-        end
-
-        it "should force direct requests" do
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting", :stderr => StringIO.new}})
-
-          Message.expects(:new).with('req', nil, {:type => :direct_request, :agent => 'foo', :filter => nil, :options => {}, :collective => 'mcollective'}).raises("spec pass")
-          client.expects(:new_request).returns("req")
-
-          client.instance_variable_set("@client", @coreclient)
-          @coreclient.stubs(:discover).returns(["test"])
-          @coreclient.stubs(:timeout_for_compound_filter).returns(0)
-
-          expect { client.send(:call_agent_batched, "foo", {}, {}, 1, 1) }.to raise_error("spec pass")
-        end
-
-        it "should process blocks correctly" do
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting", :stderr => StringIO.new}})
-
-          msg = mock
-          msg.expects(:discovered_hosts=).times(10)
-          msg.expects(:create_reqid).returns("823a3419a0975c3facbde121f72ab61f")
-          msg.expects(:requestid=).with("823a3419a0975c3facbde121f72ab61f").times(10)
-
-          stats = {:noresponsefrom => [], :responses => 0, :blocktime => 0, :totaltime => 0, :discoverytime => 0, :requestid => "823a3419a0975c3facbde121f72ab61f"}
-
-          Message.expects(:new).with('req', nil, {:type => :direct_request, :agent => 'foo', :filter => nil, :options => {}, :collective => 'mcollective'}).returns(msg).times(10)
-          client.expects(:new_request).returns("req")
-          client.expects(:sleep).with(1.0).times(9)
-
-          client.instance_variable_set("@client", @coreclient)
-          @coreclient.stubs(:discover).returns([1,2,3,4,5,6,7,8,9,0])
-          @coreclient.expects(:req).with(msg).yields("result").times(10)
-          @coreclient.stubs(:stats).returns stats
-          @coreclient.stubs(:timeout_for_compound_filter).returns(0)
-
-          client.expects(:process_results_with_block).with("foo", "result", instance_of(Proc), nil).times(10)
-
-          result = client.send(:call_agent_batched, "foo", {}, {}, 1, 1) { }
-          result[:requestid].should == "823a3419a0975c3facbde121f72ab61f"
-          result.class.should == Stats
-        end
-
-        it "should return an array of results in array mode" do
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting", :stderr => StringIO.new}})
-          client.instance_variable_set("@client", @coreclient)
-
-          msg = mock
-          msg.expects(:discovered_hosts=).times(10)
-          msg.expects(:create_reqid).returns("823a3419a0975c3facbde121f72ab61f")
-          msg.expects(:requestid=).with("823a3419a0975c3facbde121f72ab61f").times(10)
-
-          stats = {:noresponsefrom => [], :responses => 0, :blocktime => 0, :totaltime => 0, :discoverytime => 0, :requestid => "823a3419a0975c3facbde121f72ab61f"}
-
-          Progress.expects(:new).never
-
-          Message.expects(:new).with('req', nil, {:type => :direct_request, :agent => 'foo', :filter => nil, :options => {}, :collective => 'mcollective'}).returns(msg).times(10)
-          client.expects(:new_request).returns("req")
-          client.expects(:sleep).with(1.0).times(9)
-
-          @coreclient.stubs(:discover).returns([1,2,3,4,5,6,7,8,9,0])
-          @coreclient.expects(:req).with(msg).yields("result").times(10)
-          @coreclient.stubs(:stats).returns stats
-          @coreclient.stubs(:timeout_for_compound_filter).returns(0)
-
-          client.expects(:process_results_without_block).with("result", "foo", nil).returns("rspec").times(10)
-
-          client.send(:call_agent_batched, "foo", {}, {}, 1, 1).should == ["rspec", "rspec", "rspec", "rspec", "rspec", "rspec", "rspec", "rspec", "rspec", "rspec"]
-
-          client.stats[:requestid].should == "823a3419a0975c3facbde121f72ab61f"
-        end
-      end
-
-      describe "#batch_sleep_time=" do
-        it "should correctly set the sleep" do
-          Config.instance.stubs(:direct_addressing).returns(true)
-
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-          client.batch_sleep_time = 5
-          client.batch_sleep_time.should == 5
-        end
-
-        it "should only allow batch sleep to be set for direct addressing capable clients" do
-          Config.instance.stubs(:direct_addressing).returns(false)
-          Config.instance.stubs(:loadconfig).with("/nonexisting").returns(true)
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-
-          expect { client.batch_sleep_time = 5 }.to raise_error("Can only set batch sleep time if direct addressing is supported")
-        end
-      end
-
-      describe "#batch_size=" do
-        it "should correctly set the size" do
-          Config.instance.stubs(:direct_addressing).returns(true)
-
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-          client.batch_mode.should == false
-          client.batch_size = 5
-          client.batch_size.should == 5
-          client.batch_mode.should == true
-        end
-
-        it "should only allow batch size to be set for direct addressing capable clients" do
-          Config.instance.stubs(:loadconfig).with("/nonexisting").returns(true)
-          Config.instance.stubs(:direct_addressing).returns(false)
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-
-          expect { client.batch_size = 5 }.to raise_error("Can only set batch size if direct addressing is supported")
-        end
-
-        it "should support disabling batch mode when supplied a batch size of 0" do
-          Config.instance.stubs(:direct_addressing).returns(true)
-
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-          client.batch_size = 5
-          client.batch_mode.should == true
-          client.batch_size = 0
-          client.batch_mode.should == false
-        end
-      end
-
-      describe "#discover" do
-        it "should not accept invalid flags" do
-          Config.instance.stubs(:direct_addressing).returns(true)
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-
-          expect { client.discover(:rspec => :rspec) }.to raise_error("Unknown option rspec passed to discover")
-        end
-
-        it "should reset when :json, :hosts or :nodes are provided" do
-          Config.instance.stubs(:direct_addressing).returns(true)
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-          client.expects(:reset).times(3)
-          client.discover(:hosts => ["one"])
-          client.discover(:nodes => ["one"])
-          client.discover(:json => ["one"])
-        end
-
-        it "should only allow discovery data in direct addressing mode" do
-          Config.instance.stubs(:direct_addressing).returns(false)
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-          client.expects(:reset).once
-
-          expect {
-            client.discover(:nodes => ["one"])
-          }.to raise_error("Can only supply discovery data if direct_addressing is enabled")
-        end
-
-        it "should parse :nodes and :hosts and force direct requests" do
-          Config.instance.stubs(:direct_addressing).returns(true)
-          Helpers.expects(:extract_hosts_from_array).with(["one"]).returns(["one"]).twice
-
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-          client.discover(:nodes => ["one"]).should == ["one"]
-          client.discover(:hosts => ["one"]).should == ["one"]
-          client.instance_variable_get("@force_direct_request").should == true
-          client.instance_variable_get("@discovered_agents").should == ["one"]
-        end
-
-        it "should parse :json and force direct requests" do
-          Config.instance.stubs(:direct_addressing).returns(true)
-          Helpers.expects(:extract_hosts_from_json).with('["one"]').returns(["one"]).once
-
-          client = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting"}})
-          client.discover(:json => '["one"]').should == ["one"]
-          client.instance_variable_get("@force_direct_request").should == true
-          client.instance_variable_get("@discovered_agents").should == ["one"]
-        end
-
-        it "should not set direct mode for non 'mc' discovery methods" do
-          Config.instance.stubs(:direct_addressing).returns(true)
-
-          client = Client.new("foo", {:options => {:discovery_method => "rspec", :filter => {"identity" => ["foo"], "agent" => []}, :config => "/nonexisting"}})
-          @coreclient.expects(:discover).returns(["foo"])
-
-          client.discover
-          client.instance_variable_get("@discovered_agents").should == ["foo"]
-          client.instance_variable_get("@force_direct_request").should == false
-        end
-
-        it "should force direct mode for non regex identity filters" do
-          Config.instance.stubs(:direct_addressing).returns(true)
-
-          client = Client.new("foo", {:options => {:discovery_method => "mc", :filter => {"identity" => ["foo"], "agent" => []}, :config => "/nonexisting"}})
-          client.discover
-          client.instance_variable_get("@discovered_agents").should == ["foo"]
-          client.instance_variable_get("@force_direct_request").should == true
-        end
-
-        it "should not set direct mode if its disabled" do
-          Config.instance.stubs(:direct_addressing).returns(false)
-
-          client = Client.new("foo", {:options => {:discovery_method => "mc", :filter => {"identity" => ["foo"], "agent" => []}, :config => "/nonexisting"}})
-
-          client.discover
-          client.instance_variable_get("@force_direct_request").should == false
-          client.instance_variable_get("@discovered_agents").should == ["foo"]
-        end
-
-        it "should not set direct mode for regex identities" do
-          Config.instance.stubs(:direct_addressing).returns(false)
-
-          rpcclient = Client.new("foo", {:options => {:filter => {"identity" => ["/foo/"], "agent" => []}, :config => "/nonexisting"}})
-
-          rpcclient.client.expects(:discover).with({'identity' => ['/foo/'], 'agent' => ['foo']}, 2).once.returns(["foo"])
-
-          rpcclient.discover
-          rpcclient.instance_variable_get("@force_direct_request").should == false
-          rpcclient.instance_variable_get("@discovered_agents").should == ["foo"]
-        end
-
-        it "should print status to stderr if in verbose mode" do
-          @stderr.expects(:print).with("Discovering hosts using the mc method for 2 second(s) .... ")
-          @stderr.expects(:puts).with(1)
-
-          rpcclient = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting", :verbose => true, :disctimeout => 2, :stderr => @stderr, :stdout => @stdout}})
-
-          rpcclient.client.expects(:discover).with({'identity' => [], 'compound' => [], 'fact' => [], 'agent' => ['foo'], 'cf_class' => []}, 2).returns(["foo"])
-
-          rpcclient.discover
-        end
-
-        it "should not print status to stderr if in nonverbose mode" do
-          @stderr.expects(:print).never
-          @stderr.expects(:puts).never
-
-          rpcclient = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting", :verbose => false, :disctimeout => 2, :stderr => @stderr, :stdout => @stdout}})
-          rpcclient.client.expects(:discover).with({'identity' => [], 'compound' => [], 'fact' => [], 'agent' => ['foo'], 'cf_class' => []}, 2).returns(["foo"])
-
-          rpcclient.discover
-        end
-
-        it "should record the start and end times" do
-          Stats.any_instance.expects(:time_discovery).with(:start)
-          Stats.any_instance.expects(:time_discovery).with(:end)
-
-          rpcclient = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting", :verbose => false, :disctimeout => 2}})
-          rpcclient.client.expects(:discover).with({'identity' => [], 'compound' => [], 'fact' => [], 'agent' => ['foo'], 'cf_class' => []}, 2).returns(["foo"])
-
-          rpcclient.discover
-        end
-
-        it "should discover using limits in :first rpclimit mode given a number" do
-          Config.instance.stubs(:rpclimitmethod).returns(:first)
-          rpcclient = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting", :verbose => false, :disctimeout => 2}})
-          rpcclient.client.expects(:discover).with({'identity' => [], 'compound' => [], 'fact' => [], 'agent' => ['foo'], 'cf_class' => []}, 2, 1).returns(["foo"])
-
-          rpcclient.limit_targets = 1
-
-          rpcclient.discover
-        end
-
-        it "should not discover using limits in :first rpclimit mode given a string" do
-          Config.instance.stubs(:rpclimitmethod).returns(:first)
-          rpcclient = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting", :verbose => false, :disctimeout => 2}})
-          rpcclient.client.expects(:discover).with({'identity' => [], 'compound' => [], 'fact' => [], 'agent' => ['foo'], 'cf_class' => []}, 2).returns(["foo"])
-          rpcclient.limit_targets = "10%"
-
-          rpcclient.discover
-        end
-
-        it "should not discover using limits when not in :first mode" do
-          Config.instance.stubs(:rpclimitmethod).returns(:random)
-
-          rpcclient = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting", :verbose => false, :disctimeout => 2}})
-          rpcclient.client.expects(:discover).with({'identity' => [], 'compound' => [], 'fact' => [], 'agent' => ['foo'], 'cf_class' => []}, 2).returns(["foo"])
-
-          rpcclient.limit_targets = 1
-          rpcclient.discover
-        end
-
-        it "should ensure force_direct mode is false when doing traditional discovery" do
-          rpcclient = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting", :verbose => false, :disctimeout => 2}})
-          rpcclient.client.expects(:discover).with({'identity' => [], 'compound' => [], 'fact' => [], 'agent' => ['foo'], 'cf_class' => []}, 2).returns(["foo"])
-
-          rpcclient.instance_variable_set("@force_direct_request", true)
-          rpcclient.discover
-          rpcclient.instance_variable_get("@force_direct_request").should == false
-        end
-
-        it "should store discovered nodes in stats" do
-          rpcclient = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting", :verbose => false, :disctimeout => 2}})
-          rpcclient.client.expects(:discover).with({'identity' => [], 'compound' => [], 'fact' => [], 'agent' => ['foo'], 'cf_class' => []}, 2).returns(["foo"])
-
-          rpcclient.discover
-          rpcclient.stats.discovered_nodes.should == ["foo"]
-        end
-
-        it "should save discovered nodes in RPC" do
-          rpcclient = Client.new("foo", {:options => {:filter => Util.empty_filter, :config => "/nonexisting", :verbose => false, :disctimeout => 2}})
-          rpcclient.client.expects(:discover).with({'identity' => [], 'compound' => [], 'fact' => [], 'agent' => ['foo'], 'cf_class' => []}, 2).returns(["foo"])
-
-          RPC.expects(:discovered).with(["foo"]).once
-          rpcclient.discover
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/rpc/helpers_spec.rb b/spec/unit/rpc/helpers_spec.rb
deleted file mode 100755 (executable)
index f2c56ee..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module RPC
-    describe Helpers do
-      describe "#extract_hosts_from_json" do
-        it "should fail for non array data" do
-          expect {
-            Helpers.extract_hosts_from_json("{}")
-          }.to raise_error("JSON hosts list is not an array")
-        end
-
-        it "should fail for non hash array members" do
-          senders = [{"sender" => "sender1"}, {"sender" => "sender3"}, ""].to_json
-
-          expect {
-            Helpers.extract_hosts_from_json(senders)
-          }.to raise_error("JSON host list is not an array of Hashes")
-        end
-
-        it "should fail for hashes without senders" do
-          senders = [{"sender" => "sender1"}, {"sender" => "sender3"}, {}].to_json
-
-          expect {
-            Helpers.extract_hosts_from_json(senders)
-          }.to raise_error("JSON host list does not have senders in it")
-        end
-
-        it "should return all found unique senders" do
-          senders = [{"sender" => "sender1"}, {"sender" => "sender3"}, {"sender" => "sender1"}].to_json
-
-          Helpers.extract_hosts_from_json(senders).should == ["sender1", "sender3"]
-        end
-      end
-
-      describe "#extract_hosts_from_array" do
-        it "should support single string lists" do
-          Helpers.extract_hosts_from_array("foo").should == ["foo"]
-        end
-
-        it "should support arrays" do
-          Helpers.extract_hosts_from_array(["foo", "bar"]).should == ["foo", "bar"]
-        end
-
-        it "should fail for non string array members" do
-          expect {
-            Helpers.extract_hosts_from_array(["foo", 1])
-          }.to raise_error("1 should be a string")
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/rpc/reply_spec.rb b/spec/unit/rpc/reply_spec.rb
deleted file mode 100755 (executable)
index 4d31567..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module RPC
-    describe Reply do
-      before(:each) do
-        Cache.delete!(:ddl) rescue nil
-
-        ddl = stub
-        ddl.stubs(:action_interface).returns({:output => {}})
-        ddl.stubs(:actions).returns(["rspec"])
-        ddl.stubs(:pluginname).returns("rspec")
-
-        @reply = Reply.new("rspec", ddl)
-      end
-
-      describe "#initialize" do
-        it "should set an empty data hash" do
-          @reply.data.should == {}
-        end
-
-        it "should set statuscode to zero" do
-          @reply.statuscode.should == 0
-        end
-
-        it "should set statusmsg to OK" do
-          @reply.statusmsg.should == "OK"
-        end
-      end
-
-      describe "#initialize_data" do
-        before do
-          Log.stubs(:warn)
-          @ddl = DDL.new("rspec", :agent, false)
-        end
-
-        it "should set defaults correctly" do
-          @ddl.action :rspec, :description => "testing rspec" do
-            @ddl.output :one, :description => "rspec test", :display_as => "rspec", :default => "default"
-            @ddl.output :three, :description => "rspec test", :display_as => "rspec", :default => []
-            @ddl.output :two, :description => "rspec test", :display_as => "rspec"
-          end
-
-          reply = Reply.new(:rspec, @ddl)
-          reply.data.should == {:one => "default", :two => nil, :three => []}
-        end
-
-        it "should detect missing actions" do
-          reply = Reply.new(:rspec, @ddl)
-          expect { reply.initialize_data }.to raise_error(/No action 'rspec' defined/)
-        end
-      end
-
-      describe "#fail" do
-        it "should set statusmsg" do
-          @reply.fail "foo"
-          @reply.statusmsg.should == "foo"
-        end
-
-        it "should set statuscode to 1 by default" do
-          @reply.fail("foo")
-          @reply.statuscode.should == 1
-        end
-
-        it "should set statuscode" do
-          @reply.fail("foo", 2)
-          @reply.statuscode.should == 2
-        end
-      end
-
-      describe "#fail!" do
-        it "should set statusmsg" do
-          expect {
-            @reply.fail! "foo"
-          }.to raise_error(RPCAborted, "foo")
-
-          @reply.statusmsg.should == "foo"
-        end
-
-        it "should set statuscode to 1 by default" do
-          expect {
-            @reply.fail! "foo"
-          }.to raise_error(RPCAborted)
-        end
-
-        it "should set statuscode" do
-          expect {
-            @reply.fail! "foo", 2
-          }.to raise_error(UnknownRPCAction)
-
-          @reply.statuscode.should == 2
-        end
-
-        it "should raise RPCAborted for code 1" do
-          expect {
-            @reply.fail! "foo", 1
-          }.to raise_error(RPCAborted)
-        end
-
-        it "should raise UnknownRPCAction for code 2" do
-          expect {
-            @reply.fail! "foo", 2
-          }.to raise_error(UnknownRPCAction)
-        end
-
-        it "should raise MissingRPCData for code 3" do
-          expect {
-            @reply.fail! "foo", 3
-          }.to raise_error(MissingRPCData)
-        end
-
-        it "should raise InvalidRPCData for code 4" do
-          expect {
-            @reply.fail! "foo", 4
-          }.to raise_error(InvalidRPCData)
-        end
-
-        it "should raise UnknownRPCError for all other codes" do
-          expect {
-            @reply.fail! "foo", 5
-          }.to raise_error(UnknownRPCError)
-
-          expect {
-            @reply.fail! "foo", "x"
-          }.to raise_error(UnknownRPCError)
-        end
-      end
-
-      describe "#[]=" do
-        it "should save the correct data to the data hash" do
-          @reply[:foo] = "foo1"
-          @reply["foo"] = "foo2"
-
-          @reply.data[:foo].should == "foo1"
-          @reply.data["foo"].should == "foo2"
-        end
-      end
-
-      describe "#[]" do
-        it "should return the correct saved data" do
-          @reply[:foo] = "foo1"
-          @reply["foo"] = "foo2"
-
-          @reply[:foo].should == "foo1"
-          @reply["foo"].should == "foo2"
-        end
-      end
-
-      describe "#to_hash" do
-        it "should have the correct keys" do
-          @reply.to_hash.keys.sort.should == [:data, :statuscode, :statusmsg]
-        end
-
-        it "should have the correct statuscode" do
-          @reply.fail "meh", 2
-          @reply.to_hash[:statuscode].should == 2
-        end
-
-        it "should have the correct statusmsg" do
-          @reply.fail "meh", 2
-          @reply.to_hash[:statusmsg].should == "meh"
-        end
-
-        it "should have the correct data" do
-          @reply[:foo] = :bar
-          @reply.to_hash[:data][:foo].should == :bar
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/rpc/request_spec.rb b/spec/unit/rpc/request_spec.rb
deleted file mode 100755 (executable)
index a121aba..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module RPC
-    describe Request do
-      before(:each) do
-        @req = {:msgtime        => Time.now,
-                :senderid        => "spec test",
-                :requestid       => "12345",
-                :callerid        => "rip"}
-
-        @req[:body] = {:action => "test",
-                       :data   => {:foo => "bar", :process_results => true},
-                       :agent  => "tester"}
-
-        @ddl = DDL.new("rspec", :agent, false)
-
-        @request = Request.new(@req, @ddl)
-      end
-
-      describe "#validate!" do
-        it "should validate the request using the supplied DDL" do
-          @ddl.expects(:validate_rpc_request).with("test", {:foo => "bar", :process_results => true})
-          @request.validate!
-        end
-      end
-
-      describe "#initialize" do
-        it "should set time" do
-          @request.time.should == @req[:msgtime]
-        end
-
-        it "should set action" do
-          @request.action.should == "test"
-        end
-
-        it "should set data" do
-          @request.data.should == {:foo => "bar", :process_results => true}
-        end
-
-        it "should set sender" do
-          @request.sender.should == "spec test"
-        end
-
-        it "should set agent" do
-          @request.agent.should == "tester"
-        end
-
-        it "should set uniqid" do
-          @request.uniqid.should == "12345"
-        end
-
-        it "should set caller" do
-          @request.caller.should == "rip"
-        end
-
-        it "should set unknown caller if none is supplied" do
-          @req.delete(:callerid)
-          Request.new(@req, @ddl).caller.should == "unknown"
-        end
-      end
-
-      describe "#include?" do
-        it "should correctly report on hash contents" do
-          @request.include?(:foo).should == true
-        end
-
-        it "should return false for non hash data" do
-          @req[:body][:data] = "foo"
-          Request.new(@req, @ddl).include?(:foo).should == false
-        end
-      end
-
-      describe "#should_respond?" do
-        it "should return true if the header is absent" do
-          @req[:body][:data].delete(:process_results)
-          Request.new(@req, @ddl).should_respond?.should == true
-        end
-
-        it "should return correct value" do
-          @req[:body][:data][:process_results] = false
-          Request.new(@req, @ddl).should_respond?.should == false
-        end
-      end
-
-      describe "#[]" do
-        it "should return nil for non hash data" do
-          @req[:body][:data] = "foo"
-          Request.new(@req, @ddl)["foo"].should == nil
-        end
-
-        it "should return correct data" do
-          @request[:foo].should == "bar"
-        end
-
-        it "should return nil for absent data" do
-          @request[:bar].should == nil
-        end
-      end
-
-      describe "#fetch" do
-        it "should return nil for non hash data" do
-          @req[:body][:data] = "foo"
-          Request.new(@req, @ddl)["foo"].should == nil
-        end
-
-        it "should fetch data with the correct default behavior" do
-          @request.fetch(:foo, "default").should == "bar"
-          @request.fetch(:rspec, "default").should == "default"
-        end
-      end
-
-      describe "#to_hash" do
-        it "should have the correct keys" do
-          @request.to_hash.keys.sort.should == [:action, :agent, :data]
-        end
-
-        it "should return the correct agent" do
-          @request.to_hash[:agent].should == "tester"
-        end
-
-        it "should return the correct action" do
-          @request.to_hash[:action].should == "test"
-        end
-
-        it "should return the correct data" do
-          @request.to_hash[:data].should == {:foo => "bar",
-                                             :process_results => true}
-        end
-      end
-    end
-  end
-end
-
diff --git a/spec/unit/rpc/result_spec.rb b/spec/unit/rpc/result_spec.rb
deleted file mode 100755 (executable)
index 22c0b41..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module RPC
-    describe Result do
-      before(:each) do
-        @result = Result.new("tester", "test", {:foo => "bar", :bar => "baz"})
-      end
-
-      it "should include Enumerable" do
-        Result.ancestors.include?(Enumerable).should == true
-      end
-
-      describe "#initialize" do
-        it "should set the agent" do
-          @result.agent.should == "tester"
-        end
-
-        it "should set the action" do
-          @result.action.should == "test"
-        end
-
-        it "should set the results" do
-          @result.results.should == {:foo => "bar", :bar => "baz"}
-        end
-      end
-
-      describe "#[]" do
-        it "should access the results hash and return correct data" do
-          @result[:foo].should == "bar"
-          @result[:bar].should == "baz"
-        end
-      end
-
-      describe "#[]=" do
-        it "should set the correct result data" do
-          @result[:meh] = "blah"
-
-          @result[:foo].should == "bar"
-          @result[:bar].should == "baz"
-          @result[:meh].should == "blah"
-        end
-      end
-
-      describe "#fetch" do
-        it "should fetch data with the correct default behavior" do
-          @result.fetch(:foo, "default").should == "bar"
-          @result.fetch(:rspec, "default").should == "default"
-        end
-      end
-
-      describe "#each" do
-        it "should itterate all the pairs" do
-          data = {}
-
-          @result.each {|k,v| data[k] = v}
-
-          data[:foo].should == "bar"
-          data[:bar].should == "baz"
-        end
-      end
-
-      describe "#to_json" do
-        it "should correctly json encode teh data" do
-          result = Result.new("tester", "test", {:statuscode => 0, :statusmsg => "OK", :sender => "rspec",  :data => {:foo => "bar", :bar => "baz"}})
-          JSON.load(result.to_json).should == {"agent" => "tester", "action" => "test", "statuscode" => 0, "statusmsg" => "OK", "sender" => "rspec", "data" => {"foo" => "bar", "bar" => "baz"}}
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/rpc/stats_spec.rb b/spec/unit/rpc/stats_spec.rb
deleted file mode 100755 (executable)
index 8344c46..0000000
+++ /dev/null
@@ -1,324 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module RPC
-    describe Stats do
-      before(:each) do
-        @expected = {:discoverytime => 0,
-                     :okcount => 0,
-                     :blocktime => 0,
-                     :failcount => 0,
-                     :noresponsefrom => [],
-                     :responses => 0,
-                     :totaltime => 0,
-                     :discovered => 0,
-                     :starttime => 1300031826.0,
-                     :requestid => nil,
-                     :aggregate_summary => [],
-                     :aggregate_failures => [],
-                     :discovered_nodes => []}
-
-        @stats = Stats.new
-      end
-
-      describe "#initialize" do
-        it "should reset stats on creation" do
-          Stats.any_instance.stubs(:reset).returns(true).once
-          s = Stats.new
-        end
-      end
-
-      describe "#reset" do
-        it "should initialize data correctly" do
-          Time.stubs(:now).returns(Time.at(1300031826))
-          s = Stats.new
-
-          @expected.keys.each do |k|
-            @expected[k].should == s.send(k)
-          end
-        end
-      end
-
-      describe "#to_hash" do
-        it "should return correct stats" do
-          Time.stubs(:now).returns(Time.at(1300031826))
-          s = Stats.new
-
-          s.to_hash.should == @expected
-        end
-      end
-
-      describe "#[]" do
-        it "should return stat values" do
-          Time.stubs(:now).returns(Time.at(1300031826))
-          s = Stats.new
-
-          @expected.keys.each do |k|
-            @expected[k].should == s[k]
-          end
-        end
-
-        it "should return nil for unknown values" do
-          @stats["foo"].should == nil
-        end
-      end
-
-      describe "#ok" do
-        it "should increment stats" do
-          @stats.ok
-          @stats[:okcount].should == 1
-        end
-      end
-
-      describe "#fail" do
-        it "should increment stats" do
-          @stats.fail
-          @stats.failcount.should == 1
-        end
-      end
-
-      describe "#time_discovery" do
-        it "should set start time correctly" do
-          Time.stubs(:now).returns(Time.at(1300031826))
-
-          @stats.time_discovery(:start)
-
-          @stats.instance_variable_get("@discovery_start").should == 1300031826.0
-        end
-
-        it "should record the difference correctly" do
-          Time.stubs(:now).returns(Time.at(1300031826))
-          @stats.time_discovery(:start)
-
-          Time.stubs(:now).returns(Time.at(1300031827))
-          @stats.time_discovery(:end)
-
-          @stats.discoverytime.should == 1.0
-        end
-
-        it "should handle unknown actions and set discovery time to 0" do
-          Time.stubs(:now).returns(Time.at(1300031826))
-          @stats.time_discovery(:start)
-
-          Time.stubs(:now).returns(Time.at(1300031827))
-          @stats.time_discovery(:stop)
-
-          @stats.discoverytime.should == 0
-        end
-
-      end
-
-      describe "#client_stats=" do
-        it "should store stats correctly" do
-          data = {}
-          keys = [:noresponsefrom, :responses, :starttime, :blocktime, :totaltime, :discoverytime]
-          keys.each {|k| data[k] = k}
-
-          @stats.client_stats = data
-
-          keys.each do |k|
-            @stats[k].should == data[k]
-          end
-        end
-
-        it "should not store discovery time if it was already stored" do
-          data = {}
-          keys = [:noresponsefrom, :responses, :starttime, :blocktime, :totaltime, :discoverytime]
-          keys.each {|k| data[k] = k}
-
-          Time.stubs(:now).returns(Time.at(1300031826))
-          @stats.time_discovery(:start)
-
-          Time.stubs(:now).returns(Time.at(1300031827))
-          @stats.time_discovery(:end)
-
-          dtime = @stats.discoverytime
-
-          @stats.client_stats = data
-
-          @stats.discoverytime.should == dtime
-        end
-      end
-
-      describe "#time_block_execution" do
-        it "should set start time correctly" do
-          Time.stubs(:now).returns(Time.at(1300031826))
-
-          @stats.time_block_execution(:start)
-
-          @stats.instance_variable_get("@block_start").should == 1300031826.0
-        end
-
-        it "should record the difference correctly" do
-          Time.stubs(:now).returns(Time.at(1300031826))
-          @stats.time_block_execution(:start)
-
-          Time.stubs(:now).returns(Time.at(1300031827))
-          @stats.time_block_execution(:end)
-
-          @stats.blocktime.should == 1
-        end
-
-        it "should handle unknown actions and set discovery time to 0" do
-          Time.stubs(:now).returns(Time.at(1300031826))
-          @stats.time_block_execution(:start)
-
-          Time.stubs(:now).returns(Time.at(1300031827))
-          @stats.time_block_execution(:stop)
-
-          @stats.blocktime.should == 0
-        end
-      end
-
-      describe "#discovered_agents" do
-        it "should set discovered_nodes" do
-          nodes = ["one", "two"]
-          @stats.discovered_agents(nodes)
-          @stats.discovered_nodes.should == nodes
-        end
-
-        it "should set discovered count" do
-          nodes = ["one", "two"]
-          @stats.discovered_agents(nodes)
-          @stats.discovered.should == 2
-        end
-      end
-
-      describe "#finish_request" do
-        it "should calculate totaltime correctly" do
-          Time.stubs(:now).returns(Time.at(1300031824))
-          @stats.time_discovery(:start)
-
-          Time.stubs(:now).returns(Time.at(1300031825))
-          @stats.time_discovery(:end)
-
-          Time.stubs(:now).returns(Time.at(1300031826))
-          @stats.time_block_execution(:start)
-
-          Time.stubs(:now).returns(Time.at(1300031827))
-          @stats.time_block_execution(:end)
-
-          @stats.discovered_agents(["one", "two", "three"])
-          @stats.node_responded("one")
-          @stats.node_responded("two")
-
-          @stats.finish_request
-
-          @stats.totaltime.should == 2
-        end
-
-        it "should calculate no responses correctly" do
-          Time.stubs(:now).returns(Time.at(1300031824))
-          @stats.time_discovery(:start)
-
-          Time.stubs(:now).returns(Time.at(1300031825))
-          @stats.time_discovery(:end)
-
-          Time.stubs(:now).returns(Time.at(1300031826))
-          @stats.time_block_execution(:start)
-
-          Time.stubs(:now).returns(Time.at(1300031827))
-          @stats.time_block_execution(:end)
-
-          @stats.discovered_agents(["one", "two", "three"])
-          @stats.node_responded("one")
-          @stats.node_responded("two")
-
-          @stats.finish_request
-
-          @stats.noresponsefrom.should == ["three"]
-        end
-
-        it "should recover from failure correctly" do
-          Time.stubs(:now).returns(Time.at(1300031824))
-          @stats.time_discovery(:start)
-
-          Time.stubs(:now).returns(Time.at(1300031825))
-          @stats.time_discovery(:end)
-
-          Time.stubs(:now).returns(Time.at(1300031826))
-          @stats.time_block_execution(:start)
-
-          Time.stubs(:now).returns(Time.at(1300031827))
-          @stats.time_block_execution(:end)
-
-          # cause the .each to raise an exception
-          @stats.instance_variable_set("@responsesfrom", nil)
-          @stats.finish_request
-
-          @stats.noresponsefrom.should == []
-          @stats.totaltime.should == 0
-        end
-      end
-
-      describe "#node_responded" do
-        it "should append to the list of nodes" do
-          @stats.node_responded "foo"
-          @stats.responsesfrom.should == ["foo"]
-        end
-
-        it "should create a new array if adding fails" do
-          # cause the << to fail
-          @stats.instance_variable_set("@responsesfrom", nil)
-
-          @stats.node_responded "foo"
-          @stats.responsesfrom.should == ["foo"]
-        end
-      end
-
-      describe "#no_response_report" do
-        it "should create an empty report if all nodes responded" do
-          @stats.discovered_agents ["foo"]
-          @stats.node_responded "foo"
-          @stats.finish_request
-
-          @stats.no_response_report.should == ""
-        end
-
-        it "should list all nodes that did not respond" do
-          @stats.discovered_agents ["foo", "bar"]
-          @stats.finish_request
-
-          @stats.no_response_report.should match(Regexp.new(/No response from.+bar\s+foo/m))
-        end
-      end
-
-      describe "#text_for_aggregates" do
-        let(:aggregate){mock()}
-
-        before :each do
-          aggregate.stubs(:result).returns({:output => "success"})
-          aggregate.stubs(:action).returns("action")
-        end
-
-        it "should create the correct output text for aggregate functions" do
-          @stats.aggregate_summary = [aggregate]
-          aggregate.stubs(:is_a?).returns(true)
-          @stats.text_for_aggregates.should =~ /Summary of.*/
-        end
-
-        it "should display an error message for a failed statup hook" do
-          @stats.aggregate_failures = [{:name => "rspec", :type => :startup}]
-          @stats.text_for_aggregates.should =~  /exception raised while processing startup hook/
-        end
-
-        it "should display an error message for an unspecified output" do
-          @stats.aggregate_failures = [{:name => "rspec", :type => :create}]
-          @stats.text_for_aggregates.should =~  /unspecified output 'rspec' for the action/
-        end
-
-        it "should display an error message for a failed process_result" do
-          @stats.aggregate_failures = [{:name => "rspec", :type => :process_result}]
-          @stats.text_for_aggregates.should =~  /exception raised while processing result data/
-        end
-
-        it "should display an error message for a failed summarize" do
-          @stats.aggregate_failures = [{:name => "rspec", :type => :summarize}]
-          @stats.text_for_aggregates.should =~  /exception raised while summarizing/
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/rpc_spec.rb b/spec/unit/rpc_spec.rb
deleted file mode 100755 (executable)
index 2ec96d2..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe RPC do
-    describe "#const_missing" do
-      it "should deprecate only the DDL class" do
-        Log.expects(:warn).with("MCollective::RPC::DDL is deprecatd, please use MCollective::DDL instead")
-        MCollective::RPC::DDL.should == MCollective::DDL
-
-        expect { MCollective::RPC::Foo }.to raise_error(NameError)
-      end
-    end
-  end
-end
diff --git a/spec/unit/runnerstats_spec.rb b/spec/unit/runnerstats_spec.rb
deleted file mode 100755 (executable)
index 1002d12..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe RunnerStats do
-    before do
-      Agents.stubs(:agentlist).returns("agents")
-      Time.stubs(:now).returns(Time.at(0))
-
-      @stats = RunnerStats.new
-
-      logger = mock
-      logger.stubs(:log)
-      logger.stubs(:start)
-      Log.configure(logger)
-    end
-
-    describe "#to_hash" do
-      it "should return the correct data" do
-        @stats.to_hash.keys.sort.should == [:stats, :threads, :pid, :times, :agents].sort
-
-        @stats.to_hash[:stats].should == {:validated => 0, :unvalidated => 0, :passed => 0, :filtered => 0,
-          :starttime => 0, :total => 0, :ttlexpired => 0, :replies => 0}
-
-        @stats.to_hash[:agents].should == "agents"
-      end
-    end
-
-    [[:ttlexpired, :ttlexpired], [:passed, :passed], [:filtered, :filtered],
-     [:validated, :validated], [:received, :total], [:sent, :replies]].each do |tst|
-      describe "##{tst.first}" do
-        it "should increment #{tst.first}" do
-          @stats.send(tst.first)
-          @stats.to_hash[:stats][tst.last].should == 1
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/security/base_spec.rb b/spec/unit/security/base_spec.rb
deleted file mode 100755 (executable)
index 9aaacf8..0000000
+++ /dev/null
@@ -1,278 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  module Security
-    describe Base do
-      before do
-        @config = mock("config")
-        @config.stubs(:identity).returns("test")
-        @config.stubs(:configured).returns(true)
-        @config.stubs(:topicsep).returns(".")
-
-        @stats = mock("stats")
-
-        @time = Time.now
-        ::Time.stubs(:now).returns(@time)
-
-        MCollective::Log.stubs(:debug).returns(true)
-
-        MCollective::PluginManager << {:type => "global_stats", :class => @stats}
-        MCollective::Config.stubs("instance").returns(@config)
-        MCollective::Util.stubs("empty_filter?").returns(false)
-
-        @plugin = Base.new
-      end
-
-      describe "#should_process_msg?" do
-        it "should correctly validate messages" do
-          m = mock
-          m.stubs(:expected_msgid).returns("rspec")
-
-          @plugin.should_process_msg?(m, "rspec").should == true
-
-          expect {
-            @plugin.should_process_msg?(m, "fail").should == true
-          }.to raise_error(MsgDoesNotMatchRequestID)
-        end
-
-        it "should not test messages without expected_msgid" do
-          m = mock
-          m.stubs(:expected_msgid).returns(nil)
-
-          @plugin.should_process_msg?(m, "rspec").should == true
-        end
-      end
-
-      describe "#validate_filter?" do
-        it "should pass on empty filter" do
-          MCollective::Util.stubs("empty_filter?").returns(true)
-
-          @stats.stubs(:passed).once
-          @stats.stubs(:filtered).never
-          @stats.stubs(:passed).never
-
-          MCollective::Log.expects(:debug).with("Message passed the filter checks").once
-
-          @plugin.validate_filter?({}).should == true
-        end
-
-        it "should pass for known classes" do
-          MCollective::Util.stubs("has_cf_class?").with("foo").returns(true)
-
-          @stats.stubs(:passed).once
-          @stats.stubs(:filtered).never
-
-          MCollective::Log.expects(:debug).with("Message passed the filter checks").once
-          MCollective::Log.expects(:debug).with("Passing based on configuration management class foo").once
-
-          @plugin.validate_filter?({"cf_class" => ["foo"]}).should == true
-        end
-
-        it "should fail for unknown classes" do
-          MCollective::Util.stubs("has_cf_class?").with("foo").returns(false)
-
-          @stats.stubs(:filtered).once
-          @stats.stubs(:passed).never
-
-          MCollective::Log.expects(:debug).with("Message failed the filter checks").once
-          MCollective::Log.expects(:debug).with("Failing based on configuration management class foo").once
-
-          @plugin.validate_filter?({"cf_class" => ["foo"]}).should == false
-        end
-
-        it "should pass for known agents" do
-          MCollective::Util.stubs("has_agent?").with("foo").returns(true)
-
-          @stats.stubs(:passed).once
-          @stats.stubs(:filtered).never
-
-          MCollective::Log.expects(:debug).with("Message passed the filter checks").once
-          MCollective::Log.expects(:debug).with("Passing based on agent foo").once
-
-          @plugin.validate_filter?({"agent" => ["foo"]}).should == true
-        end
-
-        it "should fail for unknown agents" do
-          MCollective::Util.stubs("has_agent?").with("foo").returns(false)
-
-          @stats.stubs(:filtered).once
-          @stats.stubs(:passed).never
-
-          MCollective::Log.expects(:debug).with("Message failed the filter checks").once
-          MCollective::Log.expects(:debug).with("Failing based on agent foo").once
-
-          @plugin.validate_filter?({"agent" => ["foo"]}).should == false
-        end
-
-        it "should pass for known facts" do
-          MCollective::Util.stubs("has_fact?").with("fact", "value", "operator").returns(true)
-
-          @stats.stubs(:passed).once
-          @stats.stubs(:filtered).never
-
-          MCollective::Log.expects(:debug).with("Message passed the filter checks").once
-          MCollective::Log.expects(:debug).with("Passing based on fact fact operator value").once
-
-          @plugin.validate_filter?({"fact" => [{:fact => "fact", :operator => "operator", :value => "value"}]}).should == true
-        end
-
-        it "should fail for unknown facts" do
-          MCollective::Util.stubs("has_fact?").with("fact", "value", "operator").returns(false)
-
-          @stats.stubs(:filtered).once
-          @stats.stubs(:passed).never
-
-          MCollective::Log.expects(:debug).with("Message failed the filter checks").once
-          MCollective::Log.expects(:debug).with("Failing based on fact fact operator value").once
-
-          @plugin.validate_filter?({"fact" => [{:fact => "fact", :operator => "operator", :value => "value"}]}).should == false
-        end
-
-        it "should pass for known identity" do
-          MCollective::Util.stubs("has_identity?").with("test").returns(true)
-
-          @stats.stubs(:passed).once
-          @stats.stubs(:filtered).never
-
-          MCollective::Log.expects(:debug).with("Message passed the filter checks").once
-          MCollective::Log.expects(:debug).with("Passing based on identity").once
-
-          @plugin.validate_filter?({"identity" => ["test"]}).should == true
-        end
-
-        it "should fail for known identity" do
-          MCollective::Util.stubs("has_identity?").with("test").returns(false)
-
-          @stats.stubs(:passed).never
-          @stats.stubs(:filtered).once
-
-          MCollective::Log.expects(:debug).with("Message failed the filter checks").once
-          MCollective::Log.expects(:debug).with("Failed based on identity").once
-
-          @plugin.validate_filter?({"identity" => ["test"]}).should == false
-        end
-
-        it "should treat multiple identity filters correctly" do
-          MCollective::Util.stubs("has_identity?").with("foo").returns(false)
-          MCollective::Util.stubs("has_identity?").with("bar").returns(true)
-
-          @stats.stubs(:passed).once
-          @stats.stubs(:filtered).never
-
-          MCollective::Log.expects(:debug).with("Message passed the filter checks").once
-          MCollective::Log.expects(:debug).with("Passing based on identity").once
-
-          @plugin.validate_filter?({"identity" => ["foo", "bar"]}).should == true
-        end
-
-        it "should fail if no identity matches are found" do
-          MCollective::Util.stubs("has_identity?").with("foo").returns(false)
-          MCollective::Util.stubs("has_identity?").with("bar").returns(false)
-
-          @stats.stubs(:passed).never
-          @stats.stubs(:filtered).once
-
-          MCollective::Log.expects(:debug).with("Message failed the filter checks").once
-          MCollective::Log.expects(:debug).with("Failed based on identity").once
-
-          @plugin.validate_filter?({"identity" => ["foo", "bar"]}).should == false
-        end
-      end
-
-      describe "#create_reply" do
-        it "should return correct data" do
-          expected = {:senderid => "test",
-            :requestid => "reqid",
-            :senderagent => "agent",
-            :msgtime => @time.to_i,
-            :body => "body"}
-
-          @plugin.create_reply("reqid", "agent", "body").should == expected
-        end
-      end
-
-      describe "#create_request" do
-        it "should return correct data" do
-          expected = {:body => "body",
-            :senderid => "test",
-            :requestid => "reqid",
-            :callerid => "uid=#{Process.uid}",
-            :agent => "discovery",
-            :collective => "mcollective",
-            :filter => "filter",
-            :ttl => 20,
-            :msgtime => @time.to_i}
-
-          @plugin.create_request("reqid", "filter", "body", :server, "discovery", "mcollective", 20).should == expected
-        end
-
-        it "should set the callerid when appropriate" do
-          expected = {:body => "body",
-            :senderid => "test",
-            :requestid => "reqid",
-            :agent => "discovery",
-            :collective => "mcollective",
-            :filter => "filter",
-            :callerid => "callerid",
-            :ttl => 60,
-            :msgtime => @time.to_i}
-
-          @plugin.stubs(:callerid).returns("callerid")
-          @plugin.create_request("reqid", "filter", "body", :client, "discovery", "mcollective").should == expected
-        end
-      end
-
-      describe "#valid_callerid?" do
-        it "should not pass invalid callerids" do
-          @plugin.valid_callerid?("foo-bar").should == false
-          @plugin.valid_callerid?("foo=bar=baz").should == false
-          @plugin.valid_callerid?('foo=bar\baz').should == false
-          @plugin.valid_callerid?("foo=bar/baz").should == false
-          @plugin.valid_callerid?("foo=bar|baz").should == false
-        end
-
-        it "should pass valid callerids" do
-          @plugin.valid_callerid?("cert=foo-bar").should == true
-          @plugin.valid_callerid?("uid=foo.bar").should == true
-          @plugin.valid_callerid?("uid=foo.bar.123").should == true
-        end
-      end
-
-      describe "#callerid" do
-        it "should return a unix UID based callerid" do
-          @plugin.callerid.should == "uid=#{Process.uid}"
-        end
-      end
-
-      describe "#validrequest?" do
-        it "should log an error when not implemented" do
-          MCollective::Log.expects(:error).with("validrequest? is not implemented in MCollective::Security::Base")
-          @plugin.validrequest?(nil)
-        end
-      end
-
-      describe "#encoderequest" do
-        it "should log an error when not implemented" do
-          MCollective::Log.expects(:error).with("encoderequest is not implemented in MCollective::Security::Base")
-          @plugin.encoderequest(nil, nil, nil)
-        end
-      end
-
-      describe "#encodereply" do
-        it "should log an error when not implemented" do
-          MCollective::Log.expects(:error).with("encodereply is not implemented in MCollective::Security::Base")
-          @plugin.encodereply(nil, nil, nil)
-        end
-      end
-
-      describe "#decodemsg" do
-        it "should log an error when not implemented" do
-          MCollective::Log.expects(:error).with("decodemsg is not implemented in MCollective::Security::Base")
-          @plugin.decodemsg(nil)
-        end
-      end
-    end
-  end
-end
diff --git a/spec/unit/shell_spec.rb b/spec/unit/shell_spec.rb
deleted file mode 100755 (executable)
index 556cbc7..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe Shell do
-    describe "#initialize" do
-      it "should set locale by default" do
-        s = Shell.new("date")
-        s.environment.should == {"LC_ALL" => "C"}
-      end
-
-      it "should merge environment and keep locale" do
-        s = Shell.new("date", :environment => {"foo" => "bar"})
-        s.environment.should == {"LC_ALL" => "C", "foo" => "bar"}
-      end
-
-      it "should allow locale to be overridden" do
-        s = Shell.new("date", :environment => {"LC_ALL" => "TEST", "foo" => "bar"})
-        s.environment.should == {"LC_ALL" => "TEST", "foo" => "bar"}
-      end
-
-      it "should set no environment when given nil" do
-        s = Shell.new("date", :environment => nil)
-        s.environment.should == {}
-      end
-
-      it "should save the command" do
-        s = Shell.new("date")
-        s.command.should == "date"
-      end
-
-      it "should check the cwd exist" do
-        expect {
-          s = Shell.new("date", :cwd => "/nonexistant")
-        }.to raise_error("Directory /nonexistant does not exist")
-      end
-
-      it "should warn of illegal stdin" do
-        expect {
-          s = Shell.new("date", :stdin => nil)
-        }.to raise_error("stdin should be a String")
-      end
-
-      it "should warn of illegal stdout" do
-        expect {
-          s = Shell.new("date", :stdout => nil)
-        }.to raise_error("stdout should support <<")
-      end
-
-      it "should warn of illegal stderr" do
-        expect {
-          s = Shell.new("date", :stderr => nil)
-        }.to raise_error("stderr should support <<")
-      end
-
-      it "should set stdout" do
-        s = Shell.new("date", :stdout => "stdout")
-        s.stdout.should == "stdout"
-      end
-
-      it "should set stderr" do
-        s = Shell.new("date", :stderr => "stderr")
-        s.stderr.should == "stderr"
-      end
-
-      it "should set stdin" do
-        s = Shell.new("date", :stdin => "hello world")
-        s.stdin.should == "hello world"
-      end
-    end
-
-    describe "#runcommand" do
-      it "should run the command" do
-        Shell.any_instance.stubs("systemu").returns(true).once.with("date", "stdout" => '', "stderr" => '', "env" => {"LC_ALL" => "C"}, 'cwd' => Dir.tmpdir)
-        s = Shell.new("date")
-        s.runcommand
-      end
-
-      it "should set stdin, stdout and status" do
-        s = Shell.new('ruby -e "STDERR.puts \"stderr\"; STDOUT.puts \"stdout\""')
-        s.runcommand
-        s.stdout.should == "stdout\n"
-        s.stderr.should == "stderr\n"
-        s.status.exitstatus.should == 0
-      end
-
-      it "should report correct exitcode" do
-        s = Shell.new('ruby -e "exit 1"')
-        s.runcommand
-
-        s.status.exitstatus.should == 1
-      end
-
-      it "shold have correct environment" do
-        s = Shell.new('ruby -e "puts ENV[\'LC_ALL\'];puts ENV[\'foo\'];"', :environment => {"foo" => "bar"})
-        s.runcommand
-        s.stdout.should == "C\nbar\n"
-      end
-
-      it "should save stdout in custom stdout variable" do
-        out = "STDOUT"
-
-        s = Shell.new('echo foo', :stdout => out)
-        s.runcommand
-
-        s.stdout.should == "STDOUTfoo\n"
-        out.should == "STDOUTfoo\n"
-      end
-
-      it "should save stderr in custom stderr variable" do
-        out = "STDERR"
-
-        s = Shell.new('ruby -e "STDERR.puts \"foo\""', :stderr => out)
-        s.runcommand
-
-        s.stderr.should == "STDERRfoo\n"
-        out.should == "STDERRfoo\n"
-      end
-
-      it "should run in the correct cwd" do
-        s = Shell.new('ruby -e "puts Dir.pwd"', :cwd => Dir.tmpdir)
-
-        s.runcommand
-
-        s.stdout.should == "#{Dir.tmpdir}\n"
-      end
-
-      it "should send the stdin" do
-        s = Shell.new('ruby -e "puts STDIN.gets"', :stdin => "hello world")
-        s.runcommand
-
-        s.stdout.should == "hello world\n"
-      end
-
-      it "should support multiple lines of stdin" do
-        s = Shell.new('ruby -e "puts STDIN.gets;puts;puts STDIN.gets"', :stdin => "first line\n2nd line")
-        s.runcommand
-
-        s.stdout.should == "first line\n\n2nd line\n"
-      end
-    end
-  end
-end
diff --git a/spec/unit/ssl_spec.rb b/spec/unit/ssl_spec.rb
deleted file mode 100755 (executable)
index 3657af3..0000000
+++ /dev/null
@@ -1,262 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe SSL do
-    before do
-      @rootdir = File.dirname(__FILE__)
-      @ssl = SSL.new("#{@rootdir}/../fixtures/test-public.pem", "#{@rootdir}/../fixtures/test-private.pem")
-    end
-
-    it "should be able to decode base64 text it encoded" do
-      @ssl.base64_decode(@ssl.base64_encode("foo")).should == "foo"
-    end
-
-    it "should decrypt what it encrypted with RSA" do
-      crypted = @ssl.aes_encrypt("foo")
-      decrypted = @ssl.aes_decrypt(crypted[:key], crypted[:data])
-
-      decrypted.should == "foo"
-    end
-
-    it "should be able to decrypt using RSA private key what it encrypted with RSA public key" do
-      crypted = @ssl.rsa_encrypt_with_public("foo")
-      decrypted = @ssl.rsa_decrypt_with_private(crypted)
-
-      decrypted.should == "foo"
-    end
-
-    it "should be able to decrypt using RSA public key what it encrypted with RSA private key" do
-      crypted = @ssl.rsa_encrypt_with_private("foo")
-      decrypted = @ssl.rsa_decrypt_with_public(crypted)
-
-      decrypted.should == "foo"
-    end
-
-    it "using a helper it should be able to decrypt with private key what it encrypted using the public key" do
-      @ssl.decrypt_with_private(@ssl.encrypt_with_public("foo")).should == "foo"
-      @ssl.decrypt_with_private(@ssl.encrypt_with_public("foo", false), false).should == "foo"
-    end
-
-    it "using a helper it should be able to decrypt with public key what it encrypted using the private key" do
-      @ssl.decrypt_with_public(@ssl.encrypt_with_private("foo")).should == "foo"
-      @ssl.decrypt_with_public(@ssl.encrypt_with_private("foo", false), false).should == "foo"
-    end
-
-    describe "#initialize" do
-      it "should default to aes-256-cbc" do
-        @ssl.ssl_cipher.should == "aes-256-cbc"
-      end
-
-      it "should take the configured value when present" do
-        Config.instance.stubs("ssl_cipher").returns("aes-128-cbc")
-        @ssl = SSL.new("#{@rootdir}/../fixtures/test-public.pem", "#{@rootdir}/../fixtures/test-private.pem")
-
-        @ssl.ssl_cipher.should == "aes-128-cbc"
-      end
-
-      it "should set the supplied ssl cipher" do
-        @ssl = SSL.new("#{@rootdir}/../fixtures/test-public.pem", "#{@rootdir}/../fixtures/test-private.pem", nil, "aes-128-cbc")
-        @ssl.ssl_cipher.should == "aes-128-cbc"
-      end
-
-      it "should prefer the supplied cipher over configured cipher" do
-        Config.instance.stubs("aes_key_size").returns("foo-foo-foo")
-        @ssl = SSL.new("#{@rootdir}/../fixtures/test-public.pem", "#{@rootdir}/../fixtures/test-private.pem", nil, "aes-128-cbc")
-
-        @ssl.ssl_cipher.should == "aes-128-cbc"
-      end
-
-      it "should fail on invalid ciphers" do
-        expect {
-          @ssl = SSL.new("#{@rootdir}/../fixtures/test-public.pem", "#{@rootdir}/../fixtures/test-private.pem", nil, "foo-foo-foo")
-        }.to raise_error("The supplied cipher 'foo-foo-foo' is not supported")
-      end
-    end
-
-    describe "#read_key" do
-      it "should fail on non exiting files" do
-        expect {
-          @ssl.read_key(:public, "/nonexisting")
-        }.to raise_error("Could not find key /nonexisting")
-      end
-
-      it "should fail on existing, empty files" do
-        File.expects(:exist?).with('key').returns(true)
-        File.expects(:zero?).with('key').returns(true)
-        expect{
-          @ssl.read_key(:public, 'key')
-        }.to raise_error("public key file 'key' is empty")
-      end
-
-      it "should fail on unknown key types" do
-        expect {
-          @ssl.read_key(:unknown, @ssl.public_key_file)
-        }.to raise_error("Can only load :public or :private keys")
-      end
-
-      it "should read a public key" do
-        @ssl.read_key(:public, "#{@rootdir}/../fixtures/test-public.pem")
-      end
-
-      it "should read the public key from a certificate" do
-        @ssl.read_key(:public, "#{@rootdir}/../fixtures/test-cert.pem").to_s.should match(/.+BEGIN.+PUBLIC KEY.+END.+PUBLIC KEY.+/m)
-      end
-
-      it "should return nil if no key was given" do
-        @ssl.read_key(:public).should == nil
-      end
-
-      it "should return nil if nil key was given" do
-        @ssl.read_key(:public, nil).should == nil
-      end
-
-      it "should clear the OpenSSL error queue on ruby 1.8" do
-        Util.expects(:ruby_version).returns("1.8.7")
-        OpenSSL.expects(:errors)
-        @ssl.read_key(:public, "#{@rootdir}/../fixtures/test-public.pem")
-        @ssl.read_key(:private, "#{@rootdir}/../fixtures/test-private.pem")
-      end
-
-      it "should not clear the OpenSSL error queue on ruby > 1.8" do
-        Util.expects(:ruby_version).returns("1.9.3")
-        OpenSSL.expects(:errors).never
-        @ssl.read_key(:public, "#{@rootdir}/../fixtures/test-public.pem")
-        @ssl.read_key(:private, "#{@rootdir}/../fixtures/test-private.pem")
-      end
-    end
-
-    describe "#base64_encode" do
-      it "should correctly encode" do
-        @ssl.base64_encode("foo").should == "Zm9v\n"
-        SSL.base64_encode("foo").should == "Zm9v\n"
-      end
-    end
-
-    describe "#base64_decode" do
-      it "should correctly decode" do
-        @ssl.base64_decode("Zm9v").should == "foo"
-        SSL.base64_decode("Zm9v").should == "foo"
-      end
-    end
-
-    describe "#aes_encrypt" do
-      it "should create a key and data" do
-        crypted = @ssl.aes_encrypt("foo")
-
-        crypted.include?(:key).should == true
-        crypted.include?(:data).should == true
-      end
-    end
-
-    describe "#aes_decrypt" do
-      it "should decrypt correctly given key and data" do
-        key = @ssl.base64_decode("rAaCyW6qB0XqZNa9hji0qHwrI3P47t8diLNXoemW9ss=")
-        data = @ssl.base64_decode("mSthvO/wSl0ArNOcgysTVw==")
-
-        @ssl.aes_decrypt(key, data).should == "foo"
-      end
-
-      it "should decrypt correctly given key, data and cipher" do
-        key = @ssl.base64_decode("VEma3a/R7fjw2M4d0NIctA==")
-        data = @ssl.base64_decode("FkH6qLvKTn7a+uNPe8ciHA==")
-
-        # the default aes-256-cbc should fail here, the key above is 128 bit
-        # the exception classes changed mid-1.9.2 :(
-        if OpenSSL.constants.include?("CipherError")
-          expect { @ssl.aes_decrypt(key, data) }.to raise_error(OpenSSL::CipherError)
-        else
-          expect { @ssl.aes_decrypt(key, data) }.to raise_error(OpenSSL::Cipher::CipherError)
-        end
-
-        # new ssl instance configured for aes-128-cbc, should work
-        @ssl = SSL.new("#{@rootdir}/../fixtures/test-public.pem", "#{@rootdir}/../fixtures/test-private.pem", nil, "aes-128-cbc")
-        @ssl.aes_decrypt(key, data).should == "foo"
-      end
-    end
-
-    describe "#md5" do
-      it "should produce correct md5 sums" do
-        # echo -n 'hello world'|md5sum
-        @ssl.md5("hello world").should == "5eb63bbbe01eeed093cb22bb8f5acdc3"
-      end
-    end
-    describe "#sign" do
-      it "should sign the message without base64 by default" do
-        SSL.md5(@ssl.sign("hello world")).should == "8269b23f55945aaa82efbff857c845a6"
-      end
-
-      it "should support base64 encoding messages" do
-        SSL.md5(@ssl.sign("hello world", true)).should == "8a4eb3c3d44d22c46dc36a7e441d8db0"
-      end
-    end
-
-    describe "#verify_signature" do
-      it "should correctly verify a message signed using the same keypair" do
-        @ssl.verify_signature(@ssl.sign("hello world"), "hello world").should == true
-        @ssl.verify_signature(@ssl.sign("hello world", true), "hello world", true).should == true
-      end
-
-      it "should fail to verify messages not signed by the key" do
-        @ssl.verify_signature("evil fake signature", "hello world").should == false
-      end
-    end
-
-    describe "#decrypt_with_public" do
-      it "should decrypt correctly given key and data in base64 format" do
-        crypted = {:key=> "YaRcSDdcKgnRZ4Eu2eirl/+lzDgVkPZ41kXAQQNOi+6AfjdbbOW7Zblibx9r\n3TzZAi0ulA94gqNAXPvPC8LaO8W9TtJwlto/RHwDM7ZdfqEImSYoVACFNq28\n+0MLr3K3hIBsB1pyxgFTQul+MrCq+3Fik7Nj7ZKkJUT2veyqbg8=",
-          :data=>"TLVw1EYeOaGDmEC/R2I/cA=="}
-
-        @ssl.decrypt_with_public(crypted).should == "foo"
-      end
-    end
-
-    describe "#decrypt_with_private" do
-      it "should decrypt correctly given key and data in base64 format" do
-        crypted = {:key=> "kO1kUgJBiEBdoajN4OHp9BOie6dCznf1YKbBnp3LOyBxcDDQtjxEBlPmjQve\npXrQJ5xpLX6oNBxzU18Pf2SKYUZSbzIkDUb97GQY0WoBQsdM2OwPXH+HtF2A\no5N8iIx9srPAEAFa6hZAdqvcmRT/SzhP1kH+Gyy8fyvW8HGBjNY=",
-          :data=>"gDTaHCmes/Yua4jtjmgukQ=="}
-
-        @ssl.decrypt_with_private(crypted).should == "foo"
-      end
-    end
-
-    describe "#decrypt_with_private" do
-      it "should fail if not given a key" do
-        expect {
-          @ssl.decrypt_with_private({:iv => "x", :data => "x"})
-        }.to raise_error("Crypted data should include a key")
-      end
-
-      it "should fail if not given data" do
-        expect {
-          @ssl.decrypt_with_private({:iv => "x", :key => "x"})
-        }.to raise_error("Crypted data should include data")
-      end
-    end
-
-    describe "#decrypt_with_public" do
-      it "should fail if not given a key" do
-        expect {
-          @ssl.decrypt_with_public({:iv => "x", :data => "x"})
-        }.to raise_error("Crypted data should include a key")
-      end
-
-      it "should fail if not given data" do
-        expect {
-          @ssl.decrypt_with_public({:iv => "x", :key => "x"})
-        }.to raise_error("Crypted data should include data")
-      end
-    end
-
-    describe "#uuid" do
-      it "should produce repeatable uuids" do
-        SSL.uuid("hello world").should == SSL.uuid("hello world")
-      end
-
-      it "should not always produce the same uuid" do
-        SSL.uuid.should_not == SSL.uuid
-      end
-    end
-  end
-end
diff --git a/spec/unit/string_spec.rb b/spec/unit/string_spec.rb
deleted file mode 100755 (executable)
index fce7ef6..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-class String
-  describe "#start_with?" do
-    it "should return true for matches" do
-      "hello world".start_with?("hello").should == true
-    end
-
-    it "should return false for non matches" do
-      "hello world".start_with?("world").should == false
-    end
-  end
-end
diff --git a/spec/unit/symbol_spec.rb b/spec/unit/symbol_spec.rb
deleted file mode 100755 (executable)
index ae600fe..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-class Symbol
-  describe "#<=>" do
-    it "should be sortable" do
-      [:foo, :bar].sort.should == [:bar, :foo]
-    end
-  end
-end
diff --git a/spec/unit/unix_daemon_spec.rb b/spec/unit/unix_daemon_spec.rb
deleted file mode 100755 (executable)
index 57bb9a3..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-require 'mcollective/unix_daemon'
-
-module MCollective
-  describe UnixDaemon do
-    describe "#daemonize_runner" do
-      it "should not run on the windows platform" do
-        Util.expects("windows?").returns(true)
-        expect { UnixDaemon.daemonize_runner }.to raise_error("The Unix Daemonizer can not be used on the Windows Platform")
-      end
-
-      it "should write the pid file if requested" do
-        f = mock
-        f.expects(:write).with(Process.pid)
-
-        File.expects(:open).with("/nonexisting", "w").yields(f)
-
-        r = mock
-        r.expects(:run)
-
-        Runner.expects(:new).returns(r)
-        UnixDaemon.expects(:daemonize).yields
-
-        UnixDaemon.daemonize_runner("/nonexisting")
-      end
-
-      it "should not write a pid file unless requested" do
-        r = mock
-        r.expects(:run)
-
-        UnixDaemon.expects(:daemonize).yields
-        Runner.expects(:new).returns(r)
-        File.expects(:open).never
-
-        UnixDaemon.daemonize_runner(nil)
-      end
-    end
-  end
-end
diff --git a/spec/unit/util_spec.rb b/spec/unit/util_spec.rb
deleted file mode 100755 (executable)
index a5f6087..0000000
+++ /dev/null
@@ -1,494 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe Util do
-    before do
-      class MCollective::Connector::Stomp<MCollective::Connector::Base; end
-
-      PluginManager.clear
-      PluginManager << {:type => "connector_plugin", :class => MCollective::Connector::Stomp.new}
-    end
-
-    describe "#t" do
-      it "should correctly translate the message" do
-        I18n.expects(:t).with("PLMC1.pattern", {:rspec => "test"})
-        I18n.expects(:t).with("PLMC1.expanded", {:rspec => "test"})
-        Util.t(:PLMC1, :rspec => "test")
-        Util.t("PLMC1.expanded", :rspec => "test")
-      end
-    end
-
-    describe "#windows?" do
-      it "should correctly detect windows on unix platforms" do
-        RbConfig::CONFIG.expects("[]").returns("linux")
-        Util.windows?.should == false
-      end
-
-      it "should correctly detect windows on windows platforms" do
-        RbConfig::CONFIG.expects("[]").returns("win32")
-        Util.windows?.should == true
-      end
-    end
-
-    describe "#setup_windows_sleeper" do
-      it "should set up a thread on the windows platform" do
-        Thread.expects(:new)
-        Util.expects("windows?").returns(true).once
-        Util.setup_windows_sleeper
-      end
-
-      it "should not set up a thread on other platforms" do
-        Thread.expects(:new).never
-        Util.expects("windows?").returns(false).once
-        Util.setup_windows_sleeper
-      end
-    end
-
-    describe "#has_cf_class?" do
-      before do
-        logger = mock
-        logger.stubs(:log)
-        logger.stubs(:start)
-        Log.configure(logger)
-
-        config = mock
-        config.stubs(:classesfile).returns("/some/file")
-        Config.expects(:instance).returns(config)
-      end
-
-      it "should read the classes lines from the correct file" do
-        File.expects(:readlines).with("/some/file")
-
-        Util.has_cf_class?("test")
-      end
-
-      it "should support regular expression searches" do
-        File.stubs(:readlines).returns(["test_class_test"])
-        String.any_instance.expects(:match).with("^/").returns(true)
-        String.any_instance.expects(:match).with(Regexp.new("class")).returns(true)
-
-        Util.has_cf_class?("/class/").should == true
-      end
-
-      it "should support exact string matches" do
-        File.stubs(:readlines).returns(["test_class_test"])
-        String.any_instance.expects(:match).with("^/").returns(false)
-        String.any_instance.expects(:match).with(Regexp.new("test_class_test")).never
-
-        Util.has_cf_class?("test_class_test").should == true
-      end
-
-      it "should report a warning when the classes file cannot be parsed" do
-        File.stubs(:readlines).returns(nil)
-        Log.expects(:warn).with("Parsing classes file '/some/file' failed: NoMethodError: undefined method `each' for nil:NilClass")
-
-        Util.has_cf_class?("test_class_test").should == false
-      end
-    end
-
-    describe "#shellescape" do
-      it "should return '' for empty strings" do
-        Util.shellescape("").should == "''"
-      end
-
-      it "should quote newlines" do
-        Util.shellescape("\n").should == "'\n'"
-      end
-
-      it "should escape unwanted characters" do
-        Util.shellescape("foo;bar").should == 'foo\;bar'
-        Util.shellescape('foo`bar').should == 'foo\`bar'
-        Util.shellescape('foo$bar').should == 'foo\$bar'
-        Util.shellescape('foo|bar').should == 'foo\|bar'
-        Util.shellescape('foo&&bar').should == 'foo\&\&bar'
-        Util.shellescape('foo||bar').should == 'foo\|\|bar'
-        Util.shellescape('foo>bar').should == 'foo\>bar'
-        Util.shellescape('foo<bar').should == 'foo\<bar'
-        Util.shellescape('foobar').should == 'foobar'
-      end
-    end
-
-    describe "#make_subscription" do
-      it "should validate target types" do
-        expect {
-          Util.make_subscriptions("test", "test", "test")
-        }.to raise_error("Unknown target type test")
-
-        Config.instance.stubs(:collectives).returns(["test"])
-        Util.make_subscriptions("test", :broadcast, "test")
-      end
-
-      it "should return a subscription for each collective" do
-        Config.instance.stubs(:collectives).returns(["collective1", "collective2"])
-        Util.make_subscriptions("test", :broadcast).should == [{:type=>:broadcast,
-                                                                 :agent=>"test",
-                                                                 :collective=>"collective1"},
-                                                               {:type=>:broadcast,
-                                                                 :agent=>"test",
-                                                                 :collective=>"collective2"}]
-      end
-
-      it "should validate given collective" do
-        Config.instance.stubs(:collectives).returns(["collective1", "collective2"])
-
-        expect {
-          Util.make_subscriptions("test", :broadcast, "test")
-        }.to raise_error("Unknown collective 'test' known collectives are 'collective1, collective2'")
-      end
-
-      it "should return a single subscription array given a collective" do
-        Config.instance.stubs(:collectives).returns(["collective1", "collective2"])
-        Util.make_subscriptions("test", :broadcast, "collective1").should == [{:type=>:broadcast, :agent=>"test", :collective=>"collective1"}]
-      end
-    end
-
-    describe "#subscribe" do
-      it "should subscribe to multiple topics given an Array" do
-        subs1 = {:agent => "test_agent", :type => "test_type", :collective => "test_collective"}
-        subs2 = {:agent => "test_agent2", :type => "test_type2", :collective => "test_collective2"}
-
-        MCollective::Connector::Stomp.any_instance.expects(:subscribe).with("test_agent", "test_type", "test_collective").once
-        MCollective::Connector::Stomp.any_instance.expects(:subscribe).with("test_agent2", "test_type2", "test_collective2").once
-
-        Util.subscribe([subs1, subs2])
-      end
-
-      it "should subscribe to a single topic given a hash" do
-        MCollective::Connector::Stomp.any_instance.expects(:subscribe).with("test_agent", "test_type", "test_collective").once
-        Util.subscribe({:agent => "test_agent", :type => "test_type", :collective => "test_collective"})
-      end
-    end
-
-    describe "#unsubscribe" do
-      it "should unsubscribe to multiple topics given an Array" do
-        subs1 = {:agent => "test_agent", :type => "test_type", :collective => "test_collective"}
-        subs2 = {:agent => "test_agent2", :type => "test_type2", :collective => "test_collective2"}
-        MCollective::Connector::Stomp.any_instance.expects(:unsubscribe).with("test_agent", "test_type", "test_collective").once
-        MCollective::Connector::Stomp.any_instance.expects(:unsubscribe).with("test_agent2", "test_type2", "test_collective2").once
-
-        Util.unsubscribe([subs1, subs2])
-      end
-
-      it "should subscribe to a single topic given a hash" do
-        MCollective::Connector::Stomp.any_instance.expects(:unsubscribe).with("test_agent", "test_type", "test_collective").once
-        Util.unsubscribe({:agent => "test_agent", :type => "test_type", :collective => "test_collective"})
-      end
-    end
-
-    describe "#empty_filter?" do
-      it "should correctly compare empty filters" do
-        Util.empty_filter?(Util.empty_filter).should == true
-      end
-
-      it "should treat an empty hash as an empty filter" do
-        Util.empty_filter?({}).should == true
-      end
-
-      it "should detect non empty filters correctly" do
-        filter = Util.empty_filter
-        filter["cf_class"] << "meh"
-
-
-        Util.empty_filter?(filter).should == false
-      end
-    end
-
-    describe "#empty_filter" do
-      it "should create correct empty filters" do
-        Util.empty_filter.should == {"fact" => [], "cf_class" => [], "agent" => [], "identity" => [], "compound" => []}
-      end
-    end
-
-    describe "#default_options" do
-      it "should supply correct default options" do
-        Config.instance.stubs(:default_discovery_options).returns([])
-        empty_filter = Util.empty_filter
-        config_file = Util.config_file_for_user
-
-        Util.default_options.should == {:verbose => false, :disctimeout => nil, :timeout => 5, :config => config_file, :filter => empty_filter, :collective => nil, :discovery_method => nil, :discovery_options => []}
-      end
-    end
-
-    describe "#has_fact?" do
-      it "should handle missing facts correctly" do
-        MCollective::Facts.expects("[]").with("foo").returns(nil).once
-        Util.has_fact?("foo", "1", "==").should == false
-      end
-
-      it "should handle regex in a backward compatible way" do
-        MCollective::Facts.expects("[]").with("foo").returns("foo").times(6)
-        Util.has_fact?("foo", "foo", "=~").should == true
-        Util.has_fact?("foo", "/foo/", "=~").should == true
-        Util.has_fact?("foo", "foo", "=~").should == true
-        Util.has_fact?("foo", "bar", "=~").should == false
-        Util.has_fact?("foo", "/bar/", "=~").should == false
-        Util.has_fact?("foo", "bar", "=~").should == false
-      end
-
-      it "should evaluate equality" do
-        MCollective::Facts.expects("[]").with("foo").returns("foo").twice
-        Util.has_fact?("foo", "foo", "==").should == true
-        Util.has_fact?("foo", "bar", "==").should == false
-      end
-
-      it "should handle numeric comparisons correctly" do
-        MCollective::Facts.expects("[]").with("foo").returns("1").times(8)
-        Util.has_fact?("foo", "2", ">=").should == false
-        Util.has_fact?("foo", "1", ">=").should == true
-        Util.has_fact?("foo", "2", "<=").should == true
-        Util.has_fact?("foo", "1", "<=").should == true
-        Util.has_fact?("foo", "1", "<").should == false
-        Util.has_fact?("foo", "1", ">").should == false
-        Util.has_fact?("foo", "1", "!=").should == false
-        Util.has_fact?("foo", "2", "!=").should == true
-      end
-
-      it "should handle alphabetic comparisons correctly" do
-        MCollective::Facts.expects("[]").with("foo").returns("b").times(8)
-        Util.has_fact?("foo", "c", ">=").should == false
-        Util.has_fact?("foo", "a", ">=").should == true
-        Util.has_fact?("foo", "a", "<=").should == false
-        Util.has_fact?("foo", "b", "<=").should == true
-        Util.has_fact?("foo", "b", "<").should == false
-        Util.has_fact?("foo", "b", ">").should == false
-        Util.has_fact?("foo", "b", "!=").should == false
-        Util.has_fact?("foo", "a", "!=").should == true
-      end
-    end
-
-    describe "#parse_fact_string" do
-      it "should parse old style regex fact matches" do
-        Util.parse_fact_string("foo=/bar/").should == {:fact => "foo", :value => "/bar/", :operator => "=~"}
-        Util.parse_fact_string("foo = /bar/").should == {:fact => "foo", :value => "/bar/", :operator => "=~"}
-      end
-
-      it "should parse old style equality" do
-        Util.parse_fact_string("foo=bar").should == {:fact => "foo", :value => "bar", :operator => "=="}
-        Util.parse_fact_string("foo = bar").should == {:fact => "foo", :value => "bar", :operator => "=="}
-      end
-
-      it "should parse regex fact matches" do
-        Util.parse_fact_string("foo=~bar").should == {:fact => "foo", :value => "bar", :operator => "=~"}
-        Util.parse_fact_string("foo =~ bar").should == {:fact => "foo", :value => "bar", :operator => "=~"}
-      end
-
-      it "should treat => like >=" do
-        Util.parse_fact_string("foo=>bar").should == {:fact => "foo", :value => "bar", :operator => ">="}
-        Util.parse_fact_string("foo => bar").should == {:fact => "foo", :value => "bar", :operator => ">="}
-      end
-
-      it "should treat =< like <=" do
-        Util.parse_fact_string("foo=<bar").should == {:fact => "foo", :value => "bar", :operator => "<="}
-        Util.parse_fact_string("foo =< bar").should == {:fact => "foo", :value => "bar", :operator => "<="}
-      end
-
-      it "should parse less than or equal" do
-        Util.parse_fact_string("foo<=bar").should == {:fact => "foo", :value => "bar", :operator => "<="}
-        Util.parse_fact_string("foo <= bar").should == {:fact => "foo", :value => "bar", :operator => "<="}
-      end
-
-      it "should parse greater than or equal" do
-        Util.parse_fact_string("foo>=bar").should == {:fact => "foo", :value => "bar", :operator => ">="}
-        Util.parse_fact_string("foo >= bar").should == {:fact => "foo", :value => "bar", :operator => ">="}
-      end
-
-      it "should parse less than" do
-        Util.parse_fact_string("foo<bar").should == {:fact => "foo", :value => "bar", :operator => "<"}
-        Util.parse_fact_string("foo < bar").should == {:fact => "foo", :value => "bar", :operator => "<"}
-      end
-
-      it "should parse greater than" do
-        Util.parse_fact_string("foo>bar").should == {:fact => "foo", :value => "bar", :operator => ">"}
-        Util.parse_fact_string("foo > bar").should == {:fact => "foo", :value => "bar", :operator => ">"}
-      end
-
-      it "should parse greater than" do
-        Util.parse_fact_string("foo>bar").should == {:fact => "foo", :value => "bar", :operator => ">"}
-        Util.parse_fact_string("foo > bar").should == {:fact => "foo", :value => "bar", :operator => ">"}
-      end
-
-      it "should parse not equal" do
-        Util.parse_fact_string("foo!=bar").should == {:fact => "foo", :value => "bar", :operator => "!="}
-        Util.parse_fact_string("foo != bar").should == {:fact => "foo", :value => "bar", :operator => "!="}
-      end
-
-      it "should parse equal to" do
-        Util.parse_fact_string("foo==bar").should == {:fact => "foo", :value => "bar", :operator => "=="}
-        Util.parse_fact_string("foo == bar").should == {:fact => "foo", :value => "bar", :operator => "=="}
-      end
-
-      it "should fail for facts in the wrong format" do
-        expect {
-          Util.parse_fact_string("foo")
-        }.to raise_error("Could not parse fact foo it does not appear to be in a valid format")
-      end
-    end
-
-    describe "#colorize" do
-      it "should not add color codes when color is disabled" do
-        Config.instance.stubs(:color).returns(false)
-        Util.colorize(:red, "hello world").should == "hello world"
-      end
-
-      it "should add color when color is enabled" do
-        Config.instance.stubs(:color).returns(true)
-        Util.colorize(:red, "hello world").should == "\e[31mhello world\e[0m"
-      end
-    end
-
-    describe "#align_text" do
-      it "should default to 80 if the terminal dimensions are unknown" do
-        Util.stubs(:terminal_dimensions).returns([0,0])
-
-        rootdir = File.dirname(__FILE__)
-        input = File.read("#{rootdir}/../fixtures/util/4.in")
-        output = File.read("#{rootdir}/../fixtures/util/4.out")
-
-        (Util.align_text(input, nil, 3) + "\n").should == output
-      end
-
-      it "should return the origional string if console lines are 0" do
-        result = Util.align_text("test", 0)
-        result.should == "test"
-      end
-
-      it "should return the origional string if preamble is greater than console lines" do
-        result = Util.align_text("test", 5, 6)
-        result.should == "test"
-      end
-
-      it "should return a string prefixed by the preamble" do
-        result = Util.align_text("test")
-        result.should == "     test"
-      end
-
-      it "should correctly align strings" do
-        rootdir = File.dirname(__FILE__)
-        (1..2).each do |i|
-          input = File.read("#{rootdir}/../fixtures/util/#{i}.in")
-          output = File.read("#{rootdir}/../fixtures/util/#{i}.out")
-
-          (Util.align_text(input, 158 , 5) + "\n").should == output
-        end
-
-        input = File.read("#{rootdir}/../fixtures/util/3.in")
-        output = File.read("#{rootdir}/../fixtures/util/3.out")
-
-        (Util.align_text(input, 30, 0) + "\n").should == output
-      end
-    end
-
-    describe "#terminal_dimensions" do
-      it "should return 0 if there is no tty" do
-        stdout = mock()
-        stdout.expects(:tty?).returns(false)
-        result = Util.terminal_dimensions(stdout)
-        result.should == [0,0]
-      end
-
-      it "should return the default dimensions for a windows terminal" do
-        stdout = mock()
-        stdout.expects(:tty?).returns(true)
-        Util.expects(:windows?).returns(true)
-        result = Util.terminal_dimensions(stdout)
-        result.should == [80, 40]
-      end
-
-      it "should return 0 if an exception was raised" do
-        stdout = mock()
-        stdout.expects(:tty?).raises("error")
-        result = Util.terminal_dimensions(stdout)
-        result.should == [0, 0]
-      end
-
-      it "should return the correct dimensions if ENV columns and lines are set" do
-        stdout = mock()
-        stdout.expects(:tty?).returns(true)
-        environment = mock()
-        environment.expects(:[]).with("COLUMNS").returns(5).twice
-        environment.expects(:[]).with("LINES").returns(5).twice
-        result = Util.terminal_dimensions(stdout, environment)
-        result.should == [5,5]
-      end
-
-      it "should return the correct dimensions if ENV term is set and tput is present" do
-        stdout = mock()
-        stdout.expects(:tty?).returns(true)
-        environment = mock()
-        environment.expects(:[]).with("COLUMNS").returns(false)
-        environment.expects(:[]).with("TERM").returns(true)
-
-        Util.expects(:command_in_path?).with("tput").returns(true)
-        Util.stubs(:`).returns("5")
-
-        result = Util.terminal_dimensions(stdout, environment)
-        result.should == [5,5]
-      end
-
-      it "should return the correct dimensions if stty is present" do
-        stdout = mock()
-        stdout.expects(:tty?).returns(true)
-
-        environment = mock()
-        environment.expects(:[]).with("COLUMNS").returns(false)
-        environment.expects(:[]).with("TERM").returns(false)
-
-        Util.expects(:command_in_path?).with("stty").returns(true)
-        Util.stubs(:`).returns("5 5")
-
-        result = Util.terminal_dimensions(stdout, environment)
-        result.should == [5,5]
-      end
-    end
-
-    describe "#command_in_path?" do
-      it "should return true if the command is found" do
-        File.stubs(:exist?).returns(true)
-        result = Util.command_in_path?("test")
-        result.should == true
-      end
-
-      it "should return false if the command cannot be found" do
-        File.stubs(:exist?).returns(false)
-        result = Util.command_in_path?("test")
-        result.should == false
-      end
-    end
-
-    describe "#absolute_path?" do
-      it "should work correctly validate the path" do
-        Util.absolute_path?('.', '/', '\\').should == false
-        Util.absolute_path?('foo/foo', '/', '\\').should == false
-        Util.absolute_path?('foo\\bar', '/', '\\').should == false
-        Util.absolute_path?('../foo/bar', '/', '\\').should == false
-
-        Util.absolute_path?('\\foo/foo', '/', '\\').should == true
-        Util.absolute_path?('\\', '/', '\\').should == true
-        Util.absolute_path?('/foo', '/', '\\').should == true
-        Util.absolute_path?('/foo/foo', '/', '\\').should == true
-
-        Util.absolute_path?('.', '/', nil).should == false
-        Util.absolute_path?('foo/foo', '/', nil).should == false
-        Util.absolute_path?('foo\\bar', '/', nil).should == false
-        Util.absolute_path?('../foo/bar', '/', nil).should == false
-
-        Util.absolute_path?('\\foo/foo', '/', nil).should == false
-        Util.absolute_path?('\\', '/', nil).should == false
-        Util.absolute_path?('/foo', '/', nil).should == true
-        Util.absolute_path?('/foo/foo', '/', nil).should == true
-      end
-    end
-
-    describe "#versioncmp" do
-      it "should be able to sort a long set of various unordered versions" do
-        ary = %w{ 1.1.6 2.3 1.1a 3.0 1.5 1 2.4 1.1-4 2.3.1 1.2 2.3.0 1.1-3 2.4b 2.4 2.40.2 2.3a.1 3.1 0002 1.1-5 1.1.a 1.06}
-
-        newary = ary.sort {|a, b| Util.versioncmp(a,b) }
-
-        newary.should == ["0002", "1", "1.06", "1.1-3", "1.1-4", "1.1-5", "1.1.6", "1.1.a", "1.1a", "1.2", "1.5", "2.3", "2.3.0", "2.3.1", "2.3a.1", "2.4", "2.4", "2.4b", "2.40.2", "3.0", "3.1"]
-      end
-    end
-  end
-end
diff --git a/spec/unit/validator_spec.rb b/spec/unit/validator_spec.rb
deleted file mode 100644 (file)
index 73c1bf5..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-require File.dirname(__FILE__) + '/../../plugins/mcollective/validator/array_validator.rb'
-
-module MCollective
-  module Validator
-    describe "#load_validators" do
-      it "should not reload the plugins if the plugin cache has not expired" do
-        Validator.instance_variable_set(:@last_load, nil)
-        PluginManager.expects(:find_and_load).with("validator").once
-        Validator.load_validators
-        Validator.load_validators
-      end
-    end
-
-    describe "#[]" do
-      before do
-        Validator.load_validators
-      end
-
-      it "should return the correct class if klass is given as klass" do
-        result = Validator["array"]
-        result.should == ArrayValidator
-      end
-      it "should return the correct class if klass is given as KlassValidator" do
-        result = Validator["ArrayValidator"]
-        result.should == ArrayValidator
-      end
-      it "should return the correct class if klass is given as :klass" do
-        result = Validator[:array]
-        result.should == ArrayValidator
-      end
-    end
-
-    describe "#method_missing" do
-      it "should load a plugin if a validator method is called and the plugin exists" do
-        ArrayValidator.expects(:validate).with(2, [1,2,3])
-        result = Validator.array(2,[1,2,3])
-      end
-
-      it "should call super if a validator method is called and the plugin does not exist" do
-        expect{
-          Validator.rspec(1,2,3)
-        }.to raise_error(ValidatorError)
-      end
-    end
-
-    describe "#validator_class" do
-      it "should return the correct string for a given validator plugin name" do
-        result = Validator.validator_class("test")
-        result.should == "TestValidator"
-      end
-    end
-
-    describe "#has_validator?" do
-      it "should return true if the validator has been loaded" do
-        Validator.const_set(:TestValidator, Class)
-        Validator.has_validator?("test").should == true
-      end
-
-      it "should return false if the validator has not been loaded" do
-        Validator.has_validator?("test2").should == false
-      end
-    end
-  end
-end
diff --git a/spec/unit/vendor_spec.rb b/spec/unit/vendor_spec.rb
deleted file mode 100755 (executable)
index 4d59064..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  describe Vendor do
-    describe "#vendor_dir" do
-      it "should return correct vendor directory" do
-        specdir = File.dirname(__FILE__)
-        expected_dir = File.expand_path("#{specdir}/../../lib/mcollective/vendor")
-        Vendor.vendor_dir.should == expected_dir
-      end
-    end
-
-    describe "#load_entry" do
-      it "should attempt to load the correct path" do
-        specdir = File.dirname(__FILE__)
-        expected_dir = File.expand_path("#{specdir}/../../lib/mcollective/vendor")
-
-        Class.any_instance.stubs("load").with("#{expected_dir}/foo").once
-
-        Vendor.load_entry("foo")
-      end
-    end
-
-    describe "#require_libs" do
-      it "should require the vendor loader" do
-        Class.any_instance.stubs("require").with("mcollective/vendor/require_vendored").once
-
-        Vendor.require_libs
-      end
-    end
-  end
-end
diff --git a/spec/unit/windows_daemon_spec.rb b/spec/unit/windows_daemon_spec.rb
deleted file mode 100755 (executable)
index 6f56a44..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env rspec
-
-require 'spec_helper'
-
-module MCollective
-  if Util.windows?
-    require 'mcollective/windows_daemon'
-
-    describe WindowsDaemon do
-      describe "#daemonize_runner" do
-        it "should only run on the windows platform" do
-          Util.expects("windows?").returns(false)
-          expect { WindowsDaemon.daemonize_runner }.to raise_error("The Windows Daemonizer should only be used on the Windows Platform")
-        end
-
-        it "should not support writing pid files" do
-          expect { WindowsDaemon.daemonize_runner(true) }.to raise_error("Writing pid files are not supported on the Windows Platform")
-        end
-
-        it "should start the mainloop" do
-          WindowsDaemon.expects(:mainloop)
-          WindowsDaemon.daemonize_runner
-        end
-      end
-
-      describe "#service_stop" do
-        it "should disconnect and exit" do
-          Log.expects(:info)
-
-          connector = mock
-          connector.expects(:disconnect).once
-
-          PluginManager.expects("[]").with("connector_plugin").returns(connector)
-
-          d = WindowsDaemon.new
-          d.expects("exit!").once
-
-          d.service_stop
-        end
-      end
-    end
-  end
-end
diff --git a/spec/windows_spec.opts b/spec/windows_spec.opts
deleted file mode 100644 (file)
index 6cf0c0e..0000000
+++ /dev/null
@@ -1 +0,0 @@
---format s --backtrace
diff --git a/website/_includes/main_menu.html b/website/_includes/main_menu.html
deleted file mode 100644 (file)
index 2228318..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-                       <div class="span-3">
-                               &nbsp;
-                       </div>
-                       <div class="span-3">
-                               <a href="/">Home</a>
-                       </div>
-                       <div class="span-3">
-                               <a href="http://projects.puppetlabs.com/projects/mcollective/issues">Bugs</a>
-                       </div>
-                       <div class="span-3">
-                               <a href="https://github.com/puppetlabs/marionette-collective">GitHub</a>
-                       </div>
-                       <div class="span-3">
-                               <a href="http://code.google.com/p/mcollective/downloads/list">Files</a>
-                       </div>
-                       <div class="span-3 last">
-                               <a href="http://groups.google.com/group/mcollective-users">User List</a>
-                       </div>
-
diff --git a/website/blueprint/ie.css b/website/blueprint/ie.css
deleted file mode 100644 (file)
index 3dddda9..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -----------------------------------------------------------------------
-
-
- Blueprint CSS Framework 0.9
- http://blueprintcss.org
-
-   * Copyright (c) 2007-Present. See LICENSE for more info.
-   * See README for instructions on how to use Blueprint.
-   * For credits and origins, see AUTHORS.
-   * This is a compressed file. See the sources in the 'src' directory.
-
------------------------------------------------------------------------ */
-
-/* ie.css */
-body {text-align:center;}
-.container {text-align:left;}
-* html .column, * html .span-1, * html .span-2, * html .span-3, * html .span-4, * html .span-5, * html .span-6, * html .span-7, * html .span-8, * html .span-9, * html .span-10, * html .span-11, * html .span-12, * html .span-13, * html .span-14, * html .span-15, * html .span-16, * html .span-17, * html .span-18, * html .span-19, * html .span-20, * html .span-21, * html .span-22, * html .span-23, * html .span-24 {display:inline;overflow-x:hidden;}
-* html legend {margin:0px -8px 16px 0;padding:0;}
-sup {vertical-align:text-top;}
-sub {vertical-align:text-bottom;}
-html>body p code {*white-space:normal;}
-hr {margin:-8px auto 11px;}
-img {-ms-interpolation-mode:bicubic;}
-.clearfix, .container {display:inline-block;}
-* html .clearfix, * html .container {height:1%;}
-fieldset {padding-top:0;}
-textarea {overflow:auto;}
-input.text, input.title, textarea {background-color:#fff;border:1px solid #bbb;}
-input.text:focus, input.title:focus {border-color:#666;}
-input.text, input.title, textarea, select {margin:0.5em 0;}
-input.checkbox, input.radio {position:relative;top:.25em;}
-form.inline div, form.inline p {vertical-align:middle;}
-form.inline label {position:relative;top:-0.25em;}
-form.inline input.checkbox, form.inline input.radio, form.inline input.button, form.inline button {margin:0.5em 0;}
-button, input.button {position:relative;top:0.25em;}
\ No newline at end of file
diff --git a/website/blueprint/plugins/buttons/icons/cross.png b/website/blueprint/plugins/buttons/icons/cross.png
deleted file mode 100755 (executable)
index 1514d51..0000000
Binary files a/website/blueprint/plugins/buttons/icons/cross.png and /dev/null differ
diff --git a/website/blueprint/plugins/buttons/icons/key.png b/website/blueprint/plugins/buttons/icons/key.png
deleted file mode 100755 (executable)
index a9d5e4f..0000000
Binary files a/website/blueprint/plugins/buttons/icons/key.png and /dev/null differ
diff --git a/website/blueprint/plugins/buttons/icons/tick.png b/website/blueprint/plugins/buttons/icons/tick.png
deleted file mode 100755 (executable)
index a9925a0..0000000
Binary files a/website/blueprint/plugins/buttons/icons/tick.png and /dev/null differ
diff --git a/website/blueprint/plugins/buttons/readme.txt b/website/blueprint/plugins/buttons/readme.txt
deleted file mode 100644 (file)
index aa9fe26..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-Buttons
-
-* Gives you great looking CSS buttons, for both <a> and <button>.
-* Demo: particletree.com/features/rediscovering-the-button-element
-
-
-Credits
-----------------------------------------------------------------
-
-* Created by Kevin Hale [particletree.com]
-* Adapted for Blueprint by Olav Bjorkoy [bjorkoy.com]
-
-
-Usage
-----------------------------------------------------------------
-
-1) Add this plugin to lib/settings.yml.
-   See compress.rb for instructions.
-
-2) Use the following HTML code to place the buttons on your site:
-
-  <button type="submit" class="button positive">
-    <img src="css/blueprint/plugins/buttons/icons/tick.png" alt=""/> Save
-  </button>
-
-  <a class="button" href="/password/reset/">
-    <img src="css/blueprint/plugins/buttons/icons/key.png" alt=""/> Change Password
-  </a>
-
-  <a href="#" class="button negative">
-    <img src="css/blueprint/plugins/buttons/icons/cross.png" alt=""/> Cancel
-  </a>
diff --git a/website/blueprint/plugins/buttons/screen.css b/website/blueprint/plugins/buttons/screen.css
deleted file mode 100644 (file)
index bb66b21..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -------------------------------------------------------------- 
-  
-   buttons.css
-   * Gives you some great CSS-only buttons.
-   
-   Created by Kevin Hale [particletree.com]
-   * particletree.com/features/rediscovering-the-button-element
-
-   See Readme.txt in this folder for instructions.
-
--------------------------------------------------------------- */
-
-a.button, button {
-  display:block;
-  float:left;
-  margin: 0.7em 0.5em 0.7em 0;
-  padding:5px 10px 5px 7px;   /* Links */
-  
-  border:1px solid #dedede;
-  border-top:1px solid #eee;
-  border-left:1px solid #eee;
-
-  background-color:#f5f5f5;
-  font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
-  font-size:100%;
-  line-height:130%;
-  text-decoration:none;
-  font-weight:bold;
-  color:#565656;
-  cursor:pointer;
-}
-button {
-  width:auto;
-  overflow:visible;
-  padding:4px 10px 3px 7px;   /* IE6 */
-}
-button[type] {
-  padding:4px 10px 4px 7px;   /* Firefox */
-  line-height:17px;           /* Safari */
-}
-*:first-child+html button[type] {
-  padding:4px 10px 3px 7px;   /* IE7 */
-}
-button img, a.button img{
-  margin:0 3px -3px 0 !important;
-  padding:0;
-  border:none;
-  width:16px;
-  height:16px;
-  float:none;
-}
-
-
-/* Button colors
--------------------------------------------------------------- */
-
-/* Standard */
-button:hover, a.button:hover{
-  background-color:#dff4ff;
-  border:1px solid #c2e1ef;
-  color:#336699;
-}
-a.button:active{
-  background-color:#6299c5;
-  border:1px solid #6299c5;
-  color:#fff;
-}
-
-/* Positive */
-body .positive {
-  color:#529214;
-}
-a.positive:hover, button.positive:hover {
-  background-color:#E6EFC2;
-  border:1px solid #C6D880;
-  color:#529214;
-}
-a.positive:active {
-  background-color:#529214;
-  border:1px solid #529214;
-  color:#fff;
-}
-
-/* Negative */
-body .negative {
-  color:#d12f19;
-}
-a.negative:hover, button.negative:hover {
-  background-color:#fbe3e4;
-  border:1px solid #fbc2c4;
-  color:#d12f19;
-}
-a.negative:active {
-  background-color:#d12f19;
-  border:1px solid #d12f19;
-  color:#fff;
-}
diff --git a/website/blueprint/plugins/fancy-type/readme.txt b/website/blueprint/plugins/fancy-type/readme.txt
deleted file mode 100644 (file)
index 85f2491..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-Fancy Type
-
-* Gives you classes to use if you'd like some 
-  extra fancy typography. 
-
-Credits and instructions are specified above each class
-in the fancy-type.css file in this directory.
-
-
-Usage
-----------------------------------------------------------------
-
-1) Add this plugin to lib/settings.yml.
-   See compress.rb for instructions.
diff --git a/website/blueprint/plugins/fancy-type/screen.css b/website/blueprint/plugins/fancy-type/screen.css
deleted file mode 100644 (file)
index 68994d8..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/* --------------------------------------------------------------
-
-   fancy-type.css
-   * Lots of pretty advanced classes for manipulating text.
-
-   See the Readme file in this folder for additional instructions.
-
--------------------------------------------------------------- */
-
-/* Indentation instead of line shifts for sibling paragraphs. */
-   p + p { text-indent:2em; margin-top:-1.5em; }
-   form p + p  { text-indent: 0; } /* Don't want this in forms. */
-
-
-/* For great looking type, use this code instead of asdf:
-   <span class="alt">asdf</span>
-   Best used on prepositions and ampersands. */
-
-.alt {
-  color: #666;
-  font-family: "Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua", Georgia, serif;
-  font-style: italic;
-  font-weight: normal;
-}
-
-
-/* For great looking quote marks in titles, replace "asdf" with:
-   <span class="dquo">&#8220;</span>asdf&#8221;
-   (That is, when the title starts with a quote mark).
-   (You may have to change this value depending on your font size). */
-
-.dquo { margin-left: -.5em; }
-
-
-/* Reduced size type with incremental leading
-   (http://www.markboulton.co.uk/journal/comments/incremental_leading/)
-
-   This could be used for side notes. For smaller type, you don't necessarily want to
-   follow the 1.5x vertical rhythm -- the line-height is too much.
-
-   Using this class, it reduces your font size and line-height so that for
-   every four lines of normal sized type, there is five lines of the sidenote. eg:
-
-   New type size in em's:
-     10px (wanted side note size) / 12px (existing base size) = 0.8333 (new type size in ems)
-
-   New line-height value:
-     12px x 1.5 = 18px (old line-height)
-     18px x 4 = 72px
-     72px / 5 = 14.4px (new line height)
-     14.4px / 10px = 1.44 (new line height in em's) */
-
-p.incr, .incr p {
-  font-size: 10px;
-  line-height: 1.44em;
-  margin-bottom: 1.5em;
-}
-
-
-/* Surround uppercase words and abbreviations with this class.
-   Based on work by Jørgen Arnor GÃ¥rdsø Lom [http://twistedintellect.com/] */
-
-.caps {
-  font-variant: small-caps;
-  letter-spacing: 1px;
-  text-transform: lowercase;
-  font-size:1.2em;
-  line-height:1%;
-  font-weight:bold;
-  padding:0 2px;
-}
diff --git a/website/blueprint/plugins/link-icons/icons/doc.png b/website/blueprint/plugins/link-icons/icons/doc.png
deleted file mode 100644 (file)
index 834cdfa..0000000
Binary files a/website/blueprint/plugins/link-icons/icons/doc.png and /dev/null differ
diff --git a/website/blueprint/plugins/link-icons/icons/email.png b/website/blueprint/plugins/link-icons/icons/email.png
deleted file mode 100644 (file)
index 7348aed..0000000
Binary files a/website/blueprint/plugins/link-icons/icons/email.png and /dev/null differ
diff --git a/website/blueprint/plugins/link-icons/icons/external.png b/website/blueprint/plugins/link-icons/icons/external.png
deleted file mode 100644 (file)
index cf1cfb4..0000000
Binary files a/website/blueprint/plugins/link-icons/icons/external.png and /dev/null differ
diff --git a/website/blueprint/plugins/link-icons/icons/feed.png b/website/blueprint/plugins/link-icons/icons/feed.png
deleted file mode 100644 (file)
index 315c4f4..0000000
Binary files a/website/blueprint/plugins/link-icons/icons/feed.png and /dev/null differ
diff --git a/website/blueprint/plugins/link-icons/icons/im.png b/website/blueprint/plugins/link-icons/icons/im.png
deleted file mode 100644 (file)
index 79f35cc..0000000
Binary files a/website/blueprint/plugins/link-icons/icons/im.png and /dev/null differ
diff --git a/website/blueprint/plugins/link-icons/icons/pdf.png b/website/blueprint/plugins/link-icons/icons/pdf.png
deleted file mode 100644 (file)
index 8f8095e..0000000
Binary files a/website/blueprint/plugins/link-icons/icons/pdf.png and /dev/null differ
diff --git a/website/blueprint/plugins/link-icons/icons/visited.png b/website/blueprint/plugins/link-icons/icons/visited.png
deleted file mode 100644 (file)
index ebf206d..0000000
Binary files a/website/blueprint/plugins/link-icons/icons/visited.png and /dev/null differ
diff --git a/website/blueprint/plugins/link-icons/icons/xls.png b/website/blueprint/plugins/link-icons/icons/xls.png
deleted file mode 100644 (file)
index b977d7e..0000000
Binary files a/website/blueprint/plugins/link-icons/icons/xls.png and /dev/null differ
diff --git a/website/blueprint/plugins/link-icons/readme.txt b/website/blueprint/plugins/link-icons/readme.txt
deleted file mode 100644 (file)
index fc4dc64..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-Link Icons
-* Icons for links based on protocol or file type.
-
-This is not supported in IE versions < 7.
-
-
-Credits
-----------------------------------------------------------------
-
-* Marc Morgan
-* Olav Bjorkoy  [bjorkoy.com]
-
-
-Usage
-----------------------------------------------------------------
-
-1) Add this line to your HTML:
-  <link rel="stylesheet" href="css/blueprint/plugins/link-icons/screen.css" type="text/css" media="screen, projection">
diff --git a/website/blueprint/plugins/link-icons/screen.css b/website/blueprint/plugins/link-icons/screen.css
deleted file mode 100644 (file)
index 7b4bef9..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/* --------------------------------------------------------------
-
-   link-icons.css
-   * Icons for links based on protocol or file type.
-
-   See the Readme file in this folder for additional instructions.
-
--------------------------------------------------------------- */
-
-/* Use this class if a link gets an icon when it shouldn't. */
-body a.noicon {
-  background:transparent none !important;
-  padding:0 !important;
-  margin:0 !important;
-}
-
-/* Make sure the icons are not cut */
-a[href^="http:"], a[href^="mailto:"], a[href^="http:"]:visited,
-a[href$=".pdf"], a[href$=".doc"], a[href$=".xls"], a[href$=".rss"],
-a[href$=".rdf"], a[href^="aim:"] {
-  padding:2px 22px 2px 0;
-  margin:-2px 0;
-  background-repeat: no-repeat;
-  background-position: right center;
-}
-
-/* External links */
-a[href^="http:"]          { background-image: url(icons/external.png); }
-a[href^="mailto:"]        { background-image: url(icons/email.png); }
-a[href^="http:"]:visited  { background-image: url(icons/visited.png); }
-
-/* Files */
-a[href$=".pdf"]   { background-image: url(icons/pdf.png); }
-a[href$=".doc"]   { background-image: url(icons/doc.png); }
-a[href$=".xls"]   { background-image: url(icons/xls.png); }
-
-/* Misc */
-a[href$=".rss"],
-a[href$=".rdf"]   { background-image: url(icons/feed.png); }
-a[href^="aim:"]   { background-image: url(icons/im.png); }
diff --git a/website/blueprint/plugins/rtl/readme.txt b/website/blueprint/plugins/rtl/readme.txt
deleted file mode 100644 (file)
index 5564c40..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-RTL
-* Mirrors Blueprint, so it can be used with Right-to-Left languages.
-
-By Ran Yaniv Hartstein, ranh.co.il
-
-Usage
-----------------------------------------------------------------
-
-1) Add this line to your HTML:
-   <link rel="stylesheet" href="css/blueprint/plugins/rtl/screen.css" type="text/css" media="screen, projection">
diff --git a/website/blueprint/plugins/rtl/screen.css b/website/blueprint/plugins/rtl/screen.css
deleted file mode 100644 (file)
index 7db7eb5..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/* --------------------------------------------------------------
-
-   rtl.css
-   * Mirrors Blueprint for left-to-right languages
-
-   By Ran Yaniv Hartstein [ranh.co.il]
-
--------------------------------------------------------------- */
-
-body .container { direction: rtl; }
-body .column, body .span-1, body .span-2, body .span-3, body .span-4, body .span-5, body .span-6, body .span-7, body .span-8, body .span-9, body .span-10, body .span-11, body .span-12, body .span-13, body .span-14, body .span-15, body .span-16, body .span-17, body .span-18, body .span-19, body .span-20, body .span-21, body .span-22, body .span-23, body .span-24 {
-  float: right;
-  margin-right: 0;
-  margin-left: 10px;
-  text-align:right;
-}
-
-body div.last { margin-left: 0; }
-body table .last { padding-left: 0; }
-
-body .append-1   { padding-right: 0; padding-left: 40px; }
-body .append-2   { padding-right: 0; padding-left: 80px; }
-body .append-3   { padding-right: 0; padding-left: 120px; }
-body .append-4   { padding-right: 0; padding-left: 160px; }
-body .append-5   { padding-right: 0; padding-left: 200px; }
-body .append-6   { padding-right: 0; padding-left: 240px; }
-body .append-7   { padding-right: 0; padding-left: 280px; }
-body .append-8   { padding-right: 0; padding-left: 320px; }
-body .append-9   { padding-right: 0; padding-left: 360px; }
-body .append-10  { padding-right: 0; padding-left: 400px; }
-body .append-11  { padding-right: 0; padding-left: 440px; }
-body .append-12  { padding-right: 0; padding-left: 480px; }
-body .append-13  { padding-right: 0; padding-left: 520px; }
-body .append-14  { padding-right: 0; padding-left: 560px; }
-body .append-15  { padding-right: 0; padding-left: 600px; }
-body .append-16  { padding-right: 0; padding-left: 640px; }
-body .append-17  { padding-right: 0; padding-left: 680px; }
-body .append-18  { padding-right: 0; padding-left: 720px; }
-body .append-19  { padding-right: 0; padding-left: 760px; }
-body .append-20  { padding-right: 0; padding-left: 800px; }
-body .append-21  { padding-right: 0; padding-left: 840px; }
-body .append-22  { padding-right: 0; padding-left: 880px; }
-body .append-23  { padding-right: 0; padding-left: 920px; }
-
-body .prepend-1   { padding-left: 0; padding-right: 40px; }
-body .prepend-2   { padding-left: 0; padding-right: 80px; }
-body .prepend-3   { padding-left: 0; padding-right: 120px; }
-body .prepend-4   { padding-left: 0; padding-right: 160px; }
-body .prepend-5   { padding-left: 0; padding-right: 200px; }
-body .prepend-6   { padding-left: 0; padding-right: 240px; }
-body .prepend-7   { padding-left: 0; padding-right: 280px; }
-body .prepend-8   { padding-left: 0; padding-right: 320px; }
-body .prepend-9   { padding-left: 0; padding-right: 360px; }
-body .prepend-10  { padding-left: 0; padding-right: 400px; }
-body .prepend-11  { padding-left: 0; padding-right: 440px; }
-body .prepend-12  { padding-left: 0; padding-right: 480px; }
-body .prepend-13  { padding-left: 0; padding-right: 520px; }
-body .prepend-14  { padding-left: 0; padding-right: 560px; }
-body .prepend-15  { padding-left: 0; padding-right: 600px; }
-body .prepend-16  { padding-left: 0; padding-right: 640px; }
-body .prepend-17  { padding-left: 0; padding-right: 680px; }
-body .prepend-18  { padding-left: 0; padding-right: 720px; }
-body .prepend-19  { padding-left: 0; padding-right: 760px; }
-body .prepend-20  { padding-left: 0; padding-right: 800px; }
-body .prepend-21  { padding-left: 0; padding-right: 840px; }
-body .prepend-22  { padding-left: 0; padding-right: 880px; }
-body .prepend-23  { padding-left: 0; padding-right: 920px; }
-
-body .border {
-  padding-right: 0;
-  padding-left: 4px;
-  margin-right: 0;
-  margin-left: 5px;
-  border-right: none;
-  border-left: 1px solid #eee;
-}
-
-body .colborder {
-  padding-right: 0;
-  padding-left: 24px;
-  margin-right: 0;
-  margin-left: 25px;
-  border-right: none;
-  border-left: 1px solid #eee;
-}
-
-body .pull-1  { margin-left: 0; margin-right: -40px; }
-body .pull-2  { margin-left: 0; margin-right: -80px; }
-body .pull-3  { margin-left: 0; margin-right: -120px; }
-body .pull-4  { margin-left: 0; margin-right: -160px; }
-
-body .push-0  { margin: 0 18px 0 0; }
-body .push-1  { margin: 0 18px 0 -40px; }
-body .push-2  { margin: 0 18px 0 -80px; }
-body .push-3  { margin: 0 18px 0 -120px; }
-body .push-4  { margin: 0 18px 0 -160px; }
-body .push-0, body .push-1, body .push-2,
-body .push-3, body .push-4 { float: left; }
-
-
-/* Typography with RTL support */
-body h1,body h2,body h3,
-body h4,body h5,body h6 { font-family: Arial, sans-serif; }
-html body { font-family: Arial, sans-serif;  }
-body pre,body code,body tt { font-family: monospace; }
-
-/* Mirror floats and margins on typographic elements */
-body p img { float: right; margin: 1.5em 0 1.5em 1.5em; }
-body dd, body ul, body ol { margin-left: 0; margin-right: 1.5em;}
-body td, body th { text-align:right; }
diff --git a/website/blueprint/print.css b/website/blueprint/print.css
deleted file mode 100644 (file)
index fdb8220..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -----------------------------------------------------------------------
-
-
- Blueprint CSS Framework 0.9
- http://blueprintcss.org
-
-   * Copyright (c) 2007-Present. See LICENSE for more info.
-   * See README for instructions on how to use Blueprint.
-   * For credits and origins, see AUTHORS.
-   * This is a compressed file. See the sources in the 'src' directory.
-
------------------------------------------------------------------------ */
-
-/* print.css */
-body {line-height:1.5;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;color:#000;background:none;font-size:10pt;}
-.container {background:none;}
-hr {background:#ccc;color:#ccc;width:100%;height:2px;margin:2em 0;padding:0;border:none;}
-hr.space {background:#fff;color:#fff;visibility:hidden;}
-h1, h2, h3, h4, h5, h6 {font-family:"Helvetica Neue", Arial, "Lucida Grande", sans-serif;}
-code {font:.9em "Courier New", Monaco, Courier, monospace;}
-a img {border:none;}
-p img.top {margin-top:0;}
-blockquote {margin:1.5em;padding:1em;font-style:italic;font-size:.9em;}
-.small {font-size:.9em;}
-.large {font-size:1.1em;}
-.quiet {color:#999;}
-.hide {display:none;}
-a:link, a:visited {background:transparent;font-weight:700;text-decoration:underline;}
-a:link:after, a:visited:after {content:" (" attr(href) ")";font-size:90%;}
\ No newline at end of file
diff --git a/website/blueprint/screen.css b/website/blueprint/screen.css
deleted file mode 100644 (file)
index 9b7c1f2..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-/* -----------------------------------------------------------------------
-
-
- Blueprint CSS Framework 0.9
- http://blueprintcss.org
-
-   * Copyright (c) 2007-Present. See LICENSE for more info.
-   * See README for instructions on how to use Blueprint.
-   * For credits and origins, see AUTHORS.
-   * This is a compressed file. See the sources in the 'src' directory.
-
------------------------------------------------------------------------ */
-
-/* reset.css */
-html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, dialog, figure, footer, header, hgroup, nav, section {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;}
-article, aside, dialog, figure, footer, header, hgroup, nav, section {display:block;}
-body {line-height:1.5;}
-table {border-collapse:separate;border-spacing:0;}
-caption, th, td {text-align:left;font-weight:normal;}
-table, td, th {vertical-align:middle;}
-blockquote:before, blockquote:after, q:before, q:after {content:"";}
-blockquote, q {quotes:"" "";}
-a img {border:none;}
-
-/* typography.css */
-html {font-size:100.01%;}
-body {font-size:75%;color:#222;background:#fff;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;}
-h1, h2, h3, h4, h5, h6 {font-weight:normal;color:#111;}
-h1 {font-size:3em;line-height:1;margin-bottom:0.5em;}
-h2 {font-size:2em;margin-bottom:0.75em;}
-h3 {font-size:1.5em;line-height:1;margin-bottom:1em;}
-h4 {font-size:1.2em;line-height:1.25;margin-bottom:1.25em;}
-h5 {font-size:1em;font-weight:bold;margin-bottom:1.5em;}
-h6 {font-size:1em;font-weight:bold;}
-h1 img, h2 img, h3 img, h4 img, h5 img, h6 img {margin:0;}
-p {margin:0 0 1.5em;}
-p img.left {float:left;margin:1.5em 1.5em 1.5em 0;padding:0;}
-p img.right {float:right;margin:1.5em 0 1.5em 1.5em;}
-a:focus, a:hover {color:#000;}
-a {color:#009;text-decoration:underline;}
-blockquote {margin:1.5em;color:#666;font-style:italic;}
-strong {font-weight:bold;}
-em, dfn {font-style:italic;}
-dfn {font-weight:bold;}
-sup, sub {line-height:0;}
-abbr, acronym {border-bottom:1px dotted #666;}
-address {margin:0 0 1.5em;font-style:italic;}
-del {color:#666;}
-pre {margin:1.5em 0;white-space:pre;}
-pre, code, tt {font:1em 'andale mono', 'lucida console', monospace;line-height:1.5;}
-li ul, li ol {margin:0;}
-ul, ol {margin:0 1.5em 1.5em 0;padding-left:3.333em;}
-ul {list-style-type:disc;}
-ol {list-style-type:decimal;}
-dl {margin:0 0 1.5em 0;}
-dl dt {font-weight:bold;}
-dd {margin-left:1.5em;}
-table {margin-bottom:1.4em;width:100%;}
-th {font-weight:bold;}
-thead th {background:#c3d9ff;}
-th, td, caption {padding:4px 10px 4px 5px;}
-tr.even td {background:#e5ecf9;}
-tfoot {font-style:italic;}
-caption {background:#eee;}
-.small {font-size:.8em;margin-bottom:1.875em;line-height:1.875em;}
-.large {font-size:1.2em;line-height:2.5em;margin-bottom:1.25em;}
-.hide {display:none;}
-.quiet {color:#666;}
-.loud {color:#000;}
-.highlight {background:#ff0;}
-.added {background:#060;color:#fff;}
-.removed {background:#900;color:#fff;}
-.first {margin-left:0;padding-left:0;}
-.last {margin-right:0;padding-right:0;}
-.top {margin-top:0;padding-top:0;}
-.bottom {margin-bottom:0;padding-bottom:0;}
-
-/* forms.css */
-label {font-weight:bold;}
-fieldset {padding:1.4em;margin:0 0 1.5em 0;border:1px solid #ccc;}
-legend {font-weight:bold;font-size:1.2em;}
-input[type=text], input[type=password], input.text, input.title, textarea, select {background-color:#fff;border:1px solid #bbb;}
-input[type=text]:focus, input[type=password]:focus, input.text:focus, input.title:focus, textarea:focus, select:focus {border-color:#666;}
-input[type=text], input[type=password], input.text, input.title, textarea, select {margin:0.5em 0;}
-input.text, input.title {width:300px;padding:5px;}
-input.title {font-size:1.5em;}
-textarea {width:390px;height:250px;padding:5px;}
-input[type=checkbox], input[type=radio], input.checkbox, input.radio {position:relative;top:.25em;}
-form.inline {line-height:3;}
-form.inline p {margin-bottom:0;}
-.error, .notice, .success {padding:.8em;margin-bottom:1em;border:2px solid #ddd;}
-.error {background:#FBE3E4;color:#8a1f11;border-color:#FBC2C4;}
-.notice {background:#FFF6BF;color:#514721;border-color:#FFD324;}
-.success {background:#E6EFC2;color:#264409;border-color:#C6D880;}
-.error a {color:#8a1f11;}
-.notice a {color:#514721;}
-.success a {color:#264409;}
-
-/* grid.css */
-.container {width:950px;margin:0 auto;}
-.showgrid {background:url(src/grid.png);}
-.column, .span-1, .span-2, .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-9, .span-10, .span-11, .span-12, .span-13, .span-14, .span-15, .span-16, .span-17, .span-18, .span-19, .span-20, .span-21, .span-22, .span-23, .span-24 {float:left;margin-right:10px;}
-.last {margin-right:0;}
-.span-1 {width:30px;}
-.span-2 {width:70px;}
-.span-3 {width:110px;}
-.span-4 {width:150px;}
-.span-5 {width:190px;}
-.span-6 {width:230px;}
-.span-7 {width:270px;}
-.span-8 {width:310px;}
-.span-9 {width:350px;}
-.span-10 {width:390px;}
-.span-11 {width:430px;}
-.span-12 {width:470px;}
-.span-13 {width:510px;}
-.span-14 {width:550px;}
-.span-15 {width:590px;}
-.span-16 {width:630px;}
-.span-17 {width:670px;}
-.span-18 {width:710px;}
-.span-19 {width:750px;}
-.span-20 {width:790px;}
-.span-21 {width:830px;}
-.span-22 {width:870px;}
-.span-23 {width:910px;}
-.span-24 {width:950px;margin-right:0;}
-input.span-1, textarea.span-1, input.span-2, textarea.span-2, input.span-3, textarea.span-3, input.span-4, textarea.span-4, input.span-5, textarea.span-5, input.span-6, textarea.span-6, input.span-7, textarea.span-7, input.span-8, textarea.span-8, input.span-9, textarea.span-9, input.span-10, textarea.span-10, input.span-11, textarea.span-11, input.span-12, textarea.span-12, input.span-13, textarea.span-13, input.span-14, textarea.span-14, input.span-15, textarea.span-15, input.span-16, textarea.span-16, input.span-17, textarea.span-17, input.span-18, textarea.span-18, input.span-19, textarea.span-19, input.span-20, textarea.span-20, input.span-21, textarea.span-21, input.span-22, textarea.span-22, input.span-23, textarea.span-23, input.span-24, textarea.span-24 {border-left-width:1px;border-right-width:1px;padding-left:5px;padding-right:5px;}
-input.span-1, textarea.span-1 {width:18px;}
-input.span-2, textarea.span-2 {width:58px;}
-input.span-3, textarea.span-3 {width:98px;}
-input.span-4, textarea.span-4 {width:138px;}
-input.span-5, textarea.span-5 {width:178px;}
-input.span-6, textarea.span-6 {width:218px;}
-input.span-7, textarea.span-7 {width:258px;}
-input.span-8, textarea.span-8 {width:298px;}
-input.span-9, textarea.span-9 {width:338px;}
-input.span-10, textarea.span-10 {width:378px;}
-input.span-11, textarea.span-11 {width:418px;}
-input.span-12, textarea.span-12 {width:458px;}
-input.span-13, textarea.span-13 {width:498px;}
-input.span-14, textarea.span-14 {width:538px;}
-input.span-15, textarea.span-15 {width:578px;}
-input.span-16, textarea.span-16 {width:618px;}
-input.span-17, textarea.span-17 {width:658px;}
-input.span-18, textarea.span-18 {width:698px;}
-input.span-19, textarea.span-19 {width:738px;}
-input.span-20, textarea.span-20 {width:778px;}
-input.span-21, textarea.span-21 {width:818px;}
-input.span-22, textarea.span-22 {width:858px;}
-input.span-23, textarea.span-23 {width:898px;}
-input.span-24, textarea.span-24 {width:938px;}
-.append-1 {padding-right:40px;}
-.append-2 {padding-right:80px;}
-.append-3 {padding-right:120px;}
-.append-4 {padding-right:160px;}
-.append-5 {padding-right:200px;}
-.append-6 {padding-right:240px;}
-.append-7 {padding-right:280px;}
-.append-8 {padding-right:320px;}
-.append-9 {padding-right:360px;}
-.append-10 {padding-right:400px;}
-.append-11 {padding-right:440px;}
-.append-12 {padding-right:480px;}
-.append-13 {padding-right:520px;}
-.append-14 {padding-right:560px;}
-.append-15 {padding-right:600px;}
-.append-16 {padding-right:640px;}
-.append-17 {padding-right:680px;}
-.append-18 {padding-right:720px;}
-.append-19 {padding-right:760px;}
-.append-20 {padding-right:800px;}
-.append-21 {padding-right:840px;}
-.append-22 {padding-right:880px;}
-.append-23 {padding-right:920px;}
-.prepend-1 {padding-left:40px;}
-.prepend-2 {padding-left:80px;}
-.prepend-3 {padding-left:120px;}
-.prepend-4 {padding-left:160px;}
-.prepend-5 {padding-left:200px;}
-.prepend-6 {padding-left:240px;}
-.prepend-7 {padding-left:280px;}
-.prepend-8 {padding-left:320px;}
-.prepend-9 {padding-left:360px;}
-.prepend-10 {padding-left:400px;}
-.prepend-11 {padding-left:440px;}
-.prepend-12 {padding-left:480px;}
-.prepend-13 {padding-left:520px;}
-.prepend-14 {padding-left:560px;}
-.prepend-15 {padding-left:600px;}
-.prepend-16 {padding-left:640px;}
-.prepend-17 {padding-left:680px;}
-.prepend-18 {padding-left:720px;}
-.prepend-19 {padding-left:760px;}
-.prepend-20 {padding-left:800px;}
-.prepend-21 {padding-left:840px;}
-.prepend-22 {padding-left:880px;}
-.prepend-23 {padding-left:920px;}
-.border {padding-right:4px;margin-right:5px;border-right:1px solid #eee;}
-.colborder {padding-right:24px;margin-right:25px;border-right:1px solid #eee;}
-.pull-1 {margin-left:-40px;}
-.pull-2 {margin-left:-80px;}
-.pull-3 {margin-left:-120px;}
-.pull-4 {margin-left:-160px;}
-.pull-5 {margin-left:-200px;}
-.pull-6 {margin-left:-240px;}
-.pull-7 {margin-left:-280px;}
-.pull-8 {margin-left:-320px;}
-.pull-9 {margin-left:-360px;}
-.pull-10 {margin-left:-400px;}
-.pull-11 {margin-left:-440px;}
-.pull-12 {margin-left:-480px;}
-.pull-13 {margin-left:-520px;}
-.pull-14 {margin-left:-560px;}
-.pull-15 {margin-left:-600px;}
-.pull-16 {margin-left:-640px;}
-.pull-17 {margin-left:-680px;}
-.pull-18 {margin-left:-720px;}
-.pull-19 {margin-left:-760px;}
-.pull-20 {margin-left:-800px;}
-.pull-21 {margin-left:-840px;}
-.pull-22 {margin-left:-880px;}
-.pull-23 {margin-left:-920px;}
-.pull-24 {margin-left:-960px;}
-.pull-1, .pull-2, .pull-3, .pull-4, .pull-5, .pull-6, .pull-7, .pull-8, .pull-9, .pull-10, .pull-11, .pull-12, .pull-13, .pull-14, .pull-15, .pull-16, .pull-17, .pull-18, .pull-19, .pull-20, .pull-21, .pull-22, .pull-23, .pull-24 {float:left;position:relative;}
-.push-1 {margin:0 -40px 1.5em 40px;}
-.push-2 {margin:0 -80px 1.5em 80px;}
-.push-3 {margin:0 -120px 1.5em 120px;}
-.push-4 {margin:0 -160px 1.5em 160px;}
-.push-5 {margin:0 -200px 1.5em 200px;}
-.push-6 {margin:0 -240px 1.5em 240px;}
-.push-7 {margin:0 -280px 1.5em 280px;}
-.push-8 {margin:0 -320px 1.5em 320px;}
-.push-9 {margin:0 -360px 1.5em 360px;}
-.push-10 {margin:0 -400px 1.5em 400px;}
-.push-11 {margin:0 -440px 1.5em 440px;}
-.push-12 {margin:0 -480px 1.5em 480px;}
-.push-13 {margin:0 -520px 1.5em 520px;}
-.push-14 {margin:0 -560px 1.5em 560px;}
-.push-15 {margin:0 -600px 1.5em 600px;}
-.push-16 {margin:0 -640px 1.5em 640px;}
-.push-17 {margin:0 -680px 1.5em 680px;}
-.push-18 {margin:0 -720px 1.5em 720px;}
-.push-19 {margin:0 -760px 1.5em 760px;}
-.push-20 {margin:0 -800px 1.5em 800px;}
-.push-21 {margin:0 -840px 1.5em 840px;}
-.push-22 {margin:0 -880px 1.5em 880px;}
-.push-23 {margin:0 -920px 1.5em 920px;}
-.push-24 {margin:0 -960px 1.5em 960px;}
-.push-1, .push-2, .push-3, .push-4, .push-5, .push-6, .push-7, .push-8, .push-9, .push-10, .push-11, .push-12, .push-13, .push-14, .push-15, .push-16, .push-17, .push-18, .push-19, .push-20, .push-21, .push-22, .push-23, .push-24 {float:right;position:relative;}
-.prepend-top {margin-top:1.5em;}
-.append-bottom {margin-bottom:1.5em;}
-.box {padding:1.5em;margin-bottom:1.5em;background:#E5ECF9;}
-hr {background:#ddd;color:#ddd;clear:both;float:none;width:100%;height:.1em;margin:0 0 1.45em;border:none;}
-hr.space {background:#fff;color:#fff;visibility:hidden;}
-.clearfix:after, .container:after {content:"\0020";display:block;height:0;clear:both;visibility:hidden;overflow:hidden;}
-.clearfix, .container {display:block;}
-.clear {clear:both;}
diff --git a/website/blueprint/src/forms.css b/website/blueprint/src/forms.css
deleted file mode 100644 (file)
index b491134..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/* --------------------------------------------------------------
-
-   forms.css
-   * Sets up some default styling for forms
-   * Gives you classes to enhance your forms
-
-   Usage:
-   * For text fields, use class .title or .text
-   * For inline forms, use .inline (even when using columns)
-
--------------------------------------------------------------- */
-
-label       { font-weight: bold; }
-fieldset    { padding:1.4em; margin: 0 0 1.5em 0; border: 1px solid #ccc; }
-legend      { font-weight: bold; font-size:1.2em; }
-
-
-/* Form fields
--------------------------------------------------------------- */
-
-input[type=text], input[type=password],
-input.text, input.title,
-textarea, select {
-  background-color:#fff;
-  border:1px solid #bbb;
-}
-input[type=text]:focus, input[type=password]:focus,
-input.text:focus, input.title:focus,
-textarea:focus, select:focus {
-  border-color:#666;
-}
-
-input[type=text], input[type=password],
-input.text, input.title,
-textarea, select {
-  margin:0.5em 0;
-}
-
-input.text,
-input.title   { width: 300px; padding:5px; }
-input.title   { font-size:1.5em; }
-textarea      { width: 390px; height: 250px; padding:5px; }
-
-input[type=checkbox], input[type=radio],
-input.checkbox, input.radio {
-  position:relative; top:.25em;
-}
-
-form.inline { line-height:3; }
-form.inline p { margin-bottom:0; }
-
-
-/* Success, notice and error boxes
--------------------------------------------------------------- */
-
-.error,
-.notice,
-.success    { padding: .8em; margin-bottom: 1em; border: 2px solid #ddd; }
-
-.error      { background: #FBE3E4; color: #8a1f11; border-color: #FBC2C4; }
-.notice     { background: #FFF6BF; color: #514721; border-color: #FFD324; }
-.success    { background: #E6EFC2; color: #264409; border-color: #C6D880; }
-.error a    { color: #8a1f11; }
-.notice a   { color: #514721; }
-.success a  { color: #264409; }
diff --git a/website/blueprint/src/grid.css b/website/blueprint/src/grid.css
deleted file mode 100755 (executable)
index 02a9d0c..0000000
+++ /dev/null
@@ -1,280 +0,0 @@
-/* --------------------------------------------------------------
-
-   grid.css
-   * Sets up an easy-to-use grid of 24 columns.
-
-   By default, the grid is 950px wide, with 24 columns
-   spanning 30px, and a 10px margin between columns.
-
-   If you need fewer or more columns, namespaces or semantic
-   element names, use the compressor script (lib/compress.rb)
-
--------------------------------------------------------------- */
-
-/* A container should group all your columns. */
-.container {
-  width: 950px;
-  margin: 0 auto;
-}
-
-/* Use this class on any .span / container to see the grid. */
-.showgrid {
-  background: url(src/grid.png);
-}
-
-
-/* Columns
--------------------------------------------------------------- */
-
-/* Sets up basic grid floating and margin. */
-.column, .span-1, .span-2, .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-9, .span-10, .span-11, .span-12, .span-13, .span-14, .span-15, .span-16, .span-17, .span-18, .span-19, .span-20, .span-21, .span-22, .span-23, .span-24 {
-  float: left;
-  margin-right: 10px;
-}
-
-/* The last column in a row needs this class. */
-.last { margin-right: 0; }
-
-/* Use these classes to set the width of a column. */
-.span-1 {width: 30px;}
-
-.span-2 {width: 70px;}
-.span-3 {width: 110px;}
-.span-4 {width: 150px;}
-.span-5 {width: 190px;}
-.span-6 {width: 230px;}
-.span-7 {width: 270px;}
-.span-8 {width: 310px;}
-.span-9 {width: 350px;}
-.span-10 {width: 390px;}
-.span-11 {width: 430px;}
-.span-12 {width: 470px;}
-.span-13 {width: 510px;}
-.span-14 {width: 550px;}
-.span-15 {width: 590px;}
-.span-16 {width: 630px;}
-.span-17 {width: 670px;}
-.span-18 {width: 710px;}
-.span-19 {width: 750px;}
-.span-20 {width: 790px;}
-.span-21 {width: 830px;}
-.span-22 {width: 870px;}
-.span-23 {width: 910px;}
-.span-24 {width:950px; margin-right:0;}
-
-/* Use these classes to set the width of an input. */
-input.span-1, textarea.span-1, input.span-2, textarea.span-2, input.span-3, textarea.span-3, input.span-4, textarea.span-4, input.span-5, textarea.span-5, input.span-6, textarea.span-6, input.span-7, textarea.span-7, input.span-8, textarea.span-8, input.span-9, textarea.span-9, input.span-10, textarea.span-10, input.span-11, textarea.span-11, input.span-12, textarea.span-12, input.span-13, textarea.span-13, input.span-14, textarea.span-14, input.span-15, textarea.span-15, input.span-16, textarea.span-16, input.span-17, textarea.span-17, input.span-18, textarea.span-18, input.span-19, textarea.span-19, input.span-20, textarea.span-20, input.span-21, textarea.span-21, input.span-22, textarea.span-22, input.span-23, textarea.span-23, input.span-24, textarea.span-24 {
-  border-left-width: 1px;
-  border-right-width: 1px;
-  padding-left: 5px;
-  padding-right: 5px;
-}
-
-input.span-1, textarea.span-1 { width: 18px; }
-input.span-2, textarea.span-2 { width: 58px; }
-input.span-3, textarea.span-3 { width: 98px; }
-input.span-4, textarea.span-4 { width: 138px; }
-input.span-5, textarea.span-5 { width: 178px; }
-input.span-6, textarea.span-6 { width: 218px; }
-input.span-7, textarea.span-7 { width: 258px; }
-input.span-8, textarea.span-8 { width: 298px; }
-input.span-9, textarea.span-9 { width: 338px; }
-input.span-10, textarea.span-10 { width: 378px; }
-input.span-11, textarea.span-11 { width: 418px; }
-input.span-12, textarea.span-12 { width: 458px; }
-input.span-13, textarea.span-13 { width: 498px; }
-input.span-14, textarea.span-14 { width: 538px; }
-input.span-15, textarea.span-15 { width: 578px; }
-input.span-16, textarea.span-16 { width: 618px; }
-input.span-17, textarea.span-17 { width: 658px; }
-input.span-18, textarea.span-18 { width: 698px; }
-input.span-19, textarea.span-19 { width: 738px; }
-input.span-20, textarea.span-20 { width: 778px; }
-input.span-21, textarea.span-21 { width: 818px; }
-input.span-22, textarea.span-22 { width: 858px; }
-input.span-23, textarea.span-23 { width: 898px; }
-input.span-24, textarea.span-24 { width: 938px; }
-
-/* Add these to a column to append empty cols. */
-
-.append-1 { padding-right: 40px;}
-.append-2 { padding-right: 80px;}
-.append-3 { padding-right: 120px;}
-.append-4 { padding-right: 160px;}
-.append-5 { padding-right: 200px;}
-.append-6 { padding-right: 240px;}
-.append-7 { padding-right: 280px;}
-.append-8 { padding-right: 320px;}
-.append-9 { padding-right: 360px;}
-.append-10 { padding-right: 400px;}
-.append-11 { padding-right: 440px;}
-.append-12 { padding-right: 480px;}
-.append-13 { padding-right: 520px;}
-.append-14 { padding-right: 560px;}
-.append-15 { padding-right: 600px;}
-.append-16 { padding-right: 640px;}
-.append-17 { padding-right: 680px;}
-.append-18 { padding-right: 720px;}
-.append-19 { padding-right: 760px;}
-.append-20 { padding-right: 800px;}
-.append-21 { padding-right: 840px;}
-.append-22 { padding-right: 880px;}
-.append-23 { padding-right: 920px;}
-
-/* Add these to a column to prepend empty cols. */
-
-.prepend-1 { padding-left: 40px;}
-.prepend-2 { padding-left: 80px;}
-.prepend-3 { padding-left: 120px;}
-.prepend-4 { padding-left: 160px;}
-.prepend-5 { padding-left: 200px;}
-.prepend-6 { padding-left: 240px;}
-.prepend-7 { padding-left: 280px;}
-.prepend-8 { padding-left: 320px;}
-.prepend-9 { padding-left: 360px;}
-.prepend-10 { padding-left: 400px;}
-.prepend-11 { padding-left: 440px;}
-.prepend-12 { padding-left: 480px;}
-.prepend-13 { padding-left: 520px;}
-.prepend-14 { padding-left: 560px;}
-.prepend-15 { padding-left: 600px;}
-.prepend-16 { padding-left: 640px;}
-.prepend-17 { padding-left: 680px;}
-.prepend-18 { padding-left: 720px;}
-.prepend-19 { padding-left: 760px;}
-.prepend-20 { padding-left: 800px;}
-.prepend-21 { padding-left: 840px;}
-.prepend-22 { padding-left: 880px;}
-.prepend-23 { padding-left: 920px;}
-
-
-/* Border on right hand side of a column. */
-.border {
-  padding-right: 4px;
-  margin-right: 5px;
-  border-right: 1px solid #eee;
-}
-
-/* Border with more whitespace, spans one column. */
-.colborder {
-  padding-right: 24px;
-  margin-right: 25px;
-  border-right: 1px solid #eee;
-}
-
-
-/* Use these classes on an element to push it into the
-next column, or to pull it into the previous column.  */
-
-
-.pull-1 { margin-left: -40px; }
-.pull-2 { margin-left: -80px; }
-.pull-3 { margin-left: -120px; }
-.pull-4 { margin-left: -160px; }
-.pull-5 { margin-left: -200px; }
-.pull-6 { margin-left: -240px; }
-.pull-7 { margin-left: -280px; }
-.pull-8 { margin-left: -320px; }
-.pull-9 { margin-left: -360px; }
-.pull-10 { margin-left: -400px; }
-.pull-11 { margin-left: -440px; }
-.pull-12 { margin-left: -480px; }
-.pull-13 { margin-left: -520px; }
-.pull-14 { margin-left: -560px; }
-.pull-15 { margin-left: -600px; }
-.pull-16 { margin-left: -640px; }
-.pull-17 { margin-left: -680px; }
-.pull-18 { margin-left: -720px; }
-.pull-19 { margin-left: -760px; }
-.pull-20 { margin-left: -800px; }
-.pull-21 { margin-left: -840px; }
-.pull-22 { margin-left: -880px; }
-.pull-23 { margin-left: -920px; }
-.pull-24 { margin-left: -960px; }
-
-.pull-1, .pull-2, .pull-3, .pull-4, .pull-5, .pull-6, .pull-7, .pull-8, .pull-9, .pull-10, .pull-11, .pull-12, .pull-13, .pull-14, .pull-15, .pull-16, .pull-17, .pull-18, .pull-19, .pull-20, .pull-21, .pull-22, .pull-23, .pull-24 {float: left; position:relative;}
-
-
-.push-1 { margin: 0 -40px 1.5em 40px; }
-.push-2 { margin: 0 -80px 1.5em 80px; }
-.push-3 { margin: 0 -120px 1.5em 120px; }
-.push-4 { margin: 0 -160px 1.5em 160px; }
-.push-5 { margin: 0 -200px 1.5em 200px; }
-.push-6 { margin: 0 -240px 1.5em 240px; }
-.push-7 { margin: 0 -280px 1.5em 280px; }
-.push-8 { margin: 0 -320px 1.5em 320px; }
-.push-9 { margin: 0 -360px 1.5em 360px; }
-.push-10 { margin: 0 -400px 1.5em 400px; }
-.push-11 { margin: 0 -440px 1.5em 440px; }
-.push-12 { margin: 0 -480px 1.5em 480px; }
-.push-13 { margin: 0 -520px 1.5em 520px; }
-.push-14 { margin: 0 -560px 1.5em 560px; }
-.push-15 { margin: 0 -600px 1.5em 600px; }
-.push-16 { margin: 0 -640px 1.5em 640px; }
-.push-17 { margin: 0 -680px 1.5em 680px; }
-.push-18 { margin: 0 -720px 1.5em 720px; }
-.push-19 { margin: 0 -760px 1.5em 760px; }
-.push-20 { margin: 0 -800px 1.5em 800px; }
-.push-21 { margin: 0 -840px 1.5em 840px; }
-.push-22 { margin: 0 -880px 1.5em 880px; }
-.push-23 { margin: 0 -920px 1.5em 920px; }
-.push-24 { margin: 0 -960px 1.5em 960px; }
-
-.push-1, .push-2, .push-3, .push-4, .push-5, .push-6, .push-7, .push-8, .push-9, .push-10, .push-11, .push-12, .push-13, .push-14, .push-15, .push-16, .push-17, .push-18, .push-19, .push-20, .push-21, .push-22, .push-23, .push-24 {float: right; position:relative;}
-
-
-/* Misc classes and elements
--------------------------------------------------------------- */
-
-/* In case you need to add a gutter above/below an element */
-.prepend-top {
-  margin-top:1.5em;
-}
-.append-bottom {
-  margin-bottom:1.5em;
-}
-
-/* Use a .box to create a padded box inside a column.  */
-.box {
-  padding: 1.5em;
-  margin-bottom: 1.5em;
-  background: #E5ECF9;
-}
-
-/* Use this to create a horizontal ruler across a column. */
-hr {
-  background: #ddd;
-  color: #ddd;
-  clear: both;
-  float: none;
-  width: 100%;
-  height: .1em;
-  margin: 0 0 1.45em;
-  border: none;
-}
-
-hr.space {
-  background: #fff;
-  color: #fff;
-  visibility: hidden;
-}
-
-
-/* Clearing floats without extra markup
-   Based on How To Clear Floats Without Structural Markup by PiE
-   [http://www.positioniseverything.net/easyclearing.html] */
-
-.clearfix:after, .container:after {
-  content: "\0020";
-  display: block;
-  height: 0;
-  clear: both;
-  visibility: hidden;
-  overflow:hidden;
-}
-.clearfix, .container {display: block;}
-
-/* Regular clearing
-   apply to column that should drop below previous ones. */
-
-.clear { clear:both; }
diff --git a/website/blueprint/src/grid.png b/website/blueprint/src/grid.png
deleted file mode 100644 (file)
index d42a6c3..0000000
Binary files a/website/blueprint/src/grid.png and /dev/null differ
diff --git a/website/blueprint/src/ie.css b/website/blueprint/src/ie.css
deleted file mode 100644 (file)
index 0f458e6..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* --------------------------------------------------------------
-
-   ie.css
-
-   Contains every hack for Internet Explorer,
-   so that our core files stay sweet and nimble.
-
--------------------------------------------------------------- */
-
-/* Make sure the layout is centered in IE5 */
-body { text-align: center; }
-.container { text-align: left; }
-
-/* Fixes IE margin bugs */
-* html .column, * html .span-1, * html .span-2,
-* html .span-3, * html .span-4, * html .span-5,
-* html .span-6, * html .span-7, * html .span-8,
-* html .span-9, * html .span-10, * html .span-11,
-* html .span-12, * html .span-13, * html .span-14,
-* html .span-15, * html .span-16, * html .span-17,
-* html .span-18, * html .span-19, * html .span-20,
-* html .span-21, * html .span-22, * html .span-23,
-* html .span-24 { display:inline; overflow-x: hidden; }
-
-
-/* Elements
--------------------------------------------------------------- */
-
-/* Fixes incorrect styling of legend in IE6. */
-* html legend { margin:0px -8px 16px 0; padding:0; }
-
-/* Fixes wrong line-height on sup/sub in IE. */
-sup { vertical-align:text-top; }
-sub { vertical-align:text-bottom; }
-
-/* Fixes IE7 missing wrapping of code elements. */
-html>body p code { *white-space: normal; }
-
-/* IE 6&7 has problems with setting proper <hr> margins. */
-hr  { margin:-8px auto 11px; }
-
-/* Explicitly set interpolation, allowing dynamically resized images to not look horrible */
-img { -ms-interpolation-mode:bicubic; }
-
-/* Clearing
--------------------------------------------------------------- */
-
-/* Makes clearfix actually work in IE */
-.clearfix, .container { display:inline-block; }
-* html .clearfix,
-* html .container { height:1%; }
-
-
-/* Forms
--------------------------------------------------------------- */
-
-/* Fixes padding on fieldset */
-fieldset { padding-top:0; }
-
-/* Makes classic textareas in IE 6 resemble other browsers */
-textarea { overflow:auto; }
-
-/* Fixes rule that IE 6 ignores */
-input.text, input.title, textarea { background-color:#fff; border:1px solid #bbb; }
-input.text:focus, input.title:focus { border-color:#666; }
-input.text, input.title, textarea, select { margin:0.5em 0; }
-input.checkbox, input.radio { position:relative; top:.25em; }
-
-/* Fixes alignment of inline form elements */
-form.inline div, form.inline p { vertical-align:middle; }
-form.inline label { position:relative;top:-0.25em; }
-form.inline input.checkbox, form.inline input.radio,
-form.inline input.button, form.inline button {
-  margin:0.5em 0;
-}
-button, input.button { position:relative;top:0.25em; }
diff --git a/website/blueprint/src/print.css b/website/blueprint/src/print.css
deleted file mode 100755 (executable)
index bbc7948..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/* --------------------------------------------------------------
-
-   print.css
-   * Gives you some sensible styles for printing pages.
-   * See Readme file in this directory for further instructions.
-
-   Some additions you'll want to make, customized to your markup:
-   #header, #footer, #navigation { display:none; }
-
--------------------------------------------------------------- */
-
-body {
-  line-height: 1.5;
-  font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
-  color:#000;
-  background: none;
-  font-size: 10pt;
-}
-
-
-/* Layout
--------------------------------------------------------------- */
-
-.container {
-  background: none;
-}
-
-hr {
-  background:#ccc;
-  color:#ccc;
-  width:100%;
-  height:2px;
-  margin:2em 0;
-  padding:0;
-  border:none;
-}
-hr.space {
-  background: #fff;
-  color: #fff;
-  visibility: hidden;
-}
-
-
-/* Text
--------------------------------------------------------------- */
-
-h1,h2,h3,h4,h5,h6 { font-family: "Helvetica Neue", Arial, "Lucida Grande", sans-serif; }
-code { font:.9em "Courier New", Monaco, Courier, monospace; }
-
-a img { border:none; }
-p img.top { margin-top: 0; }
-
-blockquote {
-  margin:1.5em;
-  padding:1em;
-  font-style:italic;
-  font-size:.9em;
-}
-
-.small  { font-size: .9em; }
-.large  { font-size: 1.1em; }
-.quiet  { color: #999; }
-.hide   { display:none; }
-
-
-/* Links
--------------------------------------------------------------- */
-
-a:link, a:visited {
-  background: transparent;
-  font-weight:700;
-  text-decoration: underline;
-}
-
-a:link:after, a:visited:after {
-  content: " (" attr(href) ")";
-  font-size: 90%;
-}
-
-/* If you're having trouble printing relative links, uncomment and customize this:
-   (note: This is valid CSS3, but it still won't go through the W3C CSS Validator) */
-
-/* a[href^="/"]:after {
-  content: " (http://www.yourdomain.com" attr(href) ") ";
-} */
diff --git a/website/blueprint/src/reset.css b/website/blueprint/src/reset.css
deleted file mode 100755 (executable)
index 09d9131..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/* --------------------------------------------------------------
-
-   reset.css
-   * Resets default browser CSS.
-
--------------------------------------------------------------- */
-
-html, body, div, span, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-a, abbr, acronym, address, code,
-del, dfn, em, img, q, dl, dt, dd, ol, ul, li,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td,
-article, aside, dialog, figure, footer, header,
-hgroup, nav, section {
-  margin: 0;
-  padding: 0;
-  border: 0;
-  font-weight: inherit;
-  font-style: inherit;
-  font-size: 100%;
-  font-family: inherit;
-  vertical-align: baseline;
-}
-
-article, aside, dialog, figure, footer, header,
-hgroup, nav, section {
-    display:block;
-}
-
-body {
-  line-height: 1.5;
-}
-
-/* Tables still need 'cellspacing="0"' in the markup. */
-table { border-collapse: separate; border-spacing: 0; }
-caption, th, td { text-align: left; font-weight: normal; }
-table, td, th { vertical-align: middle; }
-
-/* Remove possible quote marks (") from <q>, <blockquote>. */
-blockquote:before, blockquote:after, q:before, q:after { content: ""; }
-blockquote, q { quotes: "" ""; }
-
-/* Remove annoying border on linked images. */
-a img { border: none; }
diff --git a/website/blueprint/src/typography.css b/website/blueprint/src/typography.css
deleted file mode 100644 (file)
index a1cfe27..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/* --------------------------------------------------------------
-
-   typography.css
-   * Sets up some sensible default typography.
-
--------------------------------------------------------------- */
-
-/* Default font settings.
-   The font-size percentage is of 16px. (0.75 * 16px = 12px) */
-html { font-size:100.01%; }
-body {
-  font-size: 75%;
-  color: #222;
-  background: #fff;
-  font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
-}
-
-
-/* Headings
--------------------------------------------------------------- */
-
-h1,h2,h3,h4,h5,h6 { font-weight: normal; color: #111; }
-
-h1 { font-size: 3em; line-height: 1; margin-bottom: 0.5em; }
-h2 { font-size: 2em; margin-bottom: 0.75em; }
-h3 { font-size: 1.5em; line-height: 1; margin-bottom: 1em; }
-h4 { font-size: 1.2em; line-height: 1.25; margin-bottom: 1.25em; }
-h5 { font-size: 1em; font-weight: bold; margin-bottom: 1.5em; }
-h6 { font-size: 1em; font-weight: bold; }
-
-h1 img, h2 img, h3 img,
-h4 img, h5 img, h6 img {
-  margin: 0;
-}
-
-
-/* Text elements
--------------------------------------------------------------- */
-
-p           { margin: 0 0 1.5em; }
-p img.left  { float: left; margin: 1.5em 1.5em 1.5em 0; padding: 0; }
-p img.right { float: right; margin: 1.5em 0 1.5em 1.5em; }
-
-a:focus,
-a:hover     { color: #000; }
-a           { color: #009; text-decoration: underline; }
-
-blockquote  { margin: 1.5em; color: #666; font-style: italic; }
-strong      { font-weight: bold; }
-em,dfn      { font-style: italic; }
-dfn         { font-weight: bold; }
-sup, sub    { line-height: 0; }
-
-abbr,
-acronym     { border-bottom: 1px dotted #666; }
-address     { margin: 0 0 1.5em; font-style: italic; }
-del         { color:#666; }
-
-pre         { margin: 1.5em 0; white-space: pre; }
-pre,code,tt { font: 1em 'andale mono', 'lucida console', monospace; line-height: 1.5; }
-
-
-/* Lists
--------------------------------------------------------------- */
-
-li ul,
-li ol       { margin: 0; }
-ul, ol      { margin: 0 1.5em 1.5em 0; padding-left: 3.333em; }
-
-ul          { list-style-type: disc; }
-ol          { list-style-type: decimal; }
-
-dl          { margin: 0 0 1.5em 0; }
-dl dt       { font-weight: bold; }
-dd          { margin-left: 1.5em;}
-
-
-/* Tables
--------------------------------------------------------------- */
-
-table       { margin-bottom: 1.4em; width:100%; }
-th          { font-weight: bold; }
-thead th    { background: #c3d9ff; }
-th,td,caption { padding: 4px 10px 4px 5px; }
-tr.even td  { background: #e5ecf9; }
-tfoot       { font-style: italic; }
-caption     { background: #eee; }
-
-
-/* Misc classes
--------------------------------------------------------------- */
-
-.small      { font-size: .8em; margin-bottom: 1.875em; line-height: 1.875em; }
-.large      { font-size: 1.2em; line-height: 2.5em; margin-bottom: 1.25em; }
-.hide       { display: none; }
-
-.quiet      { color: #666; }
-.loud       { color: #000; }
-.highlight  { background:#ff0; }
-.added      { background:#060; color: #fff; }
-.removed    { background:#900; color: #fff; }
-
-.first      { margin-left:0; padding-left:0; }
-.last       { margin-right:0; padding-right:0; }
-.top        { margin-top:0; padding-top:0; }
-.bottom     { margin-bottom:0; padding-bottom:0; }
diff --git a/website/changelog.md b/website/changelog.md
deleted file mode 100644 (file)
index a7cd14f..0000000
+++ /dev/null
@@ -1,537 +0,0 @@
----
-layout: default
-title: Changelog
-toc: false
----
-
-## Version 2.3.x
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2013/03/22|Remove the topicprefix, queueprefix and topicsep options|19673|
-|2013/03/21|Remove the plugin.discovery.timeout setting as it's not relevant anymore|19694|
-|2013/03/21|Improve error reporting from the rpc application in the light of direct_addressing|19827|
-|2013/03/20|Fail with a friendly error message when no libdir is set|19752|
-|2013/03/14|Change default RabbitMQ and ActiveMQ ports to 61613|19734|
-|2013/03/13|Set correct reply-to headers in the RabbitMQ connector|17034|
-|2013/03/12|Pre-populate the data from data plugins like agent replies|19564|
-|2013/03/12|Explicitly include StringIO|19367|
-|2013/03/12|Enable direct addressing by default|19665|
-|2013/02/20|Fix error code collision on PLMC18|19366|
-|2013/02/15|Validate arguments supplied to the RPC application and raise errors sooner|19181|
-|*2013/02/14*|*Release 2.3.1*|19265|
-|2013/02/14|Initial work towards internationalization and online help|18663|
-|2013/02/14|Update vendored JSON gem for CVE-2013-0269|19265|
-|2013/02/13|Restore the ability to set a discovery timeout on a RPC client|19238|
-|2013/02/12|Replace underscores in plugin names with dashes to keep Debian happy|19200|
-|2013/02/12|Fix package building on certain Debian systems|19141|
-|2013/02/12|Remove the stomp connector|19146|
-|2013/02/07|Read the client config before trying to use any configuration options|19105|
-|2013/01/22|When an argument fails to parse in the rpc application fail rather than continue with unintended consequences|18773|
-|2013/01/22|The fix the *--no-response* argument to the rpc application that broke due to 18438|18513|
-|2013/01/22|Set *=* dependencies on the various packages that form a plugin rather than *>=*|18758|
-|2013/01/21|Improve presentation of the --help output for applications|18447|
-|2013/01/21|When a request failed via *reply.fail*, only show the message and not the half built data|18434|
-|*2013/01/10*|*Release 2.3.0*|18259|
-|2013/01/10|Raise the correct exception when trying to access unknown data items in a Data results|18466|
-|2013/01/10|Fix failing documentation generation for data plugins|18437|
-|2013/01/09|Correctly support negative boolean flags declared as --[no]-foo|18438|
-|2013/01/03|Add the package iteration number as a dependency for the common packages|18273|
-|2012/12/21|The libdirs supplied in the config file now has to be absolute paths to avoid issues when daemonising|16018|
-|2012/12/20|Logs the error and backtrace when an action fails|16414|
-|2012/12/20|Display the values of :optional and :default in DDL generated help|16616|
-|2012/12/20|Allow the query string for the get_data action in rpcutil to be 200 chars|18200|
-|2012/12/19|Do not fail when packaging non-agent packages using custom paths|17281|
-|2012/12/19|Require Ruby > 1.8 in the RPM specs for Ruby 1.9|17149|
-|2012/12/18|Allow required inputs to specify default data in DDLs|17615|
-|2012/11/12|When disconnecting set the connection to nil|17384|
-|2012/11/08|Define a specific buildroot to support RHEL5 systems correctly|17516|
-|2012/11/08|Use the correct rpmbuild commands on systems with rpmbuild-md5|17515|
-|2012/10/22|Correctly show help for data plugins without any input queries|17137|
-|2012/10/22|Allow the rpcutil#get_data action to work with data queries that takes no input|17138|
-|2012/10/03|Improve text output when providing custom formats for aggregations|16735|
-|2012/10/03|Correctly process supplied formats when displaying aggregate results|16415|
-|2012/10/03|Prevent one failing aggregate function from impacting others|16411|
-|2012/10/03|When validation fails indicate which input key has the problem|16617|
-|2012/09/26|Data queries can be written without any input queries meaning they take no input|16424|
-|2012/09/26|Use correct timeout for agent requests when using direct addressing|16569|
-|2012/09/26|Allow BigNum data to be used in data plugin replies|16503|
-|2012/09/26|Support non string data in the summary aggregate function|16410|
-
-## Version 2.2.x
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|*2013/02/14*|*Release 2.2.3*|19265|
-|2013/02/14|Update vendored JSON gem for CVE-2013-0269|19265|
-|2013/02/13|Restore the ability to set a discovery timeout on a RPC client|19238|
-|2013/02/12|Replace underscores in plugin names with dashes to keep Debian happy|19200|
-|2013/02/12|Fix package building on certain Debian systems|19141|
-|2013/02/12|Deprecate the stomp connector|19146|
-|2013/02/07|Read the client config before trying to use any configuration options|19105|
-|2013/01/22|Set *=* dependencies on the various packages that form a plugin rather than *>=*|18758|
-|*2013/01/17*|*Release 2.2.2*|18258|
-|2013/01/03|Add the package iteration number as a dependency for the common packages|18273|
-|2012/12/24|Restore the :any validator|18265|
-|2012/12/19|Do not fail when packaging non-agent packages using custom paths|17281|
-|2012/12/19|Require Ruby > 1.8 in the RPM specs for Ruby 1.9|17149|
-|2012/11/08|Define a specific buildroot to support RHEL5 systems correctly|17516|
-|2012/11/08|Use the correct rpmbuild commands on systems with rpmbuild-md5|17515|
-|2012/10/22|Correctly show help for data plugins without any input queries|17137|
-|2012/10/22|Allow the rpcutil#get_data action to work with data queries that takes no input|17138|
-|*2012/10/17*|*Release 2.2.1*|16965|
-|2012/10/03|Improve text output when providing custom formats for aggregations|16735|
-|2012/10/03|Correctly process supplied formats when displaying aggregate results|16415|
-|2012/10/03|Prevent one failing aggregate function from impacting others|16411|
-|2012/10/03|When validation fails indicate which input key has the problem|16617|
-|2012/09/26|Data queries can be written without any input queries meaning they take no input|16424|
-|2012/09/26|Use correct timeout for agent requests when using direct addressing|16569|
-|2012/09/26|Allow BigNum data to be used in data plugin replies|16503|
-|2012/09/26|Support non string data in the summary aggregate function|16410|
-|2012/09/14|Package discovery plugins that was left out for debian|16413|
-|*2012/09/13*|*Release 2.2.0*|16323|
-
-## Version 2.1.x
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2012/09/10|Update the vendored systemu gem|16289|
-|2012/09/06|Improve error reporting for empty certificate files|15924|
-|2012/09/05|Restore the verbose behavior while building packages|16216|
-|2012/09/04|Add a fetch method that mimic Hash#fetch to RPC Results and Requests|16222|
-|2012/09/04|Include the required mcollective version in packages that include the requirement|16173|
-|2012/08/29|Add a RabbitMQ specific connector plugin|16168|
-|2012/08/22|DDL files can now specify which is the minimal version of mcollective they require|15850|
-|2012/08/22|Fix a bug when specifying a custom target directory for packages|15956|
-|2012/08/22|When producing plugin packages keep the source deb and rpm|15917|
-|2012/08/09|Improve error handling in the plugin application|15848|
-|2012/08/08|Add the ability to store general usage information in the DDL|15633|
-|2012/08/02|Restore the formatting of the progress bar that was broken in 14255|15805|
-|2012/08/01|Display an error when no aggregate results could be computed|15793|
-|2012/08/01|Create a plugin system for validators|5078|
-|2012/07/19|Create a thread safe caching layer and use it to optimize loading of DDL files|15582|
-|2012/07/19|Correctly calculate discovery timeout in all cases and simplify logic around this|15602|
-|2012/07/17|Update the *name* field in the rpcutil DDL for consistency|15558
-|2012/07/17|Validate requests against the DDL in the agents prior to authorization or calling actions|15557|
-|2012/07/17|Refactor the single big DDL class into a class per type of plugin|15109|
-|2012/07/16|Default to the configured default discovery method in the RPC client when nothing is supplied|15506|
-|2012/07/16|Improve error handling in generate application|15473|
-|*2012/07/12*|*Release 2.1.1*|15379|
-|2012/07/11|Add a --display option to RPC clients that overrides the DDL display mode|15273|
-|2012/07/10|Do not add a metadata to agents created with the generator as they are now deprecated|15445|
-|2012/07/03|Correctly parse numeric and boolean data on the CLI in the rpc application|15344|
-|2012/07/03|Fix a bug related to parsing regular expressions in compound statements|15323|
-|2012/07/02|Update vim snippets in ext for new DDL features|15273|
-|2012/06/29|Create a common package for agent packages containing the DDL for servers and clients|15268|
-|2012/06/28|Improve parsing of compound filters where the first argument is a class|15271|
-|2012/06/28|Add the ability to declare automatic result summarization in the DDL files for agents|15031|
-|2012/06/26|Suppress subscribing to reply queues when no reply is expected|15226|
-|2012/06/25|Batched RPC requests will now all have the same requestid|15195|
-|2012/06/25|Record the request id on M::Client and in the RPC client stats|15194|
-|2012/06/24|Use UUIDs for the request id rather than our own weak implementation|15191|
-|2012/06/18|The DDL can now define defaults for outputs and the RPC replies are pre-populated|15087|
-|2012/06/18|Remove unused agent help code|15084|
-|2012/06/18|Remove unused code from the *discovery* agent related to inventory and facts|15083|
-|2012/06/18|Nodes will now refuse to load RPC agents without DDL files|15082|
-|2012/06/18|The Plugin Name and Type is now available to DDL objects|15076|
-|2012/06/15|Add a get_data action to the rpcutil agent that can retrieve data from data plugins|15057|
-|2012/06/14|Allow the random selection of nodes to be deterministic|14960|
-|2012/06/12|Remove the Client#discovered_req method and add warnings to the documentation about its use|14777|
-|2012/06/11|Add a discovery source capable of doing introspection on running agents|14945|
-|2012/06/11|Only do identity filter optimisations for the *mc* discovery source|14942|
-|*2012/06/08*|*Release 2.1.0*|14846|
-|2012/06/07|Force discovery state to be reset when changing collectives in the RPC client|14874|
-|2012/06/07|Create code generators for agents and data plugins|14717|
-|2012/06/07|Fix the _No response from_ report to be correctly formatted|14868|
-|2012/06/07|Sub collectives and direct addressing mode now works correctly|14668|
-|2012/06/07|The discovery method is now pluggable, included is one supporting flat files|14255|
-|2012/05/28|Add an application to assist shell completion systems with bash and zsh completion plugins|14196|
-|2012/05/22|Improve error messages from the packager when a DDL file cannot be found|14595|
-|2012/05/17|Add a dependency on stomp to the rubygem|14300|
-|2012/05/17|Adjust the ActiveMQ and Stomp connect_timeout to allow IPv4 fall back to happen in dual homed hosts|14496|
-|2012/05/16|Add a plugable data source usable in discovery and other plugins|14254|
-|2012/05/04|Improve version dependencies and upgrade experience of debian packages|14277|
-|2012/05/03|Add the ability for the DDL to load DDL files from any plugin type|14293|
-|2012/05/03|Rename the MCollective::RPC::DDL to MCollective::DDL to match its larger role in all plugins|14254|
-
-## Version 2.0.x
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|*2013/02/14*|*Release 2.0.1*|19265|
-|2013/02/14|Update vendored JSON gem for CVE-2013-0269|19265|
-|2012/05/04|Improve version dependencies and upgrade experience of debian packages|14277|
-|*2012/04/30*|*Release 2.0.0*|13900|
-
-## Version 1.3.x
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2012/04/30|Compound filters when set from the RPC client were not working|14239|
-|2012/04/25|Various improvements to the RPM spec file wrt licencing, dependencies etc|9451|
-|2012/04/25|Support using rpmbuild-md5 to create RPMs and support Fedora|14159|
-|2012/04/25|Improve LSB compliance in the Red Hat and Debian RC scripts|14151|
-|2012/04/19|Fix reference to _topicnamesep_ and remove _topicprefix_ from examples|13873|
-|2012/04/19|Remove dependency on FPM for building RPM and Deb packages|13573|
-|2012/04/18|Improve default output format from the mco script|14056|
-|2012/04/17|Remove unintended requirement that only newest stomp gems be used|13978|
-|2012/04/12|New init script for Debian that uses LSB functions to start and stop the daemon|13043|
-|2012/04/12|Use sed -i in the Rakefile to improve compatibility with OS X|13324|
-|2012/04/11|Fix compatibility with Ruby 1.9.1 by specifically loading rbconfig early on|13872|
-|*2012/04/05*|*Release 1.3.3*|13599|
-|2012/04/04|Use the MCollective::SSL utility class for crypto functions in the SSL security plugin|13615|
-|2012/04/02|Support reading public keys from SSL Certificates as well as keys|13534|
-|2012/04/02|Move the help template to the common package for both Debian and RedHat|13434|
-|2012/03/30|Support Stomp 1.2.2 CA verified connection to ActiveMQ|10596|
-|2012/03/27|_mco help rpc_ now shows the help for the rpc application|13350|
-|2012/03/22|Add a mco command that creates native OS packaging for plugins|12597|
-|2012/03/21|Default to console based logging at warning level for clients|13285|
-|2012/03/20|Work around SSL_read errors when using SSL or AES plugins and Stomp+SSL in Ruby < 1.9.3|13207|
-|2012/03/16|Improve logging for SSL connections when using Stomp Gem newer than 1.2.0|13165|
-|2012/03/14|Simplify handling of signals like TERM and INT and remove pid file on exit|13105|
-|2012/03/13|Create a conventional place to store implemented_by scripts|13064|
-|2012/03/09|Handle exceptions added to the Stomp 1.1 compliant versions of the Stomp gem|13020|
-|2012/03/09|Specifically enable reliable communications while using the pool style syntax|13040|
-|2012/03/06|Initial support for the Windows Platform|12555|
-|2012/03/05|Application plugins can now disable any of 3 sections of the standard CLI argument parsers|12859|
-|2012/03/05|Fix base 64 encoding and decoding of message payloads that would previous raise unexpected exceptions|12950|
-|2012/03/02|Treat :hosts and :nodes as equivalents when supplying discovery data, be more strict about flags discover will accept|12852|
-|2012/03/02|Allow exit() to be used everywhere in application plugins, not just in the main method|12927|
-|2012/03/02|Allow batch mode to be enabled and disabled on demand during the life of a client|12854|
-|2012/02/29|Show the progress bar before sending any requests to give users feedback as soon as possible rather than after first result only|12865|
-|2012/02/23|Do not log exceptions in the RPC application when a non existing action is called with request parameters|12719|
-|2012/02/17|Log miscellaneous Stomp errors at error level rather than debug|12705|
-|2012/02/17|Improve subscription tracking by using the subID feature of the Stomp gem and handle duplicate exceptions|12703|
-|2012/02/15|Improve error handling in the inventory application for non responsive nodes|12638|
-|2012/02/14|Comply to Red Hat guideline by not setting mcollective to start by default after RPM install|9453|
-|2012/02/14|Allow building the client libraries as a gem|9383|
-|2012/02/13|On Red Hat like systems read /etc/sysconfig/mcollective in the init script to allow modification of the environment|7441|
-|2012/02/13|Make the handling of symlinks to the mco script more robust to handle directories with mc- in their name|6275|
-|2012/02/01|systemu and therefore MC::Shell can sometimes return nil exit code, the run() method now handles this better by returning -1 exit status|12082|
-|2012/01/27|Improve handling of discovery data on STDIN to avoid failures when run without a TTY and without supplying discovery data|12084|
-|2012/01/25|Allow the syslog facility to be configured|12109|
-|2012/01/13|Add a RPC agent validator to ensure input is one of list of known good values|11935|
-|2012/01/09|The printrpc helper did not correctly display empty strings in received output|11012|
-|2012/01/09|Add a halt method to the Application framework and standardize exit codes|11280|
-|2011/11/21|Remove unintended dependency on _pp_ in the ActiveMQ plugin|10992|
-|2011/11/17|Allow reply to destinations to be supplied on the command line or API|9847|
-|*2011/11/17*|*Release 1.3.2*|*10830*|
-|2011/11/16|Improve error reporting for code errors in application plugins|10883|
-|2011/11/15|The limit method is now configurable on each RPC client as well as the config file|7772|
-|2011/11/15|Add a --graph option to the ping application that shows response distribution|10864|
-|2011/11/14|An ActiveMQ specific connector was added that supports direct connections|7899|
-|2011/11/11|SimpleRPC clients now support native batching with --batch|5939|
-|2011/11/11|The client now unsubscribes from topics when it's idle minimising the risk of receiving misdirected messages|10670|
-|2011/11/09|Security plugins now ignore miss directed messages early thus using fewer resources|10671|
-|2011/10/28|Support ruby-1.9.2-p290 and ruby-1.9.3-rc1|10352|
-|2011/10/27|callerid, certificate names, and identity names can now only have \w . and - in them|10327|
-|2011/10/25|When discovery information is provided always accept it without requiring reset first|10265|
-|2011/10/24|Add :number, :integer and :float to the DDL and rpc application|9902|
-|2011/10/22|Speed up discovery when limit targets are set|10133|
-|2011/10/22|Do not attempt to validate TTL and Message Times on replies in the SSL plugin|10226|
-|2011/10/03|Allow the RPC client to raise an exception rather than exit on failure|9360|
-|2011/10/03|Allow the TTL of requests to be set in the config file and the SimpleRPC API|9399|
-|2011/09/26|Cryptographically secure the TTL and Message Time of requests when using AES and SSL plugins|9400|
-|2011/09/20|Update default shipped configurations to provide a better out of the box experience|9452|
-|2011/09/20|Remove deprecated mc- scripts|9402|
-|2011/09/20|Keep track of messages that has expired and expose the stat in rpcutil and inventory application|9456|
-|*2011/09/16*|*Release 1.3.1*|*9133*|
-|2011/09/9|Use direct messaging where possible for identity filters and make the rpc application direct aware|8466|
-|2011/08/29|Enforce a 60 second TTL on all messages by default|8325|
-|2011/08/29|Change the default classes.txt file to be in line with Puppet defaults|9133|
-|2011/08/06|Add reload-agents and reload-loglevel commands to the redhat RC script|7730|
-|2011/08/06|Avoid reloading the authorization class over and over from disk on each request|8703|
-|2011/08/06|Add a boolean validator to SimpleRPC agents|8799|
-|2011/08/06|Justify text results better when using printrpc|8807|
-|2011/07/22|Add --version to the mco utility|7822|
-|2011/07/22|Add missing meta data to the discovery agent|8497|
-|2011/07/18|Raise an error if invalid format fact filters are supplied|8419|
-|2011/07/14|Add a rich discovery query language|8181|
-|2011/07/08|Do not set RUBYLIB in the RC scripts, the OS should do the right thing|8063|
-|2011/07/07|Add a -j argument to all SimpleRPC clients that causes printrpc to produce JSON data|8280|
-|2011/06/30|Add the ability to do point to point comms for requests affecting small numbers of hosts|7988|
-|2011/06/21|Add support for Stomp Gem version 1.1.9 callback based logging|7960|
-|2011/06/21|On the server side log missing DDL files at debug and not warning level|7961|
-|2011/06/16|Add the ability for nodes to subscribe to per-node queues, off by default|7225|
-|2011/06/12|Remove assumptions about middleware structure from the core and move it to the connector plugins|7619|
-|*2011/06/08*|*Release 1.3.0*|7796|
-|2011/06/07|Exceptions raised during option parsing were not handled and resulted in stack traces|7796|
-|2011/06/06|Remove the sshkey, it's being moved to the plugin repository|7794|
-|2011/06/02|Correct parsing of MCOLLECTIVE_EXTRA_OPTS in cases where no config related settings were set|7755|
-|2011/05/31|Disconnect from the middleware when an application calls exit|7712|
-|2011/05/29|Validations failure in RPC agents will now raise the correct exceptions as documented|7711|
-|2011/05/25|Make the target collective for registration messages configurable|7650|
-|2011/05/24|Rename the connector plugins send method to publish to avoid issues ruby Object#send|7623|
-|2011/05/23|Log a warning when the CF file parsing fails rather than raise a whole ruby exception|7627|
-|2011/05/23|Allow applications to use the exit method as would normally be expected|7626|
-|2011/05/22|Refactor subscribe and unsubscribe so that middleware structure is entirely contained in the connectors|7620|
-|2011/05/21|Add the ability for agents to programatically declare if they should work on a node|7583|
-|2011/05/20|Improve error reporting in the single application framework|7574|
-|2011/05/16|Allow _._ in fact names|7532|
-|2011/05/16|Fix compatability issues with RH4 init system|7448|
-|2011/05/15|Handle failures from remote nodes better in the inventory app|7524|
-|2011/05/06|Revert unintended changes to the Debian rc script|7420|
-|2011/05/06|Remove the _test_ agent that was accidentally checked in|7425|
-
-## Version 1.2.x
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|*2011/06/30*|*Release 1.2.1*|8117|
-|2011/06/02|Correct parsing of MCOLLECTIVE_EXTRA_OPTS in cases where no config related settings were set|7755|
-|2011/05/23|Allow applications to use the exit method as would normally be expected|7626|
-|2011/05/16|Allow _._ in fact names|7532|
-|2011/05/16|Fix compatability issues with RH4 init system|7448|
-|2011/05/15|Handle failures from remote nodes better in the inventory app|7524|
-|2011/05/06|Revert unintended changes to the Debian rc script|7420|
-|2011/05/06|Remove the _test_ agent that was accidentally checked in|7425|
-|*2011/05/04*|*Release 1.2.0*|7227|
-
-## Version 1.1.x
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2011/05/03|Improve Red Hat RC script by using distro builtin functions|7340|
-|2011/05/01|Support setting a priority on Stomp messages|7246|
-|2011/04/30|Handle broken and incomplete DDLs better and improve the format of DDL output|7191|
-|2011/04/23|Encode the target agent and collective in requests|7223|
-|2011/04/20|Make the SSL Cipher used a config option|7191|
-|2011/04/20|Add a clear method to the PluginManager that deletes all plugins, improve test isolation|7176|
-|2011/04/19|Abstract the creation of request and reply hashes to simplify connector plugin development|5701|
-|2011/04/15|Improve the shellsafe validator and add a Util method to do shell escaping|7066|
-|2011/04/14|Update Rakefile to have a mail_patches task|6874|
-|2011/04/13|Update vendored systemu library for Ruby 1.9.2 compatability|7067|
-|2011/04/12|Fix failing tests on Ruby 1.9.2|7067|
-|2011/04/11|Update the DDL documentation to reflect the _mco help_ command|7042|
-|2011/04/11|Document the use filters on the CLI|5917|
-|2011/04/11|Improve handling of unknown facts in Util#has_fact? to avoid exceptions about nil#clone|6956|
-|2011/04/11|Correctly set timeout on the discovery agent to 5 seconds as default|7045|
-|2011/04/11|Let rpcutil#agent_inventory supply _unknown_ for missing values in agent meta data|7044|
-|*2011/04/07*|*Release 1.1.4*|6952|
-|2011/03/28|Correct loading of vendored JSON gem|6877|
-|2011/03/28|Show collective and sub collective info in the inventory application|6872|
-|2011/03/23|Disconnect from the middleware when mcollectived disconnects|6821|
-|2011/03/21|Update rpcutil ddl file to be less strict about valid fact names|6764|
-|2011/03/22|Support reading configuration from configfir/plugin.d for plugins|6623|
-|2011/03/21|Update default configuration files for subcollectives|6741|
-|2011/03/16|Add the ability to implement actions using external scripts|6705|
-|2011/03/15|Port mc-controller to the Application framework and deprecate the exit command|6637|
-|2011/03/13|Only cache registration and discovery agents, handle the rest as new instances|6692|
-|2011/03/08|PluginManager can now create new instances on demand for a plugin type|6622|
-|*2011/03/07*|*Release 1.1.3*|6609|
-|2011/03/04|Rename /usr/sbin/mc to /usr/bin/mco|6578|
-|2011/03/01|Wrap rpcclient in applications ensuring that options is always set|6308|
-|2011/02/28|Make communicating with the middleware more robust by including send calls in timeouts|6505|
-|2011/02/28|Create a wrapper to safely run shell commands avoiding zombies|6392|
-|2011/02/19|Introduce Subcollectives for network partitioning|5967|
-|2011/02/19|Improve error handling when parsing arguments in the rpc application|6388|
-|2011/02/19|Fix error logging when file_logger creation fails|6387|
-|2011/02/17|Correctly parse MCOLLECTIVE_EXTRA_OPTS in the new unified binary framework|6354|
-|2011/02/15|Allow the signing key and Debian distribution to be customized|6321|
-|2011/02/14|Remove inadvertently included package.ddl|6313|
-|2011/02/14|Handle missing libdirs without crashing|6306|
-|*2011/02/14*|*Release 1.1.2*|6303|
-|2011/02/13|Surpress replies to SimpleRPC clients who did not request results|6305|
-|2011/02/11|Fix Debian packaging error due to the same file in multiple packages|6276|
-|2011/02/11|The application framework will now disconnect from the middleware for consistancy|6292|
-|2011/02/11|Returning _nil_ from a registration plugin will skip registration|6289|
-|2011/02/11|Set loglevel to warn by default if not specified in the config file|6287|
-|2011/02/10|Fix backward compatability with empty fact strings|6278|
-|*2011/02/07*|*Release 1.1.1*|6080|
-|2011/02/02|Load the DDL from disk once per printrpc call and not for every result|5958|
-|2011/02/02|Include full Apache 2 license text|6113|
-|2011/01/31|Create a new single executable application framework|5897|
-|2011/01/30|Fix backward compatibility with old foo=/bar/ style fact searches|5985|
-|2011/01/30|Documentation update to reflect correct default identity behavior|6073|
-|2011/01/29|Let the YAML file force fact reloads when the files update|6057|
-|2011/01/29|Add the ability for fact plugins to force fact invalidation|6057|
-|2011/01/29|Document an approach to disable type validation in the DDL|6066|
-|2011/01/19|Add basic filters to the mc-ping command|5933|
-|2011/01/19|Add a ping action to the rpcutil agent|5937|
-|2011/01/17|Allow MC::RPC#printrpc to print single results|5918|
-|2011/01/16|Provide SimpleRPC style results when accessing the MC::Client results directly|5912|
-|2011/01/11|Add an option to Base64 encode the STOMP payload|5815|
-|2011/01/11|Fix a bug with forcing all facts to be strings|5832|
-|2011/01/08|When using reload_agents or USR1 signal no agents would be reloaded|5808|
-|2011/01/04|Use the LSB based init script on SUSE|5762|
-|2011/01/04|Remove the use of a Singleton in the logging class|5749|
-|2011/01/02|Add AES+RSA security plugin|5696|
-|2010/12/31|Security plugins now have access to the callerid of the message they are replying to|5745|
-|2010/12/30|Allow - in fact names|5727|
-|2010/12/29|Treat machines that fail security validation like ones that did not respond|5700|
-|*2010/12/29*|*Release 1.1.0*|5695|
-|2010/12/28|Remove trailing whitespace from all source files|5702|
-|2010/12/28|Adjust the logfile audit format to include local time and all on one line|5694|
-|2010/12/26|Improve the SimpleRPC fact_filter helper to support new fact operators|5678|
-|2010/12/25|Increase the rpcutil timeout to allow for slow facts|5679|
-|2010/12/25|Allow for network and fact source latency when calculating client timeout|5676|
-|2010/12/25|Remove MCOLLECTIVE_TIMEOUT and MCOLLECTIVE_DTIMEOUT environment vars in favour of MCOLLECTIVE_EXTRA_OPTS|5675|
-|2010/12/25|Refactor the creation of the options hash so other tools don't need to know the internal formats|5672|
-|2010/12/21|The fact plugin format has been changed and simplified, the base now provides caching and thread safety|5083|
-|2010/12/20|Add parameters <=, >=, <, >, !=, == and =~ to fact selection|5084|
-|2010/12/14|Add experimental sshkey security plugin|5085|
-|2010/12/13|Log a startup message showing version and log level|5538|
-|2010/12/13|Add a console logger|5537|
-|2010/12/13|Logging is now plugable and a syslog plugin was provided|5082|
-|2010/12/13|Allow libdir to be an array of directories for agents and ddl files|5253|
-|2010/12/13|The progress bar will now intelligently figure out the terminal dimentions|5524|
-
-## Version 1.0.x
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|*2011/02/16*|*Release 1.0.1*|6342|
-|2011/02/02|Include full Apache 2 license text|6113|
-|2011/01/29|The YAML fact plugin kept deleted facts in memory|6056|
-|2011/01/04|Use the LSB based init script on SUSE|5762|
-|2010/12/30|Allow - in fact names|5727|
-|2010/12/29|Treat machines that fail security validation like ones that did not respond|5700|
-|2010/12/25|Allow for network and fact source latency when calculating client timeout|5676|
-|2010/12/25|Increase the rpcutil timeout to allow for slow facts|5679|
-|*2010/12/13*|*Release 1.0.0*|5453|
-
-## Version 0.4.x
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2010/12/04|Remove the LSB requirements for RedHat systems|5451|
-|2010/11/23|Make the YAML fact source thread safe and force all facts to strings|5377|
-|2010/11/23|Add get_config_item to rpcutil to retrieve a running config value from a server|5376|
-|2010/11/20|Convert mc-facts into a SimpleRPC client|5371|
-|2010/11/18|Added GPG signing to Rake packaging tasks (SIGNED=1)|5355|
-|2010/11/17|Improve error messages from clients in the case of failure|5329|
-|2010/11/17|Add helpers to disconnect from the middleware and update all bundled clients|5328|
-|2010/11/16|Correct LSB provides and requires in default init script|5222|
-|2010/11/16|Input validation on rpcutil has been improved to match all valid facts|5320|
-|2010/11/16|Add the ability to limit the results to a subset of hosts|5306|
-|2010/11/15|Add fire and forget mode to SimpleRPC custom_request|5305|
-|2010/11/09|General connection settings to the Stomp connector was ignored|5245|
-|*2010/10/18*|*Release version 0.4.10*| |
-|2010/10/18|Document exit command to mc-controller|152|
-|2010/10/13|Log messages that don't pass the filters at debug level|149|
-|2010/10/03|Preserve options in cases where RPC::Client instances exist in the same program|148|
-|2010/09/30|Add the ability to set different types of callerid in the PSK plugin|145|
-|2010/09/30|Improve Ruby 1.9.x compatibility|142|
-|2010/09/29|Improve error handling in registration to avoid high CPU usage loops|143|
-|*2010/09/21*|*Release version 0.4.9*| |
-|2010/09/20|Improve Debian packaging task|140|
-|2010/09/20|Add :boolean type support to the DDL|138|
-|2010/09/19|Refactor MCollective::RPC to add less unneeded stuff to Object|137|
-|2010/09/18|Prevent duplicate config loading with multiple clients active|136|
-|2010/09/18|Rotate the log file by default, keeping 5 x 2MB files|135|
-|2010/09/18|Write a overview document detailing security of the collective|131|
-|2010/09/18|Add MCollective.version, set it during packaging and include it in the rpcutil agent|134|
-|2010/09/13|mc-inventory now use SimpleRPC and the rpcutil agent and display server stats|133|
-|2010/09/13|Make the path to the rpc-help.erb configurable and set sane default|130|
-|2010/09/13|Make the configfile used available in the Config class and add to rpcutil|132|
-|2010/09/12|Rework internal statistics and add a rpcutil agent|129|
-|2010/09/12|Fix internal memory structures related to agent meta data|128|
-|2010/08/24|Update the OpenBSD port for changes in 0.4.8 tarball|125|
-|2010/08/23|Fix indention/block error in M:R:Stats|124|
-|2010/08/23|Fix permissions in the RPM for files in /etc|123|
-|2010/08/23|Fix language in two error messages|122|
-|*2010/08/20*|*Release version 0.4.8*| |
-|2010/08/19|Fix missing help template in debian packages|90|
-|2010/08/18|Clean up some hardlink warnings in the Rakefile|117|
-|2010/08/18|Include the website in the main repo and add a simple Rake task|118|
-|2010/08/17|Handle exceptions for missing plugins better|115|
-|2010/08/17|Add support for ~/.mcollective as a config file|114|
-|2010/08/07|SSL security plugin can use either YAML or Marshal|94|
-|2010/08/06|Multiple YAML files can now be used as fact source|112|
-|2010/08/06|Allow log level to be adjusted at run time with USR2|113|
-|2010/07/31|Add basic report scripting support to mc-inventory|111|
-|2010/07/06|Removed 'rpm' from the default rake task|109|
-|2010/07/06|Add redhat-lsb to the server RPM dependencies|108|
-|*2010/06/29*|*Release version 0.4.7*| |
-|2010/06/27|Change default factsource to Yaml|106|
-|2010/06/27|Added VIM snippets to create DDLs and Agents|102|
-|2010/06/26|DDL based help now works better with Symbols in in/output|105|
-|2010/06/23|Whitespace at the end of config lines are now stripped|100|
-|2010/06/22|printrpc will now inject some colors into results|99|
-|2010/06/22|Recover from syntax and other errors in agents|98|
-|2010/06/17|The agent a MC::RPC::Client is working on is now available|97|
-|2010/06/17|Integrate the DDL with data display helpers like printrpc|92|
-|2010/06/15|Avoid duplicate topic subscribes in complex clients|95|
-|2010/06/15|Catch some unhandled exceptions in RPC Agents|96|
-|2010/06/15|Fix missing help template file from RPM|90|
-|*2010/06/14*|*Release version 0.4.6* | |
-|2010/06/12|Qualify the Process class to avoid clashes in the discovery agent|88|
-|2010/06/12|Add mc-inventory which shows agents, classes and facts for a node|87|
-|2010/06/11|mc-facts now supports standard filters|86|
-|2010/06/11|Add connection pool retry options and ssl for connection|85|
-|2010/06/11|Add support for specifying multiple stomp hosts for failover|84|
-|2010/06/10|Tighten up handling of filters to avoid nil's getting into them|83|
-|2010/06/09|Sort the mc-facts output to be more readable|82|
-|2010/06/08|Fix deprecation warnings in newer Stomp gems|81|
-|*2010/06/03*|*Release version 0.4.5* | |
-|2010/06/01|Improve the main discovery agent by adding facts and classes to its inventory action|79|
-|2010/05/30|Add various helpers to get reports as text instead of printing them|43|
-|2010/05/30|Add a custom_request method to call SimpleRPC agents with your own discovery|75|
-|2010/05/30|Refactor RPC::Client to be more generic and easier to maintain|75|
-|2010/05/29|Fix a small scoping issue in Security::Base|76|
-|2010/05/25|Add option --no-progress to disable progress bar for SimpleRPC|74|
-|2010/05/23|Add some missing dependencies to the RPMs|72 |
-|2010/05/22|Add an option _:process_results_ to the client|71|
-|2010/05/13|Fix help output that still shows old branding|70|
-|2010/04/27|The supplied generic stompclient now accepts STOMP_PORT in the environment|68 |
-|2010/04/26|Add a SimpleRPC Client helper to reset filters|64 |
-|2010/04/26|Listen for signal USR1 and reload all agents from disk|65 |
-|2010/04/12|Add SimpleRPC Authorization support|63|
-|*2010/04/03*|*Release version 0.4.4* | |
-|2010/03/27|Make it easier to construct SimpleRPC requests to use with the standard client library|60 |
-|2010/03/27|Manipulating the filters via the helper methods will force rediscovery|59 |
-|2010/03/23|Prevent Activesupport when brought in by Facter from breaking our logs|57 |
-|2010/03/23|Clean up logging for messages not targeted at us|56 |
-|2010/03/19|Add exception handling to the registration base class|55 |
-|2010/03/03|Use /usr/bin/env ruby instead of hardcoded paths|54|
-|2010/02/17|Improve mc-controller and document it|46|
-|2010/02/08|Remove some close coupling with Stomp to easy creating of other connectors|49|
-|2010/02/01|Made the discovery agent timeout configurable using plugin.discovery.timeout|48|
-|2010/01/25|mc-controller now correctly loads/reloads agents.|45|
-|2010/01/25|Building packages has been improved to ensure rdocs are always included|44 |
-|*2010/01/24*|*Release version 0.4.3* | |
-|2010/01/23|Handle ctrl-c during discovery without showing exceptions to users|34 |
-|2010/01/21|Force all facts in the YAML fact source to be strings|41 |
-|2010/01/19|Add auditing to SimpleRPC clients and Agents | |
-|2010/01/18|The SRPM we provide will now build outside of the Rake environment|40|
-|2010/01/18|Add a _fail!_ method to RPC::Agent|37|
-|2010/01/18|mc-rpc can now be used without supplying arguments|38 |
-|2010/01/18|Don't raise an error if no user/pass is given to the stomp connector, try unauthenticated mode|35|
-|2010/01/17|Improve error message when Regex validation failed on SimpleRPC input|36|
-|*2010/01/13*|*Release version 0.4.2* | |
-|2010/01/13|New packaging for Debian provided by Riccardo Setti|29|
-|2010/01/07|Improved LSB compliance of the init script - thanks Riccardo Setti|32|
-|2010/01/07|Multiple calls to SimpleRPC client would reset discovered hosts|31|
-|2010/01/04|Timeouts can now be changed with MCOLLECTIVE_TIMEOUT and MCOLLECTIVE_DTIMEOUT environment vars|25|
-|2010/01/04|Specify class and fact filters easier with the new -W or --with option|27 |
-|2010/01/04|Added COPYING file to RPMs and tarball|28|
-|2010/01/04|Make shorter filter options -C, -I, -A and -F|26|
-|*2010/01/02*|*Release version 0.4.1* | |
-|2010/01/02|Added hooks to plug into the processing of requests, also enabled setting meta data and timeouts|14|
-|2010/01/02|Created readers for @config and @logger in the SimpleRPC agent|23|
-|2009/12/30|Don't send out any requests if no nodes were discovered|17|
-|2009/12/30|Added :discovered and :discovered_nodes to client stats|20|
-|2009/12/30|Add a empty_filter? helper to the RPC mixin|18|
-|2009/12/30|Fix formatting bug with progress bar|21|
-|2009/12/29|Simplify mc-rpc command line|16|
-|2009/12/29|Fix layout issue when printing hosts that did not respond|15|
-|*2009/12/29*|*Release version 0.4.0* | |
-|2009/12/28|Add support for other configuration management systems like chef in the --with-class filters|13|
-|2009/12/28|Add a <em>Util.empty_filter?</em> to test for an empty filter| |
-|2009/12/27|Create a new client framework - SimpleRPC|6|
-|2009/12/27|Add support for multiple filters of the same type|3|
-
-## Version 0.3.x
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|*2009/12/17*|*Release version 0.3.0* | |
-|2009/12/16|Improvements for newer versions of Ruby where TERM signal was not handled|7|
-|2009/12/07|MCollective::Util is now a module and plugins can drop in util classes in the plugin dir| |
-|2009/12/07|The Rakefile now works with rake provided on Debian 4 systems|2|
-|2009/12/07|Improvements in the RC script for Debian and older Ubuntu systems|5|
-
-## Version 0.2.x
-
-|Date|Description|Ticket|
-|2009/12/01|Release version 0.2.0| |
diff --git a/website/configure/server.md b/website/configure/server.md
deleted file mode 100644 (file)
index b8cba6f..0000000
+++ /dev/null
@@ -1,732 +0,0 @@
----
-title: "MCollective Â» Configure Â» Servers"
-layout: default
----
-
-
-<!-- TODO Got to change this middleware link as soon as enough of the deploy docs come up. -->
-[middleware]: /mcollective/deploy/middleware/activemq.html
-[filters]: /mcollective/reference/ui/filters.html
-[plugin_directory]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki
-[facter_plugin]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/FactsFacter
-[ohai_plugin]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/FactsOhai
-[chef_classfile]: /mcollective/reference/integration/chef.html#class-filters
-[fact]: #facts-identity-and-classes
-[connector_plugin]: #connector-settings
-[subcollectives]: /mcollective/reference/basic/subcollectives.html
-[registration]: /mcollective/reference/plugins/registration.html
-[puppetdb]: /puppetdb/
-[security_plugin]: #security-plugin-settings
-[auditing]: /mcollective/simplerpc/auditing.html
-[authorization]: /mcollective/simplerpc/authorization.html
-[actionpolicy]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/AuthorizationActionPolicy
-[security_aes]: /mcollective/reference/plugins/security_aes.html
-[security_overview]: /mcollective/security.html
-[ssl_plugin]: /mcollective/reference/plugins/security_ssl.html
-[activemq_tls_verified]: /mcollective/reference/integration/activemq_ssl.html#ca-verified-tls
-[activemq_connector]: /mcollective/reference/plugins/connector_activemq.html
-[rabbitmq_connector]: /mcollective/reference/plugins/connector_rabbitmq.html
-[stdlib]: http://forge.puppetlabs.com/puppetlabs/stdlib
-
-{% capture badbool %}**Note:** Use these exact values only; do not use "true" or "false."{% endcapture %}
-
-{% capture pluginname %}**Note:** Capitalization of plugin names doesn't matter; MCollective normalizes it before loading the plugin.{% endcapture %}
-
-{% capture path_separator %}system path separator (colon \[`:`\] on \*nix, semicolon \[`;`\] on Windows){% endcapture %}
-
-
-
-This document describes MCollective server configuration in MCollective 2.0.0 and higher. Older versions may lack certain fetaures.
-
-
-Example / Index
------
-
-The following is an example MCollective server config file showing all of the major groups of settings. All of the setting names styled as links can be clicked, and will take you down the page to a full description of that setting.
-
-[See below the example for a full description of the config file location and format.](#the-server-config-files)
-
-<pre><code># /etc/mcollective/server.cfg
-
-# <a href="#connector-settings">Connector settings (required):</a>
-# -----------------------------
-
-<a href="#connector">connector</a> = activemq
-<a href="#directaddressing">direct_addressing</a> = 1
-
-# <a href="#activemq-connector-settings">ActiveMQ connector settings:</a>
-plugin.activemq.pool.size = 1
-plugin.activemq.pool.1.host = middleware.example.net
-plugin.activemq.pool.1.port = 61614
-plugin.activemq.pool.1.user = mcollective
-plugin.activemq.pool.1.password = secret
-plugin.activemq.pool.1.ssl = 1
-plugin.activemq.pool.1.ssl.ca = /var/lib/puppet/ssl/certs/ca.pem
-plugin.activemq.pool.1.ssl.cert = /var/lib/puppet/ssl/certs/web01.example.com.pem
-plugin.activemq.pool.1.ssl.key = /var/lib/puppet/ssl/private_keys/web01.example.com.pem
-plugin.activemq.pool.1.ssl.fallback = 0
-
-# <a href="#rabbitmq-connector-settings">RabbitMQ connector settings:</a>
-plugin.rabbitmq.vhost = /mcollective
-plugin.rabbitmq.pool.size = 1
-plugin.rabbitmq.pool.1.host = middleware.example.net
-# ... etc., similar to activemq settings
-
-# <a href="#security-plugin-settings">Security plugin settings (required):</a>
-# -----------------------------------
-
-<a href="#securityprovider">securityprovider</a> = ssl
-
-# <a href="#ssl-plugin-settings">SSL plugin settings:</a>
-plugin.ssl_client_cert_dir = /etc/mcollective.d/clients
-plugin.ssl_server_private = /etc/mcollective.d/server_private.pem
-plugin.ssl_server_public = /etc/mcollective.d/server_public.pem
-
-# <a href="#psk-plugin-settings">PSK plugin settings:</a>
-plugin.psk = j9q8kx7fnuied9e
-
-# <a href="#facts-identity-and-classes">Facts, identity, and classes (recommended):</a>
-# ------------------------------------------
-
-<a href="#factsource">factsource</a> = yaml
-<a href="#pluginyaml">plugin.yaml</a> = /etc/mcollective/facts.yaml
-<a href="#factcachetime">fact_cache_time</a> = 300
-
-<a href="#identity">identity</a> = web01.example.com
-
-<a href="#classesfile">classesfile</a> = /var/lib/puppet/state/classes.txt
-
-# <a href="#subcollectives">Subcollectives (optional):</a>
-# -------------------------
-
-<a href="#collectives">collectives</a> = mcollective,uk_collective
-<a href="#maincollective">main_collective</a> = mcollective
-
-# <a href="#node-registration">Registration (optional):</a>
-# -----------------------
-
-<a href="#registerinterval">registerinterval</a> = 300
-<a href="#registration">registration</a> = agentlist
-<a href="#registrationcollective">registration_collective</a> = mcollective
-
-# <a href="#auditing">Auditing (optional):</a>
-# -------------------
-
-<a href="#rpcaudit">rpcaudit</a> = 1
-<a href="#rpcauditprovider">rpcauditprovider</a> = logfile
-<a href="#pluginrpcauditlogfile">plugin.rpcaudit.logfile</a> = /var/log/mcollective-audit.log
-
-# <a href="#authorization">Authorization (optional):</a>
-# ------------------------
-
-<a href="#rpcauthorization">rpcauthorization</a> = 1
-<a href="#rpcauthprovider">rpcauthprovider</a> = action_policy
-
-# <a href="#logging">Logging:</a>
-# -------
-
-<a href="#loggertype">logger_type</a> = file
-<a href="#loglevel">loglevel</a> = info
-<a href="#keeplogs">keeplogs</a> = 5
-<a href="#maxlogsize">max_log_size</a> = 2097152
-<a href="#logfacility">logfacility</a> = user
-
-# <a href="#platform-defaults">Platform defaults:</a>
-# -----------------
-
-<a href="#daemonize">daemonize</a> = 1
-<a href="#libdir">libdir</a> = /usr/libexec/mcollective
-<a href="#sslcipher">ssl_cipher</a> = aes-256-cbc
-</code>
-</pre>
-
-
-([↑ Back to top](#content))
-
-
-
-
-
-
-The Server Config File(s)
------
-
-### Main Config File
-
-MCollective servers are configured with the `/etc/mcollective/server.cfg` file. It contains MCollective's core settings, as well as settings for the various plugins.
-
-> **Warning:** This file contains sensitive credentials, and should only be readable by the root user, or whatever user the MCollective daemon runs as.
-
-### File Format
-
-Each line consists of a setting, an equals sign, and a value:
-
-    # setting = value
-    connector = activemq
-
-The spaces on either side of the equals sign are optional. Lines starting with a `#` are comments.
-
-> **Note on Boolean Values:** MCollective's config code does not have consistent handling of boolean values. Many of the core settings will accept values of `1/0` and `y/n`, but will fail to handle `true/false`; additionally, each plugin can handle boolean values differently, and some of them do not properly handle the `y/n` values accepted by the core settings.
->
-> Nearly all known plugins and core settings accept `1` and `0`. Until further notice, you should always use these for all boolean settings, as no other values are universally safe.
-
-### Plugin Config Directory (Optional)
-
-Many of MCollective's settings are named with the format `plugin.<NAME>.<SETTING_NAME>`. These settings can optionally be put in separate files, in the `/etc/mcollective/plugin.d/` directory.
-
-To move a plugin setting to an external file, put it in `/etc/mcollective/plugin.d/<NAME>.cfg`, and use only the `<SETTING_NAME>` segment of the setting. So this:
-
-    # /etc/mcollective/server.cfg
-    plugin.puppet.splay = true
-
-...is equivalent to:
-
-    # /etc/mcollective/plugin.d/puppet.cfg
-    splay = true
-
-Note that this doesn't work for settings like `plugin.psk`, since they have no `<SETTING_NAME>` segment; a setting must have at least three segments to go in a plugin.cfg file.
-
-### Best Practices
-
-You should manage your MCollective servers' config files with config management software (such as Puppet). While most settings in a deployment are the same, several should be different for each server, and managing these differences manually is impractical.
-
-If your deployment is fairly simple and there is little division of responsibility (e.g. having one group in charge of MCollective core and another group in charge of several agent plugins), then you can manage the config file with a simple template.
-
-If your deployment is large or complex, or you expect it to become so, you should manage MCollective settings as individual resources, as this is the only practical way to divide responsibilities within a single file.
-
-Below is an example of how to do this using the `file_line` type from the [puppetlabs/stdlib module][stdlib]:
-
-{% highlight ruby %}
-    # /etc/puppet/modules/mcollective/manifests/setting.pp
-    define mcollective::setting ($setting = $title, $target = '/etc/mcollective/server.cfg', $value) {
-      validate_re($target, '\/(plugin\.d\/[a-z]+|server)\.cfg\Z')
-      $regex_escaped_setting = regsubst($setting, '\.', '\\.', 'G') # assume dots are the only regex-unsafe chars in a setting name.
-
-      file_line {"mco_setting_${title}":
-        path  => $target,
-        line  => "${setting} = ${value}",
-        match => "^ *${regex_escaped_setting} *=.*$",
-      }
-    }
-
-    # /etc/puppet/modules/mcollective_core/manifests/server/connector.pp
-    # ...
-    # Connector settings:
-    mcollective::setting {
-      'connector':
-        value => 'activemq';
-      'direct_addressing':
-        value => '1';
-      'plugin.activemq.pool.size':
-        value => '1';
-      'plugin.activemq.pool.1.host':
-        value => $activemq_server;
-      'plugin.activemq.pool.1.port':
-        value => '61614';
-      'plugin.activemq.pool.1.user':
-        value => $activemq_user;
-      'plugin.activemq.pool.1.password':
-        value => $activemq_password;
-      'plugin.activemq.pool.1.ssl':
-        value => '1';
-      'plugin.activemq.pool.1.ssl.fallback':
-        value => '1';
-    }
-    # ...
-{% endhighlight %}
-
-([↑ Back to top](#content))
-
-
-Required Settings
------
-
-### Connector Settings
-
-
-<pre><code><a href="#connector">connector</a> = activemq
-<a href="#directaddressing">direct_addressing</a> = 1
-
-# <a href="#activemq-connector-settings">ActiveMQ connector settings:</a>
-plugin.activemq.pool.size = 1
-plugin.activemq.pool.1.host = middleware.example.net
-plugin.activemq.pool.1.port = 61614
-plugin.activemq.pool.1.user = mcollective
-plugin.activemq.pool.1.password = secret
-plugin.activemq.pool.1.ssl = 1
-plugin.activemq.pool.1.ssl.ca = /var/lib/puppet/ssl/certs/ca.pem
-plugin.activemq.pool.1.ssl.cert = /var/lib/puppet/ssl/certs/web01.example.com.pem
-plugin.activemq.pool.1.ssl.key = /var/lib/puppet/ssl/private_keys/web01.example.com.pem
-plugin.activemq.pool.1.ssl.fallback = 0
-
-# <a href="#rabbitmq-connector-settings">RabbitMQ connector settings:</a>
-plugin.rabbitmq.vhost = /mcollective
-plugin.rabbitmq.pool.size = 1
-plugin.rabbitmq.pool.1.host = middleware.example.net
-plugin.rabbitmq.pool.1.port = 61613
-# ... etc., similar to activemq settings
-</code>
-</pre>
-
-
-MCollective always requires a connector plugin. The connector plugin is determined by the [middleware][] you chose for your deployment. Each connector plugin will have additional settings it requires.
-
-> #### Shared Configuration
->
-> * All servers and clients must use the same connector plugin, and its settings must be configured compatibly.
-> * You must use the right connector plugin for your [choice of middleware][middleware].
-> * The hostname and port must match what the middleware is using. The username and password must be valid login accounts on the middleware. If you are using [CA-verified TLS][activemq_tls_verified], the certificate must be signed by the same CA the middleware is using.
-
-#### `connector`
-
-Which connector plugin to use. This is determined by your [choice of middleware][middleware].
-
-- _Default:_ `activemq`
-- _Allowed values:_ `activemq`, `rabbitmq`, or the name of a third-party connector plugin. {{ pluginname }}
-
-
-#### `direct_addressing`
-
-Whether your middleware supports direct point-to-point messages. **This should usually be turned on,** although it is off by default. The built-in `activemq` and `rabbitmq` connectors both support direct addressing, as does the external `redis` connector. (The older `stomp` connector, however, does not.)
-
-- _Default:_ `0`
-- _Allowed values:_ `1`, `0`, `y`, `n` --- {{ badbool }}
-
-#### ActiveMQ Connector Settings
-
-ActiveMQ is the main middleware we recommend for MCollective. The ActiveMQ connector can use multiple servers as a failover pool; if you have only one server, just use a pool size of `1`.
-
-> **Note:** This is only a summary of the most commonly used ActiveMQ settings; there are about ten more settings that can be used to tune the connector's performance. [See the ActiveMQ connector documentation][activemq_connector] for more complete details.
-
-- **`plugin.activemq.pool.size`** --- How many ActiveMQ servers to attempt to use. _Default:_ (nothing)
-- **`plugin.activemq.pool.1.host`** --- The hostname of the first ActiveMQ server. (Note that additional servers use the same settings as the first, incrementing the number.) _Default:_ (nothing)
-- **`plugin.activemq.pool.1.port`** --- The Stomp port of the first ActiveMQ server. _Default:_ `61613` or `6163`, depending on the MCollective version.
-- **`plugin.activemq.pool.1.user`** --- The ActiveMQ user account to connect as. If the `STOMP_USER` environment variable is set, MCollective will use its value instead of this setting.
-- **`plugin.activemq.pool.1.password`** --- The password for the user account being used. If the `STOMP_PASSWORD` environment variable is set, MCollective will use its value instead of this setting.
-- **`plugin.activemq.pool.1.ssl`** --- Whether to use TLS when connecting to ActiveMQ. _Default:_ `0`; _allowed:_ `1/0`, `true/false`, `yes/no`
-- **`plugin.activemq.pool.1.ssl.fallback`** --- _(When `ssl == 1`)_ Whether to allow unverified TLS if the ca/cert/key settings aren't set. _Default:_ `0`; _allowed:_ `1/0`, `true/false`, `yes/no`
-- **`plugin.activemq.pool.1.ssl.ca`** --- _(When `ssl == 1`)_ The CA certificate to use when verifying ActiveMQ's certificate. Must be the path to a `.pem` file. _Default:_ (nothing)
-- **`plugin.activemq.pool.1.ssl.cert`** --- _(When `ssl == 1`)_ The certificate to present when connecting to ActiveMQ. Must be the path to a `.pem` file. _Default:_ (nothing)
-- **`plugin.activemq.pool.1.ssl.key`** --- _(When `ssl == 1`)_ The private key corresponding to this node's certificate. Must be the path to a `.pem` file. _Default:_ (nothing)
-
-#### RabbitMQ Connector Settings
-
-The RabbitMQ connector uses very similar settings to the ActiveMQ connector, with the same `.pool.1.host` style of setting names.
-
-[See the RabbitMQ connector documentation][rabbitmq_connector] for more complete details.
-
-
-([↑ Back to top](#content))
-
-
-### Security Plugin Settings
-
-<pre><code><a href="#securityprovider">securityprovider</a> = ssl
-
-# <a href="#ssl-plugin-settings">SSL plugin settings:</a>
-plugin.ssl_client_cert_dir = /etc/mcollective.d/clients
-plugin.ssl_server_private = /etc/mcollective.d/server_private.pem
-plugin.ssl_server_public = /etc/mcollective.d/server_public.pem
-
-# <a href="#psk-plugin-settings">PSK plugin settings:</a>
-plugin.psk = j9q8kx7fnuied9e
-</code>
-</pre>
-
-MCollective always requires a security plugin. (Although they're called security plugins, they actually handle more, including message serialization.) Each security plugin will have additional settings it requires.
-
-> #### Shared Configuration
->
-> All servers and clients must use the same security plugin, and its settings must be configured compatibly.
-
-It's possible to write new security plugins, but most people use one of the three included in MCollective:
-
-- **SSL:** The best choice for most users. Provides very good security when combined with TLS on the connector plugin (see above).
-- **PSK:** Poor security, but easy to configure; fine for proof-of-concept deployments.
-- **AES:** Complex to configure, and carries a noticable performance cost in large networks. Only suitable for certain use cases, like where TLS on the middleware is impossible.
-
-For a full-system look at how security works in MCollective, see [Security Overview][security_overview].
-
-
-#### `securityprovider`
-
-Which security plugin to use.
-
-- _Default:_ `psk`
-- _Allowed values:_ `ssl`, `psk`, `aes_security`, or the name of a third-party security plugin. {{ pluginname }}
-
-#### SSL Plugin Settings
-
-> **Note:** This security plugin requires you to manage and distribute SSL credentials. [See the SSL security plugin page][ssl_plugin] for full details. In summary:
->
-> * All servers share **one** "server" keypair. They must all have a copy of the public key and private key.
-> * Every admin user must have a copy of the server public key.
-> * Every admin user has their own "client" keypair.
-> * Every server must have a copy of **every** authorized client public key.
-
-All of these settings have **no default,** and must be set for the SSL plugin to work.
-
-- **`plugin.ssl_server_private`** --- The path to the server private key file, which must be in `.pem` format.
-- **`plugin.ssl_server_public`** --- The path to the server public key file, which must be in `.pem` format.
-- **`plugin.ssl_client_cert_dir`** --- A directory containing every authorized client public key.
-
-
-#### PSK Plugin Settings
-
-> **Note:** The only credential used by this plugin is a single shared password, which all servers and admin users have a copy of.
-
-- **`plugin.psk`** --- The shared passphrase. If the `MCOLLECTIVE_PSK` environment variable is set, MCollective will use its value instead of this setting.
-
-
-([↑ Back to top](#content))
-
-
-Facts, Identity, and Classes
------
-
-<pre><code><a href="#factsource">factsource</a> = yaml
-<a href="#pluginyaml">plugin.yaml</a> = /etc/mcollective/facts.yaml
-<a href="#factcachetime">fact_cache_time</a> = 300
-
-<a href="#identity">identity</a> = web01.example.com
-
-<a href="#classesfile">classesfile</a> = /var/lib/puppet/state/classes.txt
-</code>
-</pre>
-
-MCollective clients use filters to discover nodes and limit commands. (See [Discovery Filters][filters] for more details.) These filters can use a variety of per-server metadata, including **facts, identity,** and **classes.**
-
-* **Facts:** A collection of key/value data about a server's hardware and software. (E.g. `memorytotal = 8.00 GB`, `kernel = Darwin`, etc.)
-* **Identity:** The name of the node.
-* **Classes:** The Puppet classes (or Chef cookbooks, etc.) applied to this node. Classes are useful as metadata because they describe what _roles_ a server fills at your site.
-
-None of these settings are mandatory, but MCollective is less useful without them.
-
-#### `identity`
-
-The node's name or identity. This **should** be unique for each node, but does not **need** to be.
-
-- _Default:_ The value of Ruby's `Socket.gethostname` method, which is usually the server's FQDN.
-- _Sample value:_ `web01.example.com`
-- _Allowed values:_ Any string containing only alphanumeric characters, hyphens, and dots --- i.e. matching the regular expression `/\A[\w\.\-]+\Z/`
-
-#### `classesfile`
-
-A file with a list of classes applied by your configuration management system. This should be a plain text file containing one class name per line.
-
-Puppet automatically writes a class file, which can be found by running `sudo puppet apply --configprint classfile`. [Chef can be made to write a class file][chef_classfile].
-
-- _Default:_ `/var/lib/puppet/state/classes.txt`
-
-
-#### `factsource`
-
-Which fact plugin to use.
-
-MCollective includes a fact plugin called `yaml`. Most users should use this default, set [the `plugin.yaml` setting (see below)](#pluginyaml), and arrange to fill the file it relies on.
-
-Other fact plugins (including [Facter][facter_plugin] and [Ohai][ohai_plugin] ones) are available in the [plugin directory][plugin_directory]. These may require settings of their own.
-
-- _Default:_ `yaml`
-- _Allowed values:_ The name of any installed fact plugin, with the `_facts` suffix trimmed off. {{ pluginname }}
-
-#### `plugin.yaml`
-
-_When `factsource == yaml`_
-
-The fact file(s) to load for [the default `yaml` fact plugin](#factsource).
-
-- _Default:_ (nothing)
-- _Sample value:_ `/etc/mcollective/facts.yaml`
-- _Valid values:_ A single path, or a list of paths separated by the {{ path_separator }}.
-
-**Notes:**
-
-The default `yaml` fact plugin reads cached facts from a file, which should be a simple YAML hash. If multiple files are specified, they will be merged. (Later files override prior ones if there are conflicting values.)
-
-**The user is responsible for populating the fact file;** by default it is empty, and MCollective has no facts.
-
-If you are using Puppet and Facter, you can populate it by putting something like the following in your puppet master's `/etc/puppet/manifests/site.pp`, outside any node definition:
-
-{% highlight ruby %}
-    # /etc/puppet/manifests/site.pp
-    file{"/etc/mcollective/facts.yaml":
-       owner    => root,
-       group    => root,
-       mode     => 400,
-       loglevel => debug, # reduce noise in Puppet reports
-       content  => inline_template("<%= scope.to_hash.reject { |k,v| k.to_s =~ /(uptime_seconds|timestamp|free)/ }.to_yaml %>"), # exclude rapidly changing facts
-    }
-{% endhighlight %}
-
-#### `fact_cache_time`
-
-How long (in seconds) to cache fact results before refreshing from source. This can be ignored unless you're using a non-default `factsource`.
-
-- _Default:_ `300`
-
-([↑ Back to top](#content))
-
-
-Optional Features
------
-
-### Subcollectives
-
-<pre><code><a href="#collectives">collectives</a> = mcollective,uk_collective
-<a href="#maincollective">main_collective</a> = mcollective
-</code>
-</pre>
-
-Subcollectives provide an alternate way of dividing up the servers in a deployment. They are mostly useful because the middleware can be made aware of them, which enables traffic flow and access restrictions. In multi-datacenter deployments, this can save bandwidth costs and give some extra security.
-
-* [See the Subcollectives and Partitioning page][subcollectives] for more details and an example of site partitioning.
-
-Subcollective membership is managed **on the server side,** by each server's config file. A given server can join any number of collectives, and will respond to commands from any of them.
-
-> #### Shared Configuration
->
-> If you are using any additional collectives (besides the default `mcollective` collective), your middleware must be configured to permit traffic on those collectives. See the middleware deployment guide for your specific middleware to see how to do this:
->
-> * ActiveMQ: [Subcollective topic/queue names](/mcollective/deploy/middleware/activemq.html#topic-and-queue-names) --- [Multi-subcollective authorization example](/mcollective/deploy/middleware/activemq.html#detailed-restrictions-with-multiple-subcollectives)
-
-
-#### `collectives`
-
-A comma-separated list (spaces OK) of [subcollectives][] this server should join.
-
-- _Default:_ `mcollective`
-- _Sample value:_ `mcollective,uk_collective`
-
-#### `main_collective`
-
-The main collective for this server. Currently, this is only used as the default value for the [`registration_collective`](#registrationcollective) setting.
-
-- _Default:_ (the first value of [the `collectives` setting](#collectives), usually `mcollective`)
-
-
-([↑ Back to top](#content))
-
-
-### Node Registration
-
-<pre><code><a href="#registerinterval">registerinterval</a> = 300
-<a href="#registration">registration</a> = agentlist
-<a href="#registrationcollective">registration_collective</a> = mcollective
-</code>
-</pre>
-
-By default, registration is disabled, due to [`registerinterval`](#registerinterval) being set to 0.
-
-Optionally, MCollective servers can [send periodic heartbeat messages][registration] containing some inventory information. This can provide a central inventory at sites that don't already use something like [PuppetDB][], and can also be used as a simple passive monitoring system.
-
-The default registration plugin, `agentlist`, sends a standard SimpleRPC command over the MCollective middleware, to be processed by some server with an agent called `registration` installed. You would need to ensure that the `registration` agent is extremely performant (due to the volume of message it will receive) and installed on a limited number of servers. If your [middleware][] supports detailed permissions, you must also ensure that it allows servers to send commands to the registration agent ([ActiveMQ instructions](/mcollective/deploy/middleware/activemq.html#detailed-restrictions)).
-
-Some registration plugins (e.g. `redis`) can insert data directly into the inventory instead of sending an RPC message. This is a flexible system, and the user is in charge of deciding what to build with it, if anything. If all you need is a searchable inventory, [PuppetDB][] is probably closer to your needs.
-
-#### `registerinterval`
-
-How long (in seconds) to wait between registration messages. Setting this to 0 disables registration.
-
-- _Default:_ `0`
-
-#### `registration`
-
-The [registration plugin][registration] to use.
-
-This plugin must be installed on the server sending the message, and will dictate what the message contains. The default `agentlist` plugin will only send a list of the installed agents. See [Registration Plugins][registration] for more details.
-
-- _Default:_ `agentlist`
-- _Allowed values:_ The name of any installed registration plugin. {{ pluginname }}
-
-#### `registration_collective`
-
-Which subcollective to send registration messages to, when using a SimpleRPC-based registration plugin.
-
-- _Default:_ (the value of [`main_collective`](#maincollective), usually `mcollective`)
-
-
-([↑ Back to top](#content))
-
-
-### Auditing
-
-<pre><code><a href="#rpcaudit">rpcaudit</a> = 1
-<a href="#rpcauditprovider">rpcauditprovider</a> = logfile
-<a href="#pluginrpcauditlogfile">plugin.rpcaudit.logfile</a> = /var/log/mcollective-audit.log
-</code>
-</pre>
-
-Optionally, MCollective can log the SimpleRPC agent commands it receives from admin users, recording both the command itself and some identifying information about the user who issued it. The caller ID of a command is determined by the [security plugin][security_plugin] being used.
-
-MCollective ships with a local logging audit plugin, called `Logfile`, which saves audit info to a local file (different from the daemon log file). Log lines look like this:
-
-    2010-12-28T17:09:03.889113+0000: reqid=319719cc475f57fda3f734136a31e19b: reqtime=1293556143 caller=cert=nagios@monitor1 agent=nrpe action=runcommand data={:process_results=>true, :command=>"check_mailq"}
-
-Tthere are central loggers available from [the plugin directory][plugin_directory], and you can also write your own audit plugins; see [Writing Auditing Plugins][auditing] for more information.
-
-
-#### `rpcaudit`
-
-Whether to enable [SimpleRPC auditing][Auditing] for all SimpleRPC agent commands.
-
-- _Default:_ `0`
-- _Allowed values:_ `1`, `0`, `y`, `n` --- {{ badbool }}
-
-#### `rpcauditprovider`
-
-The name of the audit plugin to use whenever SimpleRPC commands are received.
-
-- _Default:_ (nothing)
-- _Sample value:_ `logfile`
-- _Allowed values:_ The name of any installed audit plugin. {{ pluginname }}
-
-
-#### `plugin.rpcaudit.logfile`
-
-_When `rpcauditprovider == logfile`_
-
-The file to write to when using the `logfile` audit plugin. **Note:** this file is not automatically rotated.
-
-- _Default:_ `/var/log/mcollective-audit.log`
-
-
-([↑ Back to top](#content))
-
-
-### Authorization
-
-<pre><code><a href="#rpcauthorization">rpcauthorization</a> = 1
-<a href="#rpcauthprovider">rpcauthprovider</a> = action_policy
-</code>
-</pre>
-
-Optionally, MCollective can refuse to execute agent commands unless they meet some requirement. The exact requirement is defined by an [authorization plugin][authorization].
-
-See [SimpleRPC Authorization][authorization] for more details, including how to enable authorization for only certain agents.
-
-The [actionpolicy][] plugin, which is provided in the [plugin directory][plugin_directory], is fairly popular and seems to meet many users' needs, when combined with a [security plugin][security_plugin] that provides a verified caller ID (such as the SSL plugin). [See its documentation][actionpolicy] for details.
-
-#### `rpcauthorization`
-
-Whether to enable [SimpleRPC authorization][Authorization] globally.
-
-- _Default:_ `0`
-- _Allowed values:_ `1`, `0`, `y`, `n` --- {{ badbool }}
-
-#### `rpcauthprovider`
-
-The plugin to use when globally managing authorization. See [SimpleRPC Authorization][authorization] for more details.
-
-- _Default:_ (nothing)
-- _Sample value:_ `action_policy`
-- _Allowed values:_ The name of any installed authorization plugin. This uses different capitalization/formatting rules from the other plugin settings: if the name of the plugin (in the code) has any interior capital letters (e.g. `ActionPolicy`), you should use a lowercase value for the setting but insert an underscore before the place where the interior capital letter(s) would have gone (e.g. `action_policy`). If the name contains no interior capital letters, simply use a lowercase value with no other changes.
-
-
-([↑ Back to top](#content))
-
-
-Advanced Settings
------
-
-### Logging
-
-<pre><code><a href="#loggertype">logger_type</a> = file
-<a href="#loglevel">loglevel</a> = info
-<a href="#logfile">logfile</a> = /var/log/mcollective.log
-<a href="#keeplogs">keeplogs</a> = 5
-<a href="#maxlogsize">max_log_size</a> = 2097152
-<a href="#logfacility">logfacility</a> = user
-</code>
-</pre>
-
-The MCollective server daemon can log to its own log file (which it will automatically rotate), or to the syslog. It can also log directly to the console, if you are running it in the foreground instead of daemonized.
-
-Some of the settings below only apply if you are using log files, and some only apply if you are using syslog.
-
-#### `logger_type`
-
-How the MCollective server daemon should log. You generally want to use a file or syslog.
-
-- _Default:_ `file`
-- _Allowed values:_ `file`, `syslog`, `console`
-
-#### `loglevel`
-
-How verbosely to log.
-
-- _Default:_ `info`
-- _Allowed values:_ In increasing order of verbosity: `fatal`, `error` , `warn`, `info`, `debug`
-
-#### `logfile`
-
-_When `logger_type == file`_
-
-Where the log file should be stored.
-
-- _Default:_ (nothing; the package's default config file usually sets a platform-appropriate value)
-- _Sample value:_ `/var/log/mcollective.log`
-
-#### `keeplogs`
-
-_When `logger_type == file`_
-
-The number of log files to keep when rotating.
-
-- _Default:_ `5`
-
-#### `max_log_size`
-
-_When `logger_type == file`_
-
-Max size in bytes for log files before rotation happens.
-
-- _Default:_ `2097152`
-
-#### `logfacility`
-
-_When `logger_type == syslog`_
-
-The syslog facility to use.
-
-- _Default:_ `user`
-
-
-([↑ Back to top](#content))
-
-
-### Platform Defaults
-
-<pre><code><a href="#daemonize">daemonize</a> = 1
-<a href="#libdir">libdir</a> = /usr/libexec/mcollective
-<a href="#sslcipher">ssl_cipher</a> = aes-256-cbc
-</code>
-</pre>
-
-These settings generally shouldn't be changed by the user, but their values may vary by platform. The package you used to install MCollective should have created a config file with platform-appropriate values for these settings.
-
-#### `daemonize`
-
-Whether to fork and run the MCollective server daemon in the background.
-
-This depends on your platform's init system. For example, newer Ubuntu releases require this to be false, while RHEL-derived systems require it to be true.
-
-- _Default:_ `0` <!-- Actually nil but acts like false -->
-- _Allowed values:_ `1`, `0`, `y`, `n` --- {{ badbool }}
-
-#### `libdir`
-
-Where to look for plugins. Should be a single path or a list of paths separated by the {{ path_separator }}.
-
-By default, this setting is blank, but the package you installed MCollective with should supply a default server.cfg file with a platform-appropriate value for this setting. **If server.cfg has no value for this setting, MCollective will not work.**
-
-- _Default:_ (nothing; the package's default config file usually sets a platform-appropriate value)
-- _Sample value:_ `/usr/libexec/mcollective:/opt/mcollective`
-
-#### `ssl_cipher`
-
-The cipher to use for encryption. This is currently only relevant if you are using the [AES security plugin][security_aes].
-
-This setting should be a standard OpenSSL cipher string. See `man enc` for a list.
-
-- _Default:_ `aes-256-cbc`
diff --git a/website/deploy/middleware/activemq.md b/website/deploy/middleware/activemq.md
deleted file mode 100644 (file)
index 1396a9a..0000000
+++ /dev/null
@@ -1,694 +0,0 @@
----
-title: "MCollective Â» Deploy Â» Middleware Â» ActiveMQ Config"
-subtitle: "ActiveMQ Config Reference for MCollective Users"
-layout: default
----
-
-[Wildcard]: http://activemq.apache.org/wildcards.html
-[minimal_example]: http://github.com/puppetlabs/marionette-collective/raw/master/ext/activemq/examples/single-broker/activemq.xml
-[maximal_example]: https://github.com/puppetlabs/marionette-collective/tree/master/ext/activemq/examples/multi-broker
-[template_example]: TODO
-[apache_activemq_config_docs]: http://activemq.apache.org/version-5-xml-configuration.html
-
-[subcollectives]: /reference/basic/subcollectives.html
-[activemq_connector]: /reference/plugins/connector_activemq.html
-[mcollective_connector_tls]: /mcollective/reference/integration/activemq_ssl.html
-
-
-Summary
------
-
-Apache ActiveMQ is the primary middleware we recommend with MCollective. It's good software, but its XML config file is large and unwieldy, and you may need to edit many sections of it in a complex MCollective deployment. This reference guide attempts to describe every major ActiveMQ setting that matters to MCollective.
-
-### How to Use This Page
-
-* This page **doesn't** describe the complete format of the activemq.xml config file, and will sometimes use incomplete shorthand to describe elements of it.
-* You should definitely refer to an example config file while reading, so you can see each element's full syntax in context.
-* You don't need to read this entire page when setting up a new deployment. We recommend that you:
-    * Start with an example config file (see directly below).
-    * Make heavy use of the table of contents above.
-    * Skim the sections of this page you currently care about, and edit your config as needed.
-    * Refer back to this page later when you need to expand your broker infrastructure.
-* If you are a new user, we recommend that you:
-    * Start with the [single-broker example config][minimal_example].
-    * Change the [user account passwords](#authentication-users-and-groups).
-    * [Set up TLS](#tls-credentials).
-
-### Example Config Files
-
-We have several. 
-
-* [Minimal config example][minimal_example] --- single broker <!-- , minimal authorization. -->
-* [Maximal config example][maximal_example] --- multi-broker <!--  with extensive authorization. -->
-
-<!-- 
-* [Template-based example][template_example] --- reduces configuration down to a handful of variables; shows how those few decisions ramify into many config edits.
- -->
-
-
-> **Note:** Some config data needs to be set in both MCollective and ActiveMQ; your configuration of one will affect the other. In this page, we call out that information with headers labeled "Shared Configuration."
-
-### Version Limits
-
-This document is about the "new" MCollective/ActiveMQ interface, which means it requires the following:
-
-* MCollective 2.0.0 or newer
-* ActiveMQ 5.5.0 or newer
-* Stomp gem 1.2.2 or newer
-* The [activemq connector][activemq_connector] plugin (included with MCollective 2.0.0 and newer)
-
-([↑ Back to top](#content))
-
-How MCollective Uses ActiveMQ
------
-
-MCollective connects to ActiveMQ over the Stomp protocol, and presents certain credentials:
-
-* It provides a username and password, with which ActiveMQ can do what it pleases. 
-* If TLS is in use, it will also present a certificate (and verify the ActiveMQ server's certificate).
-
-Once allowed to connect, MCollective will use the Stomp protocol to create subscriptions. It will then produce and consume a lot of traffic on queues and topics whose names begin with `mcollective`. (See "Topic and Queue Names" directly below.)
-
-### Absolute Minimum Requirements
-
-ActiveMQ defaults to believing that it is routing traffic between processes in a single JVM instance: it doesn't assume it is connected to the network, and it uses a loose-to-nonexistent security model.
-
-This means that if you do nothing but enable Stomp traffic, MCollective will work fine. (Albeit with terrible security and eventual out-of-control memory usage.)
-
-### Topic and Queue Names
-
-MCollective uses the following destination names. This list uses standard [ActiveMQ destination wildcards][wildcard]. "COLLECTIVE" is the name of the collective being used; by default, this is `mcollective`, but if you are using [subcollectives][], each one is implemented as an equal peer of the default collective.
-
-Topics: 
-
-- `ActiveMQ.Advisory.>` (built-in topics that all ActiveMQ producers and consumers need all permissions on)
-- `COLLECTIVE.*.agent` (for each agent plugin, where the `*` is the name of the plugin)
-
-Queues:
-
-- `COLLECTIVE.nodes` (used for direct addressing; this is a single destination that uses JMS selectors, rather than a group of destinations)
-- `COLLECTIVE.reply.>` (where the continued portion is a request ID)
-
-> #### Shared Configuration
-> 
-> Subcollectives must also be configured in the MCollective client and server config files. ActiveMQ must allow traffic on any subcollective that MCollective servers and clients expect to use.
-
-([↑ Back to top](#content))
-
-Config File Location and Format
------
-
-ActiveMQ's config is usually called activemq.xml, and is kept in ActiveMQ's configuration directory (`/etc/activemq` with Puppet Labs's Red Hat-like packages, or a subdirectory of `/etc/activemq/instances-enabled` with the standard Debian or Ubuntu packages). Any other files referenced in activemq.xml will be looked for in the same directory.
-
-The config file is in Java's Beans XML format. Note that all of the settings relevant to MCollective are located inside activemq.xml's `<broker>` element. 
-
-This document won't describe the complete format of the activemq.xml config file, and will sometimes use incomplete shorthand to describe elements of it. You should definitely [refer to an example config file](#example-config-files) while reading, so you can see each element's full syntax in context.
-
-You can also read external documentation for a more complete understanding.
-
-> **Bug Warning:** In ActiveMQ 5.5, the first-level children of the `<broker>` element must be arranged in alphabetical order. There is no good reason for this behavior, and it was fixed in ActiveMQ 5.6.
-
-### External ActiveMQ Documentation
-
-The Apache ActiveMQ documentation contains important information, but it is often incomplete, badly organized, and confusing. The Fuse documentation (a commercially supported release of ActiveMQ) is significantly better written and better organized, although it requires signing up for an email newsletter, but it may be out of sync with the most recent ActiveMQ releases.
-
-* [Apache ActiveMQ Documentation][apache_activemq_config_docs]
-* [Fuse Documentation](http://fusesource.com/documentation/fuse-message-broker-documentation/)
-
-### Wildcards
-
-You'll see a lot of [ActiveMQ destination wildcards][wildcard] below. In short:
-
-* Segments in a destination name are separated with dots (`.`)
-* A `*` represents _one segment_ (i.e. any sequence of non-dot characters)
-* A `>` represents _the whole rest of the name_ after a prefix
-
-
-([↑ Back to top](#content))
-
-Required Settings
------
-
-One way or another, you must set all of the following.
-
-### Transport Connector(s)
-
-It's generally best to only enable the transport connectors you need. For example, if you're using Stomp over TLS, don't leave a bare Stomp transport open. If you're not using a network of brokers, close the OpenWire transport.
-
-The `name` attribute of a transport connector doesn't seem to matter as long as it's locally unique.
-
-#### Stomp
-
-ActiveMQ must listen over the network for Stomp connections; otherwise, MCollective can't reach it. Enable this with a `<transportConnector>` element inside the `<transportConnectors>` element. We generally recommend using TLS.
-
-{% highlight xml %}
-    <transportConnectors>
-      <transportConnector name="stomp+nio" uri="stomp+nio://0.0.0.0:61613"/>
-    </transportConnectors>
-{% endhighlight %}
-
-* Note that the protocol/port/arguments for Stomp URIs can differ:
-    * Unencrypted: `stomp+nio://0.0.0.0:61613`
-    * CA-verified TLS: `stomp+ssl://0.0.0.0:61614?needClientAuth=true`
-    * Anonymous TLS: `stomp+ssl://0.0.0.0:61614`
-* You can choose to restrict the interface/hostname to use instead of listening on `0.0.0.0`.
-
-> **If you are using TLS,** note that you must also:
-> 
-> * [Configure ActiveMQ's TLS credentials](#tls-credentials) (see below)
-> * [Configure MCollective to use TLS credentials][mcollective_connector_tls]
-
-#### OpenWire
-
-If you are using a network of brokers instead of just one ActiveMQ server, they talk to each other over OpenWire, and will all need a transport connector for that protocol too:
-
-{% highlight xml %}
-    <transportConnector name="openwire+ssl" uri="ssl://0.0.0.0:61617?needClientAuth=true"/>
-{% endhighlight %}
-
-* Note that the protocol/port/arguments for OpenWire URIs can differ:
-    * Unencrypted: `tcp://0.0.0.0:61616`
-    * CA-verified TLS: `ssl://0.0.0.0:61617?needClientAuth=true`
-    * Anonymous TLS: `ssl://0.0.0.0:61617`
-* You can choose to restrict the interface/hostname to use instead of listening on `0.0.0.0`.
-
-
-
-#### Standard Ports for Stomp and OpenWire
-
-Alas, there aren't any; just a rough consensus.
-
-* 61613 for unencrypted Stomp
-* 61614 for Stomp with TLS
-* 61616 for unencrypted OpenWire
-* 61617 for OpenWire with TLS
-
-All of our documentation assumes these ports.
-
-> #### Shared Configuration
-> 
-> MCollective needs to know the following:
-> 
-> * The port to use for Stomp traffic
-> * The hostname or IP address to reach ActiveMQ at
-> * Whether to use TLS
-> 
-> In a network of brokers, the other ActiveMQ servers need to know the following:
-> 
-> * The port to use for OpenWire traffic
-> * The hostname or IP address to reach peer ActiveMQ servers at
-> * Whether to use TLS
-
-
-### Reply Queue Pruning
-
-MCollective sends replies on uniquely-named, single-use queues with names like `mcollective.reply.<UNIQUE ID>`. These have to be deleted after about five minutes, lest they clog up ActiveMQ's available memory. By default, queues live forever, so you have to configure this.
-
-Use a `<policyEntry>` element for `*.reply.>` queues, with `gcInactiveDestinations` set to true and `inactiveTimoutBeforeGC` set to 300000 ms (five minutes). 
-
-{% highlight xml %}
-    <destinationPolicy>
-      <policyMap>
-        <policyEntries>
-          <policyEntry queue="*.reply.>" gcInactiveDestinations="true" inactiveTimoutBeforeGC="300000" />
-          <policyEntry topic=">" producerFlowControl="false"/>
-        </policyEntries>
-      </policyMap>
-    </destinationPolicy>
-{% endhighlight %}
-
-### Disable Producer Flow Control on Topics
-
-In the example above, you can also see that `producerFlowControl` is set to false for all topics. This is highly recommended; setting it to true can cause MCollective servers to appear blocked when there's heavy traffic.
-
-
-([↑ Back to top](#content))
-
-Recommended Settings
------
-
-### TLS Credentials
-
-If you are using TLS in either your Stomp or OpenWire [transport connectors](#transport-connectors), ActiveMQ needs a keystore file, a truststore file, and a password for each:
-
-{% highlight xml %}
-    <sslContext>
-      <sslContext
-         keyStore="keystore.jks" keyStorePassword="secret"
-         trustStore="truststore.jks" trustStorePassword="secret"
-      />
-    </sslContext>
-{% endhighlight %}
-
-**Note:** This example is for CA-verified TLS. If you are using anonymous TLS, you may optionally skip the truststore attributes.
-
-The redundant nested `<sslContext>` elements are not a typo; for some reason ActiveMQ actually needs this.
-
-ActiveMQ will expect to find these files in the same directory as activemq.xml.
-
-> #### Creating a Keystore and Truststore
-> 
-> There is a [separate guide that covers how to create keystores.][activemq_keystores]
-
-[activemq_keystores]: ./activemq_keystores.html
-
-
-### Authentication (Users and Groups)
-
-When they connect, MCollective clients and servers provide a username, password, and optionally an SSL certificate. ActiveMQ can use any of these to authenticate them. 
-
-By default, ActiveMQ ignores all of these and has no particular concept of "users." Enabling authentication means ActiveMQ will only allow users with proper credentials to connect. It also gives you the option of setting up per-destination authorization (see below). 
-
-You set up authentication by adding the appropriate element to the `<plugins>` element. [The Fuse documentation has a more complete description of ActiveMQ's authentication capabilities;][fuse_security] the [ActiveMQ docs version][activemq_security] is less organized and less complete. In summary:
-
-- `simpleAuthenticationPlugin` defines users directly in activemq.xml. It's well-tested and easy. It also requires you to edit activemq.xml and restart the broker every time you add a new user. The activemq.xml file will contain sensitive passwords and must be protected.
-- `jaasAuthenticationPlugin` lets you use external text files (or even an LDAP database) to define users and groups. You need to make a `login.config` file in the ActiveMQ config directory, and possibly two more files. You can add users and groups without restarting the broker. The external users file will contain sensitive passwords and must be protected.
-- `jaasCertificateAuthenticationPlugin` ignores the username and password that MCollective presents; instead, it reads the distinguished name of the certificate and maps that to a username. It requires TLS, a `login.config` file, and two other external files. It is also impractical unless your servers are all using the same SSL certificate to connect to ActiveMQ; the currently recommended approach of re-using Puppet certificates makes this problematic, but you can probably ship credentials around and figure out a way to make it work. This is not currently well-tested with MCollective.
-
-[fuse_security]: http://fusesource.com/docs/broker/5.5/security/front.html
-[activemq_security]: http://activemq.apache.org/security.html
-
-The example below uses `simpleAuthenticationPlugin`.
-
-{% highlight xml %}
-    <plugins>
-      <simpleAuthenticationPlugin>
-        <users>
-          <authenticationUser username="mcollective" password="marionette" groups="mcollective,everyone"/>
-          <authenticationUser username="admin" password="secret" groups="mcollective,admins,everyone"/>
-        </users>
-      </simpleAuthenticationPlugin>
-      <!-- ... authorization goes below... -->
-    </plugins>
-{% endhighlight %}
-
-This creates two users, with the expectation that MCollective servers will log in as `mcollective` and admin users issuing commands will log in as `admin`. 
-
-Note that unless you set up authorization (see below), these users have the exact same capabilities. 
-
-> #### Shared Configuration
-> 
-> MCollective servers and clients both need a username and password to use when connecting. That user **must** have appropriate permissions (see "Authorization," directly below) for that server or client's role. 
-
-
-
-### Authorization (Group Permissions)
-
-By default, ActiveMQ allows everyone to **read** from any topic or queue, **write** to any topic or queue, and create (**admin**) any topic or queue. 
-
-By setting rules in an `<authorizationPlugin>` element, you can regulate things a bit. Some notes:
-
-* Authorization is done **by group.**
-* The exact behavior of authorization doesn't seem to be documented anywhere. Going by observation, it appears that ActiveMQ first tries the most specific rule available, then retreats to less specific rules. This means if a given group isn't allowed an action by a more specific rule but is allowed it by a more general rule, it still gets authorized to take that action. If you have any solid information about how this works, please email us at <faq@puppetlabs.com>.
-* MCollective creates subscriptions before it knows whether there will be any content coming. That means any role able to **read** from or **write** to a destination must also be able to **admin** that destination. Think of "admin" as a superset of both read and write.
-
-#### Simple Restrictions
-
-The following example grants all permissions on destinations beginning with `mcollective` to everyone in group `mcollective`:
-
-{% highlight xml %}
-    <plugins>
-      <!-- ...authentication stuff... -->
-      <authorizationPlugin>
-        <map>
-          <authorizationMap>
-            <authorizationEntries>
-              <authorizationEntry queue=">" write="admins" read="admins" admin="admins" />
-              <authorizationEntry topic=">" write="admins" read="admins" admin="admins" />
-              <authorizationEntry topic="mcollective.>" write="mcollective" read="mcollective" admin="mcollective" />
-              <authorizationEntry queue="mcollective.>" write="mcollective" read="mcollective" admin="mcollective" />
-              <authorizationEntry topic="ActiveMQ.Advisory.>" read="everyone" write="everyone" admin="everyone"/>
-            </authorizationEntries>
-          </authorizationMap>
-        </map>
-      </authorizationPlugin>
-    </plugins>
-{% endhighlight %}
-
-This means admins can issue commands and MCollective servers can read those commands and reply. However, it also means that servers can issue commands, which you probably don't want.
-
-Note that the `everyone` group (as seen in the `ActiveMQ.Advisory.>` topics) **isn't special.** You need to manually make sure all users are members of it. ActiveMQ does not appear to have any kind of real wildcard "everyone" group, unfortunately.
-
-#### Detailed Restrictions
-
-The following example splits permissions along a simple user/server model:
-
-{% highlight xml %}
-    <plugins>
-      <!-- ...authentication stuff... -->
-      <authorizationPlugin>
-        <map>
-          <authorizationMap>
-            <authorizationEntries>
-              <authorizationEntry queue=">" write="admins" read="admins" admin="admins" />
-              <authorizationEntry topic=">" write="admins" read="admins" admin="admins" />
-              <authorizationEntry queue="mcollective.>" write="admins" read="admins" admin="admins" />
-              <authorizationEntry topic="mcollective.>" write="admins" read="admins" admin="admins" />
-              <authorizationEntry queue="mcollective.nodes" read="mcollective" admin="mcollective" />
-              <authorizationEntry queue="mcollective.reply.>" write="mcollective" admin="mcollective" />
-              <authorizationEntry topic="mcollective.*.agent" read="mcollective" admin="mcollective" />
-              <authorizationEntry topic="mcollective.registration.agent" write="mcollective" read="mcollective" admin="mcollective" />
-              <authorizationEntry topic="ActiveMQ.Advisory.>" read="everyone" write="everyone" admin="everyone"/>
-            </authorizationEntries>
-          </authorizationMap>
-        </map>
-      </authorizationPlugin>
-    </plugins>
-{% endhighlight %}
-
-This means admins can issue commands and MCollective servers can read those commands and reply. This time, though, servers can't issue commands. The exception is the `mcollective.registration.agent` destination, which servers DO need the ability to write to if you've turned on registration. 
-
-Admins, of course, can also read commands and reply, since they have power over the entire `mcollective.>` destination set. This isn't considered much of an additional security risk, considering that admins can already control your entire infrastructure.
-
-#### Detailed Restrictions with Multiple Subcollectives
-
-Both of the above examples assume only a single `mcollective` collective. If you are using additional [subcollectives][] (e.g. `uk_collective`, `us_collective`, etc.), their destinations will start with their name instead of `mcollective`. If you need to separately control authorization for each collective, it's best to use a template to do so, so you can avoid repeating yourself. 
-
-{% highlight xml %}
-    <plugins>
-      <!-- ...authentication stuff... -->
-      <authorizationPlugin>
-        <map>
-          <authorizationMap>
-            <authorizationEntries>
-              <!-- "admins" group can do anything. -->
-              <authorizationEntry queue=">" write="admins" read="admins" admin="admins" />
-              <authorizationEntry topic=">" write="admins" read="admins" admin="admins" />
-
-              <%- @collectives.each do |collective| -%>
-              <authorizationEntry queue="<%= collective %>.>" write="admins,<%= collective %>-admins" read="admins,<%= collective %>-admins" admin="admins,<%= collective %>-admins" />
-              <authorizationEntry topic="<%= collective %>.>" write="admins,<%= collective %>-admins" read="admins,<%= collective %>-admins" admin="admins,<%= collective %>-admins" />
-              <authorizationEntry queue="<%= collective %>.nodes" read="servers,<%= collective %>-servers" admin="servers,<%= collective %>-servers" />
-              <authorizationEntry queue="<%= collective %>.reply.>" write="servers,<%= collective %>-servers" admin="servers,<%= collective %>-servers" />
-              <authorizationEntry topic="<%= collective %>.*.agent" read="servers,<%= collective %>-servers" admin="servers,<%= collective %>-servers" />
-              <authorizationEntry topic="<%= collective %>.registration.agent" write="servers,<%= collective %>-servers" read="servers,<%= collective %>-servers" admin="servers,<%= collective %>-servers" />
-              <%- end -%>
-
-              <authorizationEntry topic="ActiveMQ.Advisory.>" read="everyone" write="everyone" admin="everyone"/>
-            </authorizationEntries>
-          </authorizationMap>
-        </map>
-      </authorizationPlugin>
-    </plugins>
-{% endhighlight %}
-
-This example divides your users into several groups:
-
-* `admins` is the "super-admins" group, who can command all servers.
-* `servers` is the "super-servers" group, who can receive and respond to commands on any collective they believe themselves to be members of.
-* `COLLECTIVE-admins` can only command servers on their specific collective. (Since all servers are probably members of the default `mcollective` collective, the `mcollective-admins` group are sort of the "almost-super-admins.")
-* `COLLECTIVE-servers` can only receive and respond to commands on their specific collective.
-
-Thus, when you define your users in the [authentication setup](#authentication-users-and-groups), you could allow a certain user to command both the EU and UK collectives (but not the US collective) with `groups="eu_collective-admins,uk_collective-admins"`. You would probably want most servers to be "super-servers," since each server already gets to choose which collectives to ignore.
-
-#### MCollective's Exact Authorization Requirements
-
-As described above, any user able to read OR write on a destination must also be able to admin that destination. 
-
-Topics: 
-
-- `ActiveMQ.Advisory.>` --- Everyone must be able to read and write. 
-- `COLLECTIVE.*.agent` --- Admin users must be able to write. Servers must be able to read. 
-- `COLLECTIVE.registration.agent` --- If you're using registration, servers must be able to read and write. Otherwise, it can be ignored.
-
-Queues:
-
-- `COLLECTIVE.nodes` --- Admin users must be able to write. Servers must be able to read.
-- `COLLECTIVE.reply.>` --- Servers must be able to write. Admin users must be able to read.
-
-
-> #### Shared Configuration
-> 
-> Subcollectives must also be configured in the MCollective client and server config files. If you're setting up authorization per-subcollective, ActiveMQ must allow traffic on any subcollective that MCollective servers and clients expect to use.
-
-
-([↑ Back to top](#content))
-
-Settings for Networks of Brokers
------
-
-You can group multiple ActiveMQ servers into networks of brokers, and they can route local MCollective traffic amongst themselves. There are a lot of reasons to do this:
-
-* Scale --- we recommend a maximum of about 800 MCollective servers per ActiveMQ broker, and multiple brokers let you expand past this.
-* High availability --- MCollective servers and clients can attempt to connect to mupltiple brokers in a failover pool.
-* Partition resilience --- if an inter-datacenter link goes down, each half's local MCollective system will still work fine.
-* Network isolation and traffic limiting --- if your clients default to only sending messages to local machines, you can get better performance in the most common case while still being able to command a global collective when you need to. 
-* Security --- destination filtering can prevent certain users from sending requests to certain datacenters.
-
-This is naturally more complicated than configuring a single broker.
-
-Designing your broker network's topology is beyond the scope of this reference. The [ActiveMQ Clusters guide](/mcollective/reference/integration/activemq_clusters.html) has a brief description of an example network; see [the ActiveMQ docs][NetworksOfBrokers] or [the Fuse docs][fuse_cluster] for more detailed info. For our purposes, we assume you have already decided:
-
-* Which ActiveMQ brokers can communicate with each other.
-* What kinds of traffic should be excluded from other brokers.
-
-[NetworksOfBrokers]: http://activemq.apache.org/networks-of-brokers.html
-[fuse_cluster]: http://fusesource.com/docs/broker/5.5/clustering/index.html
-
-
-### Broker Name
-
-_Required._
-
-The main `<broker>` element has a `brokerName` attribute. In single-broker deployments, this can be anything and defaults to `localhost`. In a network of brokers, each broker's name must be globally unique across the deployment; duplicates can cause message loops.
-
-{% highlight xml %}
-    <broker xmlns="http://activemq.apache.org/schema/core" brokerName="uk-datacenter-broker" dataDirectory="${activemq.base}/data" destroyApplicationContextOnStop="true">
-{% endhighlight %}
-
-### OpenWire Transports
-
-_Required._
-
-All participants in a network of brokers need OpenWire network transports enabled. [See "Transport Connectors" above](#transport-connectors) for details.
-
-### Network Connectors
-
-_Required._
-
-If you are using a network of brokers, you need to configure which brokers can talk to each other. 
-
-On **one** broker in each linked pair, set up **two** bi-directional network connectors: one for topics, and one for queues. (The only difference between them is the `conduitSubscriptions` attribute, which must be false for the queue connector.)  
-
-This is done with a pair of `<networkConnector>` elements inside the `<networkConnectors>` element. Note that the queues connector excludes topics and vice-versa.
-
-{% highlight xml %}
-    <networkConnectors>
-      <networkConnector
-        name="stomp1-stomp2-topics"
-        uri="static:(tcp://stomp2.example.com:61616)"
-        userName="amq"
-        password="secret"
-        duplex="true"
-        decreaseNetworkConsumerPriority="true"
-        networkTTL="2"
-        dynamicOnly="true">
-        <excludedDestinations>
-          <queue physicalName=">" />
-        </excludedDestinations>
-      </networkConnector>
-      <networkConnector
-        name="stomp1-stomp2-queues"
-        uri="static:(tcp://stomp2.example.com:61616)"
-        userName="amq"
-        password="secret"
-        duplex="true"
-        decreaseNetworkConsumerPriority="true"
-        networkTTL="2"
-        dynamicOnly="true"
-        conduitSubscriptions="false">
-        <excludedDestinations>
-          <topic physicalName=">" />
-        </excludedDestinations>
-      </networkConnector>
-    </networkConnectors>
-{% endhighlight %}
-
-Notes: 
-
-* If you're using TLS for OpenWire, you'll need to change the URIs to something like `static:(ssl://stomp2.example.com:61617)` --- note the change of both protocol and port. 
-* You will need to adjust the TTL for your network's conditions.
-* A username and password are required. The broker with the `<networkConnector>` connects to the other broker as this user. This user should have **full rights** on **all** queues and topics, unless you really know what you're doing. (See [authentication](#authentication-users-and-groups) and [authorization](#authorization-group-permissions) above.)
-* The `name` attribute on each connector must be globally unique. Easiest way to do that is to combine the pair of hostnames involved with the word "queues" or "topics."
-* Alternately, you can set up two uni-directional connectors on both brokers; see the Fuse or ActiveMQ documentation linked above for more details. 
-
-
-### Destination Filtering
-
-[fuse_filtering]: http://fusesource.com/docs/broker/5.5/clustering/Networks-Filtering.html
-
-_Optional._
-
-Relevant external docs:
-
-* [Fuse filtering guide][fuse_filtering]
-
-If you want to prevent certain traffic from leaving a given datacenter, you can do so with `<excludedDestinations>` or `<dynamicallyIncludedDestinations>` elements **inside each `<networkConnector>` element.** This is mostly useful for noise reduction, by blocking traffic that other datacenters don't care about, but it can also serve security purposes. Generally, you'll be filtering on [subcollectives][], which, as described above, begin their destination names with the name of the collective.
-
-Both types of filter element can contain `<queue>` and `<topic>` elements, with their `physicalName` attributes defining a destination name with the normal wildcards.
-
-**Remember to retain the all-queues/all-topics exclusions as [shown above](#network-connectors).**
-
-#### Examples
-
-Assume a star network topology. 
-
-This topology can be achieved by either having each edge broker connect to the central broker, or having the central broker connect to each edge broker. You can achieve the same filtering in both situations, but with slightly different configuration. The two examples below have similar but not identical effects; the ramifications are subtle, and we _really_ recommend reading the external ActiveMQ and Fuse documentation if you've come this far in your deployment scale.
-
-If your central broker is connecting to the UK broker, and you want it to only pass on traffic for the global `mcollective` collective and the UK-specific `uk_collective` collective:
-
-{% highlight xml %}
-    <dynamicallyIncludedDestinations>
-      <topic physicalName="mcollective.>" />
-      <queue physicalName="mcollective.>" />
-      <topic physicalName="uk_collective.>" />
-      <queue physicalName="uk_collective.>" />
-    </dynamicallyIncludedDestinations>
-{% endhighlight %}
-
-In this case, admin users connected to the central broker can command nodes on the `uk_collective`, but admin users connected to the UK broker can't command nodes on the `us_collective`, etc. 
-
-Alternately, if your UK broker is connecting to your central broker and you want it to refrain from passing on UK-specific traffic that no one outside that datacenter cares about:
-
-{% highlight xml %}
-    <excludedDestinations>
-       <topic physicalName="uk_collective.>" />
-       <queue physicalName="uk_collective.>" />
-    </excludedDestinations>
-{% endhighlight %}
-
-In this case, admin users connected to the central broker **cannot** command nodes on the `uk_collective`; it's expected that they'll be issuing commands to the main `mcollective` collective if they need to (and are authorized to) cross outside their borders. 
-
-([↑ Back to top](#content))
-
-Tuning
------
-
-The minor adjustments listed below (turn off dedicated task runner, increase heap, and increase memory and temp usage in activemq.xml) will generally let you reach about 800 MCollective nodes connected to a single ActiveMQ server, depending on traffic and usage patterns, number of topics and queues, etc. Any more detailed tuning is beyond the scope of this reference, and is likely to be unnecessary for your deployment. 
-
-### Don't Use Dedicated Task Runner
-
-Set `-Dorg.apache.activemq.UseDedicatedTaskRunner=false` when starting ActiveMQ. MCollective creates a lot of queues and topics, so _not_ using a thread per destination will save you a lot of memory usage.
-
-This setting is **not** configured in activemq.xml; it's an extra argument to the JVM, which should be provided when ActiveMQ starts up. The place to put this varies, depending on the package you installed ActiveMQ with; it usually goes in the wrapper config file. Check your init script for clues about this file's location. With the common TanukiWrapper scripts, it would look something like this:
-
-    wrapper.java.additional.4=-Dorg.apache.activemq.UseDedicatedTaskRunner=false
-
-### Increase JVM Heap if Necessary
-
-Likewise, the max heap is usually configured in the wrapper config file (`wrapper.java.maxmemory=512`) or on the command line (`-Xmx512m`).
-
-### Memory and Temp Usage for Messages (`systemUsage`)
-
-Since ActiveMQ expects to be embedded in another JVM application, it won't automatically fill up the heap with messages; it has extra limitations on how much space to take up with message contents. 
-
-As your deployment gets bigger, you may need to increase the `<memaryUsage>` and `<tempUsage>` elements in the `<systemUsage>` element. Unfortunately, we lack a lot of solid data for what to actually set these to. Most users leave the defaults for memory and temp until they have problems, then double the defaults and see whether their problems go away. This isn't perfectly effecient, but anecdotally it appears to work.
-
-The many redundant nested elements are not a typo; for some reason, ActiveMQ seems to require this.
-
-{% highlight xml %}
-    <!--
-      The systemUsage controls the maximum amount of space the broker will 
-      use for messages.
-
-      - memoryUsage is the amount of memory ActiveMQ will take up with
-        *actual messages;* it doesn't include things like thread management.
-      - tempUsage is the amount of disk space it will use for stashing
-        non-persisted messages if the memoryUsage is exceeded (e.g. in the
-        event of a sudden flood of messages).
-      - storeUsage is the amount of disk space dedicated to persistent
-        messages (which MCollective doesn't use directly, but which may be
-        used in networks of brokers to avoid duplicates).           
-
-      If producer flow control is on, ActiveMQ will slow down producers
-      when any limits are reached; otherwise, it will use up the
-      memoryUsage, overflow into tempUsage (assuming the default cursor
-      settings aren't changed), and start failing message deliveries after
-      tempUsage is spent. In MCollective, the latter behavior is generally
-      preferable. For more information, see:
-
-      http://activemq.apache.org/producer-flow-control.html
-      http://activemq.apache.org/javalangoutofmemory.html
-    -->
-    <systemUsage>
-        <systemUsage>
-            <memoryUsage>
-                <memoryUsage limit="20 mb"/>
-            </memoryUsage>
-            <storeUsage>
-                <storeUsage limit="1 gb"/>
-            </storeUsage>
-            <tempUsage>
-                <tempUsage limit="100 mb"/>
-            </tempUsage>
-        </systemUsage>
-    </systemUsage>
-{% endhighlight %}
-
-
-([↑ Back to top](#content))
-
-Boilerplate
------
-
-There's little reason to care about these settings in most conditions, but they're in the example config files anyway.
-
-### Persistence
-
-MCollective rarely uses this. It's only necessary in networks of brokers, where it is used to prevent routing loops. Leave it enabled; it has no notable performance penalty and its disk usage is limited by the `<storeUsage>` element described above.
-
-{% highlight xml %}
-    <persistenceAdapter>
-      <kahaDB directory="${activemq.base}/data/kahadb"/>
-    </persistenceAdapter>
-{% endhighlight %}
-### Management Context
-
-This is for monitoring. MCollective doesn't use this and the examples have it turned off, but you may want it for your own purposes.
-
-{% highlight xml %}
-    <!-- 
-      The managementContext is used to configure how ActiveMQ is exposed in 
-      JMX. By default, ActiveMQ uses the MBean server that is started by 
-      the JVM. For more information, see: 
-    
-      http://activemq.apache.org/jmx.html 
-    -->
-
-    <managementContext>
-      <managementContext createConnector="false"/>
-    </managementContext>
-{% endhighlight %}
-
-### Statistics Broker
-
-MCollective doesn't use this.
-
-{% highlight xml %}
-    <plugins>
-      <!--
-        Enable the statisticsBrokerPlugin to allow ActiveMQ to collect
-        statistics.
-      -->
-      <statisticsBrokerPlugin/>
-      <!-- ...auth, etc... -->
-    </plugins>
-{% endhighlight %}
-
-
-### Jetty (Web Consoles, APIs, etc.)
-
-The activemq.xml file will often either contain Jetty settings or import them from another file. MCollective doesn't use this. If you're not using it to manage ActiveMQ, leaving it enabled may be a security risk. Note that this configuration is **outside** the `<broker>` element. 
-
-{% highlight xml %}
-    <!-- 
-      Enable web consoles, REST and Ajax APIs and demos
-      It also includes Camel (with its web console), see ${ACTIVEMQ_HOME}/conf/camel.xml for more info
-        
-      Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details 
-    -->
-    <import resource="jetty.xml"/>
-{% endhighlight %}
-
-([↑ Back to top](#content))
diff --git a/website/deploy/middleware/activemq_keystores.md b/website/deploy/middleware/activemq_keystores.md
deleted file mode 100644 (file)
index 0d7ad05..0000000
+++ /dev/null
@@ -1,273 +0,0 @@
----
-title: "MCollective Â» Deploy Â» Middleware Â» ActiveMQ Keystores"
-subtitle: "Setting Up Keystores For ActiveMQ"
-layout: default
----
-
-[tls]: ./activemq.html#tls-credentials
-
-Since ActiveMQ runs on the JVM, [configuring it to use TLS encryption/authentication][tls] requires a pair of Java keystores; it can't just use the normal PEM format certificates and keys used by Puppet and MCollective. 
-
-Java keystores require some non-obvious steps to set up, so this guide provides full instructions, including both a [manual method](#manually-creating-keystores) and a [Puppet method](#creating-keystores-with-puppet).
-
-
-## Step 0: Obtain Certificates and Keys
-
-ActiveMQ needs the following credentials:
-
-* A copy of the site's CA certificate
-* A certificate signed by the site's CA
-* A private key to match its certificate
-
-These can come from anywhere, but the CA has to match the one used by MCollective. 
-
-The easiest approach is to re-use your site's Puppet cert infrastructure, since it's already everywhere and has tools for issuing and signing arbitrary certificates.
-
-As ever, remember to **protect the private key.**
-
-### Option A: Re-Use the Node's Puppet Agent Certificate
-
-On your ActiveMQ server:
-
-* Locate the ssldir by running `sudo puppet agent --configprint ssldir`.
-* Copy the following files to your working directory, making sure to give unique names to the cert and private key:
-    * `<ssldir>/certs/ca.pem`
-    * `<ssldir>/certs/<node name>.pem`
-    * `<ssldir>/private_keys/<node name>.pem`
-
-### Option B: Get a New Certificate from the Puppet CA
-
-On your CA puppet master:
-
-* Run `sudo puppet cert generate activemq.example.com`, substituting some name for your ActiveMQ server. Unlike with a puppet master, the cert's common name can be anything; it doesn't have to be the node's hostname or FQDN.
-* Locate the ssldir by running `sudo puppet master --configprint ssldir`.
-* Retrieve the following files and copy them to a working directory on your ActiveMQ server, making sure to give unique names to the cert and private key:
-    * `<ssldir>/certs/ca.pem`
-    * `<ssldir>/certs/activemq.example.com.pem`
-    * `<ssldir>/private_keys/activemq.example.com.pem`
-
-### Option C: Do Whatever You Want
-
-If you have some other CA infrastructure, you can use that instead.
-
-You can now:
-
-* [Manually create the keystores](#manually-creating-keystores)
-* [Use Puppet to create the keystores](#creating-keystores-with-puppet)
-
-## Manually Creating Keystores
-
-We need a **"truststore"** and a **"keystore."** We also need a **password** for each. (You can use the same password for both stores.)
-
-Remember the password(s) for later, because it needs to [go in the activemq.xml file][tls]. 
-
-### Step 1: Truststore
-
-> **Note:** The truststore is only required for CA-verified TLS. If you are using anonymous TLS, you may skip it.
-
-The truststore determines which certificates are allowed to connect to ActiveMQ. If you import a CA cert into it, ActiveMQ will trust any certificate signed by that CA.
-
-> You could also _not_ import a CA, and instead import every individual certificate you want to allow. If you do that, you're on your own, but the commands should be similar.
-
-In the working directory with your PEM-format credentials, run the following command. Replace `ca.pem` with whatever you named your copy of the CA cert, and use the password when requested.
-
-{% highlight console %}
-$ sudo keytool -import -alias "My CA" -file ca.pem -keystore truststore.jks
-Enter keystore password:
-Re-enter new password:
-.
-.
-.
-Trust this certificate? [no]:  y
-Certificate was added to keystore
-{% endhighlight %}
-
-The truststore is now done.
-
-If you want, you can compare fingerprints:
-
-{% highlight console %}
-$ sudo keytool -list -keystore truststore.jks
-Enter keystore password:
-
-Keystore type: JKS
-Keystore provider: SUN
-
-Your keystore contains 1 entry
-
-my ca, Mar 30, 2012, trustedCertEntry,
-Certificate fingerprint (MD5): 99:D3:28:6B:37:13:7A:A2:B8:73:75:4A:31:78:0B:68
-
-$ sudo openssl x509 -in ca.pem -fingerprint -md5
-MD5 Fingerprint=99:D3:28:6B:37:13:7A:A2:B8:73:75:4A:31:78:0B:68
-{% endhighlight %}
-
-
-### Step 2: Keystore
-
-The keystore contains the ActiveMQ broker's certificate and private key, which it uses to identify itself to the applications that connect to it.
-
-In the working directory with your PEM-format credentials, run the following commands. Substitute the names of your key and certificate files where necessary, and the common name of your ActiveMQ server's certificate for `activemq.example.com`.
-
-These commands use both an "export/source" password and a "destination" password. The export/source password is never used again after this series of commands.
-
-{% highlight console %}
-$ sudo cat activemq_private.pem activemq_cert.pem > temp.pem
-$ sudo openssl pkcs12 -export -in temp.pem -out activemq.p12 -name activemq.example.com
-Enter Export Password:
-Verifying - Enter Export Password:
-$sudo keytool -importkeystore  -destkeystore keystore.jks -srckeystore activemq.p12 -srcstoretype PKCS12 -alias activemq.example.com
-Enter destination keystore password:
-Re-enter new password:
-Enter source keystore password:
-{% endhighlight %}
-
-The keystore is now done.
-
-If you want, you can compare fingerprints:
-
-{% highlight console %}
-$ sudo keytool -list -keystore keystore.jks
-Enter keystore password:
-
-Keystore type: JKS
-Keystore provider: SUN
-
-Your keystore contains 1 entry
-
-activemq.example.com, Mar 30, 2012, PrivateKeyEntry,
-Certificate fingerprint (MD5): 7E:2A:B4:4D:1E:6D:D1:70:A9:E7:20:0D:9D:41:F3:B9
-
-$ sudo openssl x509 -in activemq_cert.pem -fingerprint -md5
-MD5 Fingerprint=7E:2A:B4:4D:1E:6D:D1:70:A9:E7:20:0D:9D:41:F3:B9
-{% endhighlight %}
-
-### Step 3: Finish
-
-Move the keystore and truststore to ActiveMQ's config directory. Make sure they are owned by the ActiveMQ user and unreadable to any other users. [Configure ActiveMQ to use them in its `sslContext`.][tls] **Double-check** that you've made activemq.xml world-unreadable, since it now contains sensitive credentials.
-
-## Creating Keystores with Puppet
-
-If you're managing your ActiveMQ server with Puppet anyway, you can use the [puppetlabs/java_ks module](http://forge.puppetlabs.com/puppetlabs/java_ks) to handle the format conversion.
-
-This approach is more work for a single permanent ActiveMQ server, but less work if you intend to deploy multiple ActiveMQ servers or eventually change the credentials.
-
-### Step 1: Install the `java_ks` Module
-
-On your puppet master, run `sudo puppet module install puppetlabs/java_ks`.
-
-### Step 2: Create a Puppet Class
-
-The class to manage the keystores should do the following:
-
-* Make sure the PEM cert and key files are present and protected.
-* Declare a pair of `java_ks` resources.
-* Manage the mode and ownership of the keystore files.
-
-The code below is an example, but it will work fine if you put it in a module (example file location in the first comment) and set its parameters when you declare it. The name of the class (and its home module) can be changed as needed.
-
-
-{% highlight ruby %}
-    # /etc/puppet/modules/activemq/manifests/keystores.pp
-    class activemq::keystores (
-      $keystore_password, # required
-
-      # User must put these files in the module, or provide other URLs
-      $ca = 'puppet:///modules/activemq/ca.pem',
-      $cert = 'puppet:///modules/activemq/cert.pem',
-      $private_key = 'puppet:///modules/activemq/private_key.pem',
-
-      $activemq_confdir = '/etc/activemq',
-      $activemq_user = 'activemq',
-    ) {
-
-      # ----- Restart ActiveMQ if the SSL credentials ever change       -----
-      # ----- Uncomment if you are fully managing ActiveMQ with Puppet. -----
-
-      # Package['activemq'] -> Class[$title]
-      # Java_ks['activemq_cert:keystore'] ~> Service['activemq']
-      # Java_ks['activemq_ca:truststore'] ~> Service['activemq']
-
-
-      # ----- Manage PEM files -----
-
-      File {
-        owner => root,
-        group => root,
-        mode  => 0600,
-      }
-      file {"${activemq_confdir}/ssl_credentials":
-        ensure => directory,
-        mode   => 0700,
-      }
-      file {"${activemq_confdir}/ssl_credentials/activemq_certificate.pem":
-        ensure => file,
-        source => $cert,
-      }
-      file {"${activemq_confdir}/ssl_credentials/activemq_private.pem":
-        ensure => file,
-        source => $private_key,
-      }
-      file {"${activemq_confdir}/ssl_credentials/ca.pem":
-        ensure => file,
-        source => $ca,
-      }
-
-
-      # ----- Manage Keystore Contents -----
-
-      # Each keystore should have a dependency on the PEM files it relies on.
-
-      # Truststore with copy of CA cert
-      java_ks { 'activemq_ca:truststore':
-        ensure       => latest,
-        certificate  => "${activemq_confdir}/ssl_credentials/ca.pem",
-        target       => "${activemq_confdir}/truststore.jks",
-        password     => $keystore_password,
-        trustcacerts => true,
-        require      => File["${activemq_confdir}/ssl_credentials/ca.pem"],
-      }
-
-      # Keystore with ActiveMQ cert and private key
-      java_ks { 'activemq_cert:keystore':
-        ensure       => latest,
-        certificate  => "${activemq_confdir}/ssl_credentials/activemq_certificate.pem",
-        private_key  => "${activemq_confdir}/ssl_credentials/activemq_private.pem",
-        target       => "${activemq_confdir}/keystore.jks",
-        password     => $keystore_password,
-        require      => [
-          File["${activemq_confdir}/ssl_credentials/activemq_private.pem"],
-          File["${activemq_confdir}/ssl_credentials/activemq_certificate.pem"]
-        ],
-      }
-
-
-      # ----- Manage Keystore Files -----
-
-      # Permissions only.
-      # No ensure, source, or content.
-
-      file {"${activemq_confdir}/keystore.jks":
-        owner   => $activemq_user,
-        group   => $activemq_user,
-        mode    => 0600,
-        require => Java_ks['activemq_cert:keystore'],
-      }
-      file {"${activemq_confdir}/truststore.jks":
-        owner   => $activemq_user,
-        group   => $activemq_user,
-        mode    => 0600,
-        require => Java_ks['activemq_ca:truststore'],
-      }
-    
-    }
-{% endhighlight %}
-
-
-### Step 3: Assign the Class to the ActiveMQ Server
-
-...using your standard Puppet site tools.
-
-### Step 4: Finish
-
-[Configure ActiveMQ to use the keystores in its `sslContext`][tls], probably with the Puppet template you're using to manage activemq.xml.  **Double-check** that you've made activemq.xml world-unreadable, since it now contains sensitive credentials.
diff --git a/website/ec2demo.md b/website/ec2demo.md
deleted file mode 100644 (file)
index e55033b..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
----
-layout: default
-title: EC2 Demo
-toc: false
----
-[Amazon Console]: https://console.aws.amazon.com/ec2/
-[Puppet based Service]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/AgentService
-[Puppet based Package]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/AgentPackage
-[NRPE]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/AgentNRPE
-[Meta Registration]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/RegistrationMetaData
-[URL Tester]: https://github.com/ripienaar/mc-plugins/tree/master/agent/urltest
-[Registration]: /mcollective/reference/plugins/registration.html
-[Registration Monitor]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/AgentRegistrationMonitor
-
-We've created an Amazon hosted demo of mcollective that can give you a quick feel
-for how things work without all the hassle of setting up from scratch.
-
-The demo uses the new Amazon CloudFormation technology that you can access using the [Amazon Console].
-To access the AMI you must select the 'EU - West' Region. Also, prior to following the steps in the demo
-please create a SSH keypair and register it under the EC2 tab in the console for that region.
-
-The video below shows how to get going with the demo and runs through a few of the availbable options.
-For best experience please maximise the video.
-
-The two passwords requested during creation is completely arbitrary you can provide anything there and
-past entering them on the creation page you don't need to know them again later.  They are used internally
-to the demo without you being aware of them.
-
-You'll need to enter the url _http://mcollective-120-demo.s3.amazonaws.com/cloudfront`_`demo.json_ into the
-creation step.
-
-<iframe width="640" height="360" src="http://www.youtube-nocookie.com/embed/Hw0Z1xfg050" frameborder="0" allowfullscreen></iframe>
-
-## Agents
-The images all have the basic agents going as well as some community ones:
-
- * [Puppet based Service]
- * [Puppet based Package]
- * [NRPE]
- * [Meta Registration]
- * [URL Tester]
-
-## Registration
-The main node will have [Registration] setup and the community [Registration Monitor] agent,
-look in */var/tmp/mcollective* for meta data from all your nodes.
diff --git a/website/images/activemq-multi-locations.png b/website/images/activemq-multi-locations.png
deleted file mode 100644 (file)
index 56f7004..0000000
Binary files a/website/images/activemq-multi-locations.png and /dev/null differ
diff --git a/website/images/mcollective-aaa.png b/website/images/mcollective-aaa.png
deleted file mode 100644 (file)
index 35475ab..0000000
Binary files a/website/images/mcollective-aaa.png and /dev/null differ
diff --git a/website/images/mcollective/li.png b/website/images/mcollective/li.png
deleted file mode 100644 (file)
index 73d6829..0000000
Binary files a/website/images/mcollective/li.png and /dev/null differ
diff --git a/website/images/message-flow-diagram.png b/website/images/message-flow-diagram.png
deleted file mode 100644 (file)
index 301594d..0000000
Binary files a/website/images/message-flow-diagram.png and /dev/null differ
diff --git a/website/images/subcollectives-collectives.png b/website/images/subcollectives-collectives.png
deleted file mode 100644 (file)
index 7460fac..0000000
Binary files a/website/images/subcollectives-collectives.png and /dev/null differ
diff --git a/website/images/subcollectives-impact.png b/website/images/subcollectives-impact.png
deleted file mode 100644 (file)
index c5e7958..0000000
Binary files a/website/images/subcollectives-impact.png and /dev/null differ
diff --git a/website/images/subcollectives-multiple-middleware.png b/website/images/subcollectives-multiple-middleware.png
deleted file mode 100644 (file)
index bc2eab6..0000000
Binary files a/website/images/subcollectives-multiple-middleware.png and /dev/null differ
diff --git a/website/index.md b/website/index.md
deleted file mode 100644 (file)
index a5c747d..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
----
-layout: default
-title: Marionette Collective
-toc: false
----
-[Func]: https://fedorahosted.org/func/
-[Fabric]: http://fabfile.org/
-[Capistrano]: http://www.capify.org
-[Publish Subscribe Middleware]: http://en.wikipedia.org/wiki/Publish/subscribe
-[Screencasts]: /mcollective/screencasts.html
-[Amazon EC2 based demo]: /mcollective/ec2demo.html
-[broadcast paradigm]: /mcollective/reference/basic/messageflow.html
-[UsingWithPuppet]: /mcollective/reference/integration/puppet.html
-[UsingWithChef]: /mcollective/reference/integration/chef.html
-[Facter]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/FactsFacterYAML
-[Ohai]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/FactsOhai
-[WritingFactsPlugins]: /mcollective/reference/plugins/facts.html
-[NodeReports]: /mcollective/reference/ui/nodereports.html
-[PluginsSite]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki
-[SimpleRPCIntroduction]: /mcollective/simplerpc/
-[SecurityOverview]: /mcollective/security.html
-[SecurityWithActiveMQ]: /mcollective/reference/integration/activemq_security.html
-[SSLSecurityPlugin]: /mcollective/reference/plugins/security_ssl.html
-[AESSecurityPlugin]: /mcollective/reference/plugins/security_aes.html
-[SimpleRPCAuthorization]: /mcollective/simplerpc/authorization.html
-[SimpleRPCAuditing]: /mcollective/simplerpc/auditing.html
-[ActiveMQClusters]: /mcollective/reference/integration/activemq_clusters.html
-[JSONSchema]: http://json-schema.org/
-[Registration]: /mcollective/reference/plugins/registration.html
-[GettingStarted]: /mcollective/reference/basic/gettingstarted.html
-[Configuration]: /mcollective/reference/basic/configuration.html
-[Terminology]: /mcollective/terminology.html
-[devco]: http://www.devco.net/archives/tag/mcollective
-[mcollective-users]: http://groups.google.com/group/mcollective-users
-[WritingAgents]: /mcollective/reference/basic/basic_agent_and_client.html
-[ActiveMQ]: /mcollective/reference/integration/activemq_security.html
-[MessageFormat]: /mcollective/reference/basic/messageformat.html
-[ChangeLog]: /mcollective/changelog.html
-[server_config]: /mcollective/configure/server.html
-
-The Marionette Collective AKA mcollective is a framework to build server
-orchestration or parallel job execution systems.
-
-Primarily we'll use it as a means of programmatic execution of Systems Administration
-actions on clusters of servers.  In this regard we operate in the same space as tools
-like [Func], [Fabric] or [Capistrano].
-
-We've attempted to think out of the box a bit designing this system by not relying on
-central inventories and tools like SSH, we're not simply a fancy SSH "for loop".  MCollective use modern tools like
-[Publish Subscribe Middleware] and modern philosophies like real time discovery of network resources using meta data
-and not hostnames.  Delivering a very scalable and very fast parallel execution environment.
-
-To get an immediate feel for what I am on about you can look at some of the videos on the
-[Screencasts] page and then keep reading below for further info and links.  We've also created an [Amazon EC2 based demo]
-where you can launch as many instances as you want to see how it behaves first hand.
-
-## What is MCollective and what does it allow you to do
-
- * Interact with small to very large clusters of servers
- * Use a [broadcast paradigm] for request distribution.  All servers get all requests at the same time, requests have
-   filters attached and only servers matching the filter will act on requests.  There is no central asset database to
-   go out of sync, the network is the only source of truth.
- * Break free from ever more complex naming conventions for hostnames as a means of identity.  Use a very
-   rich set of meta data provided by each machine to address them.  Meta data comes from
-   [Puppet][UsingWithPuppet], [Chef][UsingWithChef], [Facter], [Ohai] or [plugins][WritingFactsPlugins] you provide yourself.
- * Comes with simple to use command line tools to call remote agents.
- * Ability to write [custom reports][NodeReports] about your infrastructure.
- * A number of agents to manage packages, services and other common components are [available from
-   the community][PluginsSite].
- * Allows you to write [simple RPC style agents, clients][SimpleRPCIntroduction] and Web UIs in an easy to understand language - Ruby
- * Extremely pluggable and adaptable to local needs
- * Middleware systems already have rich [authentication and authorization models][SecurityWithActiveMQ], leverage these as a first
-   line of control.  Include fine grained Authentication using [SSL][SSLSecurityPlugin] or [RSA][AESSecurityPlugin], [Authorization][SimpleRPCAuthorization] and
-   [Auditing][SimpleRPCAuditing] of requests.  You can see more details in the [Security Overview][SecurityOverview].
- * Re-use the ability of middleware to do [clustering, routing and network isolation][ActiveMQClusters]
-   to realize secure and scalable setups.
-
-## Pluggable Core
-We aim to provide a stable core framework that allows you to build it out into a system that meets
-your own needs, we are pluggable in the following areas:
-
- * Replace our choice of middleware - STOMP compliant middleware - with your own like AMQP based.
- * Replace our authorization system with one that suits your local needs
- * Replace our serialization - Ruby Marshal and YAML based - with your own like [JSONSchema] that is cross language.
- * Add sources of data, we support [Chef][UsingWithChef] and [Puppet][UsingWithPuppet].   You can
-   [provide a plugin to give us access to your tools data][WritingFactsPlugins].
-   The community have ones for [Facter and Ohai already][PluginsSite]
- * Create a central inventory of services [leveraging MCollective as transport][Registration]
-   that can run and distribute inventory data on a regular basis.
-
-MCollective is licensed under the Apache 2 license.
-
-## Next Steps and Further Reading
-
-### Introductory and Tutorial Pages
- * See it in action in our [Screencasts]
- * Read the [GettingStarted], [Server Configuration Reference][server_config], and [Configuration] guides for installation instructions
- * Read the [Terminology] page if you see any words where the meaning in the context of MCollective is not clear
- * Read the [ChangeLog] page to see how MCollective has developed
- * Learn how to write basic reports for your servers - [NodeReports]
- * Learn how to write simple Agents and Clients using our [Simple RPC Framework][SimpleRPCIntroduction]
- * The author maintains some agents and clients on another project [here][PluginsSite].
- * The author has written [several blog posts][devco] about mcollective.
- * Subscribe and post questions to the [mailing list][mcollective-users].
-
-### Internal References and Developer Docs
- * Finding it hard to do something complex with Simple RPC? See [WritingAgents] for what lies underneath
- * Role based security, authentication and authorization using [ActiveMQ]
- * Structure of [Request and Reply][MessageFormat] messages
-
diff --git a/website/messages/PLMC1.md b/website/messages/PLMC1.md
deleted file mode 100644 (file)
index 92bf9a6..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
----
-layout: default
-title: Message detail for PLMC1
-toc: false
----
-
-Example Message
----------------
-
-    The Marionette Collective version 2.2.2 started by /usr/bin/mco using config file /etc/mcollective/client.cfg
-
-Additional Information
-----------------------
-
-This message gets logged each time MCollective reads it's config file.  Generally this only happens once per process.  It shows the version, process name and config file as a simple debugging aid
diff --git a/website/messages/PLMC10.md b/website/messages/PLMC10.md
deleted file mode 100644 (file)
index a0fd7b5..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
----
-layout: default
-title: Message detail for PLMC10
-toc: false
----
-
-Example Message
----------------
-
-    Failed to handle message: RuntimeError: none.rb:15:in `decodemsg': Could not decrypt message 
-
-Additional Information
-----------------------
-
-When a message arrives from the middleware it gets decoded, security validated and then dispatched to the agent code.
-
-There exist a number of errors that can happen here, some are handled specifically others will be logged by this "catch all" handler.
-
-Generally there should not be many messages logged here but we include a stack trace to assist with debugging these.
-
-The messages here do not tend to originate from your Agents unless they are syntax error related but more likely to be situations like security failures due to incorrect SSL keys and so forth
-
-Should you come across one that is a regular accorance in your logs please open a ticket including your backtrace and we will improve the handling of that situation
diff --git a/website/messages/PLMC11.md b/website/messages/PLMC11.md
deleted file mode 100644 (file)
index e07cd16..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
----
-layout: default
-title: Message detail for PLMC11
-toc: false
----
-
-Example Message
----------------
-
-    Cache expired on 'ddl' key 'agent/nrpe'
-
-Additional Information
-----------------------
-
-MCollective has an internal Cache used to speed up operations like parsing of DDL files.  The cache is also usable from the agents and other plugins you write.
-
-Each entry in the cache has an associated TTL or maximum life time, once the maximum time on an item is reached it is considered expired.  Next time anything attempts to read this entry from the cache this log line will be logged.
-
-This is part of the normal operations of MCollective and doesn't indicate any problem.  We log this debug message to help you debug your own use of the cache.
diff --git a/website/messages/PLMC12.md b/website/messages/PLMC12.md
deleted file mode 100644 (file)
index c995c7f..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
----
-layout: default
-title: Message detail for PLMC12
-toc: false
----
-
-Example Message
----------------
-
-    Cache hit on 'ddl' key 'agent/nrpe'
-
-Additional Information
-----------------------
-
-MCollective has an internal Cache used to speed up operations like parsing of DDL files.  The cache is also usable from the agents and other plugins you write.
-
-Each entry in the cache has an associated TTL or maximum life time, once the maximum time on an item is reached it is considered expired.  
-
-This log line indicates that a request for a cache entry was made, the entry had not yet expired and so the cached data is being returned.  
-
-It does not indicate a problem, it's just a debugging aid
diff --git a/website/messages/PLMC13.md b/website/messages/PLMC13.md
deleted file mode 100644 (file)
index 5efd236..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
----
-layout: default
-title: Message detail for PLMC13
-toc: false
----
-
-Example Message
----------------
-
-    Could not find a cache called 'my_cache'
-
-Additional Information
-----------------------
-
-MCollective has an internal Cache used to speed up operations like parsing of DDL files.  The cache is also usable from the agents and other plugins you write.
-
-The cache is made up of many named caches, this error indicates that a cache has not yet been setup prior to trying to use it.
diff --git a/website/messages/PLMC14.md b/website/messages/PLMC14.md
deleted file mode 100644 (file)
index 8287488..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
----
-layout: default
-title: Message detail for PLMC14
-toc: false
----
-
-Example Message
----------------
-
-    No block supplied to synchronize on cache 'my_cache'
-
-Additional Information
-----------------------
-
-When using the Cache to synchronize your own code across agents or other plugins you have to supply a block to synchronise.
-
-Correct usage would be:
-
-    Cache.setup(:customer, 600)
-    Cache(:customer).synchronize do
-       # update customer record
-    end
-
-This error is raise when the logic to update the customer record is not in a block as in the example
diff --git a/website/messages/PLMC15.md b/website/messages/PLMC15.md
deleted file mode 100644 (file)
index 74afc2d..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
----
-layout: default
-title: Message detail for PLMC15
-toc: false
----
-
-Example Message
----------------
-
-    No item called 'nrpe_agent' for cache 'ddl'
-
-Additional Information
-----------------------
-
-MCollective has an internal Cache used to speed up operations like parsing of DDL files.  The cache is also usable from the agents and other plugins you write.
-
-The cache stored items using a key, this error will be logged and raised when you try to access a item that does not yet exist in the cache.
diff --git a/website/messages/PLMC16.md b/website/messages/PLMC16.md
deleted file mode 100644 (file)
index b169953..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
----
-layout: default
-title: Message detail for PLMC16
-toc: false
----
-
-Example Message
----------------
-
-    'hello' does not look like a numeric value
-
-Additional Information
-----------------------
-
-When MCollective receives an argument from the command line like port=fello it consults the DDL file to determine the desired type of this parameter, it then tries to convert the input string into the correct numeric value.
-
-This error indicates the input you provided could not be converted into the desired format.
-
-You'll usually see this when using the 'mco rpc' command to interact with an agent.  This is usually a fatal error, the request will not be sent if it does not validate against the DDL.
diff --git a/website/messages/PLMC17.md b/website/messages/PLMC17.md
deleted file mode 100644 (file)
index bf3eded..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
----
-layout: default
-title: Message detail for PLMC17
-toc: false
----
-
-Example Message
----------------
-
-    'flase' does not look like a boolean value
-
-Additional Information
-----------------------
-
-When MCollective receives an argument from the command line like force=true it consults the DDL file to determine the desired type of this parameter, it then tries to convert the input string into the correct boolean value.
-
-This error indicates the input you provided could not be converted into the desired boolean format.  It wil accept "true", "t", "yes", "y" and "1" as being true.  It will accept "false", "f", "no", "n", "0" as being false.
-
-You'll usually see this when using the 'mco rpc' command to interact with an agent.  This is usually a fatal error, the request will not be sent if it does not validate against the DDL.
diff --git a/website/messages/PLMC18.md b/website/messages/PLMC18.md
deleted file mode 100644 (file)
index f715267..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
----
-layout: default
-title: Message detail for PLMC18
-toc: false
----
-
-Example Message
----------------
-
-    Found 'rpcutil' ddl at '/usr/libexec/mcollective/mcollective/agent/rpcutil.ddl'
-
-Additional Information
-----------------------
-
-Most plugin types have a DDL file that needs to be correctly installed for the plugin to function.  There can be multiple libdirs that can provide the DDL file for a specific plugin.
-
-This message is a message designed to help you debug issues when you think the wrong DDL file is being used.
diff --git a/website/messages/PLMC19.md b/website/messages/PLMC19.md
deleted file mode 100644 (file)
index f449db5..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
----
-layout: default
-title: Message detail for PLMC19
-toc: false
----
-
-Example Message
----------------
-
-    DDL requirements validation being skipped in development
-
-Additional Information
-----------------------
-
-Usually when MCollective run it validates all requirements are met before publishing a request or processing a request against the DDL file for the agent.
-
-This can be difficult to satisfy in development perhaps because you are still writing your DDL files or debugging issues.  
-
-This message indicates that when MCollective detects it's running against an unreleased version of MCollective - like directly out of a Git clone - it will skip the DDL validation steps.  It is logged at a warning level as this significantly changes the behaviour of the client and server.
diff --git a/website/messages/PLMC2.md b/website/messages/PLMC2.md
deleted file mode 100644 (file)
index 39fb476..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
----
-layout: default
-title: Message detail for PLMC2
-toc: false
----
-
-Example Message
----------------
-
-    Reloading all agents after receiving USR1 signal
-
-Additional Information
-----------------------
-
-When sending the mcollectived process the USR1 signal on a Unix based machine this message will indicate that the signal got received and all agents are being reloaded from disk
diff --git a/website/messages/PLMC20.md b/website/messages/PLMC20.md
deleted file mode 100644 (file)
index d9e0191..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
----
-layout: default
-title: Message detail for PLMC20
-toc: false
----
-
-Example Message
----------------
-
-    Agent plugin 'example' requires MCollective version 2.2.1 or newer
-
-Additional Information
-----------------------
-
-MCollective plugins can declare a minimum version of MCollective that they require to be functional.
-
-MCollective validates this when it loads the plugin and this error will be logged or shown to the user when this requirement cannot be satisfied.
diff --git a/website/messages/PLMC21.md b/website/messages/PLMC21.md
deleted file mode 100644 (file)
index 242e7f0..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
----
-layout: default
-title: Message detail for PLMC21
-toc: false
----
-
-Example Message
----------------
-
-    Cannot validate input 'service': Input string is longer than 40 character(s)
-
-Additional Information
-----------------------
-
-Every input you provide to a RPC request is validated against it's DDL file. This error will be shown when the supplied data does not pass validation against the DDL.
-
-Consult the 'mco plugin doc' command to view the DDL file for your action and input.
diff --git a/website/messages/PLMC22.md b/website/messages/PLMC22.md
deleted file mode 100644 (file)
index 7d7dc62..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
----
-layout: default
-title: Message detail for PLMC22
-toc: false
----
-
-Example Message
----------------
-
-    Cannot determine what entity input 'port' belongs to
-
-Additional Information
-----------------------
-
-When writing a DDL you declare inputs into plugins using the input keyword.  Each input has to belong to a wrapping entity like in the example below:
-
-    action "get_data", :description => "Get data from a data plugin" do
-        input :source,
-              :prompt      => "Data Source",
-              :description => "The data plugin to retrieve information from",
-              :type        => :string,
-              :validation  => '^\w+$',
-              :optional    => false,
-              :maxlength   => 50
-    end
-
-Here the input belongs to the action entity "get_data", this error indicates that an input were found without it belonging to any specific entity
diff --git a/website/messages/PLMC23.md b/website/messages/PLMC23.md
deleted file mode 100644 (file)
index b782478..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
----
-layout: default
-title: Message detail for PLMC23
-toc: false
----
-
-Example Message
----------------
-
-    Input needs a :prompt property
-
-Additional Information
-----------------------
-
-When writing a DDL you declare inputs for all data that you pass into the plugin.  Inputs have a minimally required field set and this error indicate that you did not provide some key field while describing the input.
diff --git a/website/messages/PLMC24.md b/website/messages/PLMC24.md
deleted file mode 100644 (file)
index 423d4e9..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
----
-layout: default
-title: Message detail for PLMC24
-toc: false
----
-
-Example Message
----------------
-
-    Failed to load DDL for the 'rpcutil' agent, DDLs are required: RuntimeError: failed to parse DDL file
-
-Additional Information
-----------------------
-
-As of version 2.0.0 DDL files are required by the MCollective server.  This server indicates that it either could not find the DDL for the rpcutil agent or that there was a syntax error.
-
-Confirm that the DDL file is installed in the agent directory and that it parses correctly using the 'mco plugin doc' command.
diff --git a/website/messages/PLMC25.md b/website/messages/PLMC25.md
deleted file mode 100644 (file)
index 14fb321..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
----
-layout: default
-title: Message detail for PLMC25
-toc: false
----
-
-Example Message
----------------
-
-    aggregate method for action 'rpcutil' is missing a function parameter
-
-Additional Information
-----------------------
-
-DDL files can declare aggregation rules for the data returned by actions as seen below:
-
-         summarize do
-            aggregate summary(:collectives)
-         end
-
-This error indicates that you did not supply the argument - :collectives in this example.
diff --git a/website/messages/PLMC26.md b/website/messages/PLMC26.md
deleted file mode 100644 (file)
index 15f8335..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
----
-layout: default
-title: Message detail for PLMC26
-toc: false
----
-
-Example Message
----------------
-
-    Functions supplied to aggregate should be a hash
-
-Additional Information
-----------------------
-
-Internally when MCollective parse the DDL it converts the aggregate functions into a hash with the function name and any arguments.
-
-This error indicates that the internal translation failed, this is a critical error and would probably indicate a structure problem in your DDL or a bug in MCollective
diff --git a/website/messages/PLMC27.md b/website/messages/PLMC27.md
deleted file mode 100644 (file)
index 77f955f..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
----
-layout: default
-title: Message detail for PLMC27
-toc: false
----
-
-Example Message
----------------
-
-    Formats supplied to aggregation functions must have a :format key
-
-Additional Information
-----------------------
-
-DDL aggregate functions can take a custom format as in the example below:
-
-    aggregate average(:total_resources, :format => "Average: %d")
-
-This error indicate that the :format above could not be correctly parsed.
diff --git a/website/messages/PLMC28.md b/website/messages/PLMC28.md
deleted file mode 100644 (file)
index 160bbe6..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
----
-layout: default
-title: Message detail for PLMC28
-toc: false
----
-
-Example Message
----------------
-
-    Formats supplied to aggregation functions should be a hash
-
-Additional Information
-----------------------
-
-DDL aggregate functions can take a custom format as in the example below:
-
-    aggregate average(:total_resources, :format => "Average: %d")
-
-This error indicate that the :format above was not supplied as a hash as in the above example
diff --git a/website/messages/PLMC29.md b/website/messages/PLMC29.md
deleted file mode 100644 (file)
index 17abe89..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
----
-layout: default
-title: Message detail for PLMC29
-toc: false
----
-
-Example Message
----------------
-
-    Attempted to call action 'yum_clean' for 'package' but it's not declared in the DDL
-
-Additional Information
-----------------------
-
-Every agent has a DDL file that describes valid actions that they can perform
-
-This error indicates you attempted to perform an action that does not exist.  Review the plugin documentation using 'mco plugin doc' for correct usage
diff --git a/website/messages/PLMC3.md b/website/messages/PLMC3.md
deleted file mode 100644 (file)
index 8e1c90a..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
----
-layout: default
-title: Message detail for PLMC3
-toc: false
----
-
-Example Message
----------------
-
-    Cycling logging level due to USR2 signal
-
-Additional Information
-----------------------
-
-When sending the mcollectived process the USR2 signal on a Unix based machine this message indicates that the signal for received and the logging level is being adjusted to the next higher level or back down to debug if it was already at it's highest level.
-
-This message will be followed by another message similar to the one below:
-
-    Logging level is now WARN
diff --git a/website/messages/PLMC30.md b/website/messages/PLMC30.md
deleted file mode 100644 (file)
index 95a947f..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
----
-layout: default
-title: Message detail for PLMC30
-toc: false
----
-
-Example Message
----------------
-
-    Action 'get_fact' needs a 'fact' argument
-
-Additional Information
-----------------------
-
-Actions can declare that they expect a required input, this error indicates that you did not supply the required input
diff --git a/website/messages/PLMC31.md b/website/messages/PLMC31.md
deleted file mode 100644 (file)
index 9ac14bd..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
----
-layout: default
-title: Message detail for PLMC31
-toc: false
----
-
-Example Message
----------------
-
-    No dataquery has been defined in the DDL for data plugin 'package'
-
-Additional Information
-----------------------
-
-Each data plugin requires a DDL that has a 'dataquery' block in it.
-
-    dataquery :description => "Agent Meta Data" do
-        .
-        .
-    end
-
-This error indicates that the DDL file for a specific data plugin did not contain this block.
diff --git a/website/messages/PLMC32.md b/website/messages/PLMC32.md
deleted file mode 100644 (file)
index c432da9..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
----
-layout: default
-title: Message detail for PLMC32
-toc: false
----
-
-Example Message
----------------
-
-    No output has been defined in the DDL for data plugin '%{plugin}'
-
-Additional Information
-----------------------
-
-Data plugins must return data.  The DDL files for a data plugin must declare at least one output parameter else you will see this error.
diff --git a/website/messages/PLMC33.md b/website/messages/PLMC33.md
deleted file mode 100644 (file)
index 2bf994d..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
----
-layout: default
-title: Message detail for PLMC33
-toc: false
----
-
-Example Message
----------------
-
-    No data plugin argument was declared in the 'puppet' DDL but an input was supplied
-
-Additional Information
-----------------------
-
-Data plugins can take an optional input argument.  This error indicate that you supplied an input argument but the plugin does not actually expect any input.
-
-Review the documentation for the data plugin using 'mco plugin doc'
diff --git a/website/messages/PLMC34.md b/website/messages/PLMC34.md
deleted file mode 100644 (file)
index a14ffbe..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
----
-layout: default
-title: Message detail for PLMC34
-toc: false
----
-
-Example Message
----------------
-
-    setting meta data in agents have been deprecated, DDL files are now being used for this information. Please update the 'package' agent
-
-Additional Information
-----------------------
-
-In the past each MCollective agent had a metadata section containing information like the timeout.
-
-As of 2.2.0 the agents will now consult the DDL files that ship with each agent for this purpose so the metadata in agents are not used at all.
-
-In order to remove confusing duplication setting metadata in agents have been deprecated and from version 2.4.0 will not be supported at all.
-
-Please update your agent by removing the metadata section from it and make sure the DDL file has the correct information instead.
diff --git a/website/messages/PLMC35.md b/website/messages/PLMC35.md
deleted file mode 100644 (file)
index 083d478..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
----
-layout: default
-title: Message detail for PLMC35
-toc: false
----
-
-Example Message
----------------
-
-    Client did not request a response, surpressing reply
-
-Additional Information
-----------------------
-
-The MCollective client can ask that the agent just performs the action and never respond.  Like when supplying the --no-results option to the 'mco rpc' application.
-
-This log line indicates that the request was received and interpreted as such and no reply will be sent.  This does not indicate a problem generally it's just there to assist with debugging of problems.
diff --git a/website/messages/PLMC36.md b/website/messages/PLMC36.md
deleted file mode 100644 (file)
index ebfa38b..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
----
-layout: default
-title: Message detail for PLMC36
-toc: false
----
-
-Example Message
----------------
-
-    Unknown action 'png' for agent 'rpcutil'
-
-Additional Information
-----------------------
-
-Agents are made up of a number of named actions.  When the MCollective Server receives a request it double checks if the agent in question actually implements the logic for a specific action.
-
-When it cannot find the implementation this error will be raised.  This is an unusual situation since at this point on both the client and the server the DDL will already have been used to validate the request and the DDL would have indicated that the action is valid. 
-
-Check your agent code and make sure you have code like:
-
-    action "the_action" do
-        .
-        .
-    end
diff --git a/website/messages/PLMC37.md b/website/messages/PLMC37.md
deleted file mode 100644 (file)
index a047b50..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
----
-layout: default
-title: Message detail for PLMC37
-toc: false
----
-
-Example Message
----------------
-
-    Starting default activation checks for the 'rpcutil' agent
-
-Additional Information
-----------------------
-
-Each time the MCollective daemon starts it loads each agent from disk.  It then tries to determine if the agent should start on this node by using the activate_when method or per-agent configuration.
-
-This is a debug statement that shows you it is about to start interacting with the logic in the agent to determine if it should be made available or not.
diff --git a/website/messages/PLMC38.md b/website/messages/PLMC38.md
deleted file mode 100644 (file)
index 1c98475..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
----
-layout: default
-title: Message detail for PLMC38
-toc: false
----
-
-Example Message
----------------
-
-    Found plugin configuration 'exim.activate_agent' with value 'y'
-
-Additional Information
-----------------------
-
-The administrator can choose that a certain agent that is deployed on this machine should not be made available to the network.
-
-To do this you would add a configuration value like this example to the mcollective server.cfg:
-
-    plugin.exim.activate_agent = n
-
-If this value is "1", "y" or "true" the agent will be activated else it will be disabled.
diff --git a/website/messages/PLMC39.md b/website/messages/PLMC39.md
deleted file mode 100644 (file)
index 728abf9..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
----
-layout: default
-title: Message detail for PLMC39
-toc: false
----
-
-Example Message
----------------
-
-    Audit failed with an error, processing the request will continue.
-
-Additional Information
-----------------------
-
-Every MCollective request can be audited.  In the event where the auditing fails the processing continues.
-
-At present the failure handling is not configurable, in future the administrator might elect to not run unaudited requests via configuration.
diff --git a/website/messages/PLMC4.md b/website/messages/PLMC4.md
deleted file mode 100644 (file)
index 57e586c..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
----
-layout: default
-title: Message detail for PLMC4
-toc: false
----
-
-Example Message
----------------
-
-    Failed to start registration plugin: ArgumentError: meta.rb:6:in `gsub': wrong number of arguments (0 for 2)
-
-Additional Information
-----------------------
-
-Registration plugins are loaded into the MCollective daemon at startup and ran on a regular interval.
-
-This message indicate that on first start this plugin failed to run, it will show the exception class, line and exception message to assist with debugging
diff --git a/website/messages/PLMC5.md b/website/messages/PLMC5.md
deleted file mode 100644 (file)
index 38f22fe..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
----
-layout: default
-title: Message detail for PLMC5
-toc: false
----
-
-Example Message
----------------
-
-    Received a control message, possibly via 'mco controller' but this has been deprecated
-
-Additional Information
-----------------------
-
-In previous versions of MCollective a application called 'controller' were included that had the ability to request agent reloads and other commands that would control the runner.
-
-Unfortunately this method of controlling the daemon was never considered stable or reliable and has since been deprecate for removal during the 2.3.x development series
diff --git a/website/messages/PLMC6.md b/website/messages/PLMC6.md
deleted file mode 100644 (file)
index 42e7e98..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
----
-layout: default
-title: Message detail for PLMC6
-toc: false
----
-
-Example Message
----------------
-
-    Message does not pass filters, ignoring
-
-Additional Information
-----------------------
-
-When a specific MCollective daemon receives a message from a network it validates the filter before processing the message.  The filter is the list of classes, facts or other conditions that are associated with any message.
-
-In the case where the filter does not match the specific host this line gets logged.
-
-It's often the case for broadcast messages that all MCollective nodes will receive a message but only a subset of nodes are targetted using the filters, in that situation the nodes that received the request but should not respond to it will see this log line.
-
-It does not indicate anything to be concerned about but if you find debugging a problem and expect a node to have responded when it shouldn't this log line will give you a hint that some condition specified in the filter did not match the local host
diff --git a/website/messages/PLMC7.md b/website/messages/PLMC7.md
deleted file mode 100644 (file)
index 1a5a064..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
----
-layout: default
-title: Message detail for PLMC7
-toc: false
----
-
-Example Message
----------------
-
-    Exiting after signal: SignalException: runner.rb:6:in `run': Interrupt
-
-Additional Information
-----------------------
-
-When the MCollective daemon gets a signal from the Operating System that it does not specifically handle it will log this line before exiting.
-
-You would see this whenever the daemon is stopped by init script or when sending it a kill signal, it will then proceed to disconnect from the middleware and exit its main loop
diff --git a/website/messages/PLMC8.md b/website/messages/PLMC8.md
deleted file mode 100644 (file)
index 53546a5..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
----
-layout: default
-title: Message detail for PLMC8
-toc: false
----
-
-Example Message
----------------
-
-    Handling message for agent 'rpcutil' on collective 'eu_collective' with requestid 'a8a78d0ff555c931f045b6f448129846'
-
-Additional Information
-----------------------
-
-After receiving a message from the middleware, decoding it, validating it's security credentials and doing other checks on it the MCollective daemon will pass it off to the actual agent code for processing.
-
-Prior to doing so it will log this line indicating the agent name and sub-collective and other information that will assist in correlating the message sent from the client with those in the server logs being processed.
diff --git a/website/messages/PLMC9.md b/website/messages/PLMC9.md
deleted file mode 100644 (file)
index fe8818b..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
----
-layout: default
-title: Message detail for PLMC9
-toc: false
----
-
-Example Message
----------------
-
-    Expired Message: message 8b4fe522f0d0541dabe83ec10b7fa446 from cert=client@node created at 1358840888 is 653 seconds old, TTL is 60
-
-Additional Information
-----------------------
-
-Requests sent from clients to servers all have a creation time and a maximum validity time called a TTL.
-
-This message indicates that a message was received from the network but that it was determined to be too based on the TTL settings.
-
-Usually this happens because your clocks are not in sync - something that can be fixed by rolling out a tool like ntp across your server estate.
-
-It might also happen during very slow network conditions or when the TTL is set too low for your general network latency.
diff --git a/website/reference/basic/basic_agent_and_client.md b/website/reference/basic/basic_agent_and_client.md
deleted file mode 100644 (file)
index 4698a9b..0000000
+++ /dev/null
@@ -1,262 +0,0 @@
----
-layout: default
-title: Basic Agents and Clients
----
-[SimpleRPCIntroduction]: /mcollective/simplerpc/
-
-## Deprecation Warning
-
-You must use [SimpleRPC][SimpleRPCIntroduction] for writing agents and clients.  SimpleRPC is a framework that wraps the core MCollective client and agent structures in a lot of helpful convention and tools.
-
-**The approach to developing agents and clients documented below is not supported post version 2.0.0 and the functionality will be removed for the next major release.**
-
-## Overview
-
-Writing agents for mcollective is simple, we'll write a simple _echo_ agent as well as a cli tool to communicate with it that supports discovery, filtering and more.
-
-The agent will send back everything that got sent to it, not overly useful but enough to demonstrate the concepts.
-
-## The Agent
-
-Agents go into a directory configured in the _server.cfg_ using the _libdir_ directive.  You should have _mcollective/agent_ directory under that, restart the daemon when you've put it there.
-
-Create a file echo.rb with the following, I'll walk through each part:
-
-{% highlight ruby linenos %}
-module MCollective
-    module Agent
-        # Simple echo agent
-        class Echo
-            attr_reader :timeout, :meta
-
-            def initialize
-                @timeout = 5
-                @meta = {:license => "Apache License, Version 2",
-                         :author => "R.I.Pienaar <rip@devco.net>",
-                         :version => "1.0"}
-            end
-
-            def handlemsg(msg, stomp)
-                msg[:body]
-            end
-
-            def help
-            <<-EOH
-            Echo Agent
-            ==========
-
-            Simple agent that just sends the body of any request back
-            EOH
-            end
-        end
-    end
-end
-{% endhighlight %}
-
-Once you have it running you can test your agent works as below, we'll send the word _hello_ to the agent and we'll see if we get it back:
-
-{% highlight console %}
-% /usr/sbin/mc-call-agent --config etc/client.cfg --agent echo --arg hello
-Determining the amount of hosts matching filter for 2 seconds .... 1
-
-devel.your.com>
-"hello"
-
----- stomp call summary ----
-           Nodes: 1 / 1
-      Start Time: Tue Nov 03 23:18:40 +0000 2009
-  Discovery Time: 2001.65ms
-      Agent Time: 44.17ms
-      Total Time: 2045.82ms
-{% endhighlight %}
-
-
-### Agent name
-Each agent should be wrapped in a module and class as below, this will create an agent called _echo_ and should live in a file called _agents/echo.rb_.
-
-{% highlight ruby %}
-module MCollective
-    module Agent
-        class Echo
-        end
-    end
-end
-{% endhighlight %}
-
-### Initialization
-Every agent needs to specify a timeout and meta data.  The timeout gets used by the app server to kill off agents that is taking too long to finish.
-
-Meta data contains some information about the licence, author and version of the agent.  Right now the information is free-form but I suggest supplying at the very least the details below as we'll start enforcing the existence of it in future.
-
-{% highlight ruby %}
-            attr_reader :timeout, :meta
-
-            def initialize
-                @timeout = 1
-                @meta = {:license => "Apache License, Version 2",
-                         :author => "R.I.Pienaar <rip@devco.net>",
-                         :version => "1.0"}
-            end
-{% endhighlight %}
-
-### Handling incoming messages
-You do not need to be concerned with filtering, authentication, authorization etc when writing agents - the app server takes care of all of that for you.
-
-Whenever a message for your agent pass all the checks it will be passed to you via the _handlemsg_ method.
-
-{% highlight ruby %}
-            def handlemsg(msg, stomp)
-                msg[:body]
-            end
-{% endhighlight %}
-
-The msg will be a hash with several keys giving you information about sender, hashes, time it was sent and so forth, in our case we just want to know about the body and we're sending it right back as a return value.
-
-### Online Help
-We keep help information, not used right now but future version of the code will have a simple way to get help for each agent, the intent is that inputs, outputs and behavior to all agents would be described in this.
-
-{% highlight ruby %}
-            def help
-            <<-EOH
-            Echo Agent
-            ==========
-
-            Simple agent that just sends the body of any request back
-            EOH
-            end
-{% endhighlight %}
-
-## More complex agents
-As you write more complex agents and clients you might find the need to have a few separate files make up your agent, you can drop these files into a directory named _util_ under the plugins (that is, at the same level of the agent folder, so as _/usr/libexec/mcollective/mcollective/util_ at the time of writing).
-
-Create the _util_ folder if needed.
-
-The classes should be _MCollective::Util::Yourclass_ and you should use the following construct to require them from disk:
-
-{% highlight ruby %}
-MCollective::Util.loadclass("MCollective::Util::Yourclass")
-{% endhighlight %}
-
-Create _util/yourclass.rb_ with this content :
-
-{% highlight ruby %}
-module MCollective
- module Util
-   class Yourclass
-     # The class definition here
-   end
- end
-end
-{% endhighlight %}
-
-_loadclass_ on _Yourclass_ will automatically search for a _yourclass.rb_ file (lowercase).
-
-At present simply requiring them will work and we'll hope to maintain that but to be 100% future safe use this method.
-
-
-It also loads modules in exactly the same way.
-
-## The Client
-We provide a client library that abstracts away a lot of the work in writing simple attractive cli frontends to your agents that supports discovery, filtering, generates help etc.  The client lib is functional but we will improve/refactor the options parsing a bit in future.
-
-{% highlight ruby linenos %}
-#!/usr/bin/ruby
-
-require 'mcollective'
-
-oparser = MCollective::Optionparser.new({}, "filter")
-
-options = oparser.parse{|parser, options|
-    parser.define_head "Tester for the echo agent"
-    parser.banner = "Usage: mc-echo [options] msg"
-}
-
-if ARGV.length > 0
-    msg = ARGV.shift
-else
-    puts("Please specify a message to send")
-    exit 1
-end
-
-begin
-    options[:filter]["agent"] = "echo"
-
-    client = MCollective::Client.new(options[:config])
-
-    stats = client.discovered_req(msg, "echo", options) do |resp|
-        next if resp == nil
-
-        printf("%30s> %s\n", resp[:senderid], resp[:body])
-    end
-rescue Exception => e
-    puts("Failed to contact any agents: #{e}")
-    exit 1
-end
-
-client.display_stats(stats, options)
-{% endhighlight %}
-
-We can test it works as below:
-
-{% highlight console %}
-% ./mc-echo --config etc/client.cfg "hello world"
-Determining the amount of hosts matching filter for 2 seconds .... 1
-
-                devel.your.com> hello world
-
-Finished processing 1 / 1 hosts in 45.02 ms
-{% endhighlight %}
-
-Verbose statistics:
-
-{% highlight console %}
-% ./mc-echo --config etc/client.cfg "hello world" -v
-Determining the amount of hosts matching filter for 2 seconds .... 1
-
-                devel.your.com> hello world
-
----- stomp call summary ----
-           Nodes: 1 / 1
-      Start Time: Tue Nov 03 23:28:34 +0000 2009
-  Discovery Time: 2002.27ms
-      Agent Time: 45.84ms
-      Total Time: 2048.11ms
-{% endhighlight %}
-
-Discovery and filtering:
-
-{% highlight console %}
-% ./mc-echo --config etc/client.cfg "hello world" --with-fact country=au
-
-Failed to contact any agents: No matching clients found
-
-% ./mc-echo --config etc/client.cfg "hello world" --with-fact country=uk
-Determining the amount of hosts matching filter for 2 seconds .... 1
-
-                devel.your.com> hello world
-
-Finished processing 1 / 1 hosts in 38.77 ms
-{% endhighlight %}
-
-Standard Help:
-
-{% highlight console %}
-% ./mc-echo --help
-Usage: mc-echo [options] msg
-Tester for the echo agent
-
-Common Options
-    -c, --config FILE                Load configuratuion from file rather than default
-        --dt SECONDS                 Timeout for doing discovery
-        --discovery-timeout
-    -t, --timeout SECONDS            Timeout for calling remote agents
-    -q, --quiet                      Do not be verbose
-    -v, --verbose                    Be verbose
-    -h, --help                       Display this screen
-
-Host Filters
-        --wf, --with-fact fact=val   Match hosts with a certain fact
-        --wc, --with-class CLASS     Match hosts with a certain configuration management class
-        --wa, --with-agent AGENT     Match hosts with a certain agent
-        --wi, --with-identity IDENT  Match hosts with a certain configured identity
-{% endhighlight %}
diff --git a/website/reference/basic/basic_cli_usage.md b/website/reference/basic/basic_cli_usage.md
deleted file mode 100644 (file)
index c34e199..0000000
+++ /dev/null
@@ -1,500 +0,0 @@
----
-layout: default
-title: Using MCollective Command Line Applications
----
-MCollective is designed first and foremost for the CLI. You will mostly
-interact with a single executable called *mco* which has a number of
-sub-commands, arguments and flags.
-
-## Basic Usage of the *mco* Command
-
-A simple example of a *mco* command can be seen below:
-
-{% highlight console %}
-% mco ping
-dev8                                     time=126.19 ms
-dev6                                     time=132.79 ms
-dev10                                    time=133.57 ms
-.
-.
-
----- ping statistics ----
-25 replies max: 305.58 min: 57.50 avg: 113.16
-{% endhighlight %}
-
-In this example the *ping* sub-command is referred to as an
-*application*. Mcollective provides many applications, for a list of
-them, type *mco help*. You can also create your own application to plug
-into the framework. The *help* sub-command will show you something like
-this:
-
-
-{% highlight console %}
-% mco help
-The Marionette Collective version 2.0.0
-
-  controller      Control the mcollective daemon
-  facts           Reports on usage for a specific fact
-  find            Find hosts matching criteria
-  help            Application list and help
-  inventory       General reporting tool for nodes, collectives and subcollectives
-  ping            Ping all nodes
-  plugin          MCollective Plugin Application
-  rpc             Generic RPC agent client application
-{% endhighlight %}
-
-You can request help for a specific application using either *mco help
-application* or *mco application ---help*. Shown below is part of the
-help for the *rpc* application:
-
-{% highlight console %}
-% mco help rpc
-Generic RPC agent client application
-
-Usage: mco rpc [options] [filters] --agent <agent> --action <action> [--argument <key=val> --argument ...]
-Usage: mco rpc [options] [filters] <agent> <action> [<key=val> <key=val> ...]
-
-        --no-results, --nr           Do not process results, just send request
-    -a, --agent AGENT                Agent to call
-        --action ACTION              Action to call
-        --arg, --argument ARGUMENT   Arguments to pass to agent
-
-        --np, --no-progress          Do not show the progress bar
-    -1, --one                        Send request to only one discovered nodes
-        --batch SIZE                 Do requests in batches
-        --batch-sleep SECONDS        Sleep time between batches
-        --limit-nodes, --ln COUNT    Send request to only a subset of nodes, can be a percentage
-    -j, --json                       Produce JSON output
-    -c, --config FILE                Load configuratuion from file rather than default
-    -v, --verbose                    Be verbose
-    -h, --help                       Display this screen
-
-Common Options
-    -T, --target COLLECTIVE          Target messages to a specific sub collective
-        --dt, --discovery-timeout SECONDS
-                                     Timeout for doing discovery
-    -t, --timeout SECONDS            Timeout for calling remote agents
-    -q, --quiet                      Do not be verbose
-        --ttl TTL                    Set the message validity period
-        --reply-to TARGET            Set a custom target for replies
-
-Host Filters
-    -W, --with FILTER                Combined classes and facts filter
-    -S, --select FILTER              Compound filter combining facts and classes
-    -F, --wf, --with-fact fact=val   Match hosts with a certain fact
-    -C, --wc, --with-class CLASS     Match hosts with a certain config management class
-    -A, --wa, --with-agent AGENT     Match hosts with a certain agent
-    -I, --wi, --with-identity IDENT  Match hosts with a certain configured identity
-
-The Marionette Collective 2.0.0
-{% endhighlight %}
-
-The *help* first shows a basic overview of the command line syntax
-followed by options specific to this command.  Following that you will
-see some *Common Options* and *Host Filters* that generally apply to
-most applications.
-
-## Making RPC Requests
-
-### Overview of a Request
-
-The *rpc* application is the main application used to make requests to
-your servers. It is capable of interacting with any standard Remote
-Procedure Call (RPC) agent. Below is an example that shows an attempt to
-start a webserver on several machines:
-
-{% highlight console %}
-% mco rpc service start service=httpd
-Determining the amount of hosts matching filter for 2 seconds .... 10
-
- * [ ============================================================> ] 10 / 10
-
-dev4                                     Request Aborted
-   Could not start Service[httpd]: Execution of '/sbin/service httpd start' returned 1:
-
-
-Finished processing 10 / 10 hosts in 1323.61 ms
-{% endhighlight %}
-
-The order of events in this process are:
-
- * Perform discovery against the network and discover 10 servers
- * Send the request and then show a progress bar of the replies
- * Show any results that were out of the ordinary
- * Show some statistics
-
-Mcollective client applications aim to only provide the most relevant
-information.  In this case, the application is not showing verbose
-information about the nine *OK* results, since the most important issue
-is the one *Failure*. Keep this in mind when viewing the results of
-commands.
-
-### Anatomy of a Request
-
-MCollective agents are broken up into actions and each action can take
-input arguments.
-
-{% highlight console %}
-% mco rpc service stop service=httpd
-{% endhighlight %}
-
-This shows the basic make-up of an RPC command. In this case we are:
-
- * using the *rpc* application - a generic application that can interact with any agent
- * directing our request to machines with the *service* agent
- * sending a request to the *stop* action of the service agent
- * supplying a value, *httpd*, to the *service* argument of the *stop* action
-
-The same command has a longer form as well:
-
-{% highlight console %}
-% mco rpc --agent service --action stop --argument service=httpd
-{% endhighlight %}
-
-These two commands are functionally identical.
-
-### Discovering Available *Agents*
-
-The above command showed you how to interact with the *service* agent,
-but how can you find out that this agent even exists? On a correctly
-installed MCollective system you can use the *plugin* application to get
-a list:
-
-{% highlight console %}
-% mco plugin doc
-Please specify a plugin. Available plugins are:
-
-Agents:
-  package         Install and uninstall software packages
-  puppetd         Run puppet agent, get its status, and enable/disable it
-  rpcutil         General helpful actions that expose stats and internals to SimpleRPC clients
-  service         Agent to manage services
-{% endhighlight %}
-
-The first part of this list shows all the agents this computer is aware
-of. In order to show up on this list, an agent must have a *DDL* file
-and be installed locally.
-
-To find out the *actions*, *inputs* and *outputs* for a specific agent
-use the plugin application again:
-
-{% highlight console %}
-% mco plugin doc service
-SimpleRPC Service Agent
-=======================
-
-Agent to manage services
-
-      Author: R.I.Pienaar
-     Version: 1.2
-     License: GPLv2
-     Timeout: 60
-   Home Page: http://mcollective-plugins.googlecode.com/
-
-
-
-ACTIONS:
-========
-   restart, start, status, stop
-
-   status action:
-   --------------
-       Gets the status of a service
-
-       INPUT:
-           service:
-              Description: The service to get the status for
-                   Prompt: Service Name
-                     Type: string
-               Validation: ^[a-zA-Z\-_\d]+$
-                   Length: 30
-
-
-       OUTPUT:
-           status:
-              Description: The status of service
-               Display As: Service Status
-{% endhighlight %}
-
-This shows a truncated example of the auto-generated help for the
-*service* agent. First shown is metadata such as version, author and
-license. This is followed by the list of actions available, in this case
-the *restart*, *start*, *status* and *stop* actions.
-
-Further information is shown about each action. For example, you can see
-that the *status* action requires an input called *service* which is a
-string, has a maximum length of 30, etc. You can also see you will
-receive one output called *status*
-
-With this information, you can request the status for a specific
-service:
-
-{% highlight console %}
-% mco rpc service status service=httpd
-Determining the amount of hosts matching filter for 2 seconds .... 10
-
- * [ ============================================================> ] 10 / 10
-
-
-dev1
-   Service Status: stopped
-
-dev4
-   Service Status: stopped
-
-.
-.
-.
-
-Finished processing 10 / 10 hosts in 326.01 ms
-{% endhighlight %}
-
-Unlike the previous example, in this case specific information is
-returned on the success of the action. This is because this specific
-action is meant to retrieve information and so mcollective assumes you
-would like to see complete, thorough data regardless of success or
-failure.
-
-Note that this output displays *Service Status* as shown in the *mco
-plugin doc service* help page. Any time you need more information about
-a display name, the doc for the associated agent will have a
-*Description* section for every input and output.
-
-## Selecting Request Targets Using *Filters*
-
-### Basic Filters
-
-A key capability of mcollective is fast discovery of network resources.
-Discovery rules are written using *filters*.  For example:
-
-{% highlight console %}
-% mco rpc service status service=httpd -S "environment=development or customer=acme"
-{% endhighlight %}
-
-This shows a filter rule that limits the RPC request to being run on
-machines that are either in the Puppet environment *development* or
-belong to the Customer *acme*.
-
-Filtering can be based on *facts*, the presence of a *Configuration
-Management Class* on the node, the node's *Identity*, or installed
-*Agents* on the node.
-
-Here are a number of examples of this with short descriptions of each
-filter:
-
-{% highlight console %}
-# all machines with the service agent
-% mco ping -A service
-% mco ping --with-agent service
-
-# all machines with the apache class on them
-% mco ping -C apache
-% mco ping --with-class apache
-
-# all machines with a class that match the regular expression
-% mco ping -C /service/
-
-# all machines in the UK
-% mco ping -F country=uk
-% mco ping --with-fact country=uk
-
-# all machines in either UK or USA
-% mco ping -F "country=/uk|us/"
-
-# just the machines called dev1 or dev2
-% mco ping -I dev1 -I dev2
-
-# all machines in the domain foo.com
-% mco ping -I /foo.com$/
-{% endhighlight %}
-
-As you can see, you can filter by Agent, Class and/or Fact, and you can
-use regular expressions almost anywhere.  You can also combine filters
-additively in a command so that all the criteria have to be matched.
-
-Note: You can use a shortcut to combine Class and Fact filters:
-
-{% highlight console %}
-# all machines with classes matching /apache/ in the UK
-% mco ping -W "/apache/ location=uk"
-{% endhighlight %}
-
-### Complex *Compound* or *Select* Queries
-
-While the above examples are easy to enter, they are limited in that
-they can only combine filters additively. If you want to create searches
-with more complex boolean logic use the *-S* switch. For example:
-
-{% highlight console %}
-% mco ping -S "((customer=acme and environment=staging) or environment=development) and /apache/"
-{% endhighlight %}
-
-The above example shows a scenario where the development environment is
-usually labeled *development* but one customer has chosen to use
-*staging*. You want to find all machines in those customer's
-environments that match the class *apache*. This search would be
-impossible using the previously shown methods, but the above command
-uses *-S* to allow the use of boolean operators such as *and* and *or*
-so you can easily build the logic of the search.
-
-The *-S* switch also allows for negative matches using *not* or *!*:
-
-{% highlight console %}
-% mco ping -S "environment=development and !customer=acme"
-% mco ping -S "environment=development and not customer=acme"
-{% endhighlight %}
-
-### Filtering Using Data Plugins
-
-As of version 2.1.0, custom data plugins can also be used to create
-complex filters:
-
-{% highlight console %}
-% mco ping -S "fstat('/etc/hosts').md5=/baa3772104/ and environment=development"
-{% endhighlight %}
-
-This will search for the md5 hash of a specific file with matches
-restricted to the *development* environment.  Note that as before,
-regular expressions can also be used.
-
-As with agents, you can also discover which plugins are available for
-use:
-
-{% highlight console %}
-% mco plugin doc
-
-Please specify a plugin. Available plugins are:
-
-Agents:
-  .
-  .
-
-Data Queries:
-  agent           Meta data about installed MColletive Agents
-  augeas_match    Allows agents and discovery to do Augeas match lookups
-  fstat           Retrieve file stat data for a given file
-  resource        Information about Puppet managed resources
-  sysctl          Retrieve values for a given sysctl
-{% endhighlight %}
-
-For information on the input these plugins take and  output they provide
-use the *mco plugin doc fstat* command.
-
-Currently, each data function can only accept one input while matches
-are restricted to a single output field per invocation.
-
-## Chaining RPC Requests
-
-The *rpc* application can chain commands one after the other. The
-example below uses the *package* agent to find machines with a specific
-version of mcollective and then schedules Puppet runs on those machines:
-
-{% highlight console %}
-% mco rpc package status package=mcollective -j|jgrep "data.properties.ensure=2.0.0-6.el6" |mco rpc puppetd runonce
-{% endhighlight %}
-
-Mcollective results can also be filtered using the opensource gem,
-jgrep. Mcollective data output is fully compatible with jgrep.
-
-## Seeing the Raw Data
-
-By default the *rpc* application will try to show human-readable data.
-To see the actual raw data, add the *-v* flag to disable the display
-helpers:
-
-{% highlight console %}
-% mco rpc nrpe runcommand command=check_load -I dev1 -v
-.
-.
-dev1                                    : OK
-    {:exitcode=>0,     :output=>"OK - load average: 0.00, 0.00, 0.00",     :perfdata=>      "load1=0.000;1.500;2.000;0; load5=0.000;1.500;2.000;0; load15=0.000;1.500;2.000;0;"}
-{% endhighlight %}
-
-
-This data can also be returned in JSON format:
-
-{% highlight console %}
-% mco rpc nrpe runcommand command=check_load -I dev1 -j
-[
-  {
-    "action": "runcommand",
-    "agent": "nrpe",
-    "data": {
-      "exitcode": 0,
-      "output": "OK - load average: 0.00, 0.00, 0.00",
-      "perfdata": "load1=0.000;1.500;2.000;0; load5=0.000;1.500;2.000;0; load15=0.000;1.500;2.000;0;"
-    },
-    "statuscode": 0,
-    "statusmsg": "OK",
-    "sender": "dev1"
-  }
-]
-{% endhighlight %}
-
-## Error Messaging
-
-When an application encounters an error, it returns an explanatory
-string:
-
-{% highlight console %}
-% mco rpc rpcutil foo
-rpc failed to run: Attempted to call action foo for rpcutil but it's not declared in the DDL (MCollective::DDLValidationError)
-{% endhighlight %}
-
-By default only an abbreviated error string is shown that  provides some
-insight into the nature of the problem.  For more details, add the *-v*
-flag to show a full stack trace:
-
-{% highlight console %}
-% mco rpc rpcutil foo -v
-rpc failed to run: Attempted to call action foo for rpcutil but it's not declared in the DDL (MCollective::DDLValidationError)
-        from /usr/lib/ruby/site_ruby/1.8/mcollective/ddl.rb:303:in `validate_rpc_request'
-        from /usr/lib/ruby/site_ruby/1.8/mcollective/rpc/client.rb:218:in `method_missing'
-        from /home/rip/.mcollective.d/lib/mcollective/application/rpc.rb:133:in `send'
-        from /home/rip/.mcollective.d/lib/mcollective/application/rpc.rb:133:in `main'
-        from /usr/lib/ruby/site_ruby/1.8/mcollective/application.rb:283:in `run'
-        from /usr/lib/ruby/site_ruby/1.8/mcollective/applications.rb:23:in `run'
-        from /usr/bin/mco:20
-{% endhighlight %}
-
-## Custom Applications
-The *rpc* application should suit most needs. However, sometimes the
-data being returned calls for customization such as custom aggregation,
-summarising or complete custom display.
-
-In such cases, a custom application may be useful For example, the
-*package* application provides concluding summaries and provides some
-basic safe guards for its use. The agent also provides the commonly
-required data. Typical *package* output looks like this:
-
-{% highlight console %}
-% mco package status kernel
-Do you really want to operate on packages unfiltered? (y/n): y
-
- * [ ============================================================> ] 25 / 25
-
-
- dev5                                     version = kernel-2.6.32-220.7.1.el6
- dev9                                     version = kernel-2.6.32-220.2.1.el6
- .
- .
-
----- package agent summary ----
-           Nodes: 25 / 25
-        Versions: 9 * 2.6.32-220.2.1.el6, 9 * 2.6.32-220.4.1.el6, 7 * 2.6.32-220.el6
-    Elapsed Time: 3.95 s
-{% endhighlight %}
-
-
-Notice how this application recognises that you are acting on all
-possible machines, an action which might have a big impact on your YUM
-servers. Consequently, *package* prompts for confirmation and, at the
-end of processing, displays a brief summary of the network status.
-
-While the behaviors of custom applications are not always consistant
-with each other, in general they accept the standard discovery flags.
-For details of which flags are accepted in a given application, use the
-*mco help appname* command.
-
-To discover which custom applications are available,  run *mco* or *mco
-help*.
diff --git a/website/reference/basic/configuration.md b/website/reference/basic/configuration.md
deleted file mode 100644 (file)
index 54a9a9b..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
----
-layout: default
-title: Configuration Guide
----
-
-[SSLSecurity]: /mcollective/reference/plugins/security_ssl.html
-[AESSecurity]: /mcollective/reference/plugins/security_aes.html
-[Registration]: /mcollective/reference/plugins/registration.html
-[Auditing]: /mcollective/simplerpc/auditing.html
-[Authorization]: /mcollective/simplerpc/authorization.html
-[Subcollectives]: /mcollective/reference/basic/subcollectives.html
-[server_config]: /mcollective/configure/server.html
-
-> **Note:** There is a new [Server Configuration Reference][server_config] page with a more complete overview of MCollective's server daemon settings. A similar client configuration page is forthcoming.
-
-This guide tells you about the major configuration options in the daemon and client config files.  There are options not mentioned
-here typically ones specific to a certain plugin.
-
-## Configuration Files
-There are 2 configuration files, one for the client and one for the server, these default to */etc/mcollective/server.cfg* and */etc/mcollective/client.cfg*.
-
-Configuration is a simple *key = val* style configuration file.
-
-## Common Options
-
-|Key|Sample|Description|
-|---|------|-----------|
-|collectives|mcollective,subcollective|A list of [Subcollectives] to join - 1.1.3 and newer only|
-|main_collective|mcollective|The main collective to target - 1.1.3 and newer only|
-|logfile|/var/log/mcollective.log|Where to log|
-|loglevel|debug|Can be info, warn, debug, fatal, error|
-|identity|dev1.your.com|Identifier for this node, does not need to be unique, defaults to hostname if unset and must match _/\w\.\-/_ if set|
-|keeplogs|5|The amount of logs to keep|
-|max_log_size|2097152|Max size in bytes for log files before rotation happens|
-|libdir|/usr/libexec/mcollective:/site/mcollective|Where to look for plugins|
-|connector|activemq|Which _connector_ plugin to use for communication|
-|securityprovider|Psk|Which security model to use, see [SSL Security Plugin][SSLSecurity] and [AES Security Plugin][AESSecurity] for details on others|
-|rpchelptemplate|/etc/mcollective/rpc-help.erb|The path to the erb template used for generating help|
-|helptemplatedir|/etc/mcollective|The path that contains all the erb templates for generating help|
-|logger_type|file|Valid logger types, currently file, syslog or console|
-|ssl_cipher|aes-256-cbc|This sets the cipher in use by the SSL code, see _man enc_ for a list supported by OpenSSL|
-|direct_addressing|n|Enable or disable directed requests|
-|direct_addressing_threshold|10|When direct requests are enabled, send direct messages for less than or equal to this many hosts|
-|ttl|60|Sets the default TTL for requests - 1.3.2 and newer only|
-|logfacility|When using the syslog logger sets the facility, defaults to user|
-|default_discovery_method|The default method to use for discovery - _mc_ by default|
-|default_discovery_options|Options to pass to the discovery plugin, empty by default|
-
-## Server Configuration
-The server configuration file should be root only readable
-
-|Key|Sample|Description|
-|---|------|-----------|
-|daemonize|1|Runs the server in the background|
-|factsource|Facter|Which fact plugin to use|
-|registration|Agentlist|[Registration] plugin to use|
-|registerinterval|120|How many seconds to sleep between registration messages, setting this to zero disables registration|
-|registration_collective|development|Which sub-collective to send registration messages to|
-|classesfile|/var/lib/puppet/classes.txt|Where to find a list of classes configured by your configuration management system|
-|rpcaudit|1|Enables [SimpleRPC Auditing][Auditing]|
-|rpcauditprovider|Logfile|Enables auditing using _MCollective::Audit::Logfile_|
-|rpcauthorization|1|Enables [SimpleRPC Authorization][Authorization] globally|
-|rpcauthprovider|action_policy|Use the _MCollective::Util::ActionPolicy_ plugin to manage authorization|
-|rpclimitmethod|The method used for --limit-results.  Can be either _first_ or _random_|
-|fact_cache_time|300|How long to cache fact results for before refreshing from source|
-
-The last example sets a option for the _discovery_ plugin, you can also set this in _/etc/mcollective/plugin.d/discovery.cfg_, in that case
-you'd just set _timeout=10_ in the file.
-
-## Client Configuration
-The client configuration file should be readable by everyone, it's not advised to put PSK's or client SSL certs in a world readable file, see below how to do that per user.
-
-|Key|Sample|Description|
-|---|------|-----------|
-|color|0|Disables the use of color in RPC results|
-
-## Plugin Configuration
-You can add free form config options for plugins, they take the general form like:
-
-{% highlight ini %}
-    plugin.pluginname.option = value
-{% endhighlight %}
-
-Each plugin's documentation should tell you what options are availble.
-
-Common plugin options are:
-
-|Key|Sample|Description|
-|---|------|-----------|
-|plugin.yaml|/etc/mcollective/facts.yaml:/other/facts.yaml|Where the yaml fact source finds facts from, multiples get merged|
-|plugin.psk|123456789|The pre-shared key to use for the Psk security provider|
-|plugin.psk.callertype|group|What to base the callerid on for the PSK plugin, uid, gid, user, group or identity|
-
-## Client Setup
-It's recommended that you do not set host, user, password and Psk in the client configuration file since these files are generally world readable unlike the server one that should be root readable only.  I just set mine to *unset* so it's clear to someone who looks at the config file that it's not going to work without the settings below.
-
-You can also put client configuration in _~/.mcollective_ as an alternative to the method below, but you will need a full client.cfg then in that location.
-
-You can set various Environment variables per user to supply these values:
-
-{% highlight bash %}
-export STOMP_USER=user
-export STOMP_PASSWORD=password
-export MCOLLECTIVE_PSK=123456789
-{% endhighlight %}
-
-You an set options that will always apply using the _MCOLLECTIVE_EXTRA_OPTS_ as below:
-
-{% highlight bash %}
-export MCOLLECTIVE_EXTRA_OPTS="--dt 5 --timeout 3 --config /home/you/mcollective.cfg"
-{% endhighlight %}
-
-The client library will use these and so you can give each user who use the admin utilities their own username and rights.
diff --git a/website/reference/basic/daemon.md b/website/reference/basic/daemon.md
deleted file mode 100644 (file)
index 431244a..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
----
-layout: default
-title: Controlling the Daemon
----
-
-The main daemon that runs on nodes keeps internal stats and supports reloading of agents and changing
-logging level without restarting.
-
-If you want to reload all the agents without restarting the daemon you can just send it signal *USR1*
-and it will reload its agents.
-
-You can send *USR2* to cycle the log level through DEBUG to FATAL and back again, just keep sending
-the signal and look at the logs.
-
-Reloading agents work in most cases though we recommend a full daemon restart in production use
-due to the nature of the ruby class loading system.  If you are changing agent contents and relying
-on the reload behavior you might end up with agents not being in a consistent state.
-
-## Obtaining daemon statistics
-
-The daemon keeps a number of statistics about its operation, you can view these using the _inventory_
-application:
-
-{% highlight console %}
-% mco inventory example.com
-   Server Statistics:
-                      Version: 2.2.0
-                   Start Time: Mon Sep 24 17:37:28 +0100 2012
-                  Config File: /etc/mcollective/server.cfg
-                  Collectives: mcollective, fr_collective
-              Main Collective: mcollective
-                   Process ID: 24473
-               Total Messages: 52339
-      Messages Passed Filters: 44118
-            Messages Filtered: 8221
-             Expired Messages: 0
-                 Replies Sent: 29850
-         Total Processor Time: 527.06 seconds
-                  System Time: 349.32 seconds
-
-.
-.
-.
-{% endhighlight %}
-
-The statistics mean:
-
-|Statistic   |Meaning                                    |
-|------------|-------------------------------------------|
-|Start Time             |Local time on the node when the daemon started|
-|Collectives            |All known collectives this agent responds on|
-|Main Collective        |The primary collective|
-|Process ID             |The process ID of the mcollectived|
-|Total Messages         |Total messages received from the middleware|
-|Messages Passed Filters|Amount of messages that was determined to be applicable to this node based on filters|
-|Messages Filtered      |Messages that did not apply to this node|
-|Expired Messages       |Received messages that had expired their TTL values|
-|Replies Sent           |Not all received messages result in replies, this counts the actual replies sent|
-|Total Processor Time   |Processor time including user and system time consumed since start|
-|System Time            |System Processor time only|
-
-You can get the raw values using the *rpcutil* agent using the *daemon_stats* action.
-
-{% highlight console %}
-% mco rpc rpcutil daemon_stats
-Discovering hosts using the mongo method .... 26
-
- * [ ============================================================> ] 26 / 26
-
-.
-.
-.
-
-example.com
-               Agents: ["stomputil",
-                        "nrpe",
-                        "package",
-                        "rpcutil",
-                        "rndc",
-                        "urltest",
-                        "iptables",
-                        "puppetd",
-                        "discovery",
-                        "service",
-                        "eximng",
-                        "filemgr",
-                        "process"]
-          Config File: /etc/mcollective/server.cfg
-        Failed Filter: 168432
-        Passed Filter: 91231
-                  PID: 1418
-              Replies: 91127
-           Start Time: 1347545937
-              Threads: ["#<Thread:0x7f44350964f8 sleep>",
-                        "#<Thread:0x7f4434f7f538 sleep>",
-                        "#<Thread:0x7f44390ce368 sleep>",
-                        "#<Thread:0x7f44350981b8 run>"]
-                Times: {:cutime=>1111.13, :utime=>3539.21, :cstime=>1243.64, :stime=>5045.21}
-       Total Messages: 259842
-          TTL Expired: 179
-      Failed Security: 0
-   Security Validated: 259842
-              Version: 2.2.0
-
-
-Summary of Agents:
-
-          package = 26
-          process = 26
-        discovery = 26
-          service = 26
-          puppetd = 26
-          filemgr = 26
-             nrpe = 26
-          rpcutil = 26
-        stomputil = 26
-         iptables = 11
-          urltest = 7
-          libvirt = 4
-           eximng = 4
-     registration = 3
-             rndc = 3
-    angelianotify = 2
-
-Summary of Version:
-
-    2.2.0 = 26
-
-Finished processing 26 / 26 hosts in 289.20 ms
-{% endhighlight %}
-
-## Obtaining running configuration settings
-
-All configuration settings of any mcollective daemon can be retrieved using the *get_config_item*
-action of the *rpcutil* agent:
-
-{% highlight console %}
-% mco rpc rpcutil get_config_item item=collectives -I example.com
-Discovering hosts using the mongo method .... 1
-
- * [ ============================================================> ] 1 / 1
-
-
-example.com:
-   Property: collectives
-      Value: ["mcollective", "fr_collective"]
-
-
-Summary of Value:
-
-      mcollective = 1
-    fr_collective = 1
-
-
-Finished processing 1 / 1 hosts in 59.05 ms
-{% endhighlight %}
diff --git a/website/reference/basic/gettingstarted.md b/website/reference/basic/gettingstarted.md
deleted file mode 100644 (file)
index bd1755d..0000000
+++ /dev/null
@@ -1,285 +0,0 @@
----
-layout: default
-title: Getting Started
----
-[Screencasts]: /mcollective/screencasts.html
-[ActiveMQ]: http://activemq.apache.org/
-[RabbitMQ]: http://www.rabbitmq.com/
-[EC2Demo]: /mcollective/ec2demo.html
-[Stomp]: http://stomp.codehaus.org/Ruby+Client
-[DepRPMs]: http://www.marionette-collective.org/activemq/
-[DebianBug]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=562954
-[SecurityWithActiveMQ]: /mcollective/reference/integration/activemq_security.html
-[ActiveMQClustering]: http://www.devco.net/archives/2009/11/10/activemq_clustering.php
-[ActiveMQSamples]: http://github.com/puppetlabs/marionette-collective/tree/master/ext/activemq/examples/
-[ConfigurationReference]: /mcollective/reference/basic/configuration.html
-[Terminology]: /mcollective/terminology.html
-[SimpleRPCIntroduction]: /mcollective/simplerpc/
-[ControllingTheDaemon]: /mcollective/reference/basic/daemon.html
-[SSLSecurityPlugin]: /mcollective/reference/plugins/security_ssl.html
-[AESSecurityPlugin]: /mcollective/reference/plugins/security_aes.html
-[ConnectorActiveMQ]: /mcollective/reference/plugins/connector_activemq.html
-[ConnectorRabbitMQ]: /mcollective/reference/plugins/connector_rabbitmq.html
-[MessageFlowCast]: /mcollective/screencasts.html#message_flow
-[Plugins]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki
-[RedHatGuide]: gettingstarted_redhat.html
-[DebianGuide]: gettingstarted_debian.html
-[server_config]: /mcollective/configure/server.html
-
-*NOTE:* This is an older, deprecated version of the Getting Started documentation.  Red Hat and CentOS users can refer to [our Redhat guide][RedHatGuide]. Debian users can refer to [our Debian guide][DebianGuide]. Users on less common platforms should adapt one of those two instead of continuing to read this page.
-
-Below find a rough guide to get you going, this assumes the client and server is on the same node, but servers don't need the client code installed.
-
-Look at the [Screencasts] page, there are [some screencasts dealing with basic architecture, terminology and so forth][MessageFlowCast] that you might find helpful before getting started.
-
-## Requirements
-We try to keep the requirements on external Gems to a minimum, you only need:
-
- * A Stomp server, tested against [ActiveMQ] and [RabbitMQ]
- * Ruby
- * Rubygems
- * [Ruby Stomp Client][Stomp]
-
-RPMs for these are available [here][DepRPMs].
-
-## ActiveMQ
-ActiveMQ is currently the most used middleware for MCollective, it would be our recommended choice and one
-that the community has most experience supporting.  There is a specific connector for RabbitMQ if you wish
-to go that route though - see [ConnectorRabbitMQ] for details.  This guide will focus on ActiveMQ.
-
-Full details on setting up and configuring ActiveMQ is out of scope for this, but you can follow these simple
-setup instructions for initial testing (make sure JDK is installed, see below for Debian specific issue regarding JDK):
-
-### Download and Install
- 1. Download the ActiveMQ "binary" package (for Unix) from [ActiveMQ]
- 1. Extract the contents of the archive:
- 1. cd into the activemq directory
- 1. Execute the activemq binary
-
-{% highlight console %}
-   % tar xvzf activemq-x.x.x.tar.gz
-   % cd activemq-x.x.x
-   % bin/activemq
-{% endhighlight %}
-
-Below should help you get stomp and a user going. For their excellent full docs please see [ActiveMQ].
-There are also tested configurations in [the ext directory][ActiveMQSamples]
-
-A spec file can be found in the *ext* directory on GitHub that can be used to build RPMs for RedHat/CentOS/Fedora
-you need *tanukiwrapper* which you can find from *jpackage*, it runs fine under OpenJDK that comes with recent
-versions of these Operating Systems.  I've uploaded some RPMs and SRPMs [here][DepRPMs].
-
-For Debian systems you'd be better off using OpenJDK than Sun JDK, there's a known issue [#562954][DebianBug].
-
-### Configuring Stomp
-First you should configure ActiveMQ to listen on the Stomp protocol
-
-And then you should add a user or two, to keep it simple we'll just add one user, the template file will hopefully make it obvious where this goes, it should be in the _broker_ block:
-
-*Note: This config is for ActiveMQ 5.4*
-
-{% highlight xml %}
-<beans
-  xmlns="http://www.springframework.org/schema/beans"
-  xmlns:amq="http://activemq.apache.org/schema/core"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
-  http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
-  http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
-
-    <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" useJmx="true">
-        <managementContext>
-            <managementContext createConnector="false"/>
-        </managementContext>
-
-        <plugins>
-          <statisticsBrokerPlugin/>
-          <simpleAuthenticationPlugin>
-            <users>
-              <authenticationUser username="mcollective" password="marionette" groups="mcollective,everyone"/>
-              <authenticationUser username="admin" password="secret" groups="mcollective,admin,everyone"/>
-            </users>
-          </simpleAuthenticationPlugin>
-          <authorizationPlugin>
-            <map>
-              <authorizationMap>
-                <authorizationEntries>
-                  <authorizationEntry queue=">" write="admins" read="admins" admin="admins" />
-                  <authorizationEntry topic=">" write="admins" read="admins" admin="admins" />
-                  <authorizationEntry topic="mcollective.>" write="mcollective" read="mcollective" admin="mcollective" />
-                  <authorizationEntry queue="mcollective.>" write="mcollective" read="mcollective" admin="mcollective" />
-                  <authorizationEntry topic="ActiveMQ.Advisory.>" read="everyone" write="everyone" admin="everyone"/>
-                </authorizationEntries>
-              </authorizationMap>
-            </map>
-          </authorizationPlugin>
-        </plugins>
-
-        <systemUsage>
-            <systemUsage>
-                <memoryUsage>
-                    <memoryUsage limit="20 mb"/>
-                </memoryUsage>
-                <storeUsage>
-                    <storeUsage limit="1 gb" name="foo"/>
-                </storeUsage>
-                <tempUsage>
-                    <tempUsage limit="100 mb"/>
-                </tempUsage>
-            </systemUsage>
-        </systemUsage>
-
-        <transportConnectors>
-            <transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
-            <transportConnector name="stomp" uri="stomp://0.0.0.0:61613"/>
-        </transportConnectors>
-    </broker>
-</beans>
-{% endhighlight %}
-
-This creates a user *mcollective* with the password *marionette* and give it access to read/write/admin */topic/mcollective.`*`*.
-
-Save the above code as activemq.xml and run activemq as - if installing from a package probably _/etc/activemq/activemq.xml_:
-
-Else your package would have a RC script:
-
-{% highlight console %}
-# /etc/init.d/activemq start
-{% endhighlight %}
-
-For further info about ActiveMQ settings you might need see [SecurityWithActiveMQ] and [ActiveMQClustering].
-
-There are also a few known to work and tested [configs in git][ActiveMQSamples].
-
-## mcollective
-
-### Download and Extract
-Grab a copy of the mcollective ideally you'd use a package for your distribution else there's a tarfile that
-you can use, you can extract it wherever you want, the RPMs or deps will put files in Operating System compatible
-locations.  If you use the tarball you'll need to double check all the paths in the config files below.
-
-### Configure
-You'll need to tweak some configs in */etc/mcollective/client.cfg*, a full reference of config settings can be
-found [here][ConfigurationReference]:
-
-Mostly what you'll need to change is the *identity*, *plugin.activemq.1.`*`* and the *plugin.psk*:
-
-{% highlight ini %}
-  # main config
-  libdir = /usr/libexec/mcollective
-  logfile = /dev/null
-  loglevel = debug
-  identity = fqdn
-
-  # connector plugin config
-  connector = activemq
-  plugin.activemq.pool.size = 1
-  plugin.activemq.pool.1.host = stomp.your.net
-  plugin.activemq.pool.1.port = 61613
-  plugin.activemq.pool.1.user = unset
-  plugin.activemq.pool.1.password = unset
-
-  # security plugin config
-  securityprovider = psk
-  plugin.psk = abcdefghj
-{% endhighlight %}
-
-You should also create _/etc/mcollective/server.cfg_ here's a sample, a full reference of config settings can be found on the [Server Configuration Reference][server_config]:
-
-{% highlight ini %}
-  # main config
-  libdir = /usr/libexec/mcollective
-  logfile = /var/log/mcollective.log
-  daemonize = 1
-  keeplogs = 1
-  max_log_size = 10240
-  loglevel = debug
-  identity = fqdn
-  registerinterval = 300
-
-  # connector plugin config
-  connector = activemq
-  plugin.activemq.pool.size = 1
-  plugin.activemq.pool.1.host = stomp.your.net
-  plugin.activemq.pool.1.port = 61613
-  plugin.activemq.pool.1.user = mcollective
-  plugin.activemq.pool.1.password = password
-
-  # facts
-  factsource = yaml
-  plugin.yaml = /etc/mcollective/facts.yaml
-
-  # security plugin config
-  securityprovider = psk
-  plugin.psk = abcdefghj
-{% endhighlight %}
-
-Replace the *plugin.activemq.pool.1.host* with your server running ActiveMQ and replace the *plugin.psk* with a Pre-Shared Key of your own.
-
-The ActiveMQ connector supports other options like failover pools, see [ConnectorActiveMQ] for full details.
-
-### Create Facts
-By default - and for this setup - we'll use a simple YAML file for a fact source, later on you can use Puppet Labs Facter or something else.
-
-Create */etc/mcollective/facts.yaml* along these lines:
-
-{% highlight yaml %}
-  ---
-  location: devel
-  country: uk
-{% endhighlight %}
-
-### Start the Server
-If you installed from a package start it with the RC script, else look in the source you'll find a LSB compatible RC script to start it.
-
-### Test from a client
-If all is setup you can test with the client code:
-
-{% highlight console %}
-% mco ping
-your.domain.com                           time=74.41 ms
-
----- ping statistics ----
-1 replies max: 74.41 min: 74.41 avg: 74.41
-{% endhighlight %}
-
-This sent a simple 'hello' packet out to the network and if you started up several of the *mcollectived.rb* processes on several machines you
-would have seen several replies, be sure to give each a unique *identity* in the config.
-
-At this point you can start exploring the discovery features for example:
-
-{% highlight console %}
-% mco find --with-fact country=uk
-your.domain.com
-{% endhighlight %}
-
-This searches all systems currently active for ones with a fact *country=uk*, it got the data from the yaml file you made earlier.
-
-If you use configuration management tools like puppet and the nodes are setup with classes with *classes.txt* in */var/lib/puppet* then you
-can search for nodes with a specific class on them - the locations will configurable soon:
-
-{% highlight console %}
-% mco find --with-class common::linux
-your.domain.com
-{% endhighlight %}
-
-Chef does not yet support such a list natively but we have some details on the wiki to achieve the same with Chef.
-
-The filter commands are important they will be the main tool you use to target only parts of your infrastructure with calls to agents.
-
-See the *--help* option to the various *mco `*`* commands for available options.  You can now look at some of the available plugins and
-play around, you might need to run the server process as root if you want to play with services etc.
-
-### Plugins
-We provide limited default plugins, you can look on our sister project [MCollective Plugins][Plugins] where you will
-find various plugins to manage packages, services etc.
-
-### Further Reading
-From here you should look at the rest of the wiki pages some key pages are:
-
- * [Screencasts] - Get a hands-on look at what is possible
- * [Terminology]
- * [Introduction to Simple RPC][SimpleRPCIntroduction] - a simple to use framework for writing clients and agents
- * [ControllingTheDaemon] - Controlling a running daemon
- * [AESSecurityPlugin] - Using AES+RSA for secure message encryption and authentication of clients
- * [SSLSecurityPlugin] - Using SSL for secure message signing and authentication of clients
diff --git a/website/reference/basic/gettingstarted_debian.md b/website/reference/basic/gettingstarted_debian.md
deleted file mode 100644 (file)
index 3539663..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
----
-layout: default
-title: Getting Started
----
-[Screencasts]: /mcollective/screencasts.html
-[ActiveMQ]: http://activemq.apache.org/
-[ActiveMQ Getting Started]: http://activemq.apache.org/getting-started.html
-[EC2Demo]: /mcollective/ec2demo.html
-[Stomp]: http://stomp.codehaus.org/Ruby+Client
-[DepRPMs]: http://www.marionette-collective.org/activemq/
-[DebianBug]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=562954
-[SecurityWithActiveMQ]: /mcollective/reference/integration/activemq_security.html
-[ActiveMQClustering]: /mcollective/reference/integration/activemq_clusters.html
-[ActiveMQSamples]: http://github.com/puppetlabs/marionette-collective/tree/master/ext/activemq/examples/
-[ActiveMQSingleBrokerSample]: http://github.com/puppetlabs/marionette-collective/raw/master/ext/activemq/examples/single-broker/activemq.xml
-[ConfigurationReference]: /mcollective/reference/basic/configuration.html
-[Terminology]: /mcollective/terminology.html
-[SimpleRPCIntroduction]: /mcollective/simplerpc/
-[ControllingTheDaemon]: /mcollective/reference/basic/daemon.html
-[SSLSecurityPlugin]: /mcollective/reference/plugins/security_ssl.html
-[AESSecurityPlugin]: /mcollective/reference/plugins/security_aes.html
-[ConnectorActiveMQ]: /mcollective/reference/plugins/connector_activemq.html
-[ConnectorRabbitMQ]: /mcollective/reference/plugins/connector_rabbitmq.html
-[MessageFlowCast]: /mcollective/screencasts.html#message_flow
-[Plugins]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki
-[MCDownloads]: http://www.puppetlabs.com/downloads/mcollective/
-[RubyGems]: http://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords=rubygems
-[server_config]: /mcollective/configure/server.html
-
-Getting started using Debian based distribution like Debian squeeze and Ubuntu is easy as DEBs are available for most the required components.  This guide walks you through the process.
-
-## Requirements
-We try to keep the requirements on external Gems to a minimum, you only need:
-
- * A Stomp server, tested against [ActiveMQ]
- * Ruby
- * RubyGems
- * [Ruby Stomp Client][Stomp]
-
-## Packages
-
-We strongly recommend you set up a local Apt repository that will host all the packages on your LAN, you can get the prerequisite packages here:
-
- * [ActiveMQ]
- * Java - OpenJDK that is included with your distribution
- * Ruby - included with your distribution
- * [RubyGems]
- * Stomp Ruby Gem
- * [MCollective][MCDownloads] - mcollective-2.2.x-1_all.deb, mcollective-common-2.2.x-1_all.deb, mcollective-client-2.2.x-1_all.deb
-
-The rest of this guide will assume you set up a Apt repository.  Puppet Labs hosts a Apt repository with all these dependencies at _apt.puppetlabs.com_.
-
-## ActiveMQ
-
-ActiveMQ is currently the most used and tested middleware for use with MCollective.
-
-You need at least one ActiveMQ server on your network, all the nodes you wish to manage will connect to the central ActiveMQ server.
-Later on you can [cluster the ActiveMQ servers for availability and scale][ActiveMQClustering].
-
-### Install
-
-On the server that you chose to configure as the ActiveMQ server:
-
-{% highlight console %}
-% apt-get install openjdk-6-jre
-{% endhighlight %}
-
-ActiveMQ installation instructions can be found [here][ActiveMQ Getting Started].
-
-### Configuring
-
-[The ActiveMQ config reference][activemq_config] describes all of the ActiveMQ settings that MCollective cares about. For best use, skim the sections you care about while comparing it to an example activemq.xml file.
-
-[activemq_config]: /mcollective/deploy/middleware/activemq.html
-
-We recommend that new users:
-
-* Start with the [single-broker example config][ActiveMQSingleBrokerSample].
-* Change the [user account passwords](/mcollective/deploy/middleware/activemq.html#authentication-users-and-groups).
-* [Set up TLS](/mcollective/deploy/middleware/activemq.html#tls-credentials) and [use a TLS Stomp transport connector](/mcollective/deploy/middleware/activemq.html#transport-connectors).
-
-Other example config files are also available from [GitHub][ActiveMQSamples].
-
-### Starting
-
-Start the ActiveMQ service:
-
-{% highlight console %}
-  # /etc/init.d/activemq start
-{% endhighlight %}
-
-You should see it running in the process list:
-
-{% highlight console %}
- # ps auxw|grep java
- activemq  3012  0.1 14.5 1155112 152180 ?      Sl   Dec28   2:02 java -Dactivemq.home=/usr/share/activemq -Dactivemq.base=/usr/share/activemq -Dcom.sun.management.jmxremote -Dorg.apache.activemq.UseDedicatedTaskRunner=true -Xmx512m -Djava.library.path=/usr/lib:/usr/lib64 -classpath /usr/share/java/tanukiwrapper.jar:/usr/share/activemq/bin/run.jar -Dwrapper.key=eg4_VvENzCmvtAKg -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.pid=3000 -Dwrapper.version=3.2.3 -Dwrapper.native_library=wrapper -Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp org.apache.activemq.console.Main start
-{% endhighlight %}
-
-You should also see it listening on port 61613 or 61614 in your network stack, depending on whether you turned on TLS.
-
-You should open port 61613 or 61614 for all your nodes to connect to.
-
-## Marionette Collective
-
-There are a few packages supplied and you will have potentially two type of server:
-
- * Nodes that you wish to manage using mcollective need the mcollective and mcollective-common packages
- * Nodes that you wish to use to initiate requests from also known as clients need mcollective-client and mcollective-common packages
-
-A machine can be both at once, in which case you need to install all 3 packages.  We'll work on the assumption here that you wish to both manage your machine and use it as a client by installing all 3 packages on our initial node.
-
-### Installation
-
-{% highlight console %}
-  # apt-get install mcollective mcollective-client mcollective-common
-  # gem install stomp
-{% endhighlight %}
-
-
-## Configuring
-You'll need to tweak some configs in */etc/mcollective/client.cfg*, a full reference of config settings can be
-found [here][ConfigurationReference]:
-
-We're assuming you called the machine running ActiveMQ *stomp.example.net*; please change as appropriate. Also note that the port should be 61614 if you turned on TLS.
-
-{% highlight ini %}
-  # main config
-  libdir = /usr/libexec/mcollective
-  logfile = /dev/null
-  loglevel = error
-
-  # connector plugin config
-  connector = activemq
-  plugin.activemq.pool.size = 1
-  plugin.activemq.pool.1.host = stomp.example.net
-  plugin.activemq.pool.1.port = 61613
-  plugin.activemq.pool.1.user = mcollective
-  plugin.activemq.pool.1.password = marionette
-
-  # security plugin config
-  securityprovider = psk
-  plugin.psk = abcdefghj
-{% endhighlight %}
-
-You should also create _/etc/mcollective/server.cfg_ here's a sample, a full reference of config settings can be found on the [Server Configuration Reference][server_config]:
-
-{% highlight ini %}
-  # main config
-  libdir = /usr/libexec/mcollective
-  logfile = /var/log/mcollective.log
-  daemonize = 1
-  loglevel = info
-
-  # connector plugin config
-  connector = activemq
-  plugin.activemq.pool.size = 1
-  plugin.activemq.pool.1.host = stomp.example.net
-  plugin.activemq.pool.1.port = 61613
-  plugin.activemq.pool.1.user = mcollective
-  plugin.activemq.pool.1.password = marionette
-
-
-  # facts
-  factsource = yaml
-  plugin.yaml = /etc/mcollective/facts.yaml
-
-  # security plugin config
-  securityprovider = psk
-  plugin.psk = abcdefghj
-{% endhighlight %}
-
-Replace the *plugin.psk* in both these files with a Pre-Shared Key of your own.
-
-### Create Facts
-By default - and for this setup - we'll use a simple YAML file for a fact source, later on you can use Puppet Labs Facter or something else.
-
-Create */etc/mcollective/facts.yaml* along these lines:
-
-{% highlight yaml %}
-  ---
-  location: devel
-  country: uk
-{% endhighlight %}
-
-### Start the Server
-
-The packages include standard init script, just start the server:
-
-{% highlight console %}
-  # /etc/init.d/mcollective restart
-{% endhighlight %}
-
-You should see in the log file somethig like:
-
-{% highlight console %}
-  # tail /var/log/mcollective.log
-  I, [2010-12-29T11:15:32.321744 #11479]  INFO -- : mcollectived:33 The Marionette Collective 1.1.0 started logging at info level
-{% endhighlight %}
-
-### Test connectivity
-
-If all is fine and you see this log message you can test with the client code:
-
-{% highlight console %}
-% mco ping
-your.domain.com                           time=74.41 ms
-
----- ping statistics ----
-1 replies max: 74.41 min: 74.41 avg: 74.41
-{% endhighlight %}
-
-This sends out a simple 'hello' packet to all the machines, as we only installed one you should have just one reply.
-
-If you install the _mcollective_ and _mcollective-common_ packages along wit the facts and server.cfg you should see more nodes show up here.
-
-You can explore other aspects of your machines:
-
-{% highlight console %}
-% mco find --with-fact country=uk
-your.domain.com
-{% endhighlight %}
-
-This searches all systems currently active for ones with a fact *country=uk*, it got the data from the yaml file you made earlier.
-
-If you use confiuration management tools like puppet and the nodes are setup with classes with *classes.txt* in */var/lib/puppet* then you
-can search for nodes with a specific class on them - the locations will configurable soon:
-
-{% highlight console %}
-% mco find --with-class common::linux
-your.domain.com
-{% endhighlight %}
-
-The filter commands are important they will be the main tool you use to target only parts of your infrastructure with calls to agents.
-
-See the *--help* option to the various *mco `*`* commands for available options.  You can now look at some of the available plugins and
-play around, you might need to run the server process as root if you want to play with services etc.
-
-### Plugins
-We provide limited default plugins, you can look on our sister project [MCollective Plugins][Plugins] where you will
-find various plugins to manage packages, services etc.
-
-### Further Reading
-From here you should look at the rest of the wiki pages some key pages are:
-
- * [Screencasts] - Get a hands-on look at what is possible
- * [Terminology]
- * [Introduction to Simple RPC][SimpleRPCIntroduction] - a simple to use framework for writing clients and agents
- * [ControllingTheDaemon] - Controlling a running daemon
- * [AESSecurityPlugin] - Using AES+RSA for secure message encryption and authentication of clients
- * [SSLSecurityPlugin] - Using SSL for secure message signing and authentication of clients
diff --git a/website/reference/basic/gettingstarted_redhat.md b/website/reference/basic/gettingstarted_redhat.md
deleted file mode 100644 (file)
index 59ff23c..0000000
+++ /dev/null
@@ -1,245 +0,0 @@
----
-layout: default
-title: Getting Started
----
-[Screencasts]: /mcollective/screencasts.html
-[ActiveMQ]: http://activemq.apache.org/
-[EC2Demo]: /mcollective/ec2demo.html
-[Stomp]: http://stomp.codehaus.org/Ruby+Client
-[DepRPMs]: http://www.marionette-collective.org/activemq/
-[DebianBug]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=562954
-[SecurityWithActiveMQ]: /mcollective/reference/integration/activemq_security.html
-[ActiveMQClustering]: /mcollective/reference/integration/activemq_clusters.html
-[ActiveMQSamples]: http://github.com/puppetlabs/marionette-collective/tree/master/ext/activemq/examples/
-[ActiveMQSingleBrokerSample]: http://github.com/puppetlabs/marionette-collective/raw/master/ext/activemq/examples/single-broker/activemq.xml
-[ConfigurationReference]: /mcollective/reference/basic/configuration.html
-[Terminology]: /mcollective/terminology.html
-[SimpleRPCIntroduction]: /mcollective/simplerpc/
-[ControllingTheDaemon]: /mcollective/reference/basic/daemon.html
-[SSLSecurityPlugin]: /mcollective/reference/plugins/security_ssl.html
-[AESSecurityPlugin]: /mcollective/reference/plugins/security_aes.html
-[ConnectorActiveMQ]: /mcollective/reference/plugins/connector_activemq.html
-[ConnectorRabbitMQ]: /mcollective/reference/plugins/connector_rabbitmq.html
-[MessageFlowCast]: /mcollective/screencasts.html#message_flow
-[Plugins]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki
-[MCDownloads]: http://www.puppetlabs.com/downloads/mcollective/
-[EPEL]: http://fedoraproject.org/wiki/EPEL
-[server_config]: /mcollective/configure/server.html
-
-Getting started using Red Hat based distribution like Red Hat Enterprise Linux and CentOS is easy as RPMs are available for all the required components.  This guide walks you through the process.
-
-## Requirements
-We try to keep the requirements on external Gems to a minimum, you only need:
-
- * A Stomp server, tested against [ActiveMQ]
- * Ruby
- * Rubygems
- * [Ruby Stomp Client][Stomp]
-
-## Packages
-
-We strongly recommend you set up a local Yum repository that will host all the packages on your LAN, you can get the prerequisite packages here:
-
- * [ActiveMQ][MCDownloads] - activemq-5.4.0-2.el5.noarch.rpm, activemq-info-provider-5.4.0-2.el5.noarch.rpm, tanukiwrapper-3.2.3-1jpp.`*`.rpm
- * Java - OpenJDK that is included with your distribution
- * Ruby - included with your distribution
- * RubyGems - [EPEL]
- * Stomp Ruby Gem - [EPEL]
- * [MCollective][MCDownloads] - mcollective-2.2.x-1.el5.noarch.rpm, mcollective-common-2.2.x-1.el5.noarch.rpm, mcollective-client-2.2.x-1.el5.noarch.rpm
-
-The rest of this guide will assume you set up a Yum repository.  Puppet Labs hosts a Yum repository with all these dependencies at _yum.puppetlabs.com_.
-
-## ActiveMQ
-ActiveMQ is currently the most used and tested middleware for use with MCollective.
-
-You need at least one ActiveMQ server on your network, all the nodes you wish to manage will connect to the central ActiveMQ server.
-Later on your can [cluster the ActiveMQ servers for availability and scale][ActiveMQClustering].
-
-### Install
-
-On the server that you chose to configure as the ActiveMQ server:
-
-{% highlight console %}
-% yum install java-1.6.0-openjdk activemq
-{% endhighlight %}
-
-### Configuring
-
-[The ActiveMQ config reference][activemq_config] describes all of the ActiveMQ settings that MCollective cares about. For best use, skim the sections you care about while comparing it to an example activemq.xml file.
-
-[activemq_config]: /mcollective/deploy/middleware/activemq.html
-
-We recommend that new users:
-
-* Start with the [single-broker example config][ActiveMQSingleBrokerSample].
-* Change the [user account passwords](/mcollective/deploy/middleware/activemq.html#authentication-users-and-groups).
-* [Set up TLS](/mcollective/deploy/middleware/activemq.html#tls-credentials) and [use a TLS Stomp transport connector](/mcollective/deploy/middleware/activemq.html#transport-connectors).
-
-Other example config files are also available from [GitHub][ActiveMQSamples].
-
-
-### Starting
-
-Start the ActiveMQ service:
-
-{% highlight console %}
-  # /etc/init.d/activemq start
-{% endhighlight %}
-
-You should see it running in the process list:
-
-{% highlight console %}
- # ps auxw|grep java
- activemq  3012  0.1 14.5 1155112 152180 ?      Sl   Dec28   2:02 java -Dactivemq.home=/usr/share/activemq -Dactivemq.base=/usr/share/activemq -Dcom.sun.management.jmxremote -Dorg.apache.activemq.UseDedicatedTaskRunner=true -Xmx512m -Djava.library.path=/usr/lib:/usr/lib64 -classpath /usr/share/java/tanukiwrapper.jar:/usr/share/activemq/bin/run.jar -Dwrapper.key=eg4_VvENzCmvtAKg -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.pid=3000 -Dwrapper.version=3.2.3 -Dwrapper.native_library=wrapper -Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp org.apache.activemq.console.Main start
-{% endhighlight %}
-
-You should also see it listening on port 61613 in your network stack
-
-You should open port 61613 for all your nodes to connect to.
-
-## Marionette Collective
-
-There are a few packages supplied and you will have potentially two type of server:
-
- * Nodes that you wish to manage using mcollective need the mcollective and mcollective-common packages
- * Nodes that you wish to use to initiate requests from also known as clients need mcollective-client and mcollective-common packages
-
-A machine can be both at once, in which case you need to install all 3 packages.  We'll work on the assumption here that you wish to both manage your machine and use it as a client by installing all 3 packages on our initial node.
-
-### Installation
-
-{% highlight console %}
- # yum install mcollective mcollective-client mcollective-common rubygem-stomp
-{% endhighlight %}
-
-
-## Configuring
-You'll need to tweak some configs in */etc/mcollective/client.cfg*, a full reference of config settings can be
-found [here][ConfigurationReference]:
-
-We're assuming you called the machine running ActiveMQ *stomp.example.net* please change as appropriate
-
-{% highlight ini %}
-  # main config
-  libdir = /usr/libexec/mcollective
-  logfile = /dev/null
-  loglevel = error
-
-  # connector plugin config
-  connector = activemq
-  plugin.activemq.pool.size = 1
-  plugin.activemq.pool.1.host = stomp.example.net
-  plugin.activemq.pool.1.port = 61613
-  plugin.activemq.pool.1.user = mcollective
-  plugin.activemq.pool.1.password = marionette
-
-  # security plugin config
-  securityprovider = psk
-  plugin.psk = abcdefghj
-{% endhighlight %}
-
-You should also create _/etc/mcollective/server.cfg_ here's a sample, a full reference of config settings can be found on the [Server Configuration Reference][server_config]:
-
-{% highlight ini %}
-  # main config
-  libdir = /usr/libexec/mcollective
-  logfile = /var/log/mcollective.log
-  daemonize = 1
-  loglevel = info
-
-  # connector plugin config
-  connector = activemq
-  plugin.activemq.pool.size = 1
-  plugin.activemq.pool.1.host = stomp.example.net
-  plugin.activemq.pool.1.port = 61613
-  plugin.activemq.pool.1.user = mcollective
-  plugin.activemq.pool.1.password = marionette
-
-  # facts
-  factsource = yaml
-  plugin.yaml = /etc/mcollective/facts.yaml
-
-  # security plugin config
-  securityprovider = psk
-  plugin.psk = abcdefghj
-{% endhighlight %}
-
-Replace the *plugin.psk* in both these files with a Pre-Shared Key of your own.
-
-### Create Facts
-By default - and for this setup - we'll use a simple YAML file for a fact source, later on you can use Puppet Labs Facter or something else.
-
-Create */etc/mcollective/facts.yaml* along these lines:
-
-{% highlight yaml %}
-  ---
-  location: devel
-  country: uk
-{% endhighlight %}
-
-### Start the Server
-
-The packages include standard init script, just start the server:
-
-{% highlight console %}
-  # /etc/init.d/mcollective restart
-{% endhighlight %}
-
-You should see in the log file somethig like:
-
-{% highlight console %}
-  # tail /var/log/mcollective.log
-  I, [2010-12-29T11:15:32.321744 #11479]  INFO -- : mcollectived:33 The Marionette Collective 1.1.0 started logging at info level
-{% endhighlight %}
-
-### Test connectivity
-
-If all is fine and you see this log message you can test with the client code:
-
-{% highlight console %}
-% mco ping
-your.domain.com                           time=74.41 ms
-
----- ping statistics ----
-1 replies max: 74.41 min: 74.41 avg: 74.41
-{% endhighlight %}
-
-This sends out a simple 'hello' packet to all the machines, as we only installed one you should have just one reply.
-
-If you install the _mcollective_ and _mcollective-common_ packages along wit the facts and server.cfg you should see more nodes show up here.
-
-You can explore other aspects of your machines:
-
-{% highlight console %}
-% mco find --with-fact country=uk
-your.domain.com
-{% endhighlight %}
-
-This searches all systems currently active for ones with a fact *country=uk*, it got the data from the yaml file you made earlier.
-
-If you use confiuration management tools like puppet and the nodes are setup with classes with *classes.txt* in */var/lib/puppet* then you
-can search for nodes with a specific class on them - the locations will configurable soon:
-
-{% highlight console %}
-% mco find --with-class common::linux
-your.domain.com
-{% endhighlight %}
-
-The filter commands are important they will be the main tool you use to target only parts of your infrastructure with calls to agents.
-
-See the *--help* option to the various *mco `*`* commands for available options.  You can now look at some of the available plugins and
-play around, you might need to run the server process as root if you want to play with services etc.
-
-### Plugins
-We provide limited default plugins, you can look on our sister project [MCollective Plugins][Plugins] where you will
-find various plugins to manage packages, services etc.
-
-### Further Reading
-From here you should look at the rest of the wiki pages some key pages are:
-
- * [Screencasts] - Get a hands-on look at what is possible
- * [Terminology]
- * [Introduction to Simple RPC][SimpleRPCIntroduction] - a simple to use framework for writing clients and agents
- * [ControllingTheDaemon] - Controlling a running daemon
- * [AESSecurityPlugin] - Using AES+RSA for secure message encryption and authentication of clients
- * [SSLSecurityPlugin] - Using SSL for secure message signing and authentication of clients
diff --git a/website/reference/basic/messageflow.md b/website/reference/basic/messageflow.md
deleted file mode 100644 (file)
index 850293e..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
----
-layout: default
-title: Message Flow
-toc: false
----
-[MessageFormat]: /mcollective/reference/basic/messageformat.html
-[ActiveMQClusters]: /mcollective/reference/integration/activemq_clusters.html
-[SecurityWithActiveMQ]: /mcollective/reference/integration/activemq_security.html
-[ScreenCast]: /mcollective/screencasts.html#message_flow
-
-The diagram below shows basic message flow on a MCollective system.  There is also a [screencast][ScreenCast] that shows this process, recommend you watch that.
-
-The key thing to take away from this diagram is the broadcast paradigm that is in use, one message only leaves the client and gets broadcast to all nodes.  We'll walk you through each point below.
-
-![Message Flow](/mcollective/images/message-flow-diagram.png)
-
-|Step|Description|
-|----|-----------|
-|A|A single messages gets sent from the workstation of the administrator to the middleware.  The message has a filter attached saying only machines with the fact _cluster=c_ should perform an action.|
-|B|The middleware network broadcasts the message to all nodes.  The middleware network can be a [cluster of multiple servers in multiple locations, networks and data centers][ActiveMQClusters].|
-|C|Every node gets the message and validates the filter|
-|D|Only machines in _cluster=c_ act on the message and sends a reply, depending on your middleware only the workstation will get the reply.|
-
-For further information see:
-
- * [Messages and their contents][MessageFormat]
- * [Clustering ActiveMQ brokers][ActiveMQClusters]
- * [Security, authentication and authorization][SecurityWithActiveMQ]
diff --git a/website/reference/basic/messageformat.md b/website/reference/basic/messageformat.md
deleted file mode 100644 (file)
index 45b5789..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
----
-layout: default
-title: Message Format
----
-[SecurityPlugins]: http://github.com/puppetlabs/marionette-collective/tree/master/plugins/mcollective/security/
-[SimpleRPCIntroduction]: /mcollective/simplerpc/
-[MessageFlow]: messageflow.html
-[ScreenCast]: /mcollective/screencasts.html#message_flow
-
-The messages that gets put on the middleware attempts to contain everything that mcollective needs to function, avoiding where possible special features in the Middle Ware.  This will hopefully make it easier to create Connector plugins for other middleware.
-
-At present the task of encoding and decoding messages lies with the _MCollective::Security::`*`_ classes, see the provided [security plugins][SecurityPlugins] as a examples.
-
-Abstracting the encoding away from the security plugins is a goal for future refactorings, till then each security plugin will need to at least conform to the following structure.
-
-In general this is all hidden from the developers, especially if you use [Simple RPC][SimpleRPCIntroduction].  If you want to implement your own security or serialization you will need to know exactly how all of this sticks together.
-
-There is also a [screencast][ScreenCast] that shows this process and message format, recommend you watch that.
-
-## Message Flow
-For details of the flow of messages and how requests / replies travel around the network see the [MessageFlow] page.
-
-## History
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2011/04/23|Add _agent_ and _collective_ to the request hashes|7113|
-
-### Requests sent to agents
-A sample request that gets sent to the connector can be seen here, each component is described below:
-
-{% highlight ruby %}
-{:filter    =>
-  {"cf_class"      => ["common::linux"],
-   "fact"          => [{:fact=>"country", :value=>"uk"}],
-   "agent"         => ["package"]},
- :senderid    => "devel.your.com",
- :msgtarget   => "/topic/mcollective.discovery.command",
- :agent:      => 'discovery',
- :collective' => 'mcollective',
- :body        => body,
- :hash        => "2d437f2904980ac32d4ebb7ca1fd740b",
- :msgtime     => 1258406924,
- :ttl         => 60,
- :requestid   => "0b54253cb5d04eb8b26ea75bbf468cbc"}
-{% endhighlight %}
-
-Once this request is created the security plugin will serialize it and sent it to the connector, in the case of the PSK security plugin this is done using Marshal.
-
-#### :filter
-The filter will be evaluated by each node, if it passes the node will dispatch the message to an agent.
-
-You can see all these types of filter in action in the _MCollection::Optionparser_ class.
-
-Each filter is an array and you can have multiple filters per type which will be applied with an _AND_
-Valid filter types are:
-
-##### CF Class
-
-This will look in a list of classes/recipes/cookbooks/roles applied by your
-configuration management system and match based on that
-
-{% highlight ruby %}
-filter["cf_class"] = ["common::linux"]
-{% endhighlight %}
-
-##### MCollective Agent
-
-This will look through the list of known agents and match against that.
-
-{% highlight ruby %}
-filter["agent"] = ["package"]
-{% endhighlight %}
-
-##### Facts
-
-Since facts are key => value pairs this is a bit more complex than normal as you need to build a nested Hash.
-
-{% highlight ruby %}
-filter["fact"] = [{:fact => "country", :value => "uk"}]
-{% endhighlight %}
-
-Regular expression matches are:
-
-{% highlight ruby %}
-filter["fact"] = [{:fact => "country", :value => "/uk/"}]
-{% endhighlight %}
-
-As of version 1.1.0 this has been extended to support more comparison operators:
-
-{% highlight ruby %}
-filter["fact"] = [{:fact => "country", :value => "uk", :operator => "=="}]
-{% endhighlight %}
-
-Valid operators are: ==, =~, &lt;=, =&gt;, &gt;=, =&lt;, &gt; &lt; and !=
-
-As regular expressions are now done using their own operator backwards compatability
-is lost and in mixed version environment 1.1.x clients doing regex matches on facts
-will be treated as equality on 1.0.x and older clients.
-
-##### Identity
-
-The identity is the configured identity in the server config file, many hosts can have the same identity it's just another level of filter doesn't really mean much like a hostname that would need to be unique.
-
-{% highlight ruby %}
-filter["identity"] = ["foo.bar.com"]
-{% endhighlight %}
-
-#### :senderid
-
-The value of _identity_ in the configuration file.
-
-#### :msgtarget
-
-The Middleware topic or channel the message is being sent to.  This is not being used since later 1.1.x and since 1.3.1 it is not included in messages anymore.
-
-#### :body
-
-The contents of the body will vary by what ever the security provider choose to impliment, the PSK security provider simply Marshal encodes the body into a serialized format ready for transmission.
-
-This ensures that variable types etc remain in tact end to end.  Other security providers might use JSON etc, the decoding of this is also handled by the security provider so its totally up to the provider to decide.
-
-In the case of [Simple RPC][SimpleRPCIntroduction] the entire RPC request and replies will be in the body of the messages, it's effectively a layer on top of the basic message flow.
-
-#### :hash
-
-This is an example of something specific to the security provider, this is used only by the PSK provider so it's optional and specific to the PSK provider
-
-#### :msgtime
-
-The unix timestamp that the message was sent at.
-
-#### :ttl
-
-Each request has a TTL, messages older than this gets discarded.  Added in version 1.3.1
-
-#### :requestid
-
-This is a unique id for each message that gets sent, replies will have the same id attached to them for validation.
-
-### Replies from Agents
-Replies are very similar to requests, I'll show a reply below and only highlight the differences between requests.
-
-{% highlight ruby %}
-{:senderid    => "devel.your.com",
- :senderagent => "package",
- :msgtarget   => "/topic/mcollective.package.reply",
- :body        => body,
- :hash        => "2d437f2904980ac32d4ebb7ca1fd740b",
- :msgtime     => 1258406924,
- :requestid   => "0b54253cb5d04eb8b26ea75bbf468cbc"}
-{% endhighlight %}
-
-Once this reply is created the security plugin will serialize it and sent it to the connector, in the case of the PSK security plugin this is done using serialization tools like Marshal or YAML depending on Security Plugin.
-
-#### :senderagent
-This is the agent name that sent the reply
-
-#### :requestid
-The id that was contained in the request we are replying to.  Agents do not generally tend to generate messages - they only reply - so this should always be provided.
diff --git a/website/reference/basic/subcollectives.md b/website/reference/basic/subcollectives.md
deleted file mode 100644 (file)
index 60e6d64..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
----
-layout: default
-title: Subcollectives
----
-
-[ActiveMQClustering]: /mcollective/reference/integration/activemq_clusters.html
-[activemq_authorization]: /mcollective/deploy/middleware/activemq.html#authorization-group-permissions
-[activemq_detailed]: /mcollective/deploy/middleware/activemq.html#detailed-restrictions
-[activemq_subcollectives]: /mcollective/deploy/middleware/activemq.html#detailed-restrictions-with-multiple-subcollectives
-[activemq_filtering]: /mcollective/deploy/middleware/activemq.html#destination-filtering
-[activemq_authentication]: /mcollective/deploy/middleware/activemq.html#authentication-users-and-groups
-
-## Overview
-
-By default all servers are part of a single broadcast domain, if you have an
-agent on all machines in your network and you send a message directed to
-machines with that agent they will all get it regardless of filters.
-
-This works well for the common use case but can present problems in the
-following scenarios:
-
- * You have a very big and busy network.  With thousands of machines responding
-   to requests every 10 seconds very large numbers of messages will be created
-   and you might want to partition the traffic.
- * You have multiple data centers on different continents, the latency and
-   volume of traffic will be too big.  You'd want to duplicate monitoring and
-   management automations in each datacenter but as it's all one broadcast
-   domain you still see large amount of traffic on the slow link.
- * You can't just run multiple seperate installs because you still wish to
-   retain the central management feature of MCollective.
- * Securing a flat network can be problematic.  SimpleRPC has a security
-   framework that is aware of users and network topology but the core network
-   doesnt.
-
-We've introduced the concept of sub collectives that lets you define broadcast
-domains and configure a mcollective server to belong to one or many of these domains.
-
-## Partitioning Approaches
-
-Determining how to partition your nework can be a very complex subject and
-requires an understanding of your message flow, where requestors sit and also
-the topology of your middleware clusters.
-
-Most middleware solutions will only send traffic where they know there exist an
-interest in this traffic.  Therefore if you had an agent on only 10 of 1000
-machines only those 10 machines will receive the associated traffic.  This is an
-important distinction to keep in mind.
-
-![ActiveMQ Cluster](../../images/subcollectives-multiple-middleware.png)
-
-We'll be working with a small 52 node collective that you can see above, the
-collective has machines in many data centers spread over 4 countries.  There are
-3 ActiveMQ servers connected in a mesh.
-
-Along with each ActiveMQ node is also a Puppet Master, Nagios instance and other
-shared infrastructure components.
-
-An ideal setup for this network would be:
-
- * MCollective NRPE and Puppetd Agent on each of 52 servers
- * Puppet Commander on each of the 3 ActiveMQ locations
- * Nagios in each of the locations monitoring the machines in its region
- * Regional traffic will be isolated and contained to the region as much as
-   possible
- * Systems Administrators and Registration data retain the ability to target the
-   whole collective
-
-The problem with a single flat collective is that each of the 3 Puppet
-Commanders will get a copy of all the traffic, even traffic they did not request
-they will simply ignore the wrong traffic.  The links between Europe and US will
-see a large number of messages traveling over them.  In a small 52 node traffic
-this is managable but if each of the 4 locations had thousands of nodes the
-situation will rapidly become untenable.
-
-It seems natural then to create a number of broadcast domains - subcollectives:
-
- * A global collective that each machines belongs to
- * UK, DE, ZA and US collectives that contains just machines in those regions
- * An EU collective that has UK, DE and ZA machines
-
-Visually this arrangement might look like the diagram below:
-
-![Subcollectives](../../images/subcollectives-collectives.png)
-
-Notice how subcollectives can span broker boundaries - our EU collective has nodes
-that would connect to both the UK and DE brokers.
-
-We can now configure our Nagios and Puppet Commanders to communicate only to the
-sub collectives and the traffic for these collectives will be contained
-regionally.
-
-The graph below shows the impact of doing this, this is the US ActiveMQ instance
-showing traffic before partitioning and after.  You can see even on a small
-network this can have a big impact.
-
-![Subcollectives](../../images/subcollectives-impact.png)
-
-## Configuring MCollective
-
-Configuring the partitioned collective above is fairly simple.  We'll look at
-one of the DE nodes for reference:
-
-{% highlight ini %}
-collectives = mcollective,de_collective,eu_collective
-main_collective = mcollective
-{% endhighlight %}
-
-The _collectives_ directive tells the node all the collectives it should belong
-to and the _main`_`collective_ instructs Registration where to direct messages
-to.
-
-## Testing
-
-Testing that it works is pretty simple, first we need a _client.cfg_ that
-configures your client to talk to all the sub collectives:
-
-{% highlight ini %}
-collectives = mcollective,uk_collective,us_collective,de_collective,eu_collective,us_collective,za_collective
-main_collective = mcollective
-{% endhighlight %}
-
-You can now test with _mco ping_:
-
-{% highlight console %}
-$ mco ping -T us_collective
-host1.us.my.net         time=200.67 ms
-host2.us.my.net         time=241.30 ms
-host3.us.my.net         time=245.24 ms
-host4.us.my.net         time=275.42 ms
-host5.us.my.net         time=279.90 ms
-host6.us.my.net         time=283.61 ms
-host7.us.my.net         time=370.56 ms
-
-
----- ping statistics ----
-7 replies max: 370.56 min: 200.67 avg: 270.96
-{% endhighlight %}
-
-By specifying other collectives in the -T argument you should see the sub
-collectives and if you do not specify anything you should see all machines.
-
-Clients don't need to know about all collectives, only the ones they intend
-to communicate with.
-
-You can discover the list of known collectives and how many nodes are in each
-using the _inventory_ application:
-
-{% highlight console %}
-$ mco inventory --list-collectives
-
- * [ ==================================== ] 52 / 52
-
-   Collective                     Nodes
-   ==========                     =====
-   za_collective                  2
-   us_collective                  7
-   uk_collective                  19
-   de_collective                  24
-   eu_collective                  45
-   mcollective                    52
-
-                     Total nodes: 52
-
-{% endhighlight %}
-
-## Partitioning for Security
-
-Another possible advantage from subcollectives is security.  While the SimpleRPC
-framework has a security model that is aware of the topology the core network
-layer does not.  Even if you only give someone access to run SimpleRPC requests
-against some machines they can still use _mco ping_ to discover other nodes on
-your network.
-
-By creating a subcollective of just their nodes and restricting them on the
-middleware level to just that collective you can effectively and completely
-create a secure isolated zone that overlays your exiting network.
-
-These restrictions have to be configured on the middleware server, outside of MCollective itself. The method will vary based on the middleware you use; the suggestions below are for ActiveMQ, the main recommended middleware.
-
-### Identifying Subcollectives on ActiveMQ
-
-The ActiveMQ connector plugin identifies subcollectives with the **first segment** of every destination (topic or queue) name.
-
-So for direct node addressing, for example, the default `mcollective` collective would use the `mcollective.nodes` queue, and `uk_collective` would use the `uk_collective.nodes` queue. For the package agent, they would use the `mcollective.package.agent` and `uk_collective.package.agent` topics, respectively.
-
-This makes it easy to use ActiveMQ destination wildcards to control access to a given collective. 
-
-### Per-Subcollective Authorization
-
-To control subcollective access, identify the set of topics and queues that collective will use, then use ActiveMQ's authorization rules to secure them.
-
-* [See the "Authorization" section of the ActiveMQ config reference][activemq_authorization] for details.
-* The ["Detailed Restrictions"][activemq_detailed] example shows all of the topics and queues used by the default collective; you can copy/paste/modify these for a small number of collectives.
-* The ["Detailed Restrictions with Multiple Subcollectives"][activemq_subcollectives] example uses a snippet of ERB template to manage any number of collectives. 
-
-You must then [configure multiple ActiveMQ user accounts][activemq_authentication] for your site's admins. Give each user membership in the groups they'll need to manage their collectives.
-
-### Destination Filters in a Network of Brokers
-
-In a [network of brokers][ActiveMQClustering], you can also prevent propagation across the network of sub collective
-traffic. See the ["Destination Filtering"][activemq_filtering] section of the ActiveMQ config reference for details.
diff --git a/website/reference/development/ec2_demo.md b/website/reference/development/ec2_demo.md
deleted file mode 100644 (file)
index 1b30b12..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
----
-layout: default
-title: EC2 Demo Creation
-toc: false
----
-[Bundling]: http://support.rightscale.com/12-Guides/01-RightScale_Dashboard_User_Guide/02-Clouds/01-EC2/08-EC2_Image_Locator/Register_an_AMI#Step_2.3a_Bundle_the_Instance
-[Console]: https://console.aws.amazon.com/ec2
-
-Things to improve in next build:
-
- * set _plugin.urltest.syslocation_ to the availability zone the AMI is running on to improve mc-urltest output
-
-## RightScale AMI
-Start up ami _ami-efe4cf9b_ or a newer RightScale EC2 image
-
-## Packages Needed
-Install the following RPMs:
-
-{% highlight console %}
-facter
-tanukiwrapper
-activemq
-mcollective
-mcollective-client
-mcollective-common
-rubygem-stomp
-rubygems
-ruby-shadow
-puppet
-net-snmp-libs
-lm_sensors
-net-snmp
-perl-Socket6
-nrpe
-perl-Crypt-DES
-perl-Digest-SHA1
-nagios-plugins
-perl-Digest-HMAC
-perl-Net-SNMP
-xinetd
-dialog
-rubygem-rdialog
-{% endhighlight %}
-
-Gram and install _passmakr-1.0.0.gem_ from _http://passmakr.googlecode.com/_
-
-## File modifications
-Most of the files needed are in SVN in the _ext/ec2demo_ directory.
-
-{% highlight console %}
-.
-|-- etc
-|   |-- activemq
-|   |   `-- activemq.xml.templ
-|   |-- mcollective
-|   |   |-- client.cfg.templ
-|   |   `-- server.cfg.templ
-|   |-- nagios
-|   |   |-- command-plugins.cfg
-|   |   |-- nrpe.cfg
-|   |   `-- nrpe.d
-|   |       |-- check_disks.cfg
-|   |       |-- check_load.cfg
-|   |       |-- check_swap.cfg
-|   |       |-- check_totalprocs.cfg
-|   |       `-- check_zombieprocs.cfg
-|   |-- rc.d
-|   |   `-- rc.local
-|   `-- xinetd.d
-|       `-- nrpe
-|-- opt
-|   `-- rightscale
-|       `-- etc
-|           `-- motd-complete
-|-- root
-|   `-- README.txt
-`-- usr
-    |-- lib
-    |   `-- ruby
-    |       `-- site_ruby
-    |           `-- 1.8
-    |               `-- facter
-    |                   `-- rightscale.rb
-    `-- local
-        |-- bin
-        |   `-- start-mcollective-demo.rb
-        `-- etc
-            `-- mcollective-node.motd
-{% endhighlight %}
-
-## Bundling Changes
-Bundling up is based on [RightScale docs][bundling].
-
-You need to copy your key, cert and have your credentials all into _/mnt_:
-
-{% highlight console %}
-% cp /dev/null /root/.bash_history
-% rm -rf /var/tmp/mcollective/
-
-% ec2-bundle-vol -d /mnt -k pk-xx.pem -c cert-xx.pem -u 481328239245 -r i386
-% ec2-upload-bundle -b mcollective-041-demo -m image.manifest.xml -a xx -s xxx
-{% endhighlight %}
-
-Now register the AMI in the [AWS console][Console] then make public after testing
diff --git a/website/reference/development/releasetasks.md b/website/reference/development/releasetasks.md
deleted file mode 100644 (file)
index f65ee22..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
----
-layout: default
-title: Release Tasks
-toc: false
----
-
-Notes on what to do when we release
-
- * update Changelog
- * update ReleaseNotes
- * update rakefile for version
- * update website news section
- * tag release
- * update release notes with release date
- * build and release rpms
- * build and release debs using ami-0db89079
- * send mail
- * Announce on freshmeat
-
-## Building RPMs
-Boot up an instance of the EC2 demo AMIs
-
-{% highlight console %}
-# gem install rake
-# git clone git://github.com/puppetlabs/marionette-collective.git
-# cd marionette-collective
-# git checkout 0.x.x
-# rake rpm
-{% endhighlight %}
-
-Copy the RPMs and test it.
-
-## Building debs
-Boot up an instance of _ami-0db89079_ and do more or less the following:
-
-**Note: There's some bug, you might need to run _make deb_ twice to make it work**
-
-{% highlight console %}
-# apt-get update
-# apt-get install rake irb rdoc build-essential subversion devscripts dpatch cdbs rubygems git-core
-# git clone git://github.com/puppetlabs/marionette-collective.git
-# cd marionette-collective
-# git checkout 0.x.x
-# rake deb
-{% endhighlight %}
-
-Copy do test installs on the machine make sure it looks fine and ship them off the AMI, shut it.  Make sure to copy the source deb as well.
diff --git a/website/reference/index.md b/website/reference/index.md
deleted file mode 100644 (file)
index d6f8044..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
----
-layout: default
-title: Users Documentation and Reference
-toc: false
----
-
-Index to basic users documentation.
-
-## Basic Operations and Configuration
-
- 1. [Getting Started](basic/gettingstarted.html)
- 1. [Configuration Guide](basic/configuration.html)
- 1. [Message Flow](basic/messageflow.html)
- 1. [Network Partitioning using Subcollectives](basic/subcollectives.html)
- 1. [Message Format](basic/messageformat.html)
-
-### User Interface
-
- 1. [Using MCollective Command Line Applications](basic/basic_cli_usage.html)
- 1. [Node Reports](ui/nodereports.html)
- 1. [CLI Filters](ui/filters.html)
-
-### Integration
-
- 1. [Using with Puppet](integration/puppet.html)
- 1. [Using with Chef](integration/chef.html)
- 1. [ActiveMQ Security](integration/activemq_security.html)
- 1. [ActiveMQ SSL](integration/activemq_ssl.html)
- 1. [ActiveMQ Clusters](integration/activemq_clusters.html)
- 1. [ActiveMQ Connector](plugins/connector_activemq.html)
- 1. [RabbitMQ Connector](plugins/connector_rabbitmq.html)
-
-### Plugin Types
-
- 1. [Data Plugins](plugins/data.html)
- 1. [Discovery Plugins](plugins/discovery.html)
- 1. [Result Aggregation Plugins](plugins/aggregate.html)
- 1. [The single application plugin system](plugins/application.html)
- 1. [Registration](plugins/registration.html)
- 1. [Fact Source Plugins](plugins/facts.html)
- 1. [Validator Plugins](plugins/validator.html)
-
-### Plugins
-
- 1. [The _rpcutil_ helper Agent](plugins/rpcutil.html)
- 1. [AES+RSA based Security Plugin](plugins/security_aes.html)
- 1. [OpenSSL based Security Plugin](plugins/security_ssl.html)
- 1. [Stomp Connector](plugins/connector_stomp.html)
- 1. [ActiveMQ Connector](plugins/connector_activemq.html)
- 1. [RabbitMQ Connector](plugins/connector_rabbitmq.html)
- 1. [User Contributed Plugins](http://projects.puppetlabs.com/projects/mcollective-plugins/wiki)
-
-### Development
-
- 1. [Release Tasks](development/releasetasks.html)
- 1. [EC2 Demo Creation](development/ec2_demo.html)
diff --git a/website/reference/integration/activemq_clusters.md b/website/reference/integration/activemq_clusters.md
deleted file mode 100644 (file)
index a4f2003..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
----
-layout: default
-title: ActiveMQ Clustering
-toc: false
----
-[MessageFlow]: /mcollective/reference/basic/messageflow.html
-[NetworksOfBrokers]: http://activemq.apache.org/networks-of-brokers.html
-[SampleConfig]: http://github.com/puppetlabs/marionette-collective/tree/master/ext/activemq/
-[fuse_cluster]: http://fusesource.com/docs/broker/5.5/clustering/index.html
-[activemq_network]: /mcollective/deploy/middleware/activemq.html#settings-for-networks-of-brokers
-
-Relying on existing middleware tools and not re-inventing the transport wheel ourselves means we can take advantage of a lot of the built in features they provide.  One such feature is clustering in ActiveMQ that allows for highly scalable and flexible network layouts.
-
-We'll cover here how to build a multi data center network of ActiveMQ servers with a NOC, the NOC computers would not need to send any packets direct to the nodes they manage and thanks to our meta data based approach to addressing machines they do not even need to know IPs or hostnames.
-
-There is an example of a 3 node cluster in the [ext/activemq directory of the MCollective source][SampleConfig].
-
-## Network Design
-
-### Network Layout
-
-![ActiveMQ Cluster](/mcollective/images/activemq-multi-locations.png)
-
-The diagram above shows our sample network, I am using the same techniques to put an ActiveMQ in each of 4 countries and then having local nodes communicate to in-country ActiveMQ nodes.
-
-* These are the terminals of your NOC staff, they run the client code, these could also be isolated web servers for running admin tools etc.
-* Each location has its own instance of ActiveMQ and nodes would only need to communicate to their local ActiveMQ.  This greatly enhances security in a setup like this.
-* The ActiveMQ instances speak to each other using a protocol called OpenWire, you can run this over IPSec or you could use the native support for SSL.
-* These are the servers being managed, they run the server code.  No direct communications needs to be in place between NOC and managed servers.
-
-Refer to the [MessageFlow][] document to see how messages would traverse the middleware in a setup like this.
-
-### General Observations
-The main design goal here is to promote network isolation, the staff in your NOC are often high churn people, you'll get replacement staff relatively often and it's a struggle to secure what information they carry and how and when you can trust them.
-
-Our model of using middleware and off-loading authentication and authorization onto the middleware layer means you only need to give NOC people appropriate access to the middleware and not to each individual machine.
-
-Our usage of meta data to address machines rather than hostnames or ip address means you do not need to divulge this information to NOC staff, from their point of view they access machines like this:
-
-* All machines in _datacenter=a_
-* AND all machines with puppet class _/webserver/_
-* AND all machines with Facter fact _customer=acmeinc_
-
-In the end they can target the machines they need to target for maintenance commands as above without the need for any info about hostnames, ips, or even what/where data center A is.
-
-This model works particularly well in a Cloud environment where hostnames are dynamic and not under your control, in a cloud like Amazon S3 machines are better identified by what AMI they have booted and in what availability zones they are rather than what their hostnames are.
-
-## ActiveMQ Configuration
-
-ActiveMQ supports many types of cluster; we think their Network of Brokers model works best for MCollective.
-
-You will need to configure your ActiveMQ servers with everything from the ["Settings for Networks of Brokers" section of the ActiveMQ config reference][activemq_network]. Note the comments about the bi-directional connections: In the example network described above, you could either configure a pair of connectors on each datacenter broker to connect them to the NOC, or configure several pairs of connectors on the NOC broker to connect it to every datacenter. Do whichever makes sense for your own convenience and security needs.
-
-There is also a set of example config files in the [ext/activemq directory of the MCollective source][SampleConfig]; refer to these while reading the config reference. 
-
-See [the ActiveMQ docs][NetworksOfBrokers] or [the Fuse docs][fuse_cluster] for more detailed info about networks of brokers.
-
diff --git a/website/reference/integration/activemq_security.md b/website/reference/integration/activemq_security.md
deleted file mode 100644 (file)
index e3ca4ed..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
----
-layout: default
-title: ActiveMQ Security
-toc: false
----
-
-[Security]: http://activemq.apache.org/security.html
-[Wildcard]: http://activemq.apache.org/wildcards.html
-[activemq_config]: /mcollective/deploy/middleware/activemq.html
-[mcollective_username]: /mcollective/reference/plugins/connector_activemq.html#configuring-mcollective
-[mcollective_tls]: ./activemq_ssl.html#configuring-mcollective-servers
-
-As part of rolling out MCollective you need to think about security. The various examples in the quick start guide and on this blog has allowed all agents to talk to all nodes all agents. The problem with this approach is that should you have untrusted users on a node they can install the client applications and read the username/password from the server config file and thus control your entire architecture.
-
-The default format for message topics is compatible with [ActiveMQ wildcard patterns][Wildcard] and so we can now do fine grained controls over who can speak to what.
-
-General information about [ActiveMQ Security can be found on their wiki][Security].
-
-## Configuring Security in activemq.xml
-
-[The ActiveMQ config reference][activemq_config] contains all relevant info for configuring security is activemq.xml. The most relevant sections are: 
-
-* [Topic and Queue Names](/mcollective/deploy/middleware/activemq.html#topic-and-queue-names) --- Info about the destinations that MCollective uses.
-* [Transport Connectors](/mcollective/deploy/middleware/activemq.html#transport-connectors) --- URL structure for insecure and TLS transports.
-* [TLS Credentials](/mcollective/deploy/middleware/activemq.html#tls-credentials) --- For use with TLS transports.
-* [Authentication](/mcollective/deploy/middleware/activemq.html#authentication-users-and-groups) --- Establishing user accounts and groups.
-* [Authorization](/mcollective/deploy/middleware/activemq.html#authorization-group-permissions) --- Limiting access to destinations based on group membership.
-* [Destination Filtering](/mcollective/deploy/middleware/activemq.html#destination-filtering) --- Preventing certain messages from crossing between datacenters.
-
-
-
-## Configuring Security in MCollective
-
-MCollective clients and servers need security credentials that line up with ActiveMQ's expectations. Specifically:
-
-* [An ActiveMQ username and password][mcollective_username]
-* [TLS credentials, if necessary][mcollective_tls]
-
diff --git a/website/reference/integration/activemq_ssl.md b/website/reference/integration/activemq_ssl.md
deleted file mode 100644 (file)
index ea9a90d..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
----
-layout: default
-title: ActiveMQ TLS
-toc: false
----
-
-[keystores]: /mcollective/deploy/middleware/activemq_keystores.html
-[sslcontext]: /mcollective/deploy/middleware/activemq.html#tls-credentials
-[transport]: /mcollective/deploy/middleware/activemq.html#transport-connectors
-
-[activemq_connector]: /mcollective/reference/plugins/connector_activemq.html
-[ssl_security]: /mcollective/reference/plugins/security_ssl.html
-[aes_security]: /mcollective/reference/plugins/security_aes.html
-
-You can configure MCollective and ActiveMQ to do end-to-end encryption over TLS. This allows you to use MCollective's fast and efficient [SSL security plugin][ssl_security] instead of the slow and hard to configure [AES security plugin][aes_security]. 
-
-There are two main approaches:
-
-* [CA-verified TLS](#ca-verified-tls) encrypts traffic, and also lets you restrict middleware connections --- only nodes with valid certificates from the site's CA can connect.
-* [Anonymous TLS](#anonymous-tls) encrypts messages to prevent casual traffic sniffing, and will prevent the passwords MCollective uses to connect to ActiveMQ from being stolen. However, it doesn't check whether nodes are allowed to connect, so you have to trust your username and password security.
-
-This feature requires:
-
-* MCollective 2.0.0 or newer
-* ActiveMQ 5.5.0 or newer
-* Stomp gem 1.2.2 or newer
-* The [activemq connector][activemq_connector] plugin (included with MCollective 2.0.0 and newer)
-
-## CA-Verified TLS
-
-**(Recommended For Most Users)**
-
-### Summary
-
-This approach configures MCollective and ActiveMQ to only accept connections when the peer has a certificate signed by the site's CA. 
-
-**Benefits:**
-
-This approach gives extra security, and your MCollective servers will generally already have the credentials they need since you can re-use Puppet certificates.
-
-**Drawbacks:**
-
-You will need to go out of your way to issue keys and certificates to your admin users, which is an extra step when onboarding a new admin.
-
-
-### Step 1: Configure ActiveMQ to Use TLS
-
-Do the following steps to get ActiveMQ configured:
-
-* Follow [the ActiveMQ keystores guide][keystores] to create Java keystores for ActiveMQ.
-* [Configure activemq.xml's `<sslContext>` element to point at the keystores.][sslcontext]
-* [Configure the proper URIs in the broker's transport connectors.][transport]
-* Restart ActiveMQ.
-
-At this point, MCollective servers and clients should be unable to connect to ActiveMQ, since they do not yet have credentials configured.
-
-### Step 2: Configure MCollective Servers
-
-For the MCollective daemon you can use your existing Puppet certificates by editing the _server.cfg_ file:
-
-{% highlight ini %}
-connector = activemq
-# Optional:
-# plugin.activemq.base64 = yes
-plugin.activemq.pool.size = 1
-plugin.activemq.pool.1.host = stomp.example.com
-plugin.activemq.pool.1.port = 61614
-plugin.activemq.pool.1.user = mcollective
-plugin.activemq.pool.1.password = secret
-plugin.activemq.pool.1.ssl = true
-plugin.activemq.pool.1.ssl.ca = /var/lib/puppet/ssl/ca/ca_crt.pem
-plugin.activemq.pool.1.ssl.key = /var/lib/puppet/ssl/private_keys/<NAME>.pem
-plugin.activemq.pool.1.ssl.cert = /var/lib/puppet/ssl/certs/<NAME>.pem
-{% endhighlight %}
-
-* Set the correct paths to each node's private key and certificate; they will be named after the node's Puppet certname and located in the ssldir.
-    * You can locate a node's private key by running `sudo puppet agent --configprint hostprivkey`, the certificate with `sudo puppet agent --configprint hostcert`, and the CA certificate with `sudo puppet agent --configprint localcacert`.
-* Set the correct username and password.
-
-### Step 3: Configure MCollective Clients
-
-Each client will now need a TLS certificate issued by the Puppet CA in order to be able to
-connect to the ActiveMQ:
-
-{% highlight bash %}
-# puppet cert generate ripienaar
-notice: ripienaar has a waiting certificate request
-notice: Signed certificate request for ripienaar
-notice: Removing file Puppet::SSL::CertificateRequest ripienaar at '/var/lib/puppet/ssl/ca/requests/ripienaar.pem'
-notice: Removing file Puppet::SSL::CertificateRequest ripienaar at '/var/lib/puppet/ssl/certificate_requests/ripienaar.pem'
-{% endhighlight %}
-
-Copy the certificates to your user:
-
-{% highlight bash %}
-# mkdir /home/rip/.mcollective.d
-# cp /var/lib/puppet/ssl/ca/ca_crt.pem /home/rip/.mcollective.d/
-# cp /var/lib/puppet/ssl/private_keys/ripienaar.pem /home/rip/.mcollective.d/ripienaar-private.pem
-# cp /var/lib/puppet/ssl/public_keys/ripienaar.pem /home/rip/.mcollective.d/ripienaar.pem
-# cp /var/lib/puppet/ssl/certs/ripienaar.pem /home/rip/.mcollective.d/ripienaar-cert.pem
-# chown -R rip:rip /home/rip/.mcollective.d
-{% endhighlight %}
-
-You can now configure the mcollective client config in _/home/rip/.mcollective_ to use these:
-
-{% highlight ini %}
-connector = activemq
-# Optional:
-# plugin.activemq.base64 = yes
-plugin.activemq.pool.size = 1
-plugin.activemq.pool.1.host = stomp.example.com
-plugin.activemq.pool.1.port = 61614
-plugin.activemq.pool.1.user = ripienaar
-plugin.activemq.pool.1.password = secret
-plugin.activemq.pool.1.ssl = true
-plugin.activemq.pool.1.ssl.ca = /home/rip/.mcollective.d/ca_crt.pem
-plugin.activemq.pool.1.ssl.key = /home/rip/.mcollective.d/ripienaar-private.pem
-plugin.activemq.pool.1.ssl.cert = /home/rip/.mcollective.d/ripienaar-cert.pem
-{% endhighlight %}
-
-If you are using the SSL security plugin, you can use these same files by setting `/home/rip/.mcollective.d/ripienaar.pem` as the public key.
-
-### Finish: Verify Encryption
-
-If you want to be sure of this, you should now verify with tcpdump or wireshark that the connection and traffic
-really is all encrypted.
-
-### Troubleshooting Common Errors
-
-You will get some obvious errors from this code if any files are missing, but the errors from SSL validation will be pretty
-hard to understand.
-
-There are two main scenarios where ActiveMQ will reject an MCollective conneciton:
-
-#### MCollective Uses Wrong CA to Verify ActiveMQ Cert
-
-When the client connects using a CA set in _plugin.activemq.pool.1.ssl.ca_ that does not match the one
-in the ActiveMQ _truststore.jks_:
-
-{% highlight console %}
-failed: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
-{% endhighlight %}
-
-And in the ActiveMQ log:
-
-{% highlight console %}
-Transport failed: javax.net.ssl.SSLHandshakeException: Received fatal alert: unknown_ca
-{% endhighlight %}
-
-#### MCollective Certs Aren't Signed by the Right CA
-
-When your client has the correct CA but his certificates are not signed by that CA:
-
-{% highlight console %}
-failed: SSL_connect returned=1 errno=0 state=SSLv3 read finished A: sslv3 alert certificate unknown
-{% endhighlight %}
-
-And in the ActiveMQ log:
-
-{% highlight console %}
-sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
-{% endhighlight %}
-
-
-
-
-
-## Anonymous TLS
-
-**(Less Recommended)**
-
-### Summary
-
-This approach configures MCollective and ActiveMQ to encrypt traffic via TLS, but accept connections from anyone.
-
-**Benefits:**
-
-This approach requires less configuration, especially when adding new admin users.
-
-**Drawbacks:**
-
-This approach has some relative security drawbacks. Depending on your site's security needs, these may not concern you --- since MCollective's application-level security plugins will prevent an attacker from issuing agent commands and owning your servers, attacks like those below would only result in denial of service plus some leakage of inventory data via lower-level discovery protocols.
-
-* Although attackers can't sniff MCollective's ActiveMQ passwords, there's nothing to prevent them from logging in if they steal a password through some other means. (With CA-verified TLS, on the other hand, they would also require a private key and certificate, which provides some additional security depth.)
-* An attacker able to run a man-in-the-middle attack at your site could fool your MCollective servers into trusting a malicious ActiveMQ server. 
-
-
-### Step 1: Configure ActiveMQ to Use Anonymous TLS
-
-* Follow [the ActiveMQ keystores guide][keystores] to create a Java keystore for ActiveMQ. _You can skip the truststore._ 
-* [Configure activemq.xml's `<sslContext>` element to point at the keystore.][sslcontext] _You can skip the `trustStore` and `trustStorePassword` attributes._
-* [Configure the proper URIs in the broker's transport connectors][transport], but _leave off the `?needClientAuth=true` portion._
-* Restart ActiveMQ.
-
-
-### Step 2: Configure MCollective Servers and Clients
-
-Set the following settings in the `server.cfg` and `client.cfg` (or `~/.mcollective`) files:
-
-{% highlight ini %}
-connector = activemq
-# Optional:
-# plugin.activemq.base64 = yes
-plugin.activemq.pool.size = 1
-plugin.activemq.pool.1.host = stomp.example.com
-plugin.activemq.pool.1.port = 61614
-plugin.activemq.pool.1.user = mcollective
-plugin.activemq.pool.1.password = secret
-plugin.activemq.pool.1.ssl = true
-plugin.activemq.pool.1.ssl.fallback = true
-{% endhighlight %}
-
-The `plugin.activemq.pool.1.ssl.fallback` setting tells the plugin that it is allowed to:
-
-* Connect to an unverified server
-* Connect without presenting its own SSL credentials
-
-...if it is missing any of the `.ca` `.cert` or `.key` settings or cannot find the files they reference. If the settings _are_ present (and point to correct files), MCollective will try to do a verified connection.
-
-
-### Finish: Verify Encryption
-
-If you want to be sure of this, you should now verify with tcpdump or wireshark that the connection and traffic
-really is all encrypted.
diff --git a/website/reference/integration/chef.md b/website/reference/integration/chef.md
deleted file mode 100644 (file)
index 993c46d..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
----
-layout: default
-title: Using With Chef
-toc: false
----
-[FactsOpsCodeOhai]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/FactsOhai
-
-If you're a Chef user you are supported in both facts and classes filters.
-
-## Facts
-There is a [community plugin to enable Ohai][FactsOpsCodeOhai] as a fact source.
-
-Using this plugin Ohai facts will be converted from:
-
-{% highlight javascript %}
-  "languages": {
-    "java": {
-      "runtime": {
-        "name": "OpenJDK  Runtime Environment",
-        "build": "1.6.0-b09"
-      },
-      "version": "1.6.0"
-    },
-{% endhighlight %}
-
-to:
-
-{% highlight ruby %}
- "languages.java.version"=>"1.6.0",
- "languages.java.runtime.name"=>"OpenJDK  Runtime Environment",
- "languages.java.runtime.build"=>"1.6.0-b09",
-{% endhighlight %}
-
-So you can use the flattened versions of the information provided by Ohai in filters, reports etc.
-
-{% highlight console %}
-% mco find --with-fact languages.java.version=1.6.0
-{% endhighlight %}
-
-## Class Filters
-Chef does not provide a list of roles and recipes that has been applied to a node, to use with MCollective you need to create such a list.
-
-It's very easy with Chef to do this in a simple cookbook.  Put the following code in a cookbook and arrange for it to run *last* on your node.
-
-This will create a list of all roles and recipes in _/var/tmp/chefnode.txt_ on each node for us to use:
-
-{% highlight ruby %}
-ruby_block "store node data locally" do
-  block do
-    state = File.open("/var/tmp/chefnode.txt", "w")
-
-    node.run_state[:seen_recipes].keys.each do |recipe|
-        state.puts("recipe.#{recipe}")
-    end
-
-    node.run_list.roles.each do |role|
-        state.puts("role.#{role}")
-    end
-
-    state.close
-  end
-end
-{% endhighlight %}
-
-You should configure MCollective to use this file by putting the following in your _server.cfg_
-
-{% highlight ini %}
-classesfile = /var/tmp/chefnode.txt
-{% endhighlight %}
-
-You can now use your roles and recipe lists in filters:
-
-{% highlight console %}
-% mco find --with-class role.webserver --with-class /apache/
-{% endhighlight %}
diff --git a/website/reference/integration/puppet.md b/website/reference/integration/puppet.md
deleted file mode 100644 (file)
index b7933c2..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
----
-layout: default
-title: Using with Puppet
-toc: false
----
-[FactsRLFacter]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/FactsFacterYAML
-[PluginSync]: http://docs.reductivelabs.com/guides/plugins_in_modules.html
-[AgentPuppetd]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/AgentPuppetd
-[AgentPuppetca]: http://github.com/puppetlabs/mcollective-plugins/tree/master/agent/puppetca/
-[AgentPuppetRal]: http://github.com/puppetlabs/mcollective-plugins/tree/master/agent/puppetral/
-[PuppetCommander]: http://github.com/puppetlabs/mcollective-plugins/tree/master/agent/puppetd/commander/
-[RapidRuns]: http://www.devco.net/archives/2010/08/05/rapid_puppet_runs_with_mcollective.php
-[EC2Bootstrap]: http://www.devco.net/archives/2010/07/14/bootstrapping_puppet_on_ec2_with_mcollective.php
-[PuppetRalBlog]: http://www.devco.net/archives/2010/07/07/puppet_resources_on_demand.php
-[SchedulingPuppet]: http://www.devco.net/archives/2010/03/17/scheduling_puppet_with_mcollective.php
-[ManagingPuppetd]: http://www.devco.net/archives/2009/11/30/managing_puppetd_with_mcollective.php
-[CloudBootstrap]: http://vuksan.com/blog/2010/07/28/bootstraping-your-cloud-environment-with-puppet-and-mcollective/
-[ServiceAgent]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/AgentService
-[PackageAgent]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/AgentPackage
-[Facter2YAML]: http://www.semicomplete.com/blog/geekery/puppet-facts-into-mcollective.html
-
-If you're a Puppet user you are supported in both facts and classes filters.
-
-There are a number of community plugins related to Puppet:
-
- * Manage the Puppetd, request runs, enable and disable - [AgentPuppetd]
- * Manage the Puppet CA, sign, list and revoke certificates - [AgentPuppetca]
- * Use the Puppet Ral to create resources on demand, a distributed *ralsh* - [AgentPuppetRal]
- * Schedule your puppetd's controlling concurrency and resource usage - [PuppetCommander]
- * The [ServiceAgent] and [PackageAgent] use the Puppet RAL to function on many operating systems
-
-There are also several blog posts related to Puppet and MCollective:
-
- * Running puppet on a number of nodes as quick as possible - [RapidRuns]
- * Bootstrapping a Puppet + EC2 environment with Puppet - [EC2Bootstrap]
- * Using the Puppet RAL with MCollective - [PuppetRalBlog]
- * General scheduling of Puppet Runs - [SchedulingPuppet]
- * Managing Puppetd - [ManagingPuppetd]
- * Bootstrapping your cloud environment - [CloudBootstrap]
-
-## Facts
-There is a [community plugin to enable Facter][FactsRLFacter] as a fact source.
-
-So you can use the facts provided by Facter in filters, reports etc.
-
-{% highlight console %}
-$ mco find --with-fact lsbdistrelease=5.4
-{% endhighlight %}
-
-This includes facts pushed out with [Plugin Sync][PluginSync].
-
-A less resource intensive approach has can be found [here][Facter2YAML], it converts the Puppet scope into a YAML file that the YAML fact source then loads.  This is both less resource intensive and much faster.
-
-## Class Filters
-Puppet provides a list of classes applied to a node by default in */var/puppet/state/classes.txt* or */var/lib/puppet/state/classes.txt* (depending on which Puppet version you are using. The latter is true for 0.25.5 onwards) , we'll use this data with *--with-class* filters.
-
-You should configure MCollective to use this file by putting the following in your *server.cfg*
-
-
-{% highlight ini %}
-classesfile = /var/lib/puppet/classes.txt
-{% endhighlight %}
-
-or if using Puppet 0.23.0 and onwards
-
-{% highlight ini %}
-classesfile = /var/lib/puppet/state/classes.txt
-{% endhighlight %}
-
-You can now use your classes lists in filters:
-
-{% highlight console %}
-$ mco find --with-class /apache/
-{% endhighlight %}
diff --git a/website/reference/plugins/aggregate.md b/website/reference/plugins/aggregate.md
deleted file mode 100644 (file)
index 3fca4d1..0000000
+++ /dev/null
@@ -1,369 +0,0 @@
----
-layout: default
-title: Aggregate Plugins
----
-[DDL]: /mcollective/reference/plugins/ddl.html
-[Examples]: https://github.com/puppetlabs/marionette-collective/tree/master/plugins/mcollective/aggregate
-
-## Overview
-MCollective Agents return data and we try to provide as much usable user
-interface for free. To aid in this we require agents to have [DDL] files that
-describe the data that the agent returns.
-
-DDL files are used to configure the client but also to assist with user
-interface generation.  They are used to ask questions that an action needs but
-also to render the results when the replies come in.  For example we turn
-*:freecpu* into "Free CPU" when displaying the data based on the DDL.
-
-Previously if data that agents returned required any summarization this had to
-be done using a custom application.  Here is an example from *mco nrpe*:
-
-{% highlight console %}
-% mco nrpe check_load
-.
-.
-Finished processing 25 / 25 hosts in 556.48 ms
-
-              OK: 25
-         WARNING: 0
-        CRITICAL: 0
-         UNKNOWN: 0
-{% endhighlight %}
-
-Here to get the summary of results displayed in a way that has contextual
-relevance to the nrpe plugin a custom application had to be written and anyone
-who interacts with the agent using other RPC clients would not get the benefit
-of this summary.
-
-By using aggregate plugins and updating the DDL we can now provide such a
-summary in all result sets and display it using the *mco rpc* application and
-any calls to *printrpc*.
-
-{% highlight console %}
-% mco rpc nrpe runcommand command=check_load
-Discovering hosts using the mongo method .... 25
-
- * [============================================================> ] 25 / 25
-
-Summary of Exit Code:
-
-            OK : 25
-       WARNING : 0
-       UNKNOWN : 0
-      CRITICAL : 0
-
-
-Finished processing 25 / 25 hosts in 390.70 ms
-{% endhighlight %}
-
-Here you get a similar summary as before, all that had to be done was a simple
-aggregate plugin be written and distributed with your clients.
-
-The results are shown as above using *printrpcstats* but you can also get access to
-the raw data so you can decide to render it in some other way - perhaps using a
-graph on a web interface.
-
-We provide a number of aggregate plugins with MCollective and anyone can write
-more.
-
-For examples that already use functions see the *rpcutil* agent - its
-*collective_info*, *get_fact*, *daemon_stats* and *get_config_item* actions all
-have summaries applied.
-
-*NOTE:* This feature is available since version 2.1.0
-
-## Using existing plugins
-
-### Updating the DDL
-At present MCollective supplies 3 plugins *average()*, *summary()* and *sum()*
-you can use these in any agent, here is an example from the *rpcutil* agent DDL
-file:
-
-{% highlight ruby %}
-action "get_config_item", :description => "Get the active value of a specific config property" do
-    output :value,
-           :description => "The value that is in use",
-           :display_as => "Value"
-
-    summarize do
-        aggregate summary(:value)
-    end
-end
-{% endhighlight %}
-
-We've removed a few lines from this example DDL block leaving only the relevant
-lines.  You can see the agent outputs data called *:value* and we reference that
-output in the summary function *summary(:value)*, the result would look like
-this:
-
-### Viewing summaries on the CLI
-{% highlight console %}
-% mco rpc rpcutil get_config_item item=collectives
-.
-.
-dev8
-   Property: collectives
-      Value: ["mcollective", "uk_collective"]
-
-Summary of Value:
-
-      mcollective = 25
-    uk_collective = 15
-    fr_collective = 9
-    us_collective = 1
-
-Finished processing 25 / 25 hosts in 349.70 ms
-{% endhighlight %}
-
-You can see that the value in this case contains arrays, the *summary()*
-function produce the table in the output showing the data distribution.
-
-### Producing summaries in your own clients
-You can enable the same display in your own code, here is ruby code that has the
-same affect as the CLI call above:
-
-{% highlight ruby %}
-require 'mcollective'
-
-include MCollective::RPC
-
-c = rpcclient("rpcutil")
-
-printrpc c.get_config_item(:item => "collectives")
-
-printrpcstats :summarize => true
-{% endhighlight %}
-
-Without passing in the *:summarize => true* you would not see the summaries
-
-### Getting access to the raw summary results
-If you wanted to do something else entirely like produce a graph on a web page
-of the summaries you can get access to the raw data, here's some ruby code to
-show all computed summaries:
-
-{% highlight ruby %}
-require 'mcollective'
-
-include MCollective::RPC
-
-c = rpcclient("rpcutil")
-c.progress = false
-
-c.get_config_item(:item => "collectives")
-
-c.stats.aggregate_summary.each do |summary|
-  puts "Summary of type: %s" % summary.result_type
-  puts "Display format: '%s'" % summary.aggregate_format
-  puts
-  pp summary.result
-end
-{% endhighlight %}
-
-As you can see you will get an array of summaries this is because each DDL can
-use many aggregate calls, this would be an array of all the computed summaries:
-
-{% highlight console %}
-Summary of type: collection
-Display format: '%13s = %s'
-
-{:type=>:collection,
- :value=>
-  {"mcollective"=>25,
-   "fr_collective"=>9,
-   "us_collective"=>1,
-   "uk_collective"=>15},
- :output=>:value}
-{% endhighlight %}
-
-There are 2 types of result *:collection* and *:numeric*, in the case of numeric
-results the :value would just be a number.
-
-The *aggregate_format* is either a user supplied format or a dynamically
-computed format to display the summary results on the console.  In this case
-each pair of the hash should be displayed using the format to produce a nice
-right justified list of keys and values.
-
-## Writing your own function
-We'll cover writing your own function by looking at the Nagios one from earlier
-in this example.  You can look at [the functions supplied with
-MCollective][Examples] for more examples using other types than the one below.
-
-First lets look at the DDL for the existing *nrpe* Agent:
-
-{% highlight ruby %}
-action "runcommand", :description => "Run a NRPE command" do
-    input :command,
-          :prompt      => "Command",
-          :description => "NRPE command to run",
-          :type        => :string,
-          :validation  => '\A[a-zA-Z0-9_-]+\z',
-          :optional    => false,
-          :maxlength   => 50
-
-    output :output,
-           :description => "Output from the Nagios plugin",
-           :display_as  => "Output",
-           :default     => ""
-
-    output :exitcode,
-           :description  => "Exit Code from the Nagios plugin",
-           :display_as   => "Exit Code",
-           :default      => 3
-
-    output :perfdata,
-           :description  => "Performance Data from the Nagios plugin",
-           :display_as   => "Performance Data",
-           :default      => ""
-end
-{% endhighlight %}
-
-You can see it will return an *:exitcode* item and from the default value you
-can gather this is going to be a number.  Nagios defines 4 possibly exit codes
-for a Nagios plugin and we need to convert this *:exitcode* into a string like
-WARNING, CRITICAL, UNKNOWN or OK.
-
-Usually when writing any kind of summarizer for an array of results your code
-might contain 3 phases.
-
-Given a series of Nagios results like this:
-
-{% highlight ruby %}
-[
- {:exitcode => 0, :output => "OK", :perfdata => ""},
- {:exitcode => 2, :output => "failure", :perfdata => ""}
-]
-{% endhighlight %}
-
-You would write a nagios_states() function that does roughly this:
-
-{% highlight ruby %}
-def nagios_states(results)
-  # set initial values
-  result = {}
-  status_map = ["OK", "WARNING", "CRITICAL", "UNKNOWN"]
-  status_map.each {|s| result[s] = 0}
-
-  # loop over all the data, increment the count for OK etc
-  results.each do |result|
-    status = status_map[result[:exitcode]]
-    result[status] += 1
-  end
-
-  # return the result hash, {"OK" => 1, "CRITICAL" => 1, "WARN" => 0, "UNKNOWN" => 0}
-  return result
-end
-{% endhighlight %}
-
-You could optimise the code but you can see there are 3 major stages in the life
-of this code.
-
- * Set initial values for the return data
- * Loop the data building up the state
- * Return the data.
-
-Given this, here is our Nagios exitcode summary function, it is roughly the same
-code with a bit more boiler plate to plugin into mcollective, but the same code
-can be seen:
-
-{% highlight ruby %}
-module MCollective
-  class Aggregate
-    class Nagios_states<Base
-      # Before function is run processing
-      def startup_hook
-        # :collection or :numeric
-        @result[:type] = :collection
-
-        # set default aggregate_format if it is undefined
-        @aggregate_format = "%10s : %s" unless @aggregate_format
-
-        @result[:value] = {}
-
-        @status_map = ["OK", "WARNING", "CRITICAL", "UNKNOWN"]
-        @status_map.each {|s| @result[:value][s] = 0}
-
-      end
-
-      # Determines the average of a set of numerical values
-      def process_result(value, reply)
-        if value
-          status = @status_map[value]
-          @result[:value][status] += 1
-        else
-          @result["UNKNOWN"] += 1
-        end
-      end
-
-      # Post processing hook that returns the summary result
-      def summarize
-        result_class(@result[:type]).new(@result, @aggregate_format, @action)
-      end
-    end
-  end
-end
-{% endhighlight %}
-
-This shows that an aggregate function has the same 3 basic parts.  First we set
-the initial state using the *startup_hook*.  We then process each result as it
-comes in from the network using *process_result*.  Finally we turn that into a
-the result objects that you saw earlier in the ruby client examples using the
-*summarize* method.
-
-### *startup_hook*
-Each function needs a startup hook, without one you'll get exceptions.  The
-startup hook lets you set up the initial state.
-
-The first thing to do is set the type of result this will be.  Currently we
-support 2 types of result either a plain number indicated using *:numeric* or a
-complex *:collection* type that can be a hash with keys and values.
-
-Functions can take display formats in the DDL, in this example we set
-*@aggregate_format* to a *printf* default that would display a table of results
-but we still let the user supply his own format.
-
-We then just initialize the result hash to and build a map from the English
-representation of the Nagios status codes.
-
-### *process_result*
-Every reply that comes in from the network gets passed into your
-*process_result* method.  The first argument will be just the single value the
-DDL indicates you are interested in but you'll also get the whole rely so you
-can get access to other reply values and such.
-
-This gets called each time, we just look at the value and increment each Nagios
-status or treat it as an unknown - in case the result data is missformed.
-
-### *summarize*
-The summarize method lets you take the state you built up and convert that into
-an answer.  The summarize method is optional what you see here is the default
-action if you do not supply one.
-
-The *result_class* method accepts either *:collection* or *:numeric* as
-arguments and it is basically a factory for the correct result structure.
-
-### Deploy and update the DDL
-You should deploy this function into your *libdir/aggregate* directory called
-*nagios_states.rb* on the client machines - no harm deploying it everywhere
-though.
-
-Update the DDL so it looks like:
-
-{% highlight ruby %}
-action "runcommand", :description => "Run a NRPE command" do
-    .
-    .
-    .
-
-    if respond_to?(:summarize)
-        summarize do
-            aggregate nagios_states(:exitcode)
-        end
-    end
-end
-{% endhighlight %}
-
-Add the last few lines - we check that we're running in a version of MCollective
-that supports this feature and then we call our function with the *:exitcode*
-results.
-
-
diff --git a/website/reference/plugins/application.md b/website/reference/plugins/application.md
deleted file mode 100644 (file)
index 14e3f8d..0000000
+++ /dev/null
@@ -1,308 +0,0 @@
----
-layout: default
-title: Single Executable Application Plugin
----
-[Clients]: ../../simplerpc/clients.html
-[SimpleRPCAgents]: ../../simplerpc/agents.html
-
-
-## Overview
-The Marionette Collective 1.1.1 and newer supports a single executable - called
-mco - and have a plugin type called application that lets you create
-applications for this single executable.
-
-In the past we tended to write small standalone scripts to interact with
-MCollective, this had a number of issues:
-
- * Large number of executables in _/usr/sbin_
- * Applications behave inconsistently with regard to error handling and reporting
- * Discovering new applications is difficult since they are all over the filesystem
- * Installation and packaging of plugins is complex
-
-We've attempted to address these concerns by creating a single point of access
-for all applications - the _mco_ script - with unified help, error reporting and
-option parsing.
-
-Below you can see the single executable system in use:
-
-{% highlight console %}
-The Marionette Collective version 2.0.0
-
-usage: /usr/bin/mco: command <options>
-
-Known commands:
-
-   cap                  controller           exim
-   facts                filemgr              find
-   help                 inventory            iptables
-   nettest              nrpe                 package
-   pgrep                ping                 plugin
-   puppetd              rpc                  service
-   virt
-
-Type 'mco help' for a detailed list of commands and 'mco help command'
-to get detailed help for a command
-
-{% endhighlight %}
-
-{% highlight console %}
-$ mco help
-The Marionette Collection version 2.0.0
-
-  facts           Reports on usage for a specific fact
-  filemgr         Generic File Manager Client
-  find            Find hosts matching criteria
-  help            Application list and RPC agent help
-  inventory       Shows an inventory for a given node
-  ping            Ping all nodes
-  rpc             Generic RPC agent client application
-{% endhighlight %}
-
-{% highlight console %}
-$ mco rpc package status package=zsh
-Determining the amount of hosts matching filter for 2 seconds .... 51
-
- * [ ============================================================> ] 51 / 51
-
-
- test.com:
-    Properties:
-       {:provider=>:yum,
-       :release=>"3.el5",
-       :arch=>"x86_64",
-       :version=>"4.2.6",
-       :epoch=>"0",
-       :name=>"zsh",
-       :ensure=>"4.2.6-3.el5"}
-{% endhighlight %}
-
-These applications are equivalent to the old mc-rpc and similar applications but without the problem of lots of files in _/usr/sbin_.
-
-## Basic Application
-Applications goes in _libdir/mcollective/application/echo.rb_, the one below is a simple application that speaks to a hypothetical _echo_ action of a _helloworld_ agent. This agent has been demonstrated in : writing [agents][SimpleRPCAgents].
-
-{% highlight ruby %}
-class MCollective::Application::Echo<MCollective::Application
-   description "Reports on usage for a specific fact"
-
-   option :message,
-          :description    => "Message to send",
-          :arguments      => ["-m", "--message MESSAGE"],
-          :type           => String,
-          :required       => true
-
-   def main
-      mc = rpcclient("helloworld")
-
-      printrpc mc.echo(:msg => configuration[:message], :options => options)
-
-      printrpcstats
-   end
-end
-{% endhighlight %}
-
-Here's the application we wrote in action:
-
-{% highlight console %}
-$ mco echo
-The message option is mandatory
-
-Please run with --help for detailed help
-{% endhighlight %}
-
-{% highlight console %}
-$ mco echo -m test
-
- * [ ============================================================> ] 1 / 1
-
-
-example.com
-   Message: test
-      Time: Mon Jan 31 21:27:03 +0000 2011
-
-
-Finished processing 1 / 1 hosts in 68.53 ms
-{% endhighlight %}
-
-Most of the techniques documented in SimpleRPC [Clients] can be reused here, we've just simplified a lot of the common used patterns like CLI arguments and incorporated it all in a single framework.
-
-## Reference
-
-### Usage Messages
-
-To add custom usage messages to your application we can add lines like this:
-
-{% highlight ruby %}
-class MCollective::Application::Echo<MCollective::Application
-   description "Reports on usage for a specific fact"
-
-   usage "mco echo [options] --message message"
-end
-{% endhighlight %}
-
-You can add several of these messages by just adding multiple such lines.
-
-### Application Options
-
-A standard options hash is available simply as options you can manipulate it and pass it into the RPC Client like normal. See the SimpleRPC [Clients] reference for more on this.
-
-### CLI Argument Parsing
-
-There are several options available to assist in parsing CLI arguments. The most basic option is:
-
-{% highlight ruby %}
-class MCollective::Application::Echo<MCollective::Application
-   option :message,
-          :description    => "Message to send",
-          :arguments      => ["-m", "--message MESSAGE"]
-end
-{% endhighlight %}
-
-In this case if the user used either _-m message_ or _--message message_ on the CLI the desired message would be in _configuration`[`:message`]`_
-
-#### Required Arguments
-You can require that a certain parameter is always passed:
-
-{% highlight ruby %}
-option :message,
-  :description    => "Message to send",
-  :arguments      => ["-m", "--message MESSAGE"],
-  :required       => true
-{% endhighlight %}
-
-#### Argument data types
-CLI arguments can be forced to a specific type, we also have some additional special types that the default ruby option parser cant handle on its own.
-
-You can force data to be of type String, Fixnum etc:
-
-{% highlight ruby %}
-option :count,
-  :description    => "Count",
-  :arguments      => ["--count MESSAGE"],
-  :type           => Fixnum
-{% endhighlight %}
-
-You can force an argument to be boolean:
-
-{% highlight ruby %}
-option :detail,
-  :description    => "Detailed view",
-  :arguments      => ["--detail"],
-  :type           => :bool
-{% endhighlight %}
-
-If you have an argument that can be called many times you can force that to build an array:
-
-{% highlight ruby %}
-option :args,
-  :description    => "Arguments",
-  :arguments      => ["--argument ARG"],
-  :type           => :array
-{% endhighlight %}
-
-Here if you supplied multiple arguments _configuration`[`:args`]`_ will be an array with all the options supplied.
-
-#### Argument validation
-You can validate input passed on the CLI:
-
-{% highlight ruby %}
-option :count,
-  :description    => "Count",
-  :arguments      => ["--count MESSAGE"],
-  :type           => Fixnum,
-  :validate       => Proc.new {|val| val < 10 ? true : "The message count has to be below 10" }
-{% endhighlight %}
-
-Should the supplied value be 10 or more a error message will be displayed.
-
-#### Disabling standard sections of arguments
-By default every Application get all the RPC options enabling filtering, discovery etc.  In some cases this is undesirable so we let users disable those.
-
-{% highlight ruby %}
-class MCollective::Application::Echo<MCollective::Application
-   exclude_argument_sections "common", "filter", "rpc"
-end
-{% endhighlight %}
-
-This application will only have --help, --verbose and --config as options, all the other options will be removed.
-
-#### Post argument parsing hook
-Right after all arguments are parsed you can have a hook in your program called, this hook could perhaps parse the remaining data on _ARGV_ after option parsing is complete.
-
-{% highlight ruby %}
-class MCollective::Application::Echo<MCollective::Application
-   description "Reports on usage for a specific fact"
-
-   def post_option_parser(configuration)
-      unless ARGV.empty?
-         configuration[:message] = ARGV.shift
-      else
-         STDERR.puts "Please specify a message on the command line"
-         exit 1
-      end
-   end
-
-   def main
-      # use configuration[:message] here to access the message
-   end
-end
-{% endhighlight %}
-
-#### Validating configuration
-After the options are parsed and the post hook is called you can validate the contents of the configuration:
-
-{% highlight ruby %}
-class MCollective::Application::Echo<MCollective::Application
-   description "Reports on usage for a specific fact"
-
-   # parse the first argument as a message
-   def post_option_parser(configuration)
-      configuration[:message] = ARGV.shift unless ARGV.empty?
-   end
-
-   # stop the application if we didnt receive a message
-   def validate_configuration(configuration)
-      raise "Need to supply a message on the command line" unless configuration.include?(:message)
-   end
-
-   def main
-      # use configuration[:message] here to access the message
-   end
-end
-{% endhighlight %}
-
-### Exiting your application
-You can use the normal _exit_ Ruby method at any time to exit your application and you can supply any
-exit code as normal.
-
-The supplied applications have a standard exit code convention, if you want your applications to exhibit
-the same behavior use the _halt_ helper.  The exit codes are below:
-
-|Code|Description                                          |
-|----|-----------------------------------------------------|
-|0   |Nodes were discovered and all passed                 |
-|0   |No discovery was done but responses were received    |
-|1   |No nodes were discovered                             |
-|2   |Nodes were discovered but some responses failed      |
-|3   |Nodes were discovered but no responses were received |
-|4   |No discovery were done and no responses were received|
-
-{% highlight ruby %}
-class MCollective::Application::Echo<MCollective::Application
-   description "Reports on usage for a specific fact"
-
-   def main
-      mc = rpcclient("echo")
-
-      printrpc mc.echo(:msg => "Hello World", :options => options)
-
-      printrpcstats
-
-      halt mc.stats
-   end
-end
-{% endhighlight %}
-
-As you can see you pass the _halt_ helper an instance of the RPC Client statistics and it will then
-use that to do the right exit code.
-
diff --git a/website/reference/plugins/connector_activemq.md b/website/reference/plugins/connector_activemq.md
deleted file mode 100644 (file)
index 1456d18..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
----
-layout: default
-title: ActiveMQ Connector
-toc: false
----
-
-[STOMP]: http://stomp.codehaus.org/
-[wildcard]: http://activemq.apache.org/wildcards.html
-[subcollectives]: /reference/basic/subcollectives.html
-[activemq_config]: /mcollective/deploy/middleware/activemq.html
-
-
-The ActiveMQ connector uses the [STOMP][] rubygem to connect to ActiveMQ servers.  It is specifically optimized for ActiveMQ
-and uses features in ActiveMQ 5.5.0 and later.
-
-This plugin requires version _1.2.2_ or newer of the Stomp gem.
-
-## Differences between ActiveMQ connector and Stomp Connector
-
-### Topic and Queue Names
-
-The new connector uses different destination names from the old stomp connector. 
-
-MCollective uses the following destination names. This list uses standard [ActiveMQ destination wildcards][wildcard]. "COLLECTIVE" is the name of the collective being used; by default, this is `mcollective`, but if you are using [subcollectives][], each one is implemented as an equal peer of the default collective.
-
-Topics: 
-
-- `ActiveMQ.Advisory.>` (built-in topics that all ActiveMQ producers and consumers need all permissions on)
-- `COLLECTIVE.*.agent` (for each agent plugin, where the `*` is the name of the plugin)
-
-Queues:
-
-- `COLLECTIVE.nodes` (used for direct addressing; this is a single destination that uses JMS selectors, rather than a group of destinations)
-- `COLLECTIVE.reply.>` (where the continued portion is a request ID)
-
-Note especially that:
-
-* We can now do direct addressing to specific nodes.
-* Replies now go directly to the instigating client instead of being brodcast on a topic. 
-
-This has big impact on overall CPU usage by clients on busy networks, and also optimizes the traffic flow on
-networks with many brokers.
-
-
-## Configuring ActiveMQ
-
-See [the ActiveMQ config reference][activemq_config] for details on configuring ActiveMQ for this connector. As recommended at the top of the reference, you should skim the sections you care about and edit an example config file while reading. 
-
-
-## Configuring MCollective
-
-MCollective clients and servers use the same connector settings, although the value of settings involving credentials will vary.
-
-### Failover Pools
-
-A sample configuration can be seen below.  Note this plugin does not support the old style config of the Stomp connector.
-
-{% highlight ini %}
-connector = activemq
-plugin.activemq.pool.size = 2
-plugin.activemq.pool.1.host = stomp1
-plugin.activemq.pool.1.port = 61613
-plugin.activemq.pool.1.user = me
-plugin.activemq.pool.1.password = secret
-
-plugin.activemq.pool.2.host = stomp2
-plugin.activemq.pool.2.port = 61613
-plugin.activemq.pool.2.user = me
-plugin.activemq.pool.2.password = secret
-{% endhighlight %}
-
-This gives it 2 servers to attempt to connect to, if the first one fails it will use the second.  Usernames and passwords can be set
-with the environment variables `STOMP_USER`, `STOMP_PASSWORD`.
-
-If you do not specify a port it will default to _61613_
-
-You can also specify the following options for the Stomp gem, these are the defaults in the Stomp gem: <!-- last checked: v. 1.1.6 of the gem -->
-
-{% highlight ini %}
-plugin.activemq.initial_reconnect_delay = 0.01
-plugin.activemq.max_reconnect_delay = 30.0
-plugin.activemq.use_exponential_back_off = true
-plugin.activemq.back_off_multiplier = 2
-plugin.activemq.max_reconnect_attempts = 0
-plugin.activemq.randomize = false
-plugin.activemq.timeout = -1
-{% endhighlight %}
-
-### Message Priority
-
-ActiveMQ messages support priorities, you can pass in the needed priority header by setting:
-
-{% highlight ini %}
-plugin.activemq.priority = 4
-{% endhighlight %}
diff --git a/website/reference/plugins/connector_rabbitmq.md b/website/reference/plugins/connector_rabbitmq.md
deleted file mode 100644 (file)
index fba83ab..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
----
-layout: default
-title: RabbitMQ Connector
-toc: false
----
-[STOMP]: http://stomp.codehaus.org/
-[RabbitStomp]: http://www.rabbitmq.com/stomp.html
-[RabbitCLI]: http://www.rabbitmq.com/management-cli.html
-
-The RabbitMQ connector uses the [STOMP] rubygem to connect to RabbitMQ servers.
-
-This code will only work with version _1.2.2_ or newer of the Stomp gem.
-
-## Differences between RabbitMQ connector and Stomp Connector
-
-The RabbitMQ connector requires MCollective 2.0.0 or newer.
-
-While this plugin still uses the Stomp protocol to connect to RabbitMQ it does use a nubmer of
-RabbitMQ specific optimizations to work well and as such is a Stomp connector specific to the
-RabbitMQ broker.
-
-## Configuring RabbitMQ
-
-Basic installation of the RabbitMQ broker is out of scope for this document apart from the
-basic broker you need to enable the [Stomp plugi][RabbitStomp] and the [CLI Management Tool][RabbitCLI].
-
-With that in place you need to create a few exchanges, topics and queues for each of your
-sub collectives.
-
-First we create a virtual host, user and some permissions on the vhost:
-
-{% highlight console %}
-rabbitmqadmin declare vhost=/mcollective
-rabbitmqadmin declare user=mcollective password=changeme
-rabbitmqadmin declare permission vhost=/mcollective user=mcollective configure=.* write=.* read=.*
-{% endhighlight %}
-
-And then we need to create two exchanges that the mcollective plugin needs:
-
-{% highlight console %}
-rabbitmqadmin declare exchange vhost=/mcollective name=mcollective_broadcast type=topic
-rabbitmqadmin declare exchange vhost=/mcollective name=mcollective_directed type=direct
-{% endhighlight %}
-
-## Configuring MCollective
-
-### Common Options
-
-### Failover Pools
-A sample configuration can be seen below.
-
-{% highlight ini %}
-direct_addressing = 1
-
-connector = rabbitmq
-plugin.rabbitmq.vhost = /mcollective
-plugin.rabbitmq.pool.size = 2
-plugin.rabbitmq.pool.1.host = rabbit1
-plugin.rabbitmq.pool.1.port = 61613
-plugin.rabbitmq.pool.1.user = mcollective
-plugin.rabbitmq.pool.1.password = changeme
-
-plugin.rabbitmq.pool.2.host = rabbit2
-plugin.rabbitmq.pool.2.port = 61613
-plugin.rabbitmq.pool.2.user = mcollective
-plugin.rabbitmq.pool.2.password = changeme
-{% endhighlight %}
-
-This gives it 2 servers to attempt to connect to, if the first one fails it will use the second.  Usernames and passwords can be set
-with the environment variables STOMP_USER, STOMP_PASSWORD.
-
-If you do not specify a port it will default to _61613_
-
-You can also specify the following options for the Stomp gem, these are the defaults in the Stomp 1.2.2 gem:
-
-{% highlight ini %}
-plugin.rabbitmq.initial_reconnect_delay = 0.01
-plugin.rabbitmq.max_reconnect_delay = 30.0
-plugin.rabbitmq.use_exponential_back_off = true
-plugin.rabbitmq.back_off_multiplier = 2
-plugin.rabbitmq.max_reconnect_attempts = 0
-plugin.rabbitmq.randomize = false
-plugin.rabbitmq.timeout = -1
-plugin.rabbitmq.vhost = /
-{% endhighlight %}
diff --git a/website/reference/plugins/connector_stomp.md b/website/reference/plugins/connector_stomp.md
deleted file mode 100644 (file)
index 98eaa7a..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
----
-layout: default
-title: STOMP Connector
-toc: false
----
-[STOMP]: http://stomp.codehaus.org/
-[ConnectorActiveMQ]: /mcollective/reference/plugins/connector_activemq.html
-[ConnectorRabbitMQ]: /mcollective/reference/plugins/connector_rabbitmq.html
-
-*NOTE:* This connector is being deprecated and will not be supported in versions newer than 2.2.x.  Please move to one of the [ConnectorActiveMQ] or [ConnectorRabbitMQ].
-
-The stomp connector uses the [STOMP] rubygem to connect to compatible servers.  This is known to work with ActiveMQ and Stompserver.  Anecdotal evidence suggests it works with RabbitMQ's Stomp plugin.
-
-This code will only work with version _1.1_ and _1.1.6_ or newer of the Stomp gem, the in between versions have threading issues.
-
-As this connector tries to be as generic as possible it is hard to support all the advanced features of MCollective using it.  We do not recommend you use the directed mode
-using this plugin, instead look towards specific ones written for ActiveMQ or your chosen middleware.
-
-## Middleware Layout
-
-For broadcast messages this connector will create _topics_ with names like _/topic/&lt;collective&gt;.&lt;agent&gt;.command_ and replies will go to
-_/topic/&lt;collective&gt;.&lt;agent&gt;.reply_
-
-For directed messages it will create queues with names like _/queue/&lt;collective&gt;.mcollective.&lt;md5 hash of identity&gt;_.
-
-You should configure appropriate ACLs on your middleware to allow this scheme
-
-## Configuring
-
-### Common Options
-The most basic configuration method is supported in all versions of the gem:
-
-{% highlight ini %}
-connector = stomp
-plugin.stomp.base64 = false
-plugin.stomp.host = stomp.my.net
-plugin.stomp.port = 61613
-plugin.stomp.user = me
-plugin.stomp.password = secret
-{% endhighlight %}
-
-You can override all of these settings using environment variables STOMP_SERVER, STOMP_PORT, STOMP_USER, STOMP_PASSWORD.  It is recommended that your _client.cfg_ do not have usernames and passwords in it, users should set their own in the environment.
-
-If you are seeing issues with the Stomp gem logging protocol errors and resetting your connections, especially if you are using Ruby on Rails then set the _plugin.stomp.base64_ to true, this adds an additional layer of encoding on packets to make sure they don't interfere with UTF8 encoding used in Rails.
-
-### Failover Pools
-Newer versions of the Stomp gem supports failover between multiple Stomp servers, you need at least _1.1.6_ to use this.
-
-If you are using version _1.1.9_ and newer of the Stomp Gem and this method of configuration you will also receive more detailed
-logging about connections, failures and other significant events.
-
-{% highlight ini %}
-connector = stomp
-plugin.stomp.pool.size = 2
-plugin.stomp.pool.host1 = stomp1
-plugin.stomp.pool.port1 = 61613
-plugin.stomp.pool.user1 = me
-plugin.stomp.pool.password1 = secret
-
-plugin.stomp.pool.host2 = stomp2
-plugin.stomp.pool.port2 = 61613
-plugin.stomp.pool.user2 = me
-plugin.stomp.pool.password2 = secret
-{% endhighlight %}
-
-This gives it 2 servers to attempt to connect to, if the first one fails it will use the second.  As before usernames and passwords can be set with STOMP_USER, STOMP_PASSWORD.
-
-If you do not specify a port it will default to _6163_
-
-When using pools you can also specify the following options, these are the defaults in the Stomp 1.1.6 gem:
-
-{% highlight ini %}
-plugin.stomp.pool.initial_reconnect_delay = 0.01
-plugin.stomp.pool.max_reconnect_delay = 30.0
-plugin.stomp.pool.use_exponential_back_off = true
-plugin.stomp.pool.back_off_multiplier = 2
-plugin.stomp.pool.max_reconnect_attempts = 0
-plugin.stomp.pool.randomize = false
-plugin.stomp.pool.timeout = -1
-plugin.stomp.pool.connect_timeout = 30
-{% endhighlight %}
-
-### Message Priority
-
-As of version 5.4 of ActiveMQ messages support priorities, you can pass in the needed
-priority header by setting:
-
-{% highlight ini %}
-plugin.stomp.priority = 4
-{% endhighlight %}
diff --git a/website/reference/plugins/data.md b/website/reference/plugins/data.md
deleted file mode 100644 (file)
index e5768e3..0000000
+++ /dev/null
@@ -1,271 +0,0 @@
----
-layout: default
-title: Data Plugins
----
-[DDL]: /mcollective/reference/plugins/ddl.html
-[DiscoveryPlugins]: /mcollective/reference/plugins/discovery.html
-
-## Overview
-Up to MCollective 2.0 the discovery system could only discover against
-installed agents, configuration management classes or facts and the node
-identities. We're extending this to support discovery against many
-sources through a simple plugin system.
-
-*NOTE:* This feature is available since version 2.1.0
-
-The basic idea is that you could do discovery statements like the ones
-below:
-
-{% highlight console %}
-% mco find -S "fstat('/etc/rsyslog.conf').md5=/4edff591f6e38/"
-{% endhighlight %}
-
-{% highlight console %}
-% mco find -S "sysctl('net.ipv4.conf.all.forwarding').value=1"
-{% endhighlight %}
-
-{% highlight console %}
-% mco find -S "sysctl('net.ipv4.conf.all.forwarding').value=1 and % location=dc1"
-{% endhighlight %}
-
-You could also use these data sources in your own agents or other
-plugins:
-
-{% highlight ruby %}
-action "query" do
-   reply[:value] = Data.sysctl(request[:sysctl_name]).value
-end
-{% endhighlight %}
-
-*NOTE:* As opposed to the [DiscoveryPlugins] which are used by the client   
-to communicate to the nodes using direct addressing, data plugins on the other   
-hand refer to data that the nodes can provide, and hence this uses the normal  
-broadcast discovery paradigm.   
-
-These new data sources are plugins so you can provide via the plugin
-system and they require DDL documents.  The DDL will be used on both the
-client and the server to provide strict validation and configuration.
-
-The DDL for these plugins will affect the client libraries in the
-following ways:
-
- * You will get errors if you try to discover using unknown functions
- * Your input argument values will be validated against the DDL
- * You will only be able to use output properties that are known in the DDL
- * If a plugin DDL says it needs 5 seconds to run your discovery and maximum run times will increase by 5 seconds automatically
-
-On the servers the DDL will:
-
- * be used to validate known plugins
- * be used to validate input arguments
- * be used to validate requests for known output values
-
-## Viewing or retrieving results from a data plugin
-
-You can view the output from a data plugin using the *rpcutil* agent:
-
-{% highlight console %}
-% mco rpc rpcutil get_data source=fstat query=/etc/hosts
-.
-.
-your.node.net
-           atime: 2012-06-14 21:41:54
-       atime_age: 54128
-   atime_seconds: 1339706514
-           ctime: 2012-01-18 20:28:34
-       ctime_age: 12842128
-   ctime_seconds: 1326918514
-             gid: 0
-             md5: 54fb6627dbaa37721048e4549db3224d
-            mode: 100644
-           mtime: 2010-01-12 13:28:22
-       mtime_age: 76457740
-   mtime_seconds: 1263302902
-            name: /etc/hosts
-          output: present
-         present: 1
-            size: 158
-            type: file
-             uid: 0
-{% endhighlight %}
-
-The same action can be used to retrieve data programatically.
-
-## Writing a data plugin
-
-### The Ruby logic for the plugin
-The data plugins should not change the system in anyway, you should take
-care to create plugins that only reads the state of the system.  If you
-want to affect the status of the system you should write Agents.
-
-These plugins are kept simple as they will be typed on the command line
-so the following restrictions are present:
-
- * They can only take 1 input argument
- * They can only return simple String, Numeric or Booleans no Hashes or complex data types
- * They should be fast as these will impact discovery times and agent run times.
-
-Writing data plugins is easy and mimic the basics of writing agents,
-below we have a simple *sysctl* plugin that was used in the examples
-earlier:
-
-{% highlight ruby linenos %}
-module MCollective
-  module Data
-    class Sysctl_data<Base
-      activate_when { File.executable?("/sbin/sysctl") && Facter["kernel"] == "Linux" }
-
-      query do |sysctl|
-        shell = Shell.new("/sbin/sysctl %s" % sysctl)
-        shell.runcommand
-
-        if shell.status.exitstatus == 0
-          value = shell.stdout.chomp.split(/\s*=\s*/)[1]
-
-          if value
-            value = Integer(value) if value =~ /^\d+$/
-            value = Float(value) if value =~ /^\d+\.\d+$/
-          end
-
-          result[:value] = value
-        end
-      end
-    end
-  end
-end
-{% endhighlight %}
-
-The class names have to be *Something_data* and they must inherit from
-*Base* as in the example here. The file would be saved in the *libdir*
-as *data/sysctl_data.rb* and *data/sysctl_data.ddl*.
-
-This plugin will only be activated if the file */sbin/sysctl* exist, is
-executable and if the system is a Linux server. This allow us to install
-it on a Windows machine where it will just be disabled and those
-machines will never be discovered using this function.
-
-We then create a block that would be the main body of the query.  We use
-the *MCollective::Shell* class to run sysctl, parse the output and save
-it into the *result* hash.
-
-The result hash is the only way to return values from these plugins. You
-can only save simple strings, numbers or booleans in the result.
-
-### The DDL for the plugin
-As mentioned every data plugin requires a DDL.  These DDL files mimic
-those of the [SimpleRPC Agents][DDL].
-
-Below you'll find a DDL for the above sysctl data plugin:
-
-{% highlight ruby linenos %}
-metadata    :name        => "Sysctl values",
-            :description => "Retrieve values for a given sysctl",
-            :author      => "R.I.Pienaar <rip@devco.net>",
-            :license     => "ASL 2.0",
-            :version     => "1.0",
-            :url         => "http://marionette-collective.org/",
-            :timeout     => 1
-
-dataquery :description => "Sysctl values" do
-    input :query,
-          :prompt => "Variable Name",
-          :description => "Valid Variable Name",
-          :type => :string,
-          :validation => /^[\w\-\.]+$/,
-          :maxlength => 120
-
-    output :value,
-           :description => "Kernel Parameter Value",
-           :display_as => "Value"
-end
-{% endhighlight %}
-
-The *timeout* must be set correctly, if your data source is slow you
-need to reflect that in the timeout here.  The timeout will be used on
-the clients to decide how long to wait for discovery responses from the
-network so getting this wrong will result in nodes not being discovered.
-
-Each data plugin can only have one *dataquery* block with exactly 1
-*input* block but could have multiple *output* blocks.
-
-It's important to get the validation correct, here we only accept the
-characters we know are legal in sysctl variables on Linux.  We will
-specifically never allow backticks to be used in arguments to avoid
-accidental shell exploits.
-
-Note the correlation between output names and the use in discovery and
-agents here we create an output called *value* this means we would use
-it in discovery as:
-
-{% highlight console %}
-% mco find -S "sysctl('net.ipv4.conf.all.forwarding').value=1"
-{% endhighlight %}
-
-And we would output the result from our plugin code as:
-
-{% highlight ruby linenos %}
-result[:value] = value
-{% endhighlight %}
-
-And in any agent where we might use the data source:
-
-{% highlight ruby linenos %}
-something = Data.sysctl('net.ipv4.conf.all.forwarding').value
-{% endhighlight %}
-
-These have to match everywhere, you cannot reference undeclared data and
-you cannot use input that does not validate against the DDL declared
-validations.
-
-Refer to the full [DDL] documentation for details on all possible values
-of the *metadata*, *input* and *output* blocks.
-
-## Auto generated documentation
-As with agents the DDL can be used to generate documentation, if you
-wanted to know what the input and output values are for a specific
-plugin you can use *mco plugin doc* to see generated documentation.
-
-{% highlight console %}
-% mco plugin doc sysctl
-Sysctl values
-=============
-
-Retrieve values for a given sysctl
-
-      Author: R.I.Pienaar <rip@devco.net>
-     Version: 1.0
-     License: ASL 2.0
-     Timeout: 1
-   Home Page: http://marionette-collective.org/
-
-QUERY FUNCTION INPUT:
-
-              Description: Valid Variable Name
-                   Prompt: Variable Name
-                     Type: string
-               Validation: (?-mix:^[\w\-\.]+$)
-                   Length: 120
-
-QUERY FUNCTION OUTPUT:
-
-           value:
-              Description: Kernel Parameter Value
-               Display As: Value
-
-{% endhighlight %}
-
-## Available plugins for a node You can use the *mco inventory*
-application to see remotely what plugins a node has available:
-
-{% highlight console %}
-% mco inventory your.node
-Inventory for your.node:
-
-   .
-   .
-   .
-
-   Data Plugins:
-      fstat           sysctl
-
-{% endhighlight %}
diff --git a/website/reference/plugins/ddl.md b/website/reference/plugins/ddl.md
deleted file mode 100644 (file)
index 5d3b5e9..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
----
-layout: default
-title: Data Definition Language
----
-[WritingAgents]: /mcollective/reference/basic/basic_agent_and_client.html
-[SimpleRPCClients]: /mcollective/simplerpc/clients.html
-[ResultsandExceptions]: /mcollective/simplerpc/clients.html#results_and_exceptions
-[SimpleRPCAuditing]: /mcollective/simplerpc/auditing.html
-[SimpleRPCAuthorization]: /mcollective/simplerpc/authorization.html
-[WritingAgentsScreenCast]: http://mcollective.blip.tv/file/3808928/
-[DDLScreenCast]: http://mcollective.blip.tv/file/3799653
-[RPCUtil]: /mcollective/reference/plugins/rpcutil.html
-[ValidatorPlugins]: /mcollective/reference/plugins/validator.html
-
-As with other remote procedure invocation systems MCollective has a DDL that defines what remote methods are available, what inputs they take and what outputs they generate.
-
-In addition to the usual procedure definitions we also keep meta data about author, versions, license and other key data points.
-
-The DDL is used in various scenarios:
-
- * The user can access it in the form of a human readable help page
- * User interfaces can access it in a way that facilitate auto generation of user interfaces
- * The RPC client auto configures and use appropriate timeouts in waiting for responses
- * Before sending a call over the network inputs get validated so we do not send unexpected data to remote nodes.
- * Module repositories can use the meta data to display a standard view of available modules to assist a user in picking the right ones.
- * The server will validate incoming requests prior to sending it to agents
-
-We've created [a screencast showing the capabilities of the DDL][DDLScreenCast] that might help give you a better overview.
-
-**NOTE:** As of version 2.1.1 the DDL is required on all servers before an agent will be activated
-
-## Examples
-We'll start with a few examples as I think it's pretty simple what they do, and later on show what other permutations are allowed for defining inputs and outputs.
-
-A helper agent called [_rpcutil_][RPCUtil] is included that helps you gather stats, inventory etc about the running daemon.  This helper has a full DDL included, see the plugins dir for this agent.
-
-The typical service agent is a good example, it has various actions that all more or less take the same input.  All but status would have almost identical language.
-
-### Meta Data
-First we need to define the meta data for the agent itself:
-
-{% highlight ruby linenos %}
-metadata :name        => "SimpleRPC Service Agent",
-         :description => "Agent to manage services using the Puppet service provider",
-         :author      => "R.I.Pienaar",
-         :license     => "GPLv2",
-         :version     => "1.1",
-         :url         => "http://projects.puppetlabs.com/projects/mcollective-plugins/wiki",
-         :timeout     => 60
-{% endhighlight %}
-
-It's fairly obvious what these all do, *:timeout* is how long the MCollective daemon will let the threads run.
-
-## Required versions
-As of MCollective 2.1.2 you can indicate which is the lowest version of MCollective needed to use a plugin.  Plugins that do not meet the requirement can not be used.
-
-{% highlight ruby linenos %}
-requires :mcollective => "2.0.0"
-{% endhighlight %}
-
-You should add this right after the metadata section in the DDL
-
-## Actions, Input and Output
-Defining inputs and outputs is the hardest part, below first the *status* action:
-
-{% highlight ruby linenos %}
-action "status", :description => "Gets the status of a service" do
-    display :always  # supported in 0.4.7 and newer only
-
-    input :service,
-          :prompt      => "Service Name",
-          :description => "The service to get the status for",
-          :type        => :string,
-          :validation  => '^[a-zA-Z\-_\d]+$',
-          :optional    => false,
-          :default     => "mcollective",
-          :maxlength   => 30
-
-    output :status,
-           :description => "The status of service",
-           :display_as  => "Service Status",
-           :default     => "unknown status"
-end
-{% endhighlight %}
-
-As you see we can define all the major components of input and output parameters.  *:type* can be one of various values and each will have different parameters, more on that later.
-
-As of version 2.1.1 the outputs can define a default value.  For agents the reply structures are pre-populated with all the defined outputs, if no default is supplied a default of nil will be set.
-
-As of version 2.3.1 the inputs can also define default values, this is only processed and applied for non optional inputs.
-
-By default mcollective only show data from actions that failed, the *display* line above tells it to always show the results.  Possible values are *:ok*, *:failed* (the default behavior) and *:always*.
-
-Finally the service agent has 3 almost identical actions - *start*, *stop* and *restart* - below we use a simple loop to define them all in one go.
-
-{% highlight ruby linenos %}
-["start", "stop", "restart"].each do |act|
-    action act, :description => "#{act.capitalize} a service" do
-        input :service,
-              :prompt      => "Service Name",
-              :description => "The service to #{act}",
-              :type        => :string,
-              :validation  => '^[a-zA-Z\-_\d]+$',
-              :optional    => false,
-              :maxlength   => 30
-
-        output :status,
-               :description => "The status of service after #{act}",
-               :display_as  => "Service Status",
-               :default     => "unknown status"
-    end
-end
-{% endhighlight %}
-
-All of this code just goes into a file, no special class or module bits needed, just save it as *service.ddl* in the same location as the *service.rb*.
-
-Importantly you do not need to have the *service.rb* on a machine to use the DDL, this means on machines that are just used for running client programs you can just drop the *.ddl* files into the agents directory.
-
-You can view a human readable version of this using *mco plugin doc &lt;agent&gt;* command:
-
-{% highlight console %}
-% mco plugin doc service
-SimpleRPC Service Agent
-=======================
-
-Agent to manage services using the Puppet service provider
-
-      Author: R.I.Pienaar
-     Version: 1.1
-     License: GPLv2
-     Timeout: 60
-   Home Page: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki
-
-
-
-ACTIONS:
-========
-   restart, start, status, stop
-
-   restart action:
-   ---------------
-       Restart a service
-
-       INPUT:
-           service:
-              Description: The service to restart
-                   Prompt: Service Name
-                     Type: string
-               Validation: ^[a-zA-Z\-_\d]+$
-                   Length: 30
-
-
-       OUTPUT:
-           status:
-              Description: The status of service after restart
-               Display As: Service Status
-{% endhighlight %}
-
-### Optional Inputs
-The input block has a mandatory *:optional* field, when true it would be ok if a client attempts to call the agent without this input supplied.  If it is supplied though it will be validated.
-
-### Types of Input
-As you see above the input block has *:type* option, types can be *:string*, *:list*, *:boolean*, *:integer*, *:float* or *:number*
-
-#### :string type
-The string type validates initially that the input is infact a String, then it validates the length of the input and finally matches the supplied Regular Expression.
-
-Both *:validation* and *:maxlength* are required arguments for the string type of input.
-
-If you want to allow unlimited length text you can make *:maxlength => 0* but use this with care.
-
-As of version 2.2.0 a new plugin type called [Validator Plugins][ValidatorPlugins] exist that allow you to supply your own validations for *:string* types.
-
-#### :list type
-List types provide a list of valid options and only those will be allowed, see an example below:
-
-{% highlight ruby linenos %}
-input :action,
-      :prompt      => "Service Action",
-      :description => "The action to perform",
-      :type        => :list,
-      :optional    => false,
-      :list        => ["stop", "start", "restart"]
-{% endhighlight %}
-
-In user interfaces this might be displayed as a drop down list selector or another kind of menu.
-
-#### :boolean type
-
-The value input should be either _true_ or _false_ actual boolean values.  This feature was introduced in version _0.4.9_.
-
-#### :integer type
-
-The value input should be an integer number like _1_ or _100_ but not _1.1_.  This feature was introduced in version _1.3.2_
-
-#### :float type
-
-The value input should be a floating point number like _1.0_ but not _1_.  This feature was introduced in version _1.3.2_
-
-#### :number type
-
-The value input should be an integer or a floating point number. This feature was introduced in version _1.3.2_
-
-#### :any type
-
-The value input can be any type, this allows you to send rich objects like arrays of hashes around, it effectively disables validation of the type of input.
-
-The :any type is deprecated and will be removed after version 2.2.x.
-
-### Accessing the DDL
-While programming client applications or web apps you can gain access to the DDL for any agent in several ways:
-
-{% highlight ruby linenos %}
-require 'mcollective'
-
-config = MCollective::Config.instance
-config.loadconfig(options[:config])
-
-ddl = MCollective::DDL.new("service")
-puts ddl.help("#{config.configdir}/rpc-help.erb")
-{% endhighlight %}
-
-This will produce the text help output from the above example, you can supply any ERB template to format the output however you want.
-
-You can also access the data structures directly:
-
-{% highlight ruby linenos %}
-ddl = MCollective::DDL.new("service")
-puts "Meta Data:"
-pp ddl.meta
-
-puts
-puts "Status Action:"
-pp ddl.action_interface("status")
-{% endhighlight %}
-
-{% highlight ruby linenos %}
-Meta Data:
-{:license=>"GPLv2",
- :author=>"R.I.Pienaar",
- :name=>"SimpleRPC Service Agent",
- :timeout=>60,
- :version=>"1.1",
- :url=>"http://projects.puppetlabs.com/projects/mcollective-plugins/wiki",
- :description=>"Agent to manage services using the Puppet service provider"}
-
-Status Action:
-{:action=>"status",
- :input=>
-  {:service=>
-    {:validation=>"^[a-zA-Z\\-_\\d]+$",
-     :maxlength=>30,
-     :prompt=>"Service Name",
-     :type=>:string,
-     :optional=>false,
-     :description=>"The service to get the status for"}},
- :output=>
-  {"status"=>
-    {:display_as=>"Service Status", :description=>"The status of service"}},
- :description=>"Gets the status of a service"}
-
-{% endhighlight %}
-
-The ddl object is also available on any *rpcclient*:
-
-{% highlight ruby linenos %}
-service = rpcclient("service")
-pp service.ddl.meta
-{% endhighlight %}
-
-In the case of accessing it through the service as in this example, if there was no DDL file on the machine for the service agent you'd get a *nil* back from the ddl accessor.
-
-### Input Validation
-As mentioned earlier the client does automatic input validation using the DDL, if validation fails you will get an *MCollective::DDLValidationError* exception thrown with an appropriate message.
diff --git a/website/reference/plugins/discovery.md b/website/reference/plugins/discovery.md
deleted file mode 100644 (file)
index 0dbc4e4..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
----
-layout: default
-title: Discovery Plugins
----
-[DDL]: /mcollective/reference/plugins/ddl.html
-
-## Overview
-Up to MCollective 2.0.0 the discovery system could only discover against
-the network by doing broadcasts over the middleware.
-
-The _direct addressing_ capability introduced in 2.0.0 enables users to
-communicate with a node without doing broadcast if they know the
-configured identity of that node.
-
-In version 2.1.0 we are introducing a new kind of plugin that works on
-the client system to do discovery against any data source that can
-return a list of identities such as flatfiles or databases.
-
-## Configuring and using discovery plugins
-Your mcollective client has a setting called *default_discovery_method*
-that defaults to *mc*, if you change this in your _client.cfg_ to
-another known plugin you can use that instead.
-
-To get a list of known discovery plugins use the _mco plugin_
-application:
-
-{% highlight console %}
-% mco plugin doc
-Please specify a plugin. Available plugins are:
-
-Discovery Methods:
-  flatfile        Flatfile based discovery for node identities
-       mc              MCollective Broadcast based discovery
-       mongo           MongoDB based discovery for databases built using registration
-{% endhighlight %}
-
-Each plugin can have a different set of capabilities, for example a
-flatfile with only hostnames cannot do class or fact based filters and
-you will receive an error if you tried to do so.  You can see the
-capabilities of each plugin using the _mco plugin_ application:
-
-{% highlight console %}
-$ mco plugin doc flatfile
-flatfile
-========
-
-Flatfile based discovery for node identities
-
-      Author: R.I.Pienaar <rip@devco.net>
-     Version: 0.1
-     License: ASL 2.0
-     Timeout: 0
-   Home Page: http://marionette-collective.org/
-
-DISCOVERY METHOD CAPABILITIES:
-      Filter based on mcollective identity
-{% endhighlight %}
-
-Here you can see the only capability that this plugin has is to filter
-against identities.
-
-These plugins require DDL files to be written and distributed when
-installing each plugin.
-
-When using the mcollective CLI you can choose which plugin to use per
-request, some plugins require arguments like the file to discover
-against:
-
-{% highlight console %}
-$ mco rpc rpcutil ping --dm flatfile --do /some/text/file
-{% endhighlight %}
-
-In the case of the flatfile plugin there is a convenient shortcut
-available on all client applications that has the same effect as above:
-
-{% highlight console %}
-$ mco rpc rpcutil ping --nodes /some/text/file
-{% endhighlight %}
-
-Any request that uses the compound filters using *-S* will be forced to
-use the network broadcast discovery method.
-
-## Writing a discovery plugin
-Writing your own discovery plugin is very simple, you need to provide
-one method that returns an array of node names.
-
-The plugins only need to be present on the client machines but no harm
-in installing them on all machines.  They need to be installed into the
-*discovery* directory in the usual plugin directory.  You can use the
-*mco plugin package* command to create RPM or DEB packages for these
-plugins.
-
-{% highlight ruby linenos %}
-module MCollective
-  class Discovery
-    class Flatfile
-      def self.discover(filter, timeout, limit=0, client=nil)
-        unless client.options[:discovery_options].empty?
-          file = client.options[:discovery_options].first
-        else
-          raise "The flatfile discovery method needs a path to a text file"
-        end
-
-        raise "Cannot read the file %s specified as discovery source" % file unless File.readable?(file)
-
-        discovered = []
-
-        hosts = File.readlines(file).map{|l| l.chomp}
-
-        unless filter["identity"].empty?
-          filter["identity"].each do |identity|
-            identity = Regexp.new(identity.gsub("\/", "")) if identity.match("^/")
-
-            if identity.is_a?(Regexp)
-              discovered = hosts.grep(identity)
-            elsif hosts.include?(identity)
-              discovered << identity
-            end
-          end
-        else
-          discovered = hosts
-        end
-
-        discovered
-      end
-    end
-  end
-end
-{% endhighlight %}
-
-This is the *flatfile* plugin that is included in the distribution.  You
-can see it using the *client.options\[:discovery_options\]* array to get
-access to the file supplied using the *--do* command line argument,
-reading that file and doing either string or Regular Expression matching
-against it finally returning the list of nodes.
-
-As mentioned each plugin needs a DDL, the DDL for this plugin is very
-simple:
-
-{% highlight ruby linenos %}
-metadata    :name        => "flatfile",
-            :description => "Flatfile based discovery for node identities",
-            :author      => "R.I.Pienaar <rip@devco.net>",
-            :license     => "ASL 2.0",
-            :version     => "0.1",
-            :url         => "http://marionette-collective.org/",
-            :timeout     => 0
-
-discovery do
-    capabilities :identity
-end
-{% endhighlight %}
-
-Here we expose just the one capability, valid capabilities would be
-*:classes*, *:facts*, *:identity*, *:agents* and *:compound*.  In
-practise you cannot create a plugin that supports the *:compound*
-capability as mcollective will force the use of the *mc* plugin if you
-use those.
diff --git a/website/reference/plugins/facts.md b/website/reference/plugins/facts.md
deleted file mode 100644 (file)
index 2ea58ff..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
----
-layout: default
-title: Writing Fact Plugins
-toc: false
----
-[SimpleRPCAuthorization]: /mcollective/simplerpc/authorization.html
-[Registration]: registration.html
-
-Fact plugins are used during discovery whenever you run the agent with queries like *-W country=de*.
-
-The default setup uses a YAML file typically stored in */etc/mcollective/facts.yaml* to read facts.  There are however many fact systems like Reductive Labs Facter and Opscode Ohai or you can come up with your own.  The facts plugin type lets you write code to access these tools.
-
-Facts at the moment should be simple *variable = value* style flat Hashes, if you have a hierarchical fact system like Ohai you can flatten them into *var.subvar = value* style variables.
-
-## Details
-Implementing a facts plugin is made simple by inheriting from *MCollective::Facts::Base*, in that case you just need to provide 1 method, the YAML plugin code can be seen below:
-
-For releases in the 1.0.x release cycle and older, use this plugin format:
-
-{% highlight ruby linenos %}
-module MCollective
-    module Facts
-        require 'yaml'
-
-        # A factsource that reads a hash of facts from a YAML file
-        class Yaml<Base
-            def self.get_facts
-                config = MCollective::Config.instance
-
-                facts = {}
-
-                YAML.load_file(config.pluginconf["yaml"]).each_pair do |k, v|
-                    facts[k] = v.to_s
-                end
-
-                facts
-            end
-        end
-    end
-end
-{% endhighlight %}
-
-For releases 1.1.x and onward use this format:
-
-{% highlight ruby linenos %}
-module MCollective
-    module Facts
-        require 'yaml'
-
-        class Yaml_facts<Base
-            def load_facts_from_source
-                config = MCollective::Config.instance
-
-                facts = {}
-
-                YAML.load_file(config.pluginconf["yaml"]).each_pair do |k, v|
-                    facts[k] = v.to_s
-                end
-
-                facts
-            end
-        end
-    end
-end
-{% endhighlight %}
-
-If using the newer format in newer releases of mcollective you do not need to worry about caching or
-thread safety as the base class does this for you.  You can force reloading of facts by creating a
-*force_reload?* method that should return *true* or *false*.  Returning *true* will force the cache
-to be rebuilt.
-
-You can see that all you have to do is provide *self.get_facts* which should return a Hash as described above.
-
-There's a sample using Puppet Labs Facter on the plugins project if you wish to see an example that queries an external fact source.
-
-Once you've written your plugin you can save it in the plugins directory and configure mcollective to use it:
-
-{% highlight ini %}
-factsource = yaml
-{% endhighlight %}
-
-This will result in *MCollective::Facts::Yaml* or *MCollective::Facts::Yaml_facts* being used as source for your facts.
diff --git a/website/reference/plugins/registration.md b/website/reference/plugins/registration.md
deleted file mode 100644 (file)
index fc92bc2..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
----
-layout: default
-title: Registration
-toc: false
----
-[RegistrationMonitor]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/AgentRegistrationMonitor
-
-MCollective supports the ability for each node to register with a central inventory. The core functionality
-of Mcollective doesn't require registration internally; it's simply provided as a framework to enable you to
-build inventory systems or Web UIs.
-
-## Details
-
-Registration plugins are easy to write. You can configure your nodes to use your own or the provided one.
-
-The one we provide simply sends a list of agents to the inventory. It's available in the plugins directory
-under *registration/agentlist.rb* and can be seen in its entirety below:
-
-{% highlight ruby %}
-module MCollective
-    module Registration
-        # A registration plugin that simply sends in the list of agents we have
-        class Agentlist<Base
-            def body
-                MCollective::Agents.agentlist
-            end
-        end
-    end
-end
-{% endhighlight %}
-
-You can see it's very simple, you just need to subclass *MCollective::Registration::Base* to ensure they get
-loaded into the plugin system and provide a _body_ method whose return value will be sent to the registration agent(s).
-
-The registration plugin can decide if a message should be sent or not.  If your plugin responds with a _nil_ value the
-message will not be sent.  This can be useful if you wish to only send registration data when some condition has changed.
-On large collectives, registration messages can be quite high-volume. It's worthwhile to sample the size of your
-registration messages and multiply by the number of nodes to determine an appropriate frequency to send them.
-
-To configure it to be used you just need the following in your config:
-
-{% highlight ini %}
-registerinterval = 300
-registration = Agentlist
-
-# only valid since 1.3.0 and newer
-registration_collective = development
-{% endhighlight %}
-
-This will cause the plugin to be called every 300 seconds to the development collective, if you do not configure
-a target collective explicitely it will target the main collective for the given node.
-
-We do not provide the receiving end of this in the core mcollective. You will need to write an agent called
-*registration* and do something useful with the data you receive from all the nodes. You can find
-[a simple monitoring system][RegistrationMonitor] built using this method as an example. The receiving agent
-can simply be installed as an extra mcollectived plugin on a node which participates in the collective.
-
-You need to note a few things about the receiving agents:
-
- * They need to be fast. You'll receive a lot of registration messages so if your agent talks to a database that
-   is slow you'll run into problems
- * They should not return anything other than *nil*. The MCollective server will interpret *nil* from an agent as
-   an indication that you do not want to send back any reply.  Replying to registration requests is almost always undesired.
-
-There's nothing preventing you from running more than one type of receiving agent in your collective, you can have one
-on your monitor server as above and another with completely different code on a web server feeding a local
-cache for your web interfaces.  As long as both agents are called *registration* you'll be fine. However this
-does mean you can't run more than one registration receiver on the same server.
diff --git a/website/reference/plugins/rpcutil.md b/website/reference/plugins/rpcutil.md
deleted file mode 100644 (file)
index a20018d..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
----
-layout: default
-title: The rpcutil Agent
-toc: false
----
-
-We include an agent with a few utilities and helpers there to assist in retrieving information about the running mcollectived.
-
-We aim to add the ability to initiate reloads and so forth in this agent too in future, this
-will require further internal refactoring though.
-
-## _inventory_ Action
-
-Retrieves an inventory of the facts, classes and agents and plugins on the system, takes no arguments
-and returns a hash like this:
-
-{% highlight ruby %}
-{:agents   => ["rpcutil", "discovery"],
- :facts     => {"mcollective"=>1},
- :classes   => ["common::linux", "motd"],
- :data_plugins=>["sysctl_data", "fstat_data"],
- :collectives=>["mcollective"],
- :main_collective=>"mcollective",
- :version=>"2.0.0"}
-{% endhighlight %}
-
-## _daemon`_`stats_ Action
-
-Retrieves statistics about the running daemon, how many messages it's handled, passed, dropped etc.
-
-See the DDL for the agent for a full reference
-
-{% highlight ruby %}
-{:configfile=>"/etc/mcollective/server.cfg",
- :validated=>46,
- :threads=>      ["#<Thread:0xb7dcf480 sleep>",
-                  "#<Thread:0xb7fba704 sleep>",
-                  "#<Thread:0xb7dcfb88 run>"],
- :starttime=>1284305683,
- :agents=>["rpcutil", "discovery"],
- :unvalidated=>0,
- :pid=>15499,
- :times=>{:cutime=>0.0, :utime=>0.15, :cstime=>0.0, :stime=>0.02},
- :passed=>46,
- :total=>46,
- :filtered=>0,
- :replies=>45}
-{% endhighlight %}
-
-Replies will always be less than received since the current message has not been sent yet when the stats are gathered.
-
-## _get`_`fact_ Action
-
-Retrieves a single fact from the server
-
-{% highlight ruby %}
-{:fact   => "mcollective",
- :value  => 1}
-{% endhighlight %}
-
-## _agent`_`inventory_ Action
-
-Returns a list of all agents with their meta data like version, author, license etc
-
-{% highlight ruby %}
-{:agents=> [
-              {:agent=>"discovery",
-              :license=>"Apache License, Version 2",
-              :author=>"R.I.Pienaar <rip@devco.net>"},
-
-             {:agent=>"rpcutil",
-              :license=>"Apache License, Version 2.0",
-              :name=>"Utilities and Helpers for SimpleRPC Agents",
-              :url=>"http://marionette-collective.org/",
-              :description=> "General helpful actions that expose stats and internals to SimpleRPC clients",
-              :version=>"1.0",
-              :author=>"R.I.Pienaar <rip@devco.net>",
-              :timeout=>3}
-          ]
-}
-{% endhighlight %}
-
-## _get`_`config`_`item_ Action
-
-Retrieves the active value for any configuration item on a server
-
-{% highlight ruby %}
-{:item   => "loglevel",
- :value  => "debug"}
-{% endhighlight %}
-
-## _ping_ Action
-
-A simple lightweight ping action that just returns each nodes local time
-
-{% highlight ruby %}
-{:pong   => 1295471526}
-{% endhighlight %}
-
-## _collective`_`info_ Action
-
-Retrieves the main and sub collectives configured
-
-For a server configured with:
-
-{% highlight ruby %}
-collectives = mcollectivedev,subdev1
-main_collective = mcollectivedev
-{% endhighlight %}
-
-The following structure gets returned:
-
-{% highlight ruby %}
-{:collectives=>["mcollectivedev", "subdev1"],
- :main_collective=>"mcollectivedev"}
-{% endhighlight %}
diff --git a/website/reference/plugins/security_aes.md b/website/reference/plugins/security_aes.md
deleted file mode 100644 (file)
index 6ab8677..0000000
+++ /dev/null
@@ -1,278 +0,0 @@
----
-layout: default
-title: OpenSSL based Security Plugin
----
-[SimpleRPCAuthorization]: /mcollective/simplerpc/authorization.html
-[Registration]: registration.html
-[SSLSecurity]: security_ssl.html
-[SecurityOverview]: ../../security.html
-
-## Overview
-This plugin impliments a AES encryption and RSA public / private key based security system
-for The Marionette Collective.
-
-Please review the [Security Overview][SecurityOverview] for a general discussion about security in Marionette Collective.
-
-The design goals of this plugin are:
-
- * Each actor - clients and servers - can have their own set of public and private keys
- * All actors are uniquely and cryptographically identified
- * Requests are encrypted using the clients private key and anyone that has
-   the public key can see the request.  Thus an atacker may see the requests
-   given access to a public key of the requester.
- * Request TTLs and Message Times are cryptographically secured and tampered
-   messages are not accepted by default. This is a first line defence in message
-   replaying and tampering.
- * Replies are encrypted using the calling clients public key.  Thus no-one but
-   the caller can view the contents of replies.
- * Servers can all have their own SSL keys, or share one, or reuse keys created
-   by other PKI using software like Puppet
- * Requests from servers - like registration data - can be secured even to external
-   eavesdropping depending on the level of configuration you are prepared to do
- * Given a network where you can ensure third parties are not able to access the
-   middleware public key distribution can happen automatically
-
-During the design of this system we considered the replies back to clients to be most
-important piece of information on the network.  This is secured in a way that only
-the client can decrypt the replies he gets.  An attacker will need to gain access
-to every private key of every client to see all the reply data.
-
-Serialization uses Marshal or YAML, which means data types in and out of mcollective
-will be preserved from client to server and reverse.
-
-## Compared to the SSL plugin
-
-The earlier [SSLSecurity] only provided message signing and identification of clients, this
-new plugin builds on this adding payload encryption, identification of servers and optional
-automatic key distribution.
-
-The [SSLSecurity] plugin puts less drain on resources, if you do not specifically need encryption
-you should consider using that one instead.
-
-## Deployment Scenarios
-
-There are various modes of deployment, the more secure you wish to be the more work you have
-to do in terms of key exchange and initial setup.
-
-This plugin is designed to allow you to strike a balance between security and setup cost
-the sections below discuss the possible deployment scenarios to help you choose an approach.
-
-In all of the below setups the following components are needed:
-
- * Each user making requests - the client - needs a public and private key pair
- * Each server receiving requests need the public key of each client
-
-In cases where you wish to use [Registration] or initiate requests from the server for any
-reason the following are needed:
-
- * Each server needs a public and private key pair
- * Each other server that wish to receive these requests need the public key of the sending server
-
-In this scenario each server will act as a client making RPC requests to the collective network
-for any agent called _registration_.  So in this scenario the server acts as a client and therefore
-need a key-pair to identify it.
-
-### Manual key distribution with each server and client having unique keys
-
-In this setup each client and each server needs a unique set of keys.  You need to
-distribute these keys manually and securely - perhaps using Puppet.
-
-The setup cost is great, to enable registration the nodes receiving registration data
-need to have the public key of every other node stored locally before registration
-data can be received.
-
-If you do not use Puppet or some other PKI system that provide access to keys you need
-create keypairs for each node and client.
-
-This is the most secure setup protecting all replies and registration data.  Rogue people
-on the network who do not compromise a running host cannot make requests on the network.
-
-Attackers who compromise a server can only make registration requests assuming you deployed
-a strictly configured [Authorization][SimpleRPCAuthorization] system they cannot use those
-machines as starting points to inject requests for the rest of your network.
-
-By gaining access to your Middleware an attacker will not be able to observe the contents of
-requests, replies or registration messages.  Attackers need to compromise servers and gain
-access to private keys before they can start observing parts of the exchange.
-
-|Feature / Capability|Supported|
-|--------------------|---------|
-|Clients are uniquely identified using cryptographic means|yes|
-|Anyone with the client public key can observe request contents|yes|
-|Attackers can gain access to the client public key by just listening on the network|no|
-|Replies back to the client are readable only by client that initiated the request|yes|
-|Attackers can create new certificates and start using them to make requests as clients|no|
-|Servers are uniquely identified using cryptographic means|yes|
-|Anyone with the server public key can observe registration contents|yes|
-|Attackers can gain access to the server public keys by just listening on the network|no|
-|Registration data can be protected from rogue agents posing as registration agents|yes|
-|Attackers can create new nodes and inject registration data for those new nodes|no|
-
-To configure this scenario use the following options and manually copy public keys to the
-_plugin.aes.client`_`cert`_`dir_ directory:
-
-|Settings|Value|Descritpion|
-|--------|-----|-----------|
-|plugin.aes.send_pubkey|0|Do not send public keys|
-|plugin.aes.learn_pubkeys|0|Do not learn public keys|
-
-### Automatic public key distribution with each server and client having unique keys
-
-Here we enable the  _plugin.aes.learn`_`pubkeys_ feature on all servers.  Your public keys
-will now be distributed automatically on demand but you loose some security in that anyone
-with access to your network or middleware can observe the contents of replies and registration
-data
-
-You still need to create keys for every node - or use Puppets.  You still need to create keys
-for every user.
-
-In order to protect against attackers creating new certificates and making requests on your network
-deploy a [Authorization][SimpleRPCAuthorization] plugin that denies unknown clients.
-
-|Feature / Capability|Supported|
-|--------------------|---------|
-|Clients are uniquely identified using cryptographic means|yes|
-|Anyone with the client public key can observe request contents|yes|
-|Attackers can gain access to the client public key by just listening on the network|*yes*|
-|Replies back to the client are readable only by client that initiated the request|yes|
-|Attackers can create new certificates and start using them to make requests as clients|*yes*|
-|Servers are uniquely identified using cryptographic means|yes|
-|Anyone with the server public key can observe registration contents|yes|
-|Attackers can gain access to the server public keys by just listening on the network|*yes*|
-|Registration data can be protected from rogue agents posing as registration agents|yes|
-|Attackers can create new nodes and inject registration data for those new nodes|*yes*|
-
-To configure this scenario use the following options and ensure the _mcollectived_ can write
-to the _plugin.aes.client`_`cert`_`dir_ directory:
-
-|Settings|Value|Descritpion|
-|--------|-----|-----------|
-|plugin.aes.send_pubkey|1|Send public keys|
-|plugin.aes.learn_pubkeys|1|Learn public keys|
-
-### Manual public key distribution with servers sharing a key pair and clients having unique keys
-
-This is comparable to the older SSL plugin where all servers shared the same public / private
-pair.  Here anyone who is part of the network can decrypt the traffic related to registration
-but replies to clients are still securely encrypted and visable only to them.
-
-You will not need to create unique keys for every server, you can simply copy the same one out
-everywhere.  You still need to create keys for every user.
-
-If you do not use registration, this is a very secure setup that requires a small configuration
-overhead.
-
-|Feature / Capability|Supported|
-|--------------------|---------|
-|Clients are uniquely identified using cryptographic means|yes|
-|Anyone with the client public key can observe request contents|yes|
-|Attackers can gain access to the client public key by just listening on the network|no|
-|Replies back to the client are readable only by client that initiated the request|yes|
-|Attackers can create new certificates and start using them to make requests as clients|no|
-|Servers are uniquely identified using cryptographic means|*no*|
-|Anyone with the server public key can observe registration contents|yes|
-|Attackers can gain access to the server public keys by just listening on the network|no|
-|Registration data can be protected from rogue agents posing as registration agents|*no*|
-
-To configure this scenario use the following options and ensure the _mcollectived_ can write
-to the _plugin.aes.client`_`cert`_`dir_ directory:
-
-|Settings|Value|Descritpion|
-|--------|-----|-----------|
-|plugin.aes.send_pubkey|0|Do not send public keys|
-|plugin.aes.learn_pubkeys|0|Do not learn public keys|
-
-### Automatic public key distribution with servers sharing a key and client having unique keys
-
-This is comparable to the older SSL plugin where all servers shared the same public / private
-pair.  Here anyone who is part of the network can decrypt the traffic related to registration
-but replies to clients are still securely encrypted and visable only to them.
-
-Here we enable the  _plugin.aes.learn`_`pubkeys_ feature on all servers.  Your public keys
-will now be distributed automatically on demand but you loose some security in that anyone
-with access to your network or middleware can observe the contents of replies and registration
-data
-
-You will not need to create unique keys for every server, you can simply copy the same one out
-everywhere.  You still need to create keys for every user.
-
-In order to protect against attackers creating new certificates and making requests on your network
-deploy a [Authorization][SimpleRPCAuthorization] plugin that denies unknown clients.
-
-|Feature / Capability|Supported|
-|--------------------|---------|
-|Clients are uniquely identified using cryptographic means|yes|
-|Anyone with the client public key can observe request contents|yes|
-|Attackers can gain access to the client public key by just listening on the network|*yes*|
-|Replies back to the client are readable only by client that initiated the request|yes|
-|Attackers can create new certificates and start using them to make requests as clients|*yes*|
-|Servers are uniquely identified using cryptographic means|*no*|
-|Anyone with the server public key can observe registration contents|yes|
-|Attackers can gain access to the server public keys by just listening on the network|*yes*|
-|Registration data can be protected from rogue agents posing as registration agents|*no*|
-
-To configure this scenario use the following options and ensure the _mcollectived_ can write
-to the _plugin.aes.client`_`cert`_`dir_ directory:
-
-|Settings|Value|Descritpion|
-|--------|-----|-----------|
-|plugin.aes.send_pubkey|1|Send public keys|
-|plugin.aes.learn_pubkeys|1|Learn public keys|
-
-## Creating keys
-
-Keys are created using OpenSSL.  The filenames of public keys are significant you should name
-them so that they are unique for your network and they should match on the client and servers.
-
-{% highlight console %}
- % openssl genrsa -out server-private.pem 1024
- % openssl rsa -in server-private.pem -out server-public.pem -outform PEM -pubout
-{% endhighlight %}
-
-Client and Server keys are made using the same basic method.
-
-## Reusing Puppet keys
-
-Puppet managed nodes will all have keys created by Puppet already, you can reuse these if your
-_mcollectived_ runs as root.
-
-Generally Puppet stores these in _/var/lib/puppet/ssl/private`_`keys/fqdn.pem_ and _/var/lib/puppet/ssl/public`_`keys/fqdn.pem_
-simply configure these paths for your _server`_`private_ and _server`_`public_ options.
-
-Clients will still need their own keys made and distributed.
-
-## Future Roadmap
-
- * Depending on performance of the initial system we might validate request certificates are
-   signed by a known CA this will provide an additional level of security preventing attackers
-   from creating their own keys and using those on the network without also compromising the CA.
- * Private keys will be secured with a password
-
-
-## Configuration Options
-
-### Common Options
-
-|Setting|Example / Default|Description
-|-------|-----------------|-----------|
-|securityprovider|aes_security|Enables this security provider|
-|plugin.aes.serializer|yaml or marshal|Serialization to use|
-|plugin.aes.send_pubkey|0 or 1|Send the public key with every request|
-|plugin.aes.learn_pubkeys|0 or 1|Receive public keys from the network and cache them locally|
-
-### Client Options
-
-|Setting|Example / Default|Description
-|-------|-----------------|-----------|
-|plugin.aes.client_private|/home/user/.mcollective.d/user-private.pem|The private key path for the user.  File must be /\w\.\-/|
-|plugin.aes.client_public|/home/user/.mcollective.d/user.pem|The public key path for the user.  File must be /\w\.\-/|
-
-### Server Options
-
-|Setting|Example / Default|Description
-|-------|-----------------|-----------|
-|plugin.aes.client_cert_dir|/etc/mcollective/ssl/clients|Where to store and load client public keys|
-|plugin.aes.server_private|/etc/mcollective/ssl/server-private.pem|Server private key.  File must be /\w\.\-/|
-|plugin.aes.server_public|/etc/mcollective/ssl/server-public.pem|Server public key.  File must be /\w\.\-/|
-|plugin.aes.enforce_ttl|1|Enforce TTL and Message time security, warn only when disabled.  1.3.2 and newer only|
-
diff --git a/website/reference/plugins/security_ssl.md b/website/reference/plugins/security_ssl.md
deleted file mode 100644 (file)
index 12029d6..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
----
-layout: default
-title: OpenSSL based Security Plugin
----
-[SimpleRPCAuthorization]: /mcollective/simplerpc/authorization.html
-[Registration]: registration.html
-[AESPlugin]: security_aes.html
-[SecurityOverview]: ../../security.html
-
-## Overview
-Implements a public/private key based message validation system using SSL
-public and private keys.
-
-Please review the [Security Overview][SecurityOverview] for a general discussion about security in Marionette Collective.
-
-The design goal of the plugin are two fold:
-
- * give different security credentials to clients and servers to avoid a compromised server from sending new client requests.
- * create a token that uniquely identify the client - based on the filename of the public key.  This creates a strong identity token for [SimpleRPCAuthorization].
- * As of 1.3.2 it cryptographically protect the TTL and Message Time properties of requests.  Aiding in securing against replay atacks.
-
-Serialization uses Marshal or YAML, which means data types in and out of mcollective
-will be preserved from client to server and reverse.
-
-Validation is as default and is provided by *MCollective::Security::Base*
-
-Initial code was contributed by Vladimir Vuksan and modified by R.I.Pienaar
-
-An [alternative plugin][AESPlugin] exist that encrypts data but is more work to setup and maintain.
-
-## Setup
-
-### Nodes
-To setup you need to create a SSL key pair that is shared by all nodes.
-
-The certificate names must match /\w\.\-/.
-
-{% highlight console %}
- % openssl genrsa -out server-private.pem 1024
- % openssl rsa -in server-private.pem -out server-public.pem -outform PEM -pubout
-{% endhighlight %}
-
-Distribute the private and public file to */etc/mcollective/ssl* on all the nodes.
-Distribute the public file to */etc/mcollective/ssl* everywhere the client code runs.
-
-server.cfg:
-
-{% highlight ini %}
-  securityprovider = ssl
-  plugin.ssl_server_private = /etc/mcollective/ssl/server-private.pem
-  plugin.ssl_server_public = /etc/mcollective/ssl/server-public.pem
-  plugin.ssl_client_cert_dir = /etc/mcollective/ssl/clients/
-{% endhighlight %}
-
-TTL and Message Times are protected by default 2.0.0, this means older clients will not be able to
-communicate with servers running this version of the security plugin.  You can make it warn but not
-deny older clients:
-
-{% highlight ini %}
-  plugin.ssl.enforce_ttl = 0
-{% endhighlight %}
-
-### Users and Clients
-Now you should create a key pair for every one of your clients, here we create one
-for user john - you could also if you are less concerned with client id create one
-pair and share it with all clients:
-
-The certificate names must match /\w\.\-/.
-
-{% highlight console %}
- % openssl genrsa -out john-private.pem 1024
- % openssl rsa -in john-private.pem -out john-public.pem -outform PEM -pubout
-{% endhighlight %}
-
-Each user has a unique userid, this is based on the name of the public key.
-In this example case the userid would be *'john-public'*.
-
-Store these somewhere like:
-
-{% highlight console %}
- /home/john/.mc/john-private.pem
- /home/john/.mc/john-public.pem
-{% endhighlight %}
-
-Every users public key needs to be distributed to all the nodes, save the john one
-in a file called:
-
-{% highlight console %}
-  /etc/mcollective/ssl/clients/john-public.pem
-{% endhighlight %}
-
-If you wish to use [Registration] or auditing that sends connections over MC to a
-central host you will need also put the *server-public.pem* in the clients directory.
-
-You should be aware if you do add the node public key to the clients dir you will in
-effect be weakening your overall security.  You should consider doing this only if
-you also set up an Authorization method that limits the requests the nodes can make.
-
-client.cfg:
-
-{% highlight ini %}
- securityprovider = ssl
- plugin.ssl_server_public = /etc/mcollective/ssl/server-public.pem
- plugin.ssl_client_private = /home/john/.mc/john-private.pem
- plugin.ssl_client_public = /home/john/.mc/john-public.pem
-{% endhighlight %}
-
-If you have many clients per machine and dont want to configure the main config file
-with the public/private keys you can set the following environment variables:
-
-{% highlight console %}
- export MCOLLECTIVE_SSL_PRIVATE=/home/john/.mc/john-private.pem
- export MCOLLECTIVE_SSL_PUBLIC=/home/john/.mc/john-public.pem
-{% endhighlight %}
-
-### Serialization Method
-
-You can choose either YAML or Marshal, the default is Marshal.  The view with optional Marshal encoding is to have a serializer supported by other languages other than Ruby to enable future integration with those.
-
-To use YAML set this in both *client.cfg* and *server.cfg*:
-
-{% highlight ini %}
-plugin.ssl_serializer = yaml
-{% endhighlight %}
diff --git a/website/reference/plugins/validator.md b/website/reference/plugins/validator.md
deleted file mode 100644 (file)
index c7af44f..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
----
-layout: default
-title: Validator Plugins
----
-[DDL]: /mcollective/reference/plugins/ddl.html
-
-## Overview
-MCollective provides extensive input data validation to prevent attacks and
-injections into your agents preventing attack vectors like Shell Injection
-Attacks.
-
-Traditionally we shipped a number of pre-made validator plugins that could be
-used in agents and DDL files but you were not capable fo adding your own easily.
-
-As of version 2.2.0 you can write new Validator plugins that allow you to extend
-the DDL and Agent validation methods.
-
-## Writing A New Validator
-We'll write a new validator plugin that can validate a string matches valid Exim
-message IDs like *1Svk5S-0001AW-I5*.
-
-Validator plugins and their DDL files goes in the libdir in the *validator*
-directory on both the servers and the clients.
-
-### The Ruby Plugin
-The basic validator plugin that will validate any data against this regular
-expression can be seen here:
-
-{% highlight ruby %}
-module MCollective
-  module Validator
-    class Exim_msgidValidator
-      def self.validate(msgid)
-        Validator.typecheck(msgid, :string)
-
-        raise "Not a valid Exim Message ID" unless msgid.match(/(?:[+-]\d{4} )?(?:\[\d+\] )?(\w{6}\-\w{6}\-\w{2})/)
-      end
-    end
-  end
-end
-{% endhighlight %}
-
-All you need to do is provide a *self.validate* method that takes 1 argument and
-do whatever validation you want to do against the input data.
-
-Here we first confirm it is a string and then we do the regular expression match
-against that.  Any Exception that gets raised will result in validation failing.
-
-### The DDL
-As with other plugins these plugins need a DDL file, all they support is the
-metadata section.
-
-{% highlight ruby %}
-metadata    :name        => "Exim Message ID",
-            :description => "Validates that a string is a Exim Message ID",
-            :author      => "R.I.Pienaar <rip@devco.net>",
-            :license     => "ASL 2.0",
-            :version     => "1.0",
-            :url         => "http://devco.net/",
-            :timeout     => 1
-{% endhighlight %}
-
-## Using the Validator in a DDL
-You can use the validator in any DDL file, here is a snippet matching an input
-using the new *exim_msgid* validator:
-
-{% highlight ruby %}
-action "retrymsg", :description => "Retries a specific message" do
-    display :ok
-
-    input :msgid,
-          :prompt      => "Message ID",
-          :description => "Valid message id currently in the mail queue",
-          :type        => :string,
-          :validation  => :exim_msgid,
-          :optional    => false,
-          :maxlength   => 16
-
-    output :status,
-           :description => "Status Message",
-           :display_as  => "Status"
-end
-{% endhighlight %}
-
-Note here we are using our new validator to validate the *msgid* input.
-
-## Using the Validator in an Agent
-Agents can also have validation, traditionally this included the normal things
-like regular expressions but now here you can also use the validator plugins:
-
-{% highlight ruby %}
-action "retrymsg" do
-  validate :msgid, :exim_msgid
-
-  # call out to exim to retry the message
-end
-{% endhighlight %}
-
-Here we've extended the basic *validate* helper of the RPC Agent with our own
-plugin and used it to validate a specific input.
-
-## Listing available Validators
-You can obtain a list of validators using the *plugin* application:
-
-{% highlight ruby %}
-% mco plugin doc
-
-Please specify a plugin. Available plugins are:
-
-.
-.
-.
-
-Validator Plugins:
-  array                     Validates that a value is included in a list
-  exim_msgid                Validates that a string is a Exim Message ID
-  ipv4address               Validates that a value is an ipv4 address
-  ipv6address               Validates that a value is an ipv6 address
-  length                    Validates that the length of a string is less or equal to a specified value
-  regex                     Validates that a string matches a supplied regular expression
-  shellsafe                 Validates that a string is shellsafe
-  typecheck                 Validates that a value is of a certain type
-
-{% endhighlight %}
-
-Note our new *exim_msgid* plugin appears in this list.
-
diff --git a/website/reference/ui/filters.md b/website/reference/ui/filters.md
deleted file mode 100644 (file)
index 396c64a..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
----
-layout: default
-title: Discovery Filters
----
-
-[FactPlugin]: /mcollective/reference/plugins/facts.html
-
-Using filters to control discovery and addressing is a key concept in mcollective.
-You can use facts, classes, agents and server identities in filters and combine
-to narrow down what hosts you will affect.
-
-To determine if your client support filters use the _--help_ option:
-
-
-{% highlight console %}
-$ mco rpc --help
-.
-.
-.
-Host Filters
-    -W, --with FILTER                Combined classes and facts filter
-    -F, --wf, --with-fact fact=val   Match hosts with a certain fact
-    -C, --wc, --with-class CLASS     Match hosts with a certain config management class
-    -A, --wa, --with-agent AGENT     Match hosts with a certain agent
-    -I, --wi, --with-identity IDENT  Match hosts with a certain configured identity
-{% endhighlight %}
-
-If you see a section as above then the client supports filters, this is the default
-for all clients using SimpleRPC.
-
-All filters support Regular Expressions and some support comparisons like greater than
-or less than.
-
-Filters are applied in a combined manner, if you supply 5 filters they must all match
-your nodes.
-
-## Fact Filters
-
-Filtering on facts require that you've correctly set up a [FactPlugin].  The examples below
-show common fact filters.
-
-Install the ZSH package on machines with the fact _country=de_:
-
-{% highlight console %}
-% mco rpc package install zsh -F country=de
-{% endhighlight %}
-
-Install the ZSH package on machines where the _country_ fact starts with the letter _d_:
-
-{% highlight console %}
-% mco rpc package install zsh -F country=/^d/
-{% endhighlight %}
-
-{% highlight console %}
-% mco rpc package install zsh -F country=~^d
-{% endhighlight %}
-
-Install the ZSH package on machines with more than 2 CPUs, other available operators
-include _==, &lt;=, &gt;=, &lt;, &gt;, !=_.  For facts where the comparison and the
-actual fact is numeric it will do a numerical comparison else it wil do alphabetical:
-
-{% highlight console %}
-% mco rpc package install zsh -F "physicalprocessorcount>=2"
-{% endhighlight %}
-
-## Agent, Identity and Class filters
-
-These filters all work on the same basic pattern, they just support equality or regular
-expressions:
-
-Install ZSH on machines with hostnames starting with _web_:
-
-{% highlight console %}
-% mco rpc package install zsh -I /^web/
-{% endhighlight %}
-
-Install ZSH on machines with hostnames _web1.example.com_:
-
-{% highlight console %}
-% mco rpc package install zsh -I web1.example.com
-{% endhighlight %}
-
-## Combining Fact and Class filters
-
-As a short-hand you can combine Fact and Class filters into a single filter:
-
-Install ZSH on machines in Germany that has classes matching _/apache/_:
-
-{% highlight console %}
-% mco rpc package install zsh -W "/apache/ country=de"
-{% endhighlight %}
-
diff --git a/website/reference/ui/nodereports.md b/website/reference/ui/nodereports.md
deleted file mode 100644 (file)
index 5458cda..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
----
-layout: default
-title: Node Reports
----
-[Subcollectives]: ../basic/subcollectives.html
-
-As we have all facts, classes and agents for nodes we can do some custom reporting on all of these.
-
-The _mco inventory_ tool is a generic node and network reporting tool, it has basic scripting abilities.
-
-**Note: This is an emerging feature, the scripting language is likely to change**
-
-## Node View
-To obtain a full inventory for a given node you can run _mco inventory_ like this:
-
-{% highlight console %}
- % mco inventory your.node.com
- Inventory for your.node.com:
-
-
-   Server Statistics:
-                   Start Time: Mon Sep 13 18:24:46 +0100 2010
-                  Config File: /etc/mcollective/server.cfg
-                   Process ID: 5197
-               Total Messages: 62
-      Messages Passed Filters: 62
-            Messages Filtered: 0
-                 Replies Sent: 61
-         Total Processor Time: 0.18 seconds
-                  System Time: 0.01 seconds
-
-    Agents:
-       discovery       echo            nrpe
-       package         process         puppetd
-       rpctest         service
-
-    Configuration Management Classes:
-       aliases                        apache
-       <snip>
-
-    Facts:
-       architecture => i386
-       country => de
-       culturemotd => 1
-       customer => rip
-       diskdrives => xvda
-       <snip>
-{% endhighlight %}
-
-This gives you a good idea of all the details available for a node.
-
-## Collective List
-
-We have a concept of [Subcollectives] and you can use the inventory application to get a quick
-report on all known collectives:
-
-{% highlight console %}
-$ mco inventory --list-collectives
-
- * [ ===================================== ] 52 / 52
-
-   Collective                     Nodes
-   ==========                     =====
-   za_collective                  2
-   us_collective                  7
-   uk_collective                  19
-   de_collective                  24
-   eu_collective                  45
-   mcollective                    52
-
-                     Total nodes: 52
-
-{% endhighlight %}
-
-## Collective Map
-
-You can also create a DOT format graph of your collective:
-
-{% highlight console %}
-$ mco inventory --collective-graph collective.dot
-
-Retrieving collective info....
-Graph of 52 nodes has been written to collective.dot
-{% endhighlight %}
-
-The graph will be a simple dot graph that can be viewed with Graphviz, Gephi or
-other compatible software.
-
-## Custom Reports
-
-You can create little scriptlets and pass them into *mco inventory* with the *--script* option.
-
-You have the following data available to your reports:
-
-| Variable | Description |
-|----------|-------------|
-|time|The time the report was started, normal Ruby Time object|
-|identity|The sender id|
-|facts|A hash of facts|
-|agents|An array of agents|
-|classes|An array of CF Classes|
-
-### printf style reports
-
-Lets say you now need a report of all your IBM hardware listing hostname, serial number and product name you can write a scriptlet like this:
-
-{% highlight ruby linenos %}
-inventory do
-    format "%s:\t\t%s\t\t%s"
-
-    fields { [ identity, facts["serialnumber"], facts["productname"] ] }
-end
-{% endhighlight %}
-
-And if saved as _inventory.mc_ run it like this:
-
-{% highlight console %}
- % mco inventory -W "productname=/IBM|BladeCenter/" --script inventory.mc
- xx12:           99xxx21         BladeCenter HS22 -[7870B3G]-
- xx9:            99xxx46         BladeCenter HS22 -[7870B3G]-
- xx10:           99xxx29         BladeCenter HS22 -[7870B3G]-
- yy1:            KDxxxFR         IBM System x3655 -[79855AY]-
- xx5:            99xxx85         IBM eServer BladeCenter HS21 -[8853GLG]-
- <snip>
-{% endhighlight %}
-
-We'll add more capabilities in the future, for now you can access *facts* as a hash, *agents* and *classes* as arrays as well as *identity* as a string.
-
-
-### Perl format style reports
-To use this you need to install the *formatr* gem, once that's installed you can create a report scriptlet like below:
-
-{% highlight ruby linenos %}
-formatted_inventory do
-    page_length 20
-
-    page_heading <<TOP
-
-            Node Report @<<<<<<<<<<<<<<<<<<<<<<<<<
-                        time
-
-Hostname:         Customer:     Distribution:
--------------------------------------------------------------------------
-TOP
-
-    page_body <<BODY
-
-@<<<<<<<<<<<<<<<< @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-identity,    facts["customer"], facts["lsbdistdescription"]
-                                @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-                                facts["processor0"]
-BODY
-end
-{% endhighlight %}
-
-Here we create a paged report - 20 nodes per page - with a heading section and a 2 line report per node with identity, customer, distribution and processor.
-
-The output looks like this:
-
-{% highlight console %}
- % mco inventory -W "/dev_server/" --script inventory.mc
-
-             Node Report Sun Aug 01 10:30:57 +0100
-
- Hostname:         Customer:     Distribution:
- -------------------------------------------------------------------------
-
- dev1.one.net      rip           CentOS release 5.5 (Final)
-                                 AMD Athlon(tm) 64 X2 Dual Core Processor
-
- dev1.two.net      xxxxxxx       CentOS release 5.5 (Final)
-                                 AMD Athlon(tm) 64 X2 Dual Core Processor
-{% endhighlight %}
-
-Writing these reports are pretty ugly I freely admit, however it avoids designing our own reporting engine and it's pretty good for kicking out simple reports.  You can see the *perlform* man page for details of the reporting layouts, ours is pretty close to that thanks to Formatr
diff --git a/website/releasenotes.md b/website/releasenotes.md
deleted file mode 100644 (file)
index cc9f31c..0000000
+++ /dev/null
@@ -1,2670 +0,0 @@
----
-layout: default
-title: Release Notes
-toc: false
----
-
-This is a list of release notes for various releases, you should review these
-before upgrading as any potential problems and backward incompatible changes
-will be highlighted here.
-
-<a name="2_3_1">&nbsp;</a>
-
-## 2.3.1 - 2013/02/14
-
-This is the second release in the new development series of MCollective.  This
-release features enhancements and bug fixes.
-
-This release is for early adopters, production users should consider the 2.2.x
-series.
-
-### New Features and Improvements
-
- * Initial work towards online help, improved logging and internationalization
- * The output from *--help* has been made clearer
- * The output of a failed reply in the default *printrpc* method has been improved
-
-### Bug Fixes
-
- * The vendored JSON gem was updated to version 1.5.5 due to CVE-2013-0269
- * The RPC client inadvertently lost the ability to set discovery_timeout, this has been restored
- * Plugins with underscores in their name were not packagable on Debian, we now change underscores to dashes
- * The STOMP connector will not be maintained further and has been removed
- * A config file reading race condition were fixed, we no longer attempt to use config details before parsing the config file thus always using defaults.
- * Dependencies on packaged plugins have been made more specific to ensure updates work correctly
- * When an argument to the rpc application fails to parse the command will fail instead of continue with unexpected side effects
- * Processing of *--no-response* was broken in 2.3.0, this has been fixed
-
-### Removed Functionality
-
- * The STOMP adapter has been deprecated and removed
-
-### Online Help and Internationalization
-
-Starting in this release a number of errors and messages will start showing error codes along
-with the error text and we have a method for obtaining detailed information about each coded
-message.
-
-An example log line can be seen here:
-
-{% highlight console %}
-puppetd.rb:26 PLMC34: setting meta data in agents have been deprecated, DDL files are now being used for this information. Please update the 'puppetd.rb' agent
-{% endhighlight %}
-
-And an example CLI error string:
-
-{% highlight console %}
-% mco rpc rpcutil get_fact
-
-The rpc application failed to run: PLMC30: Action 'get_fact' needs a 'fact' argument
-
-Use the 'mco doc PLMC30' command for details about this error, use -v for full error backtrace details
-{% endhighlight %}
-
-You can now use the *mco doc PLMC30* command to get additional information about this error
-and any other error code you might see.
-
-Only a small number of errors and log lines have been updated for the new system and
-we will soon publish web versions of these help documents too which should help when
-searching for resolution to common errors.
-
-### Backwards Compatibility and Upgrading
-
-The STOMP connector has been removed, if you are using it please move to the RabbitMQ
-or ActiveMQ one before upgrading.  Especially if you use Debian which would avoid the
-package upgrading from failing
-
-### Changes since 2.3.0
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|*2013/02/14*|*Release 2.3.1*|19265|
-|2013/02/14|Initial work towards internationalization and online help|18663|
-|2013/02/14|Update vendored JSON gem for CVE-2013-0269|19265|
-|2013/02/13|Restore the ability to set a discovery timeout on a RPC client|19238|
-|2013/02/12|Replace underscores in plugin names with dashes to keep Debian happy|19200|
-|2013/02/12|Fix package building on certain Debian systems|19141|
-|2013/02/12|Remove the stomp connector|19146|
-|2013/02/07|Read the client config before trying to use any configuration options|19105|
-|2013/01/22|When an argument fails to parse in the rpc application fail rather than continue with unintended consequences|18773|
-|2013/01/22|The fix the *--no-response* argument to the rpc application that broke due to 18438|18513|
-|2013/01/22|Set *=* dependencies on the various packages that form a plugin rather than *>=*|18758|
-|2013/01/21|Improve presentation of the --help output for applications|18447|
-|2013/01/21|When a request failed via *reply.fail*, only show the message and not the half built data|18434|
-
-<a name="2_2_3">&nbsp;</a>
-
-## 2.2.3 - 2013/02/14
-
-This is a maintenance release to the current production version of MCollective.
-This release is a bug fix only release.
-
-### Bug Fixes
-
- * The vendored JSON gem was updated to version 1.5.5 due to CVE-2013-0269
- * The RPC client inadvertently lost the ability to set discovery_timeout, this has been restored
- * Plugins with underscores in their name were not packagable on Debian, we now change underscores to dashes
- * The STOMP adapter will not be maintained past this release series, we now issue deprecation warnigns
- * A config file reading race condition were fixed, we no longer attempt to use config details before parsing the config file thus always using defaults.
- * Dependencies on packaged plugins have been made more specific to ensure updates work correctly
-
-### Backwards Compatibility and Upgrading
-
-This release should be 100% backwards compatible with 2.2.0, 2.2.1 and 2.2.2, when upgrading
-from earlier releases please review the Release notes for 2.0.0.
-
-If you packaged any plugins with a underscore in their name, future packages will have a dash
-instead, this might cause upgrade problems.
-
-We are deprecating the STOMP connector, if you are using this connector please consider moving to the
-ActiveMQ or RabbitMQ specific ones.
-
-### Changes since 2.2.2
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|*2013/02/14*|*Release 2.2.3*|19265|
-|2013/02/14|Update vendored JSON gem for CVE-2013-0269|19265|
-|2013/02/13|Restore the ability to set a discovery timeout on a RPC client|19238|
-|2013/02/12|Replace underscores in plugin names with dashes to keep Debian happy|19200|
-|2013/02/12|Fix package building on certain Debian systems|19141|
-|2013/02/12|Deprecate the stomp connector|19146|
-|2013/02/07|Read the client config before trying to use any configuration options|19105|
-|2013/01/22|Set *=* dependencies on the various packages that form a plugin rather than *>=*|18758|
-
-<a name="2_0_1">&nbsp;</a>
-
-## 2.0.1 - 2013/02/14
-
-This is a maintenance release against our unsupported past production release, it brings no
-visible changes or bug fixes we only updated the vendored JSON gem to version 1.5.5 due to
-CVE-2013-0269
-
-<a name="2_2_2">&nbsp;</a>
-
-## 2.2.2 - 2013/01/17
-
-This is a maintenance release to the current production version of MCollective.
-This release is a bug fix only release.
-
-### Bug Fixes
-
- * Add the package iteration number as dependency for common packages
- * The :any validator has been restored
- * Packaging non-agent plugins failed when providing custom paths
- * Packaging on RHEL5 systems failed due to an undefined buildroot
- * When available packages will be built using rpmbuild-md5
- * Help for data plugins with no input queries are now rendered correctly
- * The rpcutil#get_data action now supports data plugins without input queries
- * The RPM packages will now require Ruby > 1.8 to improve packaging for 1.9.x
-
-### Backwards Compatibility and Upgrading
-
-This release should be 100% backwards compatible with 2.2.0 and 2.2.1, when upgrading
-from earlier releases please review the Release notes for 2.0.0.
-
-### Changes since 2.2.1
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|*2013/02/17*|*Release 2.2.2*|18258|
-|2013/01/03|Add the package iteration number as a dependency for the common packages|18273|
-|2012/12/24|Restore the :any validator|18265|
-|2012/12/19|Do not fail when packaging non-agent packages using custom paths|17281|
-|2012/12/19|Require Ruby > 1.8 in the RPM specs for Ruby 1.9|17149|
-|2012/11/08|Define a specific buildroot to support RHEL5 systems correctly|17516|
-|2012/11/08|Use the correct rpmbuild commands on systems with rpmbuild-md5|17515|
-|2012/10/22|Correctly show help for data plugins without any input queries|17137|
-|2012/10/22|Allow the rpcutil#get_data action to work with data queries that takes no input|17138|
-
-<a name="2_3_0">&nbsp;</a>
-
-## 2.3.0 - 2012/01/10
-
-This is the first release in the new development series of MCollective.  This
-release features small enhancements and bug fixes.
-
-This release is for early adopters, production users should consider the 2.2.x
-series.
-
-### Enhancements and behaviour changes
-
- * Data queries can be written without any input queries
- * Required inputs can now supply default values in their DDLs
- * Support for Ruby 1.9 was improved in the packages
- * The generated plugin documentation has been updated to show defaults and optional items
- * Errors in agents will now log backtraces on the servers to assist with debugging
- * libdirs will now be expanded to absolute paths and using relative ones will raise an error
- * Various error and logging improvements
- * Various improvements to the plugin packager
-
-### Bug fixes
-
- * Packaging non-agent plugins with custom paths caused an unexpected failure
- * The plugin packager works correctly on RHEL5 now after previously using an incorrect buildroot
- * Correctly handle custom formats passed to the aggregation plugins from the DDL
- * Failure in one aggregate plugin does not impact other aggregate functions
- * The chosen timeout for agents when using direct addressing could be wrong in some cases
- * Data plugins can now return BigNum data like those found in timestamps
- * Aggregate functions support non string data
- * Boolean flags in applications can now support --noop and --no-noop style flags
- * Data results were not raising the correct exception, this was not causing problems in practice but caused the mcollective-test gem to fail
-
-### Input defaults in the DDL
-
-You can now provide input defaults for required inputs in the DDL meaning if not
-supplied they will default to the supplied format.
-
-{% highlight ruby %}
-action "get_fact", :description => "Retrieve a single fact from the fact store" do
-     input :fact,
-           :prompt      => "The name of the fact",
-           :description => "The fact to retrieve",
-           :type        => :string,
-           :validation  => '^[\w\-\.]+$',
-           :optional    => false,
-           :maxlength   => 40,
-           :default     => "operatingsystems"
-end
-{% endhighlight %}
-
-The DDL file above defines a input *fact* that is required and sets a default value to
-*operatingsystem*.
-
-Previously the following command would have failed stating the input is required, now it
-will default to the supplied value and continue without error:
-
-{% highlight ruby %}
-$ mco rpc rpcutil get_fact
-{% endhighlight %}
-
-The defaults processing is done on the client side and not on the servers meaning at no
-point does a non compliant request get published by the clients and older MCollective servers
-will process these requests correctly.
-
-### Backwards Compatibility and Upgrading
-
-This release can cohabit with older versions with the only potential upgrade problem being
-the changes to how the libdir variable is handled.
-
-In the past a libdir could be:
-
-{% highlight ini %}
-libdir = /usr/libexec/mcollective:.mcollective.d
-{% endhighlight %}
-
-This would have the effect of looking for *.mcollective.d* in the current directory.
-
-This represented a security risk and would fail on the server side when daemonizing.
-We now force all libdir paths to be fully qualified and raises an error at start should
-you have relative paths.
-
-### Changes since 2.2.1
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2012/01/10|Raise the correct exception when trying to access unknown data items in a Data results|18466|
-|2013/01/10|Fix failing documentation generation for data plugins|18437|
-|2013/01/09|Correctly support negative boolean flags declared as --[no]-foo|18438|
-|2013/01/03|Add the package iteration number as a dependency for the common packages|18273|
-|2012/12/21|The libdirs supplied in the config file now has to be absolute paths to avoid issues when daemonising|16018|
-|2012/12/20|Logs the error and backtrace when an action fails|16414|
-|2012/12/20|Display the values of :optional and :default in DDL generated help|16616|
-|2012/12/20|Allow the query string for the get_data action in rpcutil to be 200 chars|18200|
-|2012/12/19|Do not fail when packaging non-agent packages using custom paths|17281|
-|2012/12/19|Require Ruby > 1.8 in the RPM specs for Ruby 1.9|17149|
-|2012/12/18|Allow required inputs to specify default data in DDLs|17615|
-|2012/11/12|When disconnecting set the connection to nil|17384|
-|2012/11/08|Define a specific buildroot to support RHEL5 systems correctly|17516|
-|2012/11/08|Use the correct rpmbuild commands on systems with rpmbuild-md5|17515|
-|2012/10/22|Correctly show help for data plugins without any input queries|17137|
-|2012/10/22|Allow the rpcutil#get_data action to work with data queries that takes no input|17138|
-|2012/10/03|Improve text output when providing custom formats for aggregations|16735|
-|2012/10/03|Correctly process supplied formats when displaying aggregate results|16415|
-|2012/10/03|Prevent one failing aggregate function from impacting others|16411|
-|2012/10/03|When validation fails indicate which input key has the problem|16617|
-|2012/09/26|Data queries can be written without any input queries meaning they take no input|16424|
-|2012/09/26|Use correct timeout for agent requests when using direct addressing|16569|
-|2012/09/26|Allow BigNum data to be used in data plugin replies|16503|
-|2012/09/26|Support non string data in the summary aggregate function|16410|
-
-
-<a name="2_2_1">&nbsp;</a>
-
-## 2.2.1 - 2012/10/17
-
-This is a maintenance release to the current production version of MCollective.
-This release is a bug fix only release.
-
-### Bug Fixes
-
- * Various display and stability improvements with aggregate plugins
- * Improve error messages
- * Data queries that does not take an input still had to provide a bogus query input, now not needed
- * When using direct addressing and identity filter the client timeout was incorrect
- * BigNum type data can now be used in data plugin replies
-
-### Backwards Compatibility and Upgrading
-
-This release should be 100% backwards compatible with 2.2.0, when upgrading from earlier releases
-pleas reivew the Release notes for 2.0.0.
-
-### Changes since 2.1.0
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|*2012/10/17*|*Release 2.2.1*|16965|
-|2012/10/03|Improve text output when providing custom formats for aggregations|16735|
-|2012/10/03|Correctly process supplied formats when displaying aggregate results|16415|
-|2012/10/03|Prevent one failing aggregate function from impacting others|16411|
-|2012/10/03|When validation fails indicate which input key has the problem|16617|
-|2012/09/26|Data queries can be written without any input queries meaning they take no input|16424|
-|2012/09/26|Use correct timeout for agent requests when using direct addressing|16569|
-|2012/09/26|Allow BigNum data to be used in data plugin replies|16503|
-|2012/09/26|Support non string data in the summary aggregate function|16410|
-|2012/09/14|Package discovery plugins that was left out for debian|16413|
-
-<a name="2_2_0">&nbsp;</a>
-
-## 2.2.0 - 2012/09/13
-
-This is the next production release of MCollective. It brings to an end active
-support for versions 2.1.1 and older.
-
-### Major Enhancements
-
- * A new plugin type called data plugins were added making network discovery extendible by users
- * Discovery is now pluggable allowing network based, database based, file based or any other data source to be used as a source of truth
- * Automatic result summarization methods can be declared in the DDL and users can write their own
- * A RabbitMQ specific Direct Addressing capable connector was added
- * Agent DDLs must be present on the servers, input validation is done against the DDL and prior to running user code
- * DDL files can define default values for returned data - all declared data fields are pre-populated by agents
- * DDL files can store general usage information that gets rendered via the help application
- * DDL files can declare the minimum version mcollective they need to be functional and loading plugins on older mcollective versions will fail
- * New validation logic in DDL files and Agents can now be delivered using plugins
- * A thread safe caching system was added that users can use in their Agents to store information between invocations
- * Code generators to assist writing agents
- * Support deterministic random node selection
- * Display mode can be overriden on the CLI using the new *--display* option
- * The plugin packager will now keep source debs and rpms and has had major improvements done
- * A new application called *completion* was added to assist in writing shell completion systems. ZSH and Bash examples are in *ext/*
- * Various improvements to documentation was made especially around using the CLI tools and discovery available plugins
-
-### Bug Fixes
-
- * The vendored systemu gem has been updated to remove a rude error message
- * Improved error reporting in many areas
- * Boolean and numeric data is correctly parsed on the RPC application command line
- * Improved parsing of compound filters
- * Batched requests will now all have the same request id thus improving consistency of auditing information
-
-### Deprecations
-
- * Remove the traditional Client#discovered_req method
- * The metadata section in the agent is being removed as the DDL is now present everywhere
-
-### Data Plugins
-
-A new plugin type called _data plugins_ have been added, these plugins are
-usable in discovery requests and in any agent code.
-
-You can use these plugins to expose any node side data to your client discovery
-command line, an example can be seen below, this will discover all nodes where
-_/etc/syslog.conf_ has a md5 sum matching the regular expression _/19ff4997e/_:
-
-{% highlight console %}
-$ mco rpc rpcutil ping -S "fstat('/etc/rsyslog.conf').md5 = /19ff4997e/"
-{% endhighlight %}
-
-For full information see the plugins documentation on our website. The _fstat_
-plugin seen above is included at the moment, more will be added in due course
-but as always users can also write their own suitable to their needs.
-
-### Custom Discovery Sources
-
-A new type of plugin that can be used as alternative data sources for discovery
-data has been added. The traditional network broadcast mode is supported and
-remains the default but a new flat file one was added.
-
-Custom discovery sources can be made the default for a client using the
-*default_discovery_method* configuration option but can be selected on the
-command line using _--disc-method_.
-
-All applications now have a _--nodes_ option that takes as an argument a flat
-file full of mcollective identity names, one per line.
-
-Users can write their own discovery plugins and distribute it using the normal
-plugin packager. A complex example can be seen in the community plugin site
-for the MongoDB registration plugin.
-
-In the event that the _-S_ filter is used the network discovery mode will be
-forced so that data source plugins in discovery queries will always work as
-expected.
-
-This feature requires Direct Addressing.
-
-### DDL files on the servers
-
-The DDL files now have to be on the servers and the clients. On the servers the
-results will be pre-populated with default data for all defined output values of
-a specific action and you can now supply defaults.
-
-Additionally input will be validated on each node prior to running the agent
-code providing consistent input validation on client and server.  This should
-remove the need to add *validate* statements to agents.
-
-An example for a Nagios plugin can be seen below, here we default to *UNKNOWN*
-so that even if the action fails to run we will still see valid data being
-returned thats appropriate for the specific use case.
-
-{% highlight ruby %}
-action "runcommand", :description => "Run a NRPE command" do
-  output :exitcode,
-         :description  => "Exit Code from the Nagios plugin",
-         :display_as   => "Exit Code",
-         :default      => 3
-end
-{% endhighlight %}
-
-### Summarization Plugins
-
-Often custom applications are written just to summarize data like the *facts*
-application or *nrpe* ones.
-
-We have added a new plugin type that allows you to define summarization logic
-and included a few of our own.  These summaries are declared in the DDL, here is
-a section from the new DDL for the *get_fact* action:
-
-{% highlight ruby %}
-action "get_fact", :description => "Retrieve a single fact from the fact store" do
-  output :value,
-          :description => "The value of the fact",
-          :display_as => "Value"
-
-  summarize do
-    aggregate summary(:value)
-  end
-end
-{% endhighlight %}
-
-Here we are using the *summarize* block to say that we wish to summarize the
-output *:value*.  The *summary(:value)* is the call to a custom plugin and you
-can provide your own.
-
-Now when interacting with this action you will see summaries produced
-automatically:
-
-{% highlight ruby %}
-% mco rpc rpcutil get_fact fact=operatingsystemrelease
-.
-.
-dev2
-    Fact: operatingsystemrelease
-   Value: 6.2
-
-
-Summary of Value:
-
-    6.2 = 19
-    6.3 = 7
-
-Finished processing 26 / 26 hosts in 294.97 ms
-{% endhighlight %}
-
-The last section of the rpc output shows the summarization in action.
-
-The NRPE plugin on GitHub shows an example of a Nagios specific aggregation
-function and the plugin packager supports distributing these plugins.
-
-### Validation Plugins
-
-Users can now write their own plugins to perform input validation, these
-validations are usable in DDL files and agents.
-
-Below is a snippet from a DDL file using a custom *exim_msgid* validation
-plugin:
-
-{% highlight ruby %}
-    input :msgid,
-          :prompt      => "Message ID",
-          :description => "Valid message id currently in the mail queue",
-          :type        => :string,
-          :validation  => :exim_msgid,
-          :optional    => false,
-          :maxlength   => 16
-{% endhighlight %}
-
-And a snippet using the same plugin inside your agent:
-
-{% highlight ruby %}
-action "retrymsg" do
-  validate :msgid, :exim_msgid
-
-  # call out to exim to retry the message
-end
-{% endhighlight %}
-
-The error messages shown when validation fails are more user friendly than
-before, in this example the new error would be *Not a valid Exim Message ID*
-where in the past it would have been *value should match ^(?:[+-]\d{4})?(?:\[\d+\] )?(\w{6}\-\w{6}\-\w{2})/*
-
-### Code generation
-
-Code for agents and data sources can now be generated to assist development, you
-can use the _plugin_ command to create a basic skeleton agent or data source
-including the DDL files.
-
-{% highlight console %}
-$ mco plugin generate agent myagent actions=do_something,do_something_else
-{% endhighlight %}
-
-Defaults used in the metadata templates can be set in the config file:
-
-{% highlight ini %}
-plugin.metadata.url=http://devco.net
-plugin.metadata.author=R.I.Pienaar <rip@devco.net>
-plugin.metadata.license=ASL2.0
-plugin.metadata.version=0.0.1
-{% endhighlight %}
-
-All generator produced output will have these settings set, the other fields are
-constructed using a pattern convenient for using in your editor as a template.
-
-### Backwards Compatibility and Upgrading
-
-As of this version every agent on every node and client must have a DDL file. If
-the DDL file is not present or not valid the agent will not activate.  Further
-input validation is done according to the content of the DDL prior to running
-any actions.  You should therefore prepare for this upgrade by writing and
-deploying DDL files for all your agents.
-
-Version 2.0.0 and 2.2.0 can co-exist on the same network. If a new client uses
-any of the new features added such as data plugins the older clients will simply
-refuse to run the request but requests using features shared between versions
-will continue to work.
-
-When you first start this version of mcollectived you will see warnings logged
-similar to the one below:
-
-{% highlight ruby %}
-puppetd.rb:26: setting meta data in agents have been deprecated, DDL files are now being used for this information.
-{% endhighlight %}
-
-This is only a warning and not a critical problem.  The next major release will
-remove support for metadata in agents.
-
-Upgrading from versions prior to 2.0.0 was not tested, please refer to the
-release notes for 2.0.0.
-
-<a name="2_1_1">&nbsp;</a>
-
-## 2.1.1 - 2012/07/12
-
-This release features major new features, enhancements and bug fixes.
-
-This release is for early adopters, production users should consider the 2.0.x
-series.
-
-### Major Enhancements
-
- * A new discovery source was added capable of querying agent properties
- * When doing limited discovery you can now supply a random seed for deterministic random selection
- * A *get_data* action has been added to the *rpcutil* agent to retrieve the result of a data plugin
- * RPC Agents must have DDLs on the MCollective Servers, agents will not load without them
- * Output values can now have defaults assigned in the DDL, the server will set those defaults before running an action
- * A new plugin type used to summarize sets of replies has been added. Summarization is declared in the DDL for an Agent
-
-### Bug Fixes
-
- * Correctly parse numeric and boolean input arguments in the RPC application
-
-### Deprecations
-
- * The old *Client#discovered_req* is removed along with the *controller* application that used it
- * Parsing compound filters were improved wrt complex regular expressions
- * Metadata sections in agents are not needed anymore and deprecation notices are logged when they are found
-
-### Summarization Plugins
-
-Often custom applications are written just to summarize data like the *facts*
-application or *nrpe* ones.
-
-We have added a new plugin type that allows you to define summarization logic
-and included a few of our own.  These summaries are declared in the DDL, here is
-a section from the new DDL for the *get_fact* action:
-
-{% highlight ruby %}
-action "get_fact", :description => "Retrieve a single fact from the fact store" do
-  output :value,
-          :description => "The value of the fact",
-          :display_as => "Value"
-
-  summarize do
-    aggregate summary(:value)
-  end
-end
-{% endhighlight %}
-
-Here we are using the *summarize* block to say that we wish to summarize the
-output *:value*.  The *summary(:value)* is the call to a custom plugin and you
-can provide your own.
-
-Now when interacting with this action you will see summaries produced
-automatically:
-
-{% highlight ruby %}
-% mco rpc rpcutil get_fact fact=operatingsystemrelease
-.
-.
-dev2
-    Fact: operatingsystemrelease
-   Value: 6.2
-
-
-Summary of Value:
-
-    6.2 = 19
-    6.3 = 7
-
-Finished processing 26 / 26 hosts in 294.97 ms
-{% endhighlight %}
-
-The last section of the rpc output shows the summarization in action.
-
-The NRPE plugin on GitHub shows an example of a Nagios specific aggregation
-function and the plugin packager supports distributing these plugins.
-
-### DDL files on the servers
-
-The DDL files now have to be on the servers and the clients.  On the servers the
-results will be pre-populated with default data for all defined output values of
-a specific action and you can now supply defaults.
-
-An example for a Nagios plugin can be seen below, here we default to *UNKNOWN*
-so that even if the action fails to run we will still see valid data being
-returned thats appropriate for the specific use case.
-
-{% highlight ruby %}
-action "runcommand", :description => "Run a NRPE command" do
-  output :exitcode,
-         :description  => "Exit Code from the Nagios plugin",
-         :display_as   => "Exit Code",
-         :default      => 3
-end
-{% endhighlight %}
-
-As the servers now have the DDL the *metadata* section at the top of agents are
-not needed anymore and deprecations will be logged when the mcollectived starts
-up warning you of this.
-
-### Backwards Compatibility and Upgrading
-
-As this release now requires DDL files to exist before an agent can be loaded in
-the server you might have to adjust your deployment strategy and possibly write
-some DDLs for your custom agents.  The DDL files have to be on both client and
-servers.
-
-The servers will now pre-populate the replies with all output defined in the DDL
-and supply defaults if no default is provided in the DDL it will default to nil.
-This might potentially change the behavior of custom applications that are
-designed around the approach of checking if a field is included in the results
-or not.
-
-When you first start this version of mcollectived you will see warnings logged
-similar to the one below:
-
-{% highlight ruby %}
-puppetd.rb:26: setting meta data in agents have been deprecated, DDL files are now being used for this information.
-{% endhighlight %}
-
-This is only a warning and not a critical problem.  Once 2.2.0 is out we will be
-updating all the agents to remove metadata sections in favour of those in the DDL.
-You should also remove metadata from your own agents.
-
-### Changes since 2.1.0
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2012/07/11|Add a --display option to RPC clients that overrides the DDL display mode|15273|
-|2012/07/10|Do not add a metadata to agents created with the generator as they are now deprecated|15445|
-|2012/07/03|Correctly parse numeric and boolean data on the CLI in the rpc application|15344|
-|2012/07/03|Fix a bug related to parsing regular expressions in compound statements|15323|
-|2012/07/02|Update vim snippets in ext for new DDL features|15273|
-|2012/06/29|Create a common package for agent packages containing the DDL for servers and clients|15268|
-|2012/06/28|Improve parsing of compound filters where the first argument is a class|15271|
-|2012/06/28|Add the ability to declare automatic result summarization in the DDL files for agents|15031|
-|2012/06/26|Surpress subscribing to reply queues when no reply is expected|15226|
-|2012/06/25|Batched RPC requests will now all have the same requestid|15195|
-|2012/06/25|Record the request id on M::Client and in the RPC client stats|15194|
-|2012/06/24|Use UUIDs for the request id rather than our own weak implementation|15191|
-|2012/06/18|The DDL can now define defaults for outputs and the RPC replies are pre-populated|15087|
-|2012/06/18|Remove unused agent help code|15084|
-|2012/06/18|Remove unused code from the *discovery* agent related to inventory and facts|15083|
-|2012/06/18|Nodes will now refuse to load RPC agents without DDL files|15082|
-|2012/06/18|The Plugin Name and Type is now available to DDL objects|15076|
-|2012/06/15|Add a get_data action to the rpcutil agent that can retrieve data from data plugins|15057|
-|2012/06/14|Allow the random selection of nodes to be deterministic|14960|
-|2012/06/12|Remove the Client#discovered_req method and add warnings to the documentation about its use|14777|
-|2012/06/11|Add a discovery source capable of doing introspection on running agents|14945|
-|2012/06/11|Only do identity filter optimisations for the *mc* discovery source|14942|
-
-<a name="2_1_0">&nbsp;</a>
-
-## 2.1.0 - 2012/06/08
-
-This is the first release in the new development series of MCollective.  This
-releas features major new features and enhancements.
-
-This release is for early adopters, production users should consider the 2.0.x
-series.
-
-### Major Enhancements
-
- * Discovery requests can now run custom data plugins on nodes to facilitate discovery against any node-side data
- * Discovery sources are now pluggable, one supporting flat files are included in this release
- * All applications now have a --nodes option to read a text file of identities to operate on
- * A new _completion_ application was added to assist with shell completion systems, zsh and bash tab completion plugins are in ext
- * Users can now use a generator to create skeleton agents and data sources
-
-### Changes in behavior
-
- * The _mco controller_ application is being deprecated for the next major release and has now been removed from the development series
- * The _mco find_ application is now a discovery client so it's output mode has changed slightly but the functionality stays the same
-
-### Bug Fixes
-
- * Numerous small improvement to user facing errors and status outputs have been made
- * Sub collectives combined with direct addressing has been fixed
- * Various packaging issues were resolved
- * The ActiveMQ and Stomp connectors will now by default handle dual homed IPv6 and IPv4 hosts better in cases where the IPv6 target isn't reachable
-
-### Data Plugins
-
-A new plugin type called _data plugins_ have been added, these plugins are
-usable in discovery requests and in any agent code.
-
-You can use these plugins to expose any node side data to your client discovery
-command line, an example can be seen below, this will discover all nodes where
-_/etc/syslog.conf_ has a md5 sum matching the regular expression
-_/19ff4997e/_:
-
-{% highlight console %}
-$ mco rpc rpcutil ping -S "fstat('/etc/rsyslog.conf').md5 = /19ff4997e/"
-{% endhighlight %}
-
-For full information see the plugins documentation on our website. The _fstat_
-plugin seen above is included at the moment, more will be added in due course
-but as always users can also write their own suitable to their needs.
-
-### Custom Discovery Sources
-
-Since the introduction of direct addressing mode in 2.0.0 you've been able to
-pragmatically specify arbitrary host lists as discovery data but this was never
-exposed to the user interface.
-
-We now introduce plugins that can be used as alternative data sources and
-include the traditional network broadcast mode and a flat file one.  The hope
-is that more will be added in future perhaps integrating with systems like
-PuppetDB.  There is also one that uses the MongoDB Registration plugin to build
-a local node cache.
-
-Custom discovery sources can be made the default for a client using the
-*default_discovery_method* configuration option but can be selected on the
-command line using _--disc-method_.
-
-All applications now have a _--nodes_ option that takes as an argument a flat
-file full of mcollective identity names, one per line.
-
-Users can write their own discovery plugins and distribute it using the normal
-plugin packager.
-
-In the event that the _-S_ filter is used the network discovery mode will be
-forced so that data source plugins in discovery queries will always work as
-expected.
-
-### Code generation
-
-Code for agents and data sources can now be generated to assist development,
-you can use the _plugin_ command to create a basic skeleton agent or data source
-including the DDL files.
-
-{% highlight console %}
-$ mco plugin generate agent myagent actions=do_something,do_something_else
-{% endhighlight %}
-
-Defaults used in the metadata templates can be set in the config file:
-
-{% highlight ini %}
-plugin.metadata.url=http://devco.net
-plugin.metadata.author=R.I.Pienaar <rip@devco.net>
-plugin.metadata.license=ASL2.0
-plugin.metadata.version=0.0.1
-{% endhighlight %}
-
-All generator produced output will have these settings set, the other fields
-are constructed using a pattern convenient for using in your editor as a
-template.
-
-### Backwards Compatibility and Upgrading
-
-This release can co-exist with 2.0.0 but using the new discovery data plugins in a
-mixed environment will result in the old nodes not being discovered and they will
-log exceptions in their logs.  This was done by choice and ensures the safest
-possible upgrade path.
-
-When the 2.0.0 collective is running with directed mode enabled a client using the
-new discovery plugins will be able to communicate wth the older nodes without
-problem.
-
-### Changes since 2.0.0
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2012/06/07|Force discovery state to be reset when changing collectives in the RPC client|14874|
-|2012/06/07|Create code generators for agents and data plugins|14717|
-|2012/06/07|Fix the _No response from_ report to be correctly formatted|14868|
-|2012/06/07|Sub collectives and direct addressing mode now works correctly|14668|
-|2012/06/07|The discovery method is now pluggable, included is one supporting flat files|14255|
-|2012/05/28|Add an application to assist shell completion systems with bash and zsh completion plugins|14196|
-|2012/05/22|Improve error messages from the packager when a DDL file cannot be found|14595|
-|2012/05/17|Add a dependency on stomp to the rubygem|14300|
-|2012/05/17|Adjust the ActiveMQ and Stomp connect_timeout to allow IPv4 fall back to happen in dual homed hosts|14496|
-|2012/05/16|Add a plugable data source usable in discovery and other plugins|14254|
-|2012/05/04|Improve version dependencies and upgrade experience of debian packages|14277|
-|2012/05/03|Add the ability for the DDL to load DDL files from any plugin type|14293|
-|2012/05/03|Rename the MCollective::RPC::DDL to MCollective::DDL to match its larger role in all plugins|14254|
-
-<a name="2_0_0">&nbsp;</a>
-
-## 2.0.0 - 2012/04/30
-
-This is the next production release of MCollective.  It brings to an
-end active support for versions 1.3.3 and older.
-
-This release brings to general availability all the features added in the
-1.3.x development series.
-
-### Major Enhancements
-
- * Complete messaging protocol rewrite to enable direct style connectivity that would allow programs to bypass normal discovery instead using their own data sources
- * An additional more robust messaging paradigm supporting a more assured addressing and delivery scheme
- * Batched mode allowing users to address machines in small groups thus avoiding thundering herd and enabling more granular changes
- * A more complete language for expressing discovery that includes and/or/not style queries across the infrastructure
- * Improved Stomp connection security using normal industry standard Certificate Authority validated TLS
- * New connector that uses ActiveMQ specific features for better performance and scalability
- * Security of the SSL and AES security plugins have been improved for tamper protection by middle men
- * A message validity period has been introduced to lower the window of message replay attacks
- * Better error handling and better logging for Stomp connections
- * JSON output from the 'rpc' application
- * Ability to pipe RPC requests into each other creating a chain of related RPC calls
- * Better validations, better error handling and better documentation creation from the DDL
- * Performance improvements in the CLI, more consistently formatted output of received data
- * A Ruby GEM of the client is now made available on rubygems.org
- * The rc script for Debian based systems have been improved to prevent duplicate daemons from running
- * Built in packager for plugins into native OS packages - RedHat and Debian supported
- * MS Windows Support
-
-### Point to Point comms
-
-Previously MCollective could only broadcast messages and was tied to a discovery model.
-
-The messaging layer now supports per node destinations that allows you to address a node, even if its down,
-doesn't yet exist or if you cannot come up with a filter that would match a group of arbitrarily selected
-nodes.
-
-When this mode is in use the user configure which machine to communicate with using either text, arrays or
-JSON data.  It will then communicate directly to those nodes via the middleware and if any of them are down
-you will get the usual no responses report after DDL configured timeout, this is a smooth transparent to the
-end user mix in communication modes.
-
-It is ideal for building deployers, web apps and so forth where you know exactly which nodes should be there
-and you'd like to influence the MCollective network addressing, perhaps from a CMDB you built yourself.
-
-This is the start towards an assured style of delivery, you can consider it the TCP to MCollective's UDP.
-Both modes of communication will be supported in the future and both will have access to all the same agents
-and clients.
-
-This is feature is enabled using the *direct_addressing* configuration option. At present only the new
-ActiveMQ connector supports this at scale.  The ActiveMQ connector is now the recommended standard connector
-combined with Apache ActiveMQ.  More brokers could be supported in future.
-
-### Pluggable / Optional Discovery
-
-If the user did _mco rpc rpcutil ping -I box.example.com -I another.example.com_ mcollective will now just
-assume you know what she wants, it won't do a discover to confirm those machines exist or not, it will just go
-and communicate with them.  This is a big end user visible speed improvement.  If however you did a filter
-like *-I /example.com/* mcollective cannot know which machines you want to reach and so a traditional
-broadcast discovery is done first.
-
-When the direct addressing mode is enabled various behind the scenes optimizations are being done:
-
- * If a discovery is done and it finds you only want to address 10 or fewer nodes it will use direct mode for that
-   request.  This avoids a second needless broadcast.  This is less efficient to the middleware but does not send
-   needless messages to uninterested nodes that would then just ignore them.
- * The _rpc_ application supports piping output from one to the next.  Example of this below.
-
-{% highlight console %}
-$ mco rpc package update package=foo -W customer=acme -j|mco rpc service restart service=bar
-{% endhighlight %}
-
-This will update a package on machines matching *customer=foo* and then restart the service *bar* on those
-machines.
-
-The first request is doing traditional discovery based on the fact while the 2nd request is not doing
-discovery at all, it uses the JSON output enabled by -j as discovery data and then restart the service on only
-those machines.
-
-These abilities are exposed in the SimpleRPC client API and you can write your own schemes, query your own
-databases etc
-
-### Batching
-
-Often the speed of MCollective is a problem, you want to install a package on thousands of machines but your
-APT or YUM server isn't up to the task.
-
-You can now do batching of requests:
-
-{% highlight console %}
-$ mco package update myapp --batch 10 --batch-sleep 60
-{% endhighlight %}
-
-This performs the update as usual but only affecting machines in groups of 10 and sleeps for a minute between.
-
-You can also access this functionality via the API please see the docs for usage.  Any existing script or
-application should support this functionality without any code changes.
-
-The results, error reporting, statistics reporting and so forth all stays consistent with non batched
-behavior.
-
-At any time you can interrupt the process and only the current group of machines will have been affected.
-
-The batching requires a direct addressing capable collective as it is built using the new direct to node
-communications and pluggable discovery features
-
-### ActiveMQ specific connector
-
-A new connector plugin has been added that is specific to ActiveMQ and is compatible with the new direct
-addressing communication system.
-
-You will need to change your ActiveMQ configuration to support this plugin, see the documentation for this
-plugin and the examples in _ext/activemq_ have also been updated for the new plugin.
-
-Anyone who use ActiveMQ is strongly recommended to use this plugin as it uses a few ActiveMQ specific
-optimizations that can have a big performance enhancing effect on your collective.
-
-### Packaging Agent plugins
-
-Distributing agents has been a problem as they are just files that have limited meta data and attached.
-
-We now support packaging agents into rpm or deb packages, your agent must have a DDL file for this to work:
-
-{% highlight console %}
-$ mco plugin package . --vendor "My Company"
-Successfully built RPM 'mcollective-exim_ng-client-0.1-1.noarch.rpm'
-Successfully built RPM 'mcollective-exim_ng-common-0.1-1.noarch.rpm'
-Successfully built RPM 'mcollective-exim_ng-agent-0.1-1.noarch.rpm'
-{% endhighlight %}
-
-The packages will have meta data like Author, Version and so forth as per your DDL file.
-
-Users can provide their own packaging implementations for other package managers or custom layouts using the
-MCollective plugin system.
-
-### Full verified CA
-
-When using the new ActiveMQ specific connector combined with Stomp version 1.2.2 or newer you can get full CA
-verified connection handling ensuring that only clients using signed certificates can connect to ActiveMQ.
-
-The documentation for the ActiveMQ SSL setup now includes instructions on setting up ActiveMQ and your clients
-using the built in Puppet CA but any CA could be used to manage these certificates.
-
-This feature will work best when ActiveMQ 5.6.0 is released in a few weeks since there will then be a NIO+SSL
-Stomp connector. The current SNAPSHOT release of ActiveMQ has this feature as well as the most recent Service
-Pack release of the Fuse Message Broker.
-
-### MS Windows Support
-
-The MS Windows platform is now supported as both a client and a server.  The _ext/windows_ directory has some
-helpers and read me documentation that has been confirmed to work but we have not yet completed packaging
-ourselves so this is still a manual process.
-
-Combined with Puppet 2.7.12 or newer the Package and Service agents can be used to manage Windows resources
-using the same commands as those on Linux via mcollective.
-
-### New Discovery Language
-
-Previously dicovery was very limited, filters were simply run one after the other and you could not do
-anything complex like a mix of OR and AND boolean logic.
-
-A new compact discovery language was introduced perfect for use on the command line, an example below:
-
-{% highlight console %}
-$ mco find -S "((fqdn=/example.com/ or fqdn=/another.com/) or customer=acme) and apache and physicalprocessorcount>2"
-{% endhighlight %}
-
-The EBNF for this language can be seen below, it's available on the command line and the API
-
-    compound = ["("] expression [")"] {["("] expression [")"]}
-    expression = [!|not]statement ["and"|"or"] [!|not] statement
-    char = A-Z | a-z | < | > | => | =< | _ | - |* | / { A-Z | a-z | < | > | => | =< | _ | - | * | / | }
-    int = 0|1|2|3|4|5|6|7|8|9{|0|1|2|3|4|5|6|7|8|9|0}
-
-### Backwards Compatibility and Upgrading
-
-This release is not compatible with older versions. Client scripts and agents written for older versions will
-continue to work but a network hosting both 2.0.0 clients and older one will effectively be split into 2
-networks.  While planning your upgrade you should plan to have machines running the client for both versions
-to retain full control during upgrade.  The upgrade is best done in an scheduled window where all machines are
-updated together.
-
-While upgrading you must ensure that the plugins that come with the release are updated at the same time as
-the release.  Older security and connector plugins will not function with this release.  This also means if
-you wrote your own connector or security plugin you will need to port these prior to upgrading.
-
-Past this it should be a simple matter of updating using your operating systems package manager.
-
-We recommend you switch to the new ActiveMQ based connector plugin away from the previous generic Stomp one as
-this is the primary supported method of deployment and the generic Stomp one will be deprecated in future.
-Additionally the Stomp connector does not support the new direct messaging communications mode.
-
-In order to upgrade to the new ActiveMQ connector you will need to change your broker setup including ACLs,
-transport connectors, message policies and inter broker connections.  Sample configuration files for single
-and multi broker setups can be found in the Git repository or the tar file in _ext/activemq_
-
-<a name="1_3_3">&nbsp;</a>
-
-## 1.3.3 - 2012/04/05
-
-This is a release in the development series of MCollective.  It feature major new features and bug fixes.
-
-This release is for early adopters, production users should consider the 1.2.x series.
-
-### Major Enhancements
-
- * The MS Windows platform is now supported, packaging is still outstanding
- * Agents can now be packaged to native OS packages using the new _mco plugin_ command
- * _mco help rpc_ now show the help for the rpc application, _mco plugin doc puppetd_ shows the help for the puppetd agent
- * Full CA verified Stomp is supported and documented between ActiveMQ and MCollective using Stomp > 1.2.2
- * Application exit codes have been standardized using a new _halt_ helper function
- * A new validator that allows users to check if a supplied value is one of a fixed list
- * The syslog facility can now be set in the configuration file
- * The client libraries are now available as a Ruby Gem
- * Batch mode can now be enabled and disabled at will in an application
- * The client config files now default to console based logging at warn level
-
-### Bug Fixes
-
- * nil or empty results are correctly displayed by printrpc
- * Some exceptions under Ruby 1.9.3 when using run() related to nil exit code has been fixed
- * Various exceptions have been silence in inventory application, stomp plugin, rpc application and others
- * Previous SSL_read errors when using the Stomp+TLS configuration is now avoided on Ruby 1.8
-
-### Packaging Agent plugins
-
-Distributing agents has been a problem as they are just files that have limited meta data and attached.
-
-We now support packaging agents into rpm or deb packages, your agent must have a DDL file
-for this to work:
-
-{% highlight console %}
-$ mco plugin package . --vendor "My Company"
-Successfully built RPM 'mcollective-exim_ng-client-0.1-1.noarch.rpm'
-Successfully built RPM 'mcollective-exim_ng-common-0.1-1.noarch.rpm'
-Successfully built RPM 'mcollective-exim_ng-agent-0.1-1.noarch.rpm'
-{% endhighlight %}
-
-The packages will have meta data like Author, Version and so forth as per your DDL file.
-
-We support building all the main plugin types in this manner but need to restructure the plugins
-repository to support this layout.
-
-To use this you need to install the fpm gem, you must install 0.4.3 and not a newer version, we are
-currently working on removing the fpm dependency as it's proven to be too unreliable to use.
-
-Users can provide their own packaging implementations for other package managers or custom layouts
-using the MCollective plugin system.
-
-### Full verified CA
-
-When using the new ActiveMQ specific connector combined with Stomp version 1.2.2 or newer you can
-get full CA verified connection handling ensuring that only clients using signed certificates
-can connect to ActiveMQ.
-
-The documentation for the ActiveMQ SSL setup now includes instructions on setting up ActiveMQ and your
-clients using the built in Puppet CA but any CA could be used to manage these certificates.
-
-This feature will work best when ActiveMQ 5.6.0 is released in a few weeks since there will then be a NIO+SSL
-Stomp connector. The current SNAPSHOT release of ActiveMQ has this feature as well as the most recent Service
-Pack release of the Fuse Message Broker.
-
-### MS Windows Support
-
-The MS Windows platform is now supported as both a client and a server.  The _ext/windows_ directory
-has some helpers and read me documentation that has been confirmed to work but we have not yet
-completed packaging ourselves so this is still a manual process.
-
-Combined with Puppet 2.7.12 or newer the Package and Service agents can be used to manage Windows
-resources using the same commands as those on Linux via mcollective.
-
-### Backwards compatibility
-
-This release is backwards compatible with version 1.3.2, if you are coming from an older version please
-review earlier release notes.
-
-If you have been using the ActiveMQ specific plugin and its SSL settings you will now need to enable
-fallback mode as it will now only connect to ActiveMQ machines that present the correct CA certificate
-and will refuse to use anonymous certificates
-
-{% highlight ini %}
-plugin.activemq.pool.1.ssl.fallback = 1
-{% endhighlight %}
-
-### Changes since 1.3.2
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2012/04/04|Use the MCollective::SSL utility class for crypto functions in the SSL security plugin|13615|
-|2012/04/02|Support reading public keys from SSL Certificates as well as keys|13534|
-|2012/04/02|Move the help template to the common package for both Debian and RedHat|13434|
-|2012/03/30|Support Stomp 1.2.2 CA verified connection to ActiveMQ|10596|
-|2012/03/27|_mco help rpc_ now shows the help for the rpc application|13350|
-|2012/03/22|Add a mco command that creates native OS packaging for plugins|12597|
-|2012/03/21|Default to console based logging at warning level for clients|13285|
-|2012/03/20|Work around SSL_read errors when using SSL or AES plugins and Stomp+SSL in Ruby < 1.9.3|13207|
-|2012/03/16|Improve logging for SSL connections when using Stomp Gem newer than 1.2.0|13165|
-|2012/03/14|Simplify handling of signals like TERM and INT and remove pid file on exit|13105|
-|2012/03/13|Create a conventional place to store implemented_by scripts|13064|
-|2012/03/09|Handle exceptions added to the Stomp 1.1 compliant versions of the Stomp gem|13020|
-|2012/03/09|Specifically enable reliable communications while using the pool style syntax|13040|
-|2012/03/06|Initial support for the Windows Platform|12555|
-|2012/03/05|Application plugins can now disable any of 3 sections of the standard CLI argument parsers|12859|
-|2012/03/05|Fix base 64 encoding and decoding of message payloads that would previous raise unexpected exceptions|12950|
-|2012/03/02|Treat :hosts and :nodes as equivalents when supplying discovery data, be more strict about flags discover will accept|12852|
-|2012/03/02|Allow exit() to be used everywhere in application plugins, not just in the main method|12927|
-|2012/03/02|Allow batch mode to be enabled and disabled on demand during the life of a client|12854|
-|2012/02/29|Show the progress bar before sending any requests to give users feedback as soon as possible rather than after first result only|12865|
-|2012/02/23|Do not log exceptions in the RPC application when a non existing action is called with request parameters|12719|
-|2012/02/17|Log miscellaneous Stomp errors at error level rather than debug|12705|
-|2012/02/17|Improve subscription tracking by using the subID feature of the Stomp gem and handle duplicate exceptions|12703|
-|2012/02/15|Improve error handling in the inventory application for non responsive nodes|12638|
-|2012/02/14|Comply to Red Hat guideline by not setting mcollective to start by default after RPM install|9453|
-|2012/02/14|Allow building the client libraries as a gem|9383|
-|2012/02/13|On Red Hat like systems read /etc/sysconfig/mcollective in the init script to allow modification of the environment|7441|
-|2012/02/13|Make the handling of symlinks to the mco script more robust to handle directories with mc- in their name|6275|
-|2012/02/01|systemu and therefore MC::Shell can sometimes return nil exit code, the run() method now handles this better by returning -1 exit status|12082|
-|2012/01/27|Improve handling of discovery data on STDIN to avoid failures when run without a TTY and without supplying discovery data|12084|
-|2012/01/25|Allow the syslog facility to be configured|12109|
-|2012/01/13|Add a RPC agent validator to ensure input is one of list of known good values|11935|
-|2012/01/09|The printrpc helper did not correctly display empty strings in received output|11012|
-|2012/01/09|Add a halt method to the Application framework and standardize exit codes|11280|
-|2011/11/21|Remove unintended dependency on _pp_ in the ActiveMQ plugin|10992|
-|2011/11/17|Allow reply to destinations to be supplied on the command line or API|9847|
-
-
-<a name="1_3_2">&nbsp;</a>
-
-## 1.3.2 - 2011/11/17
-
-This is a release in the development series of MCollective.  It feature major new features.
-
-This release is for early adopters, production users should consider the 1.2.x series.
-
-### Enhancements
-
- * Handling of syntax errors in Application plugins have been improved
- * The limit method can now be set per RPC Client instance
- * Optionally show response distribution in the _ping_ application with the _--graph_ option
- * Expose a statistic about expired messages via the _rpcutil_ agent and show them in the inventory application.
- * Remove all the _mc-_ scripts that has been ported to applications
- * AES and TTL security plugins prevent tampering with the TTL and Message Times
- * The RPC client can now raise an exception rather than exit on failure - ideal for use in web apps
- * Discovery during requests that has a specific limit count set have been sped up
- * Specific types for :number, :float and :integer has been aded to the DDL and the RPC application has special handling for them
- * Caller ID, Certificate Names and Identity Names can now only be word characters, full stop and dash
- * Security plugins are now quicker to ignore miss directed messages
- * The client now unsubscribes from topics it does not need anymore
- * SimpleRPC now supports performing actions in batches with a sleep between each batch
- * A direct request capable ActiveMQ specific plugin has been included
- * Message TTLs can be set globally in the config or in the API
-
-### ActiveMQ specific connector
-
-A new connector plugin has been added that is specific to ActiveMQ and is compatible
-with the new direct addressing communication system.
-
-You will need to change your ActiveMQ configuration to support this plugin, see the
-documentation for this plugin and the examples in _ext/activemq_ have also been
-updated for the new plugin.
-
-Anyone who use ActiveMQ is strongly recommended to use this plugin as it uses a
-few ActiveMQ specific optimizations that can have a big performance enhancing effect
-on your collective.
-
-### Batching
-
-Often the speed of MCollective is a problem, you want to install a package on thousands
-of machines but your APT or YUM server isn't up to the task.
-
-You can now do batching of requests:
-
-{% highlight console %}
-$ mco package update myapp --batch 10 --batch-sleep 60
-{% endhighlight %}
-
-This performs the update as usual but only affecting machines in groups of 10 and
-sleeps for a minute between.
-
-You can also access this functionality via the API please see the docs for usage.
-Any existing script or application should support this functionality without any
-code changes.
-
-The results, error reporting, statistics reporting and so forth all stays consistant
-with non batched behavior.
-
-The batching requires a direct addressing capable collective.
-
-### Backwards Compatibility
-
-As this release does a few more tweaks to the security system it might not work with older
-versions of MCollective.
-
-Hopefully this will be the last release in this dev cycle to break backwards compatibility
-as we're nearing the next major release.
-
-#### Identities, Certificates and Caller ID names
-
-These items have been tightened up to only match _\w\.-_.  Plugins like the registration
-ones might assume it is safe to just write files based on names contained in these fields
-so rather than expect everyone to write secure code the framework now just enforce
-a safe approach to these.
-
-This means if you have cases that would violate this rule you would need to change that
-configuration prior to upgrading to 1.3.2
-
-#### AES and SSL plugins are more secure
-
-If you use the AES or SSL plugins you will need to plan your rollout carefully, these plugins
-are not capable of communicating with older versions of MCollective.
-
-#### Changes since 1.3.1
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2011/11/16|Imrpove error reporting for code errors in application plugins|10883|
-|2011/11/15|The limit method is now configurable on each RPC client as well as the config file|7772|
-|2011/11/15|Add a --graph option to the ping application that shows response distribution|10864|
-|2011/11/14|An ActiveMQ specific connector was added that supports direct connections|7899|
-|2011/11/11|SimpleRPC clients now support native batching with --batch|5939|
-|2011/11/11|The client now unsubscribes from topics when it's idle minimising the risk of receiving missdirected messages|10670|
-|2011/11/09|Security plugins now ignore miss directed messages early thus using fewer resources|10671|
-|2011/10/28|Support ruby-1.9.2-p290 and ruby-1.9.3-rc1|10352|
-|2011/10/27|callerid, certificate names, and identity names can now only have \w . and - in them|10327|
-|2011/10/25|When discovery information is provided always accept it without requiring reset first|10265|
-|2011/10/24|Add :number, :integer and :float to the DDL and rpc application|9902|
-|2011/10/22|Speed up discovery when limit targets are set|10133|
-|2011/10/22|Do not attempt to validate TTL and Message Times on replies in the SSL plugin|10226|
-|2011/10/03|Allow the RPC client to raise an exception rather than exit on failure|9360|
-|2011/10/03|Allow the TTL of requests to be set in the config file and the SimpleRPC API|9399|
-|2011/09/26|Cryptographically secure the TTL and Message Time of requests when using AES and SSL plugins|9400|
-|2011/09/20|Update default shipped configurations to provide a better out of the box experience|9452|
-|2011/09/20|Remove deprecated mc- scripts|9402|
-|2011/09/20|Keep track of messages that has expired and expose the stat in rpcutil and inventory application|9456|
-
-<a name="1_3_1">&nbsp;</a>
-
-## 1.3.1 - 2011/09/16
-
-This is a release in the development series of MCollective.  It feature major new features
-and bug fixes.
-
-This release is for early adopters, production users should consider the 1.2.x series.
-
-### Enhancements
-
- * Messaging has been completely reworked internally to be more generic and easier to integrate
-   with other middleware
- * When using Stomp 1.1.9 detailed connection logs are kept showing connections, reconnections
-   and communication errors
- * A new point to point - but still via the middleware - communications ability has been introduced
- * When point to point comms is enabled, favour this mode when small number of nodes are being addressed
- * Add -j to any SimpleRPC client. Clients using _printrpc_ will automatically support a new JSON output format
- * A new rich discovery language was added using the -S flag
- * SimpleRPC validators can now also validate boolean data
- * The default location of _classes.txt_ has changed to be in line with Puppet defaults.
- * A default TTL of 60 seconds are set on all messages.  This is a start towards replay protection and is needed
-   for the new point to point comms style
- * Discovery is now optional.  If you supply an identity filter discovery will be bypassed.  Additionally discovery
-   can be supplied in arrays, text or JSON formats.  This requires the new point to point comms model.
-
-### Bug Fixes
-
- * Missing DDL files on the servers are now logged at debug level to minimise noise in the logs
- * The RC scripts set RUBYLIB, remove this and rely on the operating system to be set up correctly
- * Invalid fact filters supplied on the CLI now raises an error rather than create empty filters
-
-### New Discovery Language
-
-Previously dicovery was very limited, filters were simply run one after the other and you could not do
-anything complex like a mix of OR and AND boolean logic.
-
-A new compact discovery language was introduced perfect for use on the command line, an example below:
-
-{% highlight console %}
-$ mco find -S "((fqdn=/example.com/ or fqdn=/another.com/) or customer=acme) and apache and physicalprocessorcount>2"
-{% endhighlight %}
-
-The EBNF for this language can be seen below, it's available on the command line and the API
-
-    compound = ["("] expression [")"] {["("] expression [")"]}
-    expression = [!|not]statement ["and"|"or"] [!|not] statement
-    char = A-Z | a-z | < | > | => | =< | _ | - |* | / { A-Z | a-z | < | > | => | =< | _ | - | * | / | }
-    int = 0|1|2|3|4|5|6|7|8|9{|0|1|2|3|4|5|6|7|8|9|0}
-
-### Point to Point comms
-
-Previously MCollective could only broadcast messages and was tied to a discovery model.  This is in line
-with the initial goals of the project, having solved that we want to mix in a more traditional messaging
-style.
-
-The messaging layer now supports per node destinations that allows you to address a node, even if its down,
-doesn't yet exist or if you cannot come up with a filter that would match a group of arbitrarily selected
-nodes.
-
-When this mode is in use you tell it using either text, arrays or JSON data which machines to communicate with
-it will then talk directly to those nodes via the middleware and if any of them are down you will get the
-usual no responses report after DDL configured timeout, this is a smooth transparent to the end user mix
-in communication modes.
-
-It is ideal for building deployers, web apps and so forth where you know exactly which nodes should be there
-and you'd like to influence the MCollective network addressing, perhaps from a CMDB you built yourself.
-
-This is the start towards an assured style of delivery, you can consider it the TCP to MCollective's UDP.
-Both modes of communication will be supported in the future and both will have access to all the same agents
-clients etc.
-
-This is feature is still maturing, you enable it using the _direct\_\addressing_ configuration option.  At
-present the STOMP connector supports it but it is not optimized for networks larger than 20 to 30 hosts.  A
-new connector is being developed that uses ActiveMQ features to achieve this efficiently.
-
-### Pluggable / Optional Discovery
-
-If you did _mco rpc rpcutil ping -I box.example.com -I another.example.com_ mcollective will now just assume
-you know what you want, it won't do a discover to confirm those machines exist or not, it will just go and
-talk with them.  This is a big end user visible speed improvement.  If however you did a filter like _-I /example.com/_
-it cannot know which machines you want to reach and so a traditional broadcast discovery is done first.
-
-When the direct addressing mode is enabled various behind the scenes optimizations are being done:
-
- * If a discovery is done and it finds you only want to address 10 or fewer nodes it will use direct mode for that
-   request.  This avoids a second needless broadcast.  This is less efficient to the middleware but does not send
-   needless messages to uninterested nodes that would then just ignore them.
- * The _rpc_ application supports piping output from one to the next.  Example of this below.
-
-{% highlight console %}
-$ mco rpc package update package=foo -W customer=acme -j|mco rpc service restart service=bar
-{% endhighlight %}
-
-This will update a package on machines matching _customer=foo_ and then restart the service _bar_ on those machines.
-
-The first request is doing traditional discovery based on the fact while the 2nd request is not doing discovery
-at all, it uses the JSON output enabled by -j as discovery data and then restart the service on only those machines.
-
-These abilities are exposed in the SimpleRPC client API and you can write your own schemes, query your own databases etc
-
-### Backwards Compatibility
-
-This is a big release and the entire messaging system has been redesigned, rewritten and has had features added.
-As such there might be problems running mixed 1.2.x and 1.3.1 networks, we'd ask users to test this in lab situations
-and provide us feedback to improve the eventual transition from 1.2.x to 1.4.x.  We did though aim to maintain backward
-compatibility and the intention is to fix any bugs reported where a default configured 1.3.x cannot co-habit with a
-previous 1.2.x build.
-
-Enabling the new direct addressing mode is a big configuration change both in your collective and the middleware as such
-soon as you enable it there will be compatibility issues until all your nodes are up to the same level.  Specifically old
-nodes will just ignore your direct requests.
-
-The default location for _classes.txt_ has changed to _/var/lib/puppet/state/classes.txt_ you need to ensure
-this file exists or configure either MCollective or Puppet accordingly else your classes filters will break
-
-Messages are now valid for only 60 seconds, nodes will _ignore_ messages older than 60 seconds.  This means
-your clocks have to be in sync on your entire collective.  We use UTC time for the TTL check so your machines
-can be in different time zones.  At present the 60 second threshold is hard coded, it will become configurble on a
-per message basis in future.
-
-#### Changes since 1.3.0
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2011/09/9|Use direct messaging where possible for identity filters and make the rpc application direct aware|8466|
-|2011/08/29|Enforce a 60 second TTL on all messages by default|8325|
-|2011/08/29|Change the default classes.txt file to be in line with Puppet defaults|9133|
-|2011/08/06|Add reload-agents and reload-loglevel commands to the redhat RC script|7730|
-|2011/08/06|Avoid reloading the authorization class over and over from disk on each request|8703|
-|2011/08/06|Add a boolean validator to SimpleRPC agents|8799|
-|2011/08/06|Justify text results better when using printrpc|8807|
-|2011/07/22|Add --version to the mco utility|7822|
-|2011/07/22|Add missing meta data to the discovery agent|8497|
-|2011/07/18|Raise an error if invalid format fact filters are supplied|8419|
-|2011/07/14|Add a rich discovery query language|8181|
-|2011/07/08|Do not set RUBYLIB in the RC scripts, the OS should do the right thing|8063|
-|2011/07/07|Add a -j argument to all SimpleRPC clients that causes printrpc to produce JSON data|8280|
-|2011/06/30|Add the ability to do point to point comms for requests affecting small numbers of hosts|7988|
-|2011/06/21|Add support for Stomp Gem version 1.1.9 callback based logging|7960|
-|2011/06/21|On the server side log missing DDL files at debug and not warning level|7961|
-|2011/06/16|Add the ability for nodes to subscribe to per-node queues, off by default|7225|
-|2011/06/12|Remove assumptions about middleware structure from the core and move it to the connector plugins|7619|
-
-<a name="1_2_1">&nbsp;</a>
-
-## 1.2.1 - 2011/06/30
-
-This is a maintenance release in the production series of MCollective and is a recommended
-upgrade for all users of 1.2.0.
-
-### Bug Fixes
-
- * Improve error handling in the inventory application
- * Fix compatablity problems with RedHat 4 init scripts
- * Allow . in Fact names
- * Allow applications to use the exit method
- * Correct parsing of the MCOLLECTIVE_EXTRA_OPTS environment variable
-
-### Backwards compatibility
-
-This release should be 100% backward compatable with version 1.2.0
-
-#### Changes since 1.2.0
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2011/06/02|Correct parsing of MCOLLECTIVE_EXTRA_OPTS in cases where no config related settings were set|7755|
-|2011/05/23|Allow applications to use the exit method as would normally be expected|7626|
-|2011/05/16|Allow _._ in fact names|7532|
-|2011/05/16|Fix compatibility issues with RH4 init system|7448|
-|2011/05/15|Handle failures from remote nodes better in the inventory app|7524|
-|2011/05/06|Revert unintended changes to the Debian rc script|7420|
-|2011/05/06|Remove the _test_ agent that was accidentally checked in|7425|
-
-<a name="1_3_0">&nbsp;</a>
-
-## 1.3.0 - 2011/06/08
-
-This is a release in the development series of mcollective.  It features major
-new features, some bug fixes and internal structure refactoring.
-
-This release is for early adopters, production users should consider the 1.2.x series.
-
-### Enhancements
-
- * Agents can now programatically declare if they should work on a node
- * Applications can now use the exit method as normal and clean disconnects will be done
- * The target collective for registration messages is configurable.  In the past it defaulted to main_collective
-
-### Bug Fixes
-
- * Error reporting in applications, agents and mcolletive core has been improved
- * The RC script works better on Red Hat 4 based systems
-
-### Other Changes
-
- * The connector layer is being improved to make it easier to use other middleware.
-   This release starts this process but it's far from complete.
- * The sshkey plugin was removed from core and moved to the plugins project
-
-### Backwards Compatibility
-
-If you were using the sshkey plugin you need to ensure your CM system is copying it out prior to this
-upgrade as the packages will not contain it anymore.
-
-If you have your own connectors other than the STOMP one we supply you should wait to upgrade till 1.3.1
-at which point you will need to make extensive changes to your plugins internals.  If your CM is copying
-out the connector you have to ensure that when this version of MCollective start that the new plugin is
-in place.
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2011/06/07|Exceptions raised during option parsing were not handled and resulted in stack traces|7796|
-|2011/06/06|Remove the sshkey, it's being moved to the plugin repository|7794|
-|2011/06/02|Correct parsing of MCOLLECTIVE_EXTRA_OPTS in cases where no config related settings were set|7755|
-|2011/05/31|Disconnect from the middleware when an application calls exit|7712|
-|2011/05/29|Validations failure in RPC agents will now raise the correct exceptions as documented|7711|
-|2011/05/25|Make the target collective for registration messages configurable|7650|
-|2011/05/24|Rename the connector plugins send method to publish to avoid issues ruby Object#send|7623|
-|2011/05/23|Log a warning when the CF file parsing fails rather than raise a whole ruby exception|7627|
-|2011/05/23|Allow applications to use the exit method as would normally be expected|7626|
-|2011/05/22|Refactor subscribe and unsubscribe so that middleware structure is entirely contained in the connectors|7620|
-|2011/05/21|Add the ability for agents to programatically declare if they should work on a node|7583|
-|2011/05/20|Improve error reporting in the single application framework|7574|
-|2011/05/16|Allow _._ in fact names|7532|
-|2011/05/16|Fix compatibility issues with RH4 init system|7448|
-|2011/05/15|Handle failures from remote nodes better in the inventory app|7524|
-|2011/05/06|Revert unintended changes to the Debian rc script|7420|
-|2011/05/06|Remove the _test_ agent that was accidentally checked in|7425|
-
-<a name="1_2_0">&nbsp;</a>
-
-## 1.2.0 - 2011/05/04
-
-This is the next production release of MCollective.  It brings to an
-end active support for versions 1.1.4 and older.
-
-This release brings to general availability all the features added in the
-1.1.x development series.
-
-### Enhancements
-
- * The concept of sub-collectives were introduced that help you partition
-   your MCollective traffic for network isolation, traffic management and security
- * The single executable framework has been introduced replacing the old
-   _mc-\*_ commands
- * A new AES+RSA security plugin was added that provides strong encryption,
-   client authentication and message security
- * New fact matching operators <=, >=, <, >, !=, == and =~.
- * Actions can be written in external scripts and therefore other languages
-   than Ruby, wrappers exist for PHP, Perl and Python
- * Plugins can now be configured using the _plugins.d_ directory
- * A convenient and robust exec wrapper has been written to assist in calling
-   external scripts
- * The _MCOLLECTIVE\_EXTRA\_OPTS_ environment variable has been added that will
-   add options to all client scripts
- * Network timeout handling has been improved to better take account of latency
- * Registration plugins can elect to skip sending of registration data by
-   returning _nil_, previously nil data would be published
- * Multiple libdirs are supported
- * The logging framework is pluggable and easier to use
- * Fact plugins can now force fact cache invalidation.  The YAML plugin will
-   force a cache clear as soon as the source YAML file updates
- * The _ping_ application now supports filters
- * Network payload can now be Base64 encoded avoiding issues with Unicode characters
-   in older Stomp gems
- * All fact plugins are now cached and only updated every 300 seconds
- * The progress bar now resizes based on terminal dimensions
- * DDL files with missing output blocks will not invalidate the whole DDL
- * Display of DDL assisted complex data has been improved to be more readable
- * Stomp messages can have a priority header added for use with recent versions
-   of ActiveMQ
- * Almost 300 unit tests have been written, lots of old code and any new code being
-   written is subject to continuos testing on Ruby 1.8.5, 1.8.6 and 1.9.2
- * Improved the Red Hat RC script to be more compliant with distribution policies
-   and to reuse the builtin functions
-
-### Deprecations and removed functionality
-
- * The old _mc-\*_ commands are being removed in favor for the new _mco_ command.
-   The old style is still available and your existing scripts will keep working but
-   porting to the new single executable system is very easy and encouraged.
- * _MCOLLECTIVE_TIMEOUT_ and _MCOLLECTIVE_DTIMEOUT_ were removed in favor of _MCOLLECTIVE\_EXTRA\_OPTS_
- * _mc-controller_ could exit all mcollectived instances, this feature was not ported
-   to the new _mco controller_ application
-
-### Bug Fixes
-
- * mcollectived and all of the standard supplied client scripts now disconnects
-   cleanly from the middleware avoiding exceptions in the ActiveMQ logs
- * Communications with the middleware has been made robust by adding a timeout
-   while sending
- * Machines that do not pass security validation are now handled as having not
-   responded at all
- * When a fire and forget request was sent, replies were still sent, they are
-   now suppressed
-
-### Backwards compatibility
-
-This release can communicate with machines running older versions of mcollective
-there are though a few steps to take to ensure a smooth upgrade.
-
-#### Backward compatible sub-collective setup
-
-{% highlight ini %}
-topicprefix = /topic/mcollective
-{% endhighlight %}
-
-This has to change to:
-
-{% highlight ini %}
-topicprefix = /topic/
-main_collective = mcollective
-collectives = mcollective
-{% endhighlight %}
-
-#### Security Plugins
-
-The interface for the _encodereply_ method on the security plugins have changed
-if you are using any of the community plugins or wrote your own you should update
-them with the latest at the time you upgrade to 1.2.0
-
-#### Fact Plugins
-
-The interface to the fact plugins have been greatly simplified, this means you need to
-update to new plugins at the time you upgrade to 1.2.0
-
-You can place these new plugins into the plugindir before upgrading. The old mcollective
-will not use these plugins and the new one will not touch the old ones. This will allow
-for a clean rollback.
-
-Once the new version is deployed you will immediately have caching on all fact types
-at 300 seconds you can tune this using the fact_cache_time setting in the configuration file.
-
-#### New fact selectors
-
-The new fact selectors are only available on newer versions of mcollective.  If a client
-attempts to use them and an older version of the server is on the network those older
-servers will treat all fact lookups as ==
-
-#### Changes since 1.1.4
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2011/05/03|Improve Red Hat RC script by using distro builtin functions|7340|
-|2011/05/01|Support setting a priority on Stomp messages|7246|
-|2011/04/30|Handle broken and incomplete DDLs better and improve the format of DDL output|7191|
-|2011/04/23|Encode the target agent and collective in requests|7223|
-|2011/04/20|Make the SSL Cipher used a config option|7191|
-|2011/04/20|Add a clear method to the PluginManager that deletes all plugins, improve test isolation|7176|
-|2011/04/19|Abstract the creation of request and reply hashes to simplify connector plugin development|5701|
-|2011/04/15|Improve the shellsafe validator and add a Util method to do shell escaping|7066|
-|2011/04/14|Update Rakefile to have a mail_patches task|6874|
-|2011/04/13|Update vendored systemu library for Ruby 1.9.2 compatibility |7067|
-|2011/04/12|Fix failing tests on Ruby 1.9.2|7067|
-|2011/04/11|Update the DDL documentation to reflect the _mco help_ command|7042|
-|2011/04/11|Document the use filters on the CLI|5917|
-|2011/04/11|Improve handling of unknown facts in Util#has_fact? to avoid exceptions about nil#clone|6956|
-|2011/04/11|Correctly set timeout on the discovery agent to 5 seconds as default|7045|
-|2011/04/11|Let rpcutil#agent_inventory supply _unknown_ for missing values in agent meta data|7044|
-
-<a name="1_1_4">&nbsp;</a>
-
-## 1.1.4 - 2011/04/07
-
-This is a release in the development series of mcollective.  It features major
-new features and some bug fixes.
-
-This release is for early adopters, production users should consider the 1.0.x series.
-
-### Actions in other languages
-
-We have implemented the ability to write actions in languages other than Ruby.
-This is done via simple JSON API documented in [in our docs](simplerpc/agents.html#actions-in-external-scripts)
-
-The _ext_ directory on [GitHub](https://github.com/puppetlabs/marionette-collective/tree/master/ext/action_helpers)
-hosts wrappers for PHP, Perl and Python that makes using this interface easier.
-
-{% highlight ruby %}
-action "test" do
-    implemented_by "/some/external/script"
-end
-{% endhighlight %}
-
-Special thanks to the community members who contributed the wrappers.
-
-### Enhancements
-
- * Actions can now be written in any language
- * Plugin configuration can be kept in _/etc/mcollective/plugin.d_
- * _mco inventory_ now shows collective and sub-collective membership
- * mc-controller has been deprecated for _mco controller_
- * Agents are now ran using new instances of the classes rather than reuse the exiting
-   one to avoid concurrency related problems
-
-### Bug Fixes
-
- * When mcollectived exits it now cleanly disconnects from the Middleware
- * The _rpcutil_ agent is less strict about valid Fact names
- * The default configuration files have been updated for sub-collectives
-
-### Backwards Compatibility
-
-This release will be backward compatible with version _1.1.3_ for compatibility
-with earlier releases see the notes for _1.1.3_ and the sub collective related
-configuration changes.
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2011/03/28|Correct loading of vendored JSON gem|6877|
-|2011/03/28|Show collective and sub collective info in the inventory application|6872|
-|2011/03/23|Disconnect from the middleware when mcollectived disconnects|6821|
-|2011/03/21|Update rpcutil ddl file to be less strict about valid fact names|6764|
-|2011/03/22|Support reading configuration from configfir/plugin.d for plugins|6623|
-|2011/03/21|Update default configuration files for sub-collectives|6741|
-|2011/03/16|Add the ability to implement actions using external scripts|6705|
-|2011/03/15|Port mc-controller to the Application framework and deprecate the exit command|6637|
-|2011/03/13|Only cache registration and discovery agents, handle the rest as new instances|6692|
-|2011/03/08|PluginManager can now create new instances on demand for a plugin type|6622|
-
-<a name="1_1_3">&nbsp;</a>
-
-## 1.1.3 - 2011/03/07
-
-This is a release in the development series of mcollective.  It features major
-new features and some bug fixes.
-
-This release is for early adopters, production users should consider the 1.0.x series.
-
-### Enhancements
-
- * Add the ability to partition collectives into sub-collectives for security and
-   network traffic management
- * Add a exec wrapper for agents that provides unique environments and cwds in a
-   thread safe manner as well as avoid zombie processes
- * Automatically pass Application options to rpcclient when options are not
-   specifically provided
- * Rename _/usr/sbin/mc_ to _/usr/bin/mco_
-
-### Bug Fixes
-
- * Missing _libdirs_ will not cause crashes anymore
- * Parse _MCOLLECTIVE\_EXTRA\_OPTS_ correctly with multiple options
- * _file`_`logger_ failures are handled better
- * Improve middleware communication in unreliable settings by adding timeouts
-   around middleware operations
-
-### Backwards Compatibility
-
-The configuration format has changed slightly to accomodate the concept of
-collective names and sub-collectives.
-
-In older releases the configuration was:
-
-{% highlight ini %}
-topicprefix = /topic/mcollective
-{% endhighlight %}
-
-This has to change to:
-
-{% highlight ini %}
-topicprefix = /topic/
-main_collective = mcollective
-collectives = mcollective
-{% endhighlight %}
-
-When setup as above a old and new version will be compatible but as soon as you
-start configuring the new sub-collective feature you will loose compatiblity
-between versions.
-
-Various defaults apply, if you configure it with these exactly topic and
-collective names you can leave off the _main`_`collective_ and _collectives_
-directives as the above settings would be their defaults
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2011/03/04|Rename /usr/sbin/mc to /usr/bin/mco|6578|
-|2011/03/01|Wrap rpcclient in applications ensuring that options is always set|6308|
-|2011/02/28|Make communicating with the middleware more robust by including send calls in timeouts|6505|
-|2011/02/28|Create a wrapper to safely run shell commands avoiding zombies|6392|
-|2011/02/19|Introduce Sub-collectives for network partitioning|5967|
-|2011/02/19|Improve error handling when parsing arguments in the rpc application|6388|
-|2011/02/19|Fix error logging when file_logger creation fails|6387|
-|2011/02/17|Correctly parse MCOLLECTIVE\_EXTRA\_OPTS in the new unified binary framework|6354|
-|2011/02/15|Allow the signing key and Debian distribution to be customized|6321|
-|2011/02/14|Remove inadvertently included package.ddl|6313|
-|2011/02/14|Handle missing libdirs without crashing|6306|
-
-<a name="1_0_1">&nbsp;</a>
-
-## 1.0.1 - 2011/02/16
-
-### Release Focus and Notes
-
-This is a minor bug fix release.
-
-### Bugs Fixed
-
- * The YAML fact plugin failed to remove deleted facts from memory
- * The _-_ character is now allowed in Fact names for the rpcutil agent
- * Machines that fali security validations were not reported correctly,
-   they are now treated as having not responded at all
- * Timeouts on RPC requests were too aggressive and did not allow for slow networks
-
-### Backwards Compatibility
-
-This release will be backward compatible with older releases.
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2011/02/02|Include full Apache 2 license text|6113|
-|2011/01/29|The YAML fact plugin kept deleted facts in memory|6056|
-|2012/01/04|Use the LSB based init script on SUSE|5762|
-|2010/12/30|Allow - in fact names|5727|
-|2010/12/29|Treat machines that fail security validation like ones that did not respond|5700|
-|2010/12/25|Allow for network and fact source latency when calculating client timeout|5676|
-|2010/12/25|Increase the rpcutil timeout to allow for slow facts|5679|
-
-## 1.1.2 - 2011/02/14
-
-This is a release in the development series of mcollective.  It features minor
-bug fixes and features.
-
-This release is for early adopters, production users should consider the 1.0.x series.
-
-### Bug Fixes
-
- * The main fix in this release is a packaging bug in Debian systems that prevented
-   both client and server from being installed on the same machine.
- * Backwards compatibility fix for fact filters that are empty strings
-
-### Enhancement
-
- * Registration plugins can now return nil which will skip that specific registration
-   message.  This will enable plugins to decide based on some node state if a message
-   should be sent or not.
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2011/02/13|Surpress replies to SimpleRPC clients who did not request results|6305|
-|2011/02/11|Fix Debian packaging error due to the same file in multiple packages|6276|
-|2011/02/11|The application framework will now disconnect from the middleware for consistency|6292|
-|2011/02/11|Returning _nil_ from a registration plugin will skip registration|6289|
-|2011/02/11|Set loglevel to warn by default if not specified in the config file|6287|
-|2011/02/10|Fix backward compatibility with empty fact strings|6278|
-
-## 1.1.1 - 2011/02/02
-
-This is a release in the development series of mcollective.  It features major new
-features and numerous bug fixes.  Please pay careful attention to the upgrading
-section as there is some changes that are not backward compatible.
-
-This release is for early adopters, production users should consider the 1.0.x series.
-
-### AES+RSA Security Plugin
-
-A new security plugin that encrypts the payloads, uniquely identify senders and secure
-replies from inspection by other people on the collective has been written.  The plugin
-can re-use Puppet certificates and supports distributing of public keys if you wish.
-
-This plugin and its deployment is very complex and it has a visible performance impact
-but we felt it was a often requested feature and so decided to implement it.
-
-Full documentation for this plugin can be found [in our docs](reference/plugins/security_aes.html), please read them very
-carefully should you choose to deploy this plugin.
-
-### Single Executable Framework
-
-In the past a lot of the CLI tools have behaved inconsistently as the mc scripts were
-mostly just written to serve immediate needs, we are starting a process of improving
-these scripts and making them more robust.
-
-The first step is to create a new framework for CLI commands, we call these Single Executable
-Applications.  A new executable called _mc_ is being distributed with this release:
-
-{% highlight console %}
-$ mc
-The Marionette Collective version 1.1.1
-
-/usr/sbin/mc: command (options)
-
-Known commands: rpc filemgr inventory facts ping find help
-{% endhighlight %}
-
-{% highlight console %}
-$ mc help
-The Marionette Collection version 1.1.1
-
-  facts           Reports on usage for a specific fact
-  filemgr         Generic File Manager Client
-  find            Find hosts matching criteria
-  help            Application list and RPC agent help
-  inventory       Shows an inventory for a given node
-  ping            Ping all nodes
-  rpc             Generic RPC agent client application
-{% endhighlight %}
-
-{% highlight console %}
-$ mc rpc package status package=zsh
-Determining the amount of hosts matching filter for 2 seconds .... 51
-
- * [ ============================================================> ] 51 / 51
-
-
- test.com:
-    Properties:
-       {:provider=>:yum,
-       :release=>"3.el5",
-       :arch=>"x86_64",
-       :version=>"4.2.6",
-       :epoch=>"0",
-       :name=>"zsh",
-       :ensure=>"4.2.6-3.el5"}
-{% endhighlight %}
-
-You can see these commands behave just like their older counter parts but is more integrated
-and discovering available commands is much easier.
-
-Agent help that was in the past available through _mc-rpc --ah agentname_ is now available through
-_mc help agentname_ and error reporting is short single line reports by default but by adding
-_-v_ to the command line you can get full Ruby backtraces.
-
-We've maintained backward compatibility by creating wrappers for all the old mc scripts but these
-might be deprecated in future.
-
-These application live in the normal plugin directories and should make it much easier to distribute
-plugins in future.
-
-We will port the scripts for plugins to this framework and encourage you to do the same when writing
-new CLI tools.  An example of a ported CLI can be seen in the _filemgr_ agent.
-
-Find the documentation for these plugins [here](reference/plugins/application.html).
-
-### Miscellaneous Improvements
-
-The logging system has been ra-efactored to not use a Signleton, logging messages are now simply:
-
-{% highlight ruby %}
-MCollective::Log.notice("hello world")
-{% endhighlight %}
-
-A backwards compatible wrapper exist to prevent existing code from breaking.
-
-In some cases - like when using MCollective from within Rails - the STOMP
-gem would fail to decode the payloads.  We've worked with the authors and
-a new release was made that makes this more robust but we've also enabled
-Base64 encoding on the Stomp connector for those who can't upgrade the Gem
-and who are running into this problem.
-
-### Bug Fixes
-
-
- * Machines that do not pass security checks are handled as having not responded
-   so that these are listed in the usual stat for non responsive hosts
- * The - character is now allowed in Fact names by the DDL for rpcutil
- * Version 1.1.0 introduced a bug with reloading agents from disks using USR1 and mc-controller
-
-### Enhancements
-
- * New AES+RSA based security plugin was added
- * Create a new single executable framework and port several mc scripts
- * Security plugins have access to the callerid they are responding to
- * The logging methods have been improved by removing the use of Singletons
- * The STOMP connector can now Base64 encode all sent data to deal with en/decoding issues by the gem
- * The rpcutil agent has a new _ping_ action
- * the _mc ping_ client now supports standard filters
- * DDL documentation has been updated to show you can disable type validations in the DDL
- * Fact plugins can now force fact cache invalidation, the YAML plugin will immediately load new facts when mtime on the file change
- * Improve _1.0.0_ compatibility for _foo=/bar/_ style fact matches at the expense of _1.1.0_ compatibility
-
-### Upgrading
-
-Upgrading should be mostly painless as most things are backward compatible.
-
-We discovered that we broke backward compatibility with _1.0.0_ and _0.4.x_ Fact filters.  A filter in the form
-_foo=/bar/_ would be treated as an equality filter and not a regular expression.
-
-This releases fixes this compatibility with older versions at the expense of compatibility with _1.1.0_.  If you
-are upgrading from _1.1.0_ keep this in mind and plan accordingly, once you've upgraded a client its requests that
-contain these filters will not be correctly parsed on servers running _1.1.0_.
-
-The security plugins have changed slightly, if you wrote your own security plugin the interface to _encodereply_
-has changed slightly.  All the bundled security plugins have been updated already and older ones will just
-keep working.
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2011/02/02|Load the DDL from disk once per printrpc call and not for every result|5958|
-|2011/02/02|Include full Apache 2 license text|6113|
-|2011/01/31|Create a new single executable application framework|5897|
-|2011/01/30|Fix backward compatibility with old foo=/bar/ style fact searches|5985|
-|2011/01/30|Documentation update to reflect correct default identity behavior|6073|
-|2011/01/29|Let the YAML file force fact reloads when the files update|6057|
-|2011/01/29|Add the ability for fact plugins to force fact invalidation|6057|
-|2011/01/29|Document an approach to disable type validation in the DDL|6066|
-|2011/01/19|Add basic filters to the mc-ping command|5933|
-|2011/01/19|Add a ping action to the rpcutil agent|5937|
-|2011/01/17|Allow MC::RPC#printrpc to print single results|5918|
-|2011/01/16|Provide SimpleRPC style results when accessing the MC::Client results directly|5912|
-|2011/01/11|Add an option to Base64 encode the STOMP payload|5815|
-|2011/01/11|Fix a bug with forcing all facts to be strings|5832|
-|2011/01/08|When using reload_agents or USR1 signal no agents would be reloaded|5808|
-|2011/01/04|Use the LSB based init script on SUSE|5762|
-|2011/01/04|Remove the use of a Singleton in the logging class|5749|
-|2011/01/02|Add AES+RSA security plugin|5696|
-|2010/12/31|Security plugins now have access to the callerid of the message they are replying to|5745|
-|2010/12/30|Allow - in fact names|5727|
-|2010/12/29|Treat machines that fail security validation like ones that did not respond|5700|
-
-## 1.1.0 - 2010/12/29
-
-This is the first in a new development series, as such there will be rapid changes
-and new features.  We cannot guarantee the changes will be backward compatible but
-we will as before try to keep these releases solid and production quality.
-
-Production users who do not wish to have rapid change should use release 1.0.0.
-
-This release focus mainly on getting all the community contributed code into a release
-and addressing some issues I had but wasn't comfortable fixing them late in the
-previous development series.
-
-Please read these notes carefully we are **removing** some old functionality and changing
-some internals, you need to carefully review the text below.
-
-### Bug Fixes
-
- * The progress bar will now try hard to detect screen size and adjust itself,
-   failing back to a dumb mode if it can't work it out.
- * rpcutil timeout was too short when considering slow facts and network latency
-
-### Improvements
-
- * libdir can now be multiple directories specified with : separation - Thanks to Richard Clamp
- * Logging is now pluggable, 3 logger types are supported - file, syslog and console.  Thanks to
-   Nicolas Szalay for the initial Syslog code
- * A new experimental ssh agent based security system.  Thanks to Jordan Sissel
- * New fact matching operators <=, >=, <, >, !=, == and =~. Thanks to Mike Pountney
- * SimpleRPC fact_filter method can now take any valid fact string as input in addition to the old format
- * A message gets logged at startup showing mcollective version and logging level
- * The fact plugin format has been changed, simplified, made thread safe and global caching added.
-   This breaks backward compatibility with old fact sources
- * Creating options hashes has been simplified by adding a helper that creates them for you
- * Calculating the client timeout has been improved by including for latency and fact source slowness
- * Audit log lines are now on one line and include a ISO 8601 format date
-
-### Removed Functionality
-
- * The old MCOLLECTIVE_TIMEOUT and MCOLLECTIVE_DTIMEOUT were removed, a new MCOLLECTIVE_EXTRA_OPTS
-   was added which should allow much more flexibility.  Supply any command line options in this var
-
-### Upgrading
-
-Upgrading should be easy the only backward incompatible change is the Facts format.  If you only use
-the included YAML plugin the upgrade will just work if you use the packages.  If you use either the
-facter or ohai plugins you will need to download new plugins from the community plugin page.
-
-If you wrote your own Facts plugin you will need to change it a bit:
-
-  * The old get_facts method should now be load_facts_from_source
-  * The class for facts have to be in the form MCollective::Facts::Foo_facts and the filename should match
-
-This is all, your facts can now be much simpler as threading and caching is handled in the base class.
-
-You can place these new plugins into the plugindir before upgrading.  The old mcollective will not use
-these plugins and the new one will not touch the old ones.  This will allow for a clean rollback.
-
-Once the new version is deployed you will immediately have caching on all fact types at 3000 seconds
-you can tune this using the fact_cache_time setting in the configuration file.
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2010/12/28|Adjust the logfile audit format to include local time and all on one line|5694|
-|2010/12/26|Improve the SimpleRPC fact_filter helper to support new fact operators|5678|
-|2010/12/25|Increase the rpcutil timeout to allow for slow facts|5679|
-|2010/12/25|Allow for network and fact source latency when calculating client timeout|5676|
-|2010/12/25|Remove MCOLLECTIVE_TIMEOUT and MCOLLECTIVE_DTIMEOUT environment vars in favor of MCOLLECTIVE_EXTRA_OPTS|5675|
-|2010/12/25|Refactor the creation of the options hash so other tools don't need to know the internal formats|5672|
-|2010/12/21|The fact plugin format has been changed and simplified, the base now provides caching and thread safety|5083|
-|2010/12/20|Add parameters <=, >=, <, >, !=, == and =~ to fact selection|5084|
-|2010/12/14|Add experimental sshkey security plugin|5085|
-|2010/12/13|Log a startup message showing version and log level|5538|
-|2010/12/13|Add a console logger|5537|
-|2010/12/13|Logging is now pluggable and a syslog plugin was provided|5082|
-|2010/12/13|Allow libdir to be an array of directories for agents and ddl files|5253|
-|2010/12/13|The progress bar will now intelligently figure out the terminal dimensions|5524|
-
-## 1.0.0 - 2010/12/13
-
-### Release Focus and Notes
-
-This is a bug fix and minor improvement release.
-
-We will maintain the 1.0.x branch as a stable supported branch.  The features
-currently in the branch will be frozen and we'll only do bug fixes.
-
-A new 1.1.x series of releases will be done where we will introduce new features.
-Once the 1.1.x code base reaches a mature point it will become the new stable
-release and so forth.
-
-### Bug Fixes
-
- * Settings like retry times were ignored in the Stomp connector
- * The default init script had incorrect LSB comments
- * The rpcutil DDL has better validation and will now match all facts
-
-### New Features and Enhancements
-
- * You can now send RPC requests to a subset of discovered nodes
- * SimpleRPC custom_request can now be used to create fire and forget requests
- * Clients can now cleanly disconnect from the middleware.  Bundled clients have been
-   updated.  This should cause fewer exceptions in ActiveMQ logs
- * Rather than big exceptions many clients will now log errors only
- * mc-facts has been reworked to be a SimpleRPC client, this speeds it up significantly
- * Add get_config_item to rpcutil to retrieve a running config value from a server
- * YAML facts are now forced to be all strings and is thread safe
- * On RedHat based systems the requirement for the LSB packages has been removed
-
-The first feature is a major new feature in SimpleRPC.  If you expose a service redundantly
-on your network using MCollective you wouldn't always want to send requests to all the
-nodes providing the service.  You can now limit the requests to an arbitrary amount
-using the new --limit-nodes option which will also take a percentage.  A shortcut -1 has
-been added that is the equivalent to --limit-nodes 1
-
-### Backwards Compatibility
-
-This release will be backward compatible with older releases.
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2010/12/04|Remove the LSB requirements for RedHat systems|5451|
-|2010/11/23|Make the YAML fact source thread safe and force all facts to strings|5377|
-|2010/11/23|Add get_config_item to rpcutil to retrieve a running config value from a server|5376|
-|2010/11/20|Convert mc-facts into a SimpleRPC client|5371|
-|2010/11/18|Added GPG signing to Rake packaging tasks (SIGNED=1)|5355|
-|2010/11/17|Improve error messages from clients in the case of failure|5329|
-|2010/11/17|Add helpers to disconnect from the middleware and update all bundled clients|5328|
-|2010/11/16|Correct LSB provides and requires in default init script|5222|
-|2010/11/16|Input validation on rpcutil has been improved to match all valid facts|5320|
-|2010/11/16|Add the ability to limit the results to a subset of hosts|5306|
-|2010/11/15|Add fire and forget mode to SimpleRPC custom_request|5305|
-|2010/11/09|General connection settings to the Stomp connector was ignored|5245|
-
-## 0.4.10 - 2010/10/18
-
-### Release Focus and Notes
-
-This is a bug fix and minor improvement release.
-
-### Bug Fixes
-
- * Multiple RPC proxy classes in the same script would not all share the same command line options
- * Ruby 1.9.x compatibility has been improved
- * A major bug in registration has been fixed, any exception in the registration logic would have
-   resulted in a high CPU consuming loop
-
-The last bug is a major issue it will result in the _mcollectived_ consuming lots of CPU, updating to
-this version of MCollective is strongly suggested.  Should you run into this problem on a large scale
-you can use _mc-controller exit_ to exit all your _mcollectived_ processes at the same time.
-
-### New Features and Enhancements
-
- * The PSK security plugin can now be configured to set the callerid to a few different values
-   useful for cases where you want to do group based RPC Authorization for example.
- * Info logging has been minimised by demoting the 'not targeted at us' message to debug
- * Document the 'exit' option to mc-controller
-
-### Backwards Compatibility
-
-This release will be backward compatible with older releases.
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2010/10/18|Document exit command to mc-controller|152|
-|2010/10/13|Log messages that don't pass the filters at debug level|149|
-|2010/10/03|Preserve options in cases where RPC::Client instances exist in the same program|148|
-|2010/09/30|Add the ability to set different types of callerid in the PSK plugin|145|
-|2010/09/30|Improve Ruby 1.9.x compatibility|142|
-|2010/09/29|Improve error handling in registration to avoid high CPU usage loops|143|
-
-
-## 0.4.9 - 2010/09/21
-
-### Release Focus and Notes
-
-This is a bug fix and minor improvement release.
-
-### Bug Fixes
-
- * Internal data structure related to Agent meta data has been fixed, no user impact from this
- * When using per-user config files the _rpc-help.erb_ template could not be found
- * The log files will now rotate by default keeping 5 x 2MB files
- * The config were parsed multiple times in complex scripts, this has been eliminated
- * MCollective::RPC loaded a bunch of unneeded stuff into Object, this has been cleaned up
- * Various packaging related tweaks were done
-
-### New Features
-
- * We ship a new agent called _rpcutil_ with the base system, you can use this agent to get inventory etc from your _mcollectived_.  _mc-inventory_ has been rewritten to use this agent and should serve as a good reference for what you can get from the agent.
- * The DDL now support :boolean style inputs, mc-rpc also turn true/false on the command line into booleans when needed
-
-### Backwards Compatibility
-
-This release will be backward compatible with older releases.
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2010/09/20|Improve Debian packaging task|140|
-|2010/09/20|Add :boolean type support to the DDL|138|
-|2010/09/19|Refactor MCollective::RPC to add less unneeded stuff to Object|137|
-|2010/09/18|Prevent duplicate config loading with multiple clients active|136|
-|2010/09/18|Rotate the log file by default, keeping 5 x 2MB files|135|
-|2010/09/18|Write a overview document detailing security of the collective|131|
-|2010/09/18|Add MCollective.version, set it during packaging and include it in the rpcutil agent|134|
-|2010/09/13|mc-inventory now use SimpleRPC and the rpcutil agent and display server stats|133|
-|2010/09/13|Make the path to the rpc-help.erb configurable and set sane default|130|
-|2010/09/13|Make the configfile used available in the Config class and add to rpcutil|132|
-|2010/09/12|Rework internal statistics and add a rpcutil agent|129|
-|2010/09/12|Fix internal memory structures related to agent meta data|128|
-|2010/08/24|Update the OpenBSD port for changes in 0.4.8 tarball|125|
-|2010/08/23|Fix indention/block error in M:R:Stats|124|
-|2010/08/23|Fix permissions in the RPM for files in /etc|123|
-|2010/08/23|Fix language in two error messages|122|
-
-## 0.4.8 - 2010/08/20
-
-### Release Focus and Notes
-
-This is a bug fix and minor improvement release.
-
-### Bug Fixes
-
- * The RPM packages now require redhat-lsb since our RC scripts need it
- * The rake tasks do not attempt to build rpms on all platforms
- * Some plugin missing related exceptions are now handled gracefully
- * The Rakefile had a few warnings cleaned up
-
-### Notable New Features
-
- * Users can now have a _~/.mcollective_ file which will be preferred over over _/etc/mcollective/client.cfg_ if it exists.  You can still use _--config_ to override.
-
- * The SSL Security plugin can now use "either YAML or Marshal for serialization":/reference/plugins/security_ssl.html#serialization_method, this means other programming languages can be used as clients.  A sample Perl client is included in the ext directory.  Marshal remains the default for backwards compatibility
-
- * _mc-inventory_ can now be used to create "custom reports using a small reporting DSL":/reference/ui/nodereports.html, this enable you to build custom reports listing all your machines and gives you access to facts, agents and classes lists.
-
- * The log level for the _mcollectived_ can be adjusted during run time using the _USR2_ unix process signal.
-
-### Backwards Compatibility
-
-This release will be backward compatible with older releases.  If you choose to use YAML in the SSL plugin you need matching versions on the client.
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2010/08/19|Fix missing help template in debian packages|90|
-|2010/08/18|Clean up some hardlink warnings in the Rakefile|117|
-|2010/08/18|Include the website in the main repo and add a simple Rake task|118|
-|2010/08/17|Handle exceptions for missing plugins better|115|
-|2010/08/17|Add support for ~/.mcollective as a config file|114|
-|2010/08/07|SSL security plugin can use either YAML or Marshal|94|
-|2010/08/06|Multiple YAML files can now be used as fact source|112|
-|2010/08/06|Allow log level to be adjusted at run time with USR2|113|
-|2010/07/31|Add basic report scripting support to mc-inventory|111|
-|2010/07/06|Removed 'rpm' from the default rake task|109|
-|2010/07/06|Add redhat-lsb to the server RPM dependencies|108|
-
-## 0.4.7 - 2010/06/29
-
-### Release Focus and Notes
-
-This is a bug fix and incremental improvement release focusing on small improvements in the DDL mostly.
-
-### Data Definition Language
-
-We've extended the use of the DDL in the RPC client.  We've integrated the DDL into _printrpc_ helper.  The output is dynamic showing field names in human readable format rather than hash dumps.
-
-We're also using color to improve the display of the results, the color display can be disabled with the new _color_ configuration option.
-
-A "screencast of the DDL integration":http://mcollective.blip.tv/file/3799653 and color usage has been recorded.
-
-### Bug Fixes
-
-A serious issue has been fixed with regard to complex agents.  If you attempted to use multiple agents from the same script errors such as duplicate discovery results or simply not working.
-
-The default fact source has been changed to YAML, it was inadvertently set to Facter in the past.
-
-Some previously unhandled exceptions are now being handled correctly and passed onto the clients as failed requests rather than no responses at all.
-
-### Backwards Compatibility
-
-This release will be backward compatible with older releases.  The change to YAML fact source by default might impact you if you did not previously specify a fact source in the configuration files.
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-| 2010/06/27 | Change default factsource to YAML|106|
-| 2010/06/27 | Added VIM snippets to create DDLs and Agents|102|
-| 2010/06/26 | DDL based help now works better with Symbols in in/output|105|
-| 2010/06/23 | Whitespace at the end of config lines are now stripped|100|
-| 2010/06/22 | printrpc will now inject some colors into results|99|
-| 2010/06/22 | Recover from syntax and other errors in agents|98|
-| 2010/06/17 | The agent a MC::RPC::Client is working on is now available|97|
-| 2010/06/17 | Integrate the DDL with data display helpers like printrpc|92|
-| 2010/06/15 | Avoid duplicate topic subscribes in complex clients|95|
-| 2010/06/15 | Catch some unhandled exceptions in RPC Agents|96|
-| 2010/06/15 | Fix missing help template file from RPM|90|
-
-## 0.4.6 - 2010/06/14
-
-### Release Focus and Notes
-
-This release is a major feature release.
-
-We're focusing mainly on the Stomp connector and on the SimpleRPC agents in this release though a few smaller additions were made.
-
-### Stomp Connector
-
-We've historically been stuck just using RubyGem Stomp 1.1 due to multi threading bugs in the newer releases.  All attempts to contact the authors failed.  Recently though I had some luck and these issues are resolved in the RubyGem Stomp 1.1.6 release.
-
-This means we can take advantage of a lot of new features such as connection pooling for failover/ha and also SSL TLS between nodes and ActiveMQ server.
-
-See "Stomp Connector":/reference/plugins/connector_stomp.html for details.
-
-### RPC Agent Data Description Language
-
-I've been working since around February on building introspection, automatically generated documentation and the ability for user interfaces to be auto generated for agents, even ones you write your self.
-
-This feature is documented in "DDL":/simplerpc/ddl.html but a quick example of a DDL document might help make it clear:
-
-### CLI Utilities changes
-
-  * _mc-facts_ now take all the standard filters so you can make reports for just subsets of machines
-  * A new utility _mc-inventory_ has been added, it will show agents, facts and classes for a node
-  * _mc-rpc_ has a new option _--agent-help_ that will use the DDL and display auto generated documentation for an agent.
-  * _mc-facts_ output is sorted for better readability
-
-### Backwards Compatibility
-
-This release will be backward compatible with older releases, the new Stomp features though require the newer Ruby Gem.
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-| 2010/06/12 | Qualify the Process class to avoid clashes in the discovery agent|88|
-| 2010/06/12 | Add mc-inventory which shows agents, classes and facts for a node|87|
-| 2010/06/11 | mc-facts now supports standard filters|86|
-| 2010/06/11 | Add connection pool retry options and SSL for connection|85|
-| 2010/06/11 | Add support for specifying multiple stomp hosts for failover|84|
-| 2010/06/10 | Tighten up handling of filters to avoid nil's getting into them|83|
-| 2010/06/09 | Sort the mc-facts output to be more readable|82|
-| 2010/06/08 | Fix deprecation warnings in newer Stomp gems|81|
-
-## 0.4.5 - 2010/06/03
-
-### Release Focus and Notes
-
-This release is a major feature release.
-
-The focus of this release is to finish up some of the more enterprise like features, we now have fine grained Authorization and Authentication and a new security model that uses SSL keys.
-
-### Security Plugin
-
-Vladimir Vuksan contributed the base code of a new "SSL based security plugin":/reference/plugins/security_ssl.html .  This plugin builds on the old PSK plugin but gives each client a unique certificate pair.  The nodes all share a certificate and only store client public keys.  This means that should one node be compromised it cannot be used to control the rest of the network.
-
-### Authorization Plugin
-
-We've developed new hooks and plugins for SimpleRPC that enable you to write "fine grained authorization systems":/simplerpc/authorization.html .  You can do authorization on every aspect of the request and you'll have access to the caller userid as provided by the security plugin.  Combined with the above SSL plugin this can be used to build powerful and secure Authentication and Authorization systems.
-
-A sample plugin can be found "here":http://code.google.com/p/mcollective-plugins/wiki/ActionPolicy
-
-### Enhancements for Web Development
-
-Web apps doesn't tie in well with our discover, request, wait model.  We've made it easier for web apps to maintain their own cached discovery data using the "Registration:/reference/plugins/registration.html system and then based on that do requests that would not require any discovery.
-
-### Fire and Forget requests
-
-It is often desirable to just send a request and not wait for any reply.  We've made it easy to do requests like this] with the addition of a new request parameter on the SimpleRPC client class.
-
-Requests like this will not take any time to do discovery and you will not be able to get results back from the agents.
-
-### Reloading Agents
-
-To make it a bit easier to manage daemons and agents you can now send the _mcollectived_ a _USR1_ signal and it will re-read all it's agents from disk.
-
-### Backwards Compatibility
-
-This release when used with the old style PSK plugin should be perfectly backward compatible with your existing agents.  To use some of the newer features like authorization will require config and/or agent changes.
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-| 2010/06/01 | Improve the main discovery agent by adding facts and classes to its inventory action|79|
-| 2010/05/30 | Add various helpers to get reports as text instead of printing them|43|
-| 2010/05/30 | Add a custom_request method to call SimpleRPC agents with your own discovery|75|
-| 2010/05/30 | Refactor RPC::Client to be more generic and easier to maintain|75|
-| 2010/05/29 | Fix a small scoping issue in Security::Base|76|
-| 2010/05/25 | Add option --no-progress to disable progress bar for SimpleRPC|74|
-| 2010/05/23 | Add some missing dependencies to the RPMs|72|
-| 2010/05/22 | Add an option _:process_results_ to the client|71|
-| 2010/05/13 | Fix help output that still shows old branding|70|
-| 2010/04/27 | The supplied generic stompclient now accepts STOMP_PORT in the environment|68|
-| 2010/04/26 | Add a SimpleRPC Client helper to reset filters|64|
-| 2010/04/26 | Listen for signal USR1 and reload all agents from disk|65|
-| 2010/04/12 | Add SimpleRPC Authorization support|63|
-
-
-## 0.4.4 - 2010/04/03
-
-### Release Focus and Notes
-
-This release is mostly a bug fix release.
-
-We've cleaned up the logs a bit so you'll see fewer exceptions logged, also if you have Rails + Puppet on a node the logs will stay in the standard format.  We are handling some exceptions better which has improved stability of the registration system.
-
-If you do some slow queries in your discovery agent you can bump the timeout up in the config using _plugin.discovery.timeout_.
-
-All the scripts now use _/usr/bin/env ruby_ rather than hardcoded paths to deal better with Ruby's in weird places.
-
-Several other small annoyances was fixed or improved.
-
-### mc-controller
-
-We've always had a tool that let you control a network of mcollective instances remotely, it lagged behind a bit with the core, we've fixed it up and documented it "here":/reference/basic/daemon.html .  You can use it to reload agents from disk without restarting the daemon for example or get stats or shut down the entire mcollective network.
-
-### Backwards Compatibility
-
-No changes that impacts backward compatibility has been made.
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-| 2010/03/27 | Make it easier to construct SimpleRPC requests to use with the standard client library|60|
-| 2010/03/27 | Manipulating the filters via the helper methods will force rediscovery|59|
-| 2010/03/23 | Prevent Activesupport when brought in by Facter from breaking our logs|57|
-| 2010/03/23 | Clean up logging for messages not targeted at us|56|
-| 2010/03/19 | Add exception handling to the registration base class|55|
-| 2010/03/03 | Use /usr/bin/env ruby instead of hardcoded paths|54|
-| 2010/02/17 | Improve mc-controller and document it|46|
-| 2010/02/08 | Remove some close coupling with Stomp to easy creating of other connectors|49|
-| 2010/02/01 | Made the discovery agent timeout configurable using plugin.discovery.timeout|48|
-| 2010/01/25 | mc-controller now correctly loads/reloads agents.|45|
-| 2010/01/25 | Building packages has been improved to ensure rdocs are always included|44|
-
-
-## 0.4.3 - 2010/01/24
-
-### Release Focus and Notes
-
-This release fixes a few bugs and introduce a major new SimpleRPC feature for auditing requests.
-
-### Auditing
-
-We've created an "auditing framework for SimpleRPC":/simplerpc/auditing.html, each request gets passed to an audit plugin for processing.  We ship one that simply logs to a file on each node and there's a "community plugin":http://code.google.com/p/mcollective-plugins/wiki/AuditCentralRPCLog that logs everything on a central logging host.
-
-In future we might add auditing to the client libraries so requests will be logged where they are sent as well as auditing of replies being sent, this will be driven by requests from the community though.
-
-### New _fail!_ method for SimpleRPC
-
-Till now while writing agents you can use the _fail_ method to set statuses in the reply, this however did not also raise exceptions and terminate execution of the agent immediately.
-
-Often the existing behavior is required but it did lead to some awkward code when you did want to just exit the agent immediately as well as set a fail status.  We've added a _fail!_ method that works just like _fail_ except it stops execution of your agent immediately.
-
-### Backwards Compatibility
-
-No changes that impacts backward compatibility has been made.
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-| 2010/01/23 | Handle ctrl-c during discovery without showing exceptions to users|34|
-| 2010/01/21 | Force all facts in the YAML fact source to be strings|41|
-| 2010/01/19 | Add SimpleRPCAuditing audit logging to SimpleRPC clients and Agents| |
-| 2010/01/18 | The SRPM we provide will now build outside of the Rake environment|40|
-| 2010/01/18 | Add a _fail!_ method to RPC::Agent|37|
-| 2010/01/18 | mc-rpc can now be used without supplying arguments|38|
-| 2010/01/18 | Don't raise an error if no user/pass is given to the stomp connector, try unauthenticated mode|35|
-| 2010/01/17 | Improve error message when Regex validation failed on SimpleRPC input|36|
-
-
-## 0.4.2 - 2010/01/14
-
-### Release Focus and Notes
-
-This release fixes a few bugs, add some command line improvements and brings major changes to the Debian packaging.
-
-### Packaging
-
-Firstly we've had some amazing work done by Riccardo Setti to make us Debian packages that complies with Debian and Ubuntu policy, this release use these new packages.  It has some unfortunate changes to file layout detailed below but overall I think it's a big win to get us in line with Distribution policies and standards.
-
-The only major change is that in the past we used _/usr/libexec/mcollective_ as the libdir, but Debian does not have this directory and it is not in the LFHS anymore so we now use _/usr/share/mcollective/plugins_ as the lib dir.  You need to move your plugins there and update both client and server configs.
-
-The RedHat packages will move to this convention too in the next release since I think it's the better location and complies with LFHS.
-
-### Command Line Improvements
-
-We've streamlined the command line a bit, nothings changed we've just added some flags.
-
-The _--with-class_, _--with-fact_, _--with-agent_ and _--with-identity_ now all have a short form _-C_, _-F_, _-A_ and _-I_ respectively.
-
-We've added a new filter option _--with_ and a short form _-W_ that combines _--with-class_ and _--with-fact_ into one filter type, use case would be:
-
-{% highlight console %}
-  % mc-find-hosts -W "/centreon/ country=de roles::dev_server/"
-{% endhighlight %}
-
-This would find hosts with class regex matched _/centreon/_, class _roles::dev_server_ and fact matching _country=de_.  Hopefully this saves on some typing.
-
-You can also now set the environment variables _MCOLLECTIVE_TIMEOUT_ and _MCOLLECTIVE_DTIMEOUT_ which saves you from typing _--timeout_ and _--discovery-timeout_ often, especially useful on very fast networks.
-
-### Other fixes and improvements
-
- * We've added the COPYING file to all the packages
- * We've made the init script more LSB compliant
- * A bug related to discovery in SimpleRPC was fixed
-
-### Backwards Compatibility
-
-The only backwards issue is the Debian packages.  They've been tested to upgrade cleanly but you need to change the config as above.
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-| 2010/01/13 | New packaging for Debian provided by Riccardo Setti|29|
-| 2010/01/07 | Improved LSB compliance of the init script - thanks Riccardo Setti|32|
-| 2010/01/07 | Multiple calls to SimpleRPC client would reset discovered hosts|31|
-| 2010/01/04 | Timeouts can now be changed with MCOLLECTIVE_TIMEOUT and MCOLLECTIVE_DTIMEOUT environment vars|25|
-| 2010/01/04 | Specify class and fact filters easier with the new -W or --with option|27 |
-| 2010/01/04 | Added COPYING file to RPMs and tarball|28|
-| 2010/01/04 | Make shorter filter options -C, -I, -A and -F|26|
-
-## 0.4.1 - 2010/01/02
-
-### Release Focus and Notes
-
-This is a bug fix release to address some shortcomings and issues found in Simple RPC.
-
-The main issue is around handling of meta data in agents, the documented approach did not work, we've now solved this by adding a number of hooks into the processing of Simple RPC agents.
-
-We've also made logging and config retrieval a bit easier in agents - and documented this.
-
-You can now call the _mc-rpc_ command a bit easier:
-
-{% highlight console %}
-  % mc-rpc --agent helloworld --action echo --argument msg="hello world"
-  % mc-rpc helloworld echo msg="hello world"
-{% endhighlight %}
-
-The 2 calls are the same, you can pass as many arguments in _key=val_ pairs as needed at the end.
-
-### Backwards Compatibility
-
-No issues with backward compatibility, should be a simple upgrade.
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-| 2010/01/02 | Added hooks to plug into the processing of requests, also enabled setting meta data and timeouts|14|
-| 2010/01/02 | Created readers for @config and @logger in the SimpleRPC agent|23|
-| 2009/12/30 | Don't send out any requests if no nodes were discovered|17|
-| 2009/12/30 | Added :discovered and :discovered_nodes to client stats|20|
-| 2009/12/30 | Add a empty_filter? helper to the RPC mixin|18|
-| 2009/12/30 | Fix formatting bug with progress bar|21|
-| 2009/12/29 | Simplify mc-rpc command line|16|
-| 2009/12/29 | Fix layout issue when printing hosts that did not respond|15|
-
-
-## 0.4.0 - 2009/12/29
-
-### Release Focus and Notes
-
-This release introduced a major new feature - Simple RPC - a framework for easily building clients and agents.  More than that it's a set of conventions and standards that will help us build generic clients like web based ones capable of talking to all agents.
-
-We think this feature is ready for wide use, it's well documented and we've done extensive testing.  We'll be porting some of our own code over to it once this release is out and we do anticipate there might be some _0.4.x_ releases to round off a few issues that might remain.  We do not currently have any open tickets against Simple RPC.
-
-We've also added the ability to create more complex queries such as:
-
-{% highlight console %}
---with-class /dev_server/ --with-class /rails/
-{% endhighlight %}
-
-This does an _AND_ operation on the puppet classes on the node and finds only nodes with both _/dev_server/_ *AND* _/rails/_ classes.  This new functionality applies to all types of filter.
-
-We've made the _--with-class_ filters more generic in comments, documentation etc with an eye to be more usable in Chef and other Configuration Management environments.
-
-### Backwards Compatibility
-
-Unfortunately introducing the new filtering methods has some backward compatibility issues, if you had clients/agents with code like:
-
-{% highlight ruby %}
-   options[:filter]["agent"] = "some agent"
-{% endhighlight %}
-
-You should now change that to:
-
-{% highlight ruby %}
-   options[:filter]["agent"] << "some agent"
-{% endhighlight %}
-
-As each filter is an array now.  If you do not change the code it will still work as before but you will not be able to use the compound filtering feature on filter types that you've forced to be a string and there might be some other undesired side effects.  We've tried though to at least not break old code, they just can't use the new features.
-
-You were also able to test easily in the past if you're running unfiltered using
-something like:
-
-{% highlight ruby %}
-   if options[:filter] == {}
-{% endhighlight %}
-
-Now that's much harder and we've added a helper to make this easier:
-
-{% highlight ruby %}
-   if MCollective::Util.empty_filter?(options[:filter])
-{% endhighlight %}
-
-This new method is compatible with both the old and new filter method so you can start using it before you finish the first issue mentioned here.
-
-We've also made the class filter more generic, in the past you did class filters like this:
-
-{% highlight ruby %}
-   options[:filter]["puppet_class"] << /apache/
-{% endhighlight %}
-
-Now you have to adjust it to:
-
-{% highlight ruby %}
-   options[:filter]["cf_class"] << /apache/
-{% endhighlight %}
-
-Old code will keep working but you should change to this name for filters to be consistent with the rest of the code base.
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-| 2009/12/28 | Add support for other configuration management systems like chef in the --with-class filters|13|
-| 2009/12/28 | Add a _Util.empty`_`filter?_ to test for an empty filter| |
-| 2009/12/27 | Create a new client framework SimpleRPCIntroduction|6|
-| 2009/12/27 | Add support for multiple filters of the same type|3|
-
-## 0.3.0 - 2009/12/17
-
-### Release Focus and Notes
-
-Primarily a bug fix release.  Only new feature is to allow the user to create _MCollective::Util::`*`_ classes and put those in the plugins directory.  This is useful for more complex agents and clients.
-
-### Backwards Compatibility
-
-This release should not break any older code, if it does it's a bug.
-
-### Changes
-
-|Date|Description|Ticket|
-|----|-----------|------|
-|2009/12/16|Improvements for newer versions of Ruby where TERM signal was not handled|7|
-|2009/12/07|MCollective::Util is now a module and plugins can drop in util classes in the plugin dir| |
-|2009/12/07|The Rakefile now works with rake provided on Debian 4 systems|2|
-|2009/12/07|Improvements in the RC script for Debian and older Ubuntu systems|5|
-
-## 0.2.0 - 2009/12/02
-
-### Release Focus and Notes
-
-First numbered release
-
-### Backwards Compatibility
-
-n/a
-
-### Changes
-
-n/a
diff --git a/website/screencasts.md b/website/screencasts.md
deleted file mode 100644 (file)
index 8e0291a..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
----
-layout: default
-title: Screen Casts
-toc: false
----
-[blip]: http://mcollective.blip.tv/
-[slideshare]: http://www.slideshare.net/mcollective
-[ec2demo]: /mcollective/ec2demo.html
-[Terminology]: /mcollective/terminology.html
-[SimpleRPCIntroduction]: /mcollective/simplerpc/
-[DDL]: /mcollective/reference/plugins/ddl.html
-
-We believe screen casts give the best introduction to new concepts, so we've recorded
-several to complement the documentation.
-
-There's a [blip] channel that has all the videos, you can subscribe and follow there.
-There is also a [slideshare] site where presentations will go that we do at conferences and events.
-
-## Introductions and Guides
-<ol>
-<li><a href="#introduction">Introducing MCollective</a></li>
-<li><a href="#ec2_demo">EC2 Hosted Demo</a></li>
-<li><a href="#message_flow">Message Flow, Terminology and Components</a></li>
-<li><a href="#writing_agents">Writing Agents</a></li>
-<li><a href="#simplerpc_ddl">Detailed information about the DDL</a></li>
-</ol>
-
-## Tools built using MCollective
-<ol>
-<li><a href="#simplerpc_ddl_irb">SimpleRPC DDL IRB</a></li>
-<li><a href="#mcollective_deployer">Software Deployer used by developers</a></li>
-<li><a href="#exim">Managing clusters of Exim Servers</a></li>
-<li><a href="#server_provisioner">Bootstrapping Puppet on EC2</a></li>
-</ol>
-
-<a name="introduction">&nbsp;</a>
-
-### Introduction
-[This video](http://youtu.be/0i7VpvC2vMM) introduces the basic concepts behind MCollective.  It predates the
-SimpleRPC framework but is still valid today.
-
-<iframe width="640" height="360" src="http://www.youtube-nocookie.com/embed/0i7VpvC2vMM" frameborder="0" allowfullscreen></iframe>
-
-<a name="ec2_demo">&nbsp;</a>
-
-### EC2 Based Demo
-Sometimes you just want to know if a tool is right for you by getting hands on experience
-we've made a EC2 hosted demo where you can fire up as many nodes in a cluster as you want and
-get some experience.
-
-View the [ec2demo] page for more about this.
-
-<iframe width="640" height="360" src="http://www.youtube-nocookie.com/embed/Hw0Z1xfg050" frameborder="0" allowfullscreen></iframe>
-
-<a name="message_flow">&nbsp;</a>
-
-### Message Flow, Terminology and Components
-This video introduces the messaging concepts you need to know about when using MCollective.
-It shows how the components talk with each other and what software needs to be installed where
-on your network.  Viewing this prior to starting your deployment is recommended.
-
-We also have a page detailing the [Terminology]
-
-<iframe width="640" height="480" src="http://www.youtube-nocookie.com/embed/fIHW41W8jas" frameborder="0" allowfullscreen></iframe>
-
-View more <a href="http://www.slideshare.net/">webinars</a> from <a href="http://www.slideshare.net/mcollective">Marionette Collective</a>.
-<a name="writing_agents">&nbsp;</a>
-
-### How to write an Agent, DDL and Client
-Writing agents are easy, we have good documentation that can be used as a reference, [this
-video](http://youtu.be/2Xhq_UqnqRE) should show you how to tie it all together though.
-See the [SimpleRPC Introduction][SimpleRPCIntroduction] for reference wiki pages after viewing this video.
-
-<iframe width="640" height="480" src="http://www.youtube-nocookie.com/embed/2Xhq_UqnqRE" frameborder="0" allowfullscreen></iframe>
-
-<a name="simplerpc_ddl">&nbsp;</a>
-
-### The SimpleRPC DDL
-The Data Definition Language helps your clients produce more user friendly output, it ensures
-input gets validated while showing online help, and it enables dynamic generation of user interfaces.
-After you have watched the video, you can refer to the [DDL] wiki page for more information.
-
-<iframe width="640" height="480" src="http://www.youtube-nocookie.com/embed/xikjjXvN6nA" frameborder="0" allowfullscreen></iframe>
-
-<a name="simplerpc_ddl_irb">&nbsp;</a>
-
-### SimpleRPC DDL enhanced IRB
-Based on the SimpleRPC DDL, this custom IRB shell supports command completion. 
-
-<iframe width="640" height="480" src="http://www.youtube-nocookie.com/embed/xikjjXvN6nA" frameborder="0" allowfullscreen></iframe>
-
-<a name="mcollective_deployer"> </a>
-
-### Software Deployer using MCollective
-If you ever do commissioned work based on MCollective, this deployer written using SimpleRPC may be of use.
-It can be used by developers to deploy applications live into production using a defined
-API and process.
-
-<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/Fqt2SgnQn3k&amp;hl=en_US&amp;fs=1?rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Fqt2SgnQn3k&amp;hl=en_US&amp;fs=1?rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>
-
-<a name="exim">&nbsp; </a>
-
-### Managing Exim Clusters
-A command line and dialog-based UI written to manage clusters of Exim Servers.
-
-The code for this is [open source](http://github.com/puppetlabs/mcollective-plugins/tree/master/agent/exim/).
-Unfortunately it predates SimpleRPC; we hope to port it soon.
-
-<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/kNvoQCpJ1V4&amp;hl=en_US&amp;fs=1?rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/kNvoQCpJ1V4&amp;hl=en_US&amp;fs=1?rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>
-
-<a name="server_provisioner">&nbsp;</a>
-
-### Bootstrapping Puppet on EC2 with MCollective
-Modern cloud environments present a lot of challenges to automation. However, with MCollective and
-some existing open source agents and plugins you can completely automate the entire process
-of provisioning EC2 nodes using Puppet.
-
-More detail is available [on this blog post](http://www.devco.net/archives/2010/07/14/bootstrapping_puppet_on_ec2_with_mcollective.php)
-
-<iframe width="640" height="480" src="http://www.youtube-nocookie.com/embed/-iEgz9MD3qA" frameborder="0" allowfullscreen></iframe>
diff --git a/website/security.md b/website/security.md
deleted file mode 100644 (file)
index 76fe480..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
----
-layout: default
-title: Security Overview
-toc: false
----
-[broadcast paradigm]: /mcollective/reference/basic/messageflow.html
-[SimpleRPC]: /mcollective/simplerpc/
-[Authorization]: /mcollective/simplerpc/authorization.html
-[Auditing]: /mcollective/simplerpc/auditing.html
-[SSL security plugin]: /mcollective/reference/plugins/security_ssl.html
-[AES security plugin]: /mcollective/reference/plugins/security_aes.html
-[ActiveMQ Security]: /mcollective/reference/integration/activemq_security.html
-[ActiveMQ TLS]: http://activemq.apache.org/how-do-i-use-ssl.html
-[ActiveMQ SSL]: /mcollective/reference/integration/activemq_ssl.html
-[ActiveMQ STOMP]: http://activemq.apache.org/stomp.html
-[MCollective STOMP Connector]: /mcollective/reference/plugins/connector_stomp.html
-[ActionPolicy]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/AuthorizationActionPolicy
-[CentralAudit]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/AuditCentralRPC
-[Subcollectives]: reference/basic/subcollectives.html
-
-
-Due to the [broadcast paradigm] of mcollective security is a complex topic to
-discuss.
-
-This discussion will focus on strong SSL and AES+RSA based security plugins,
-these are not the default or only option but is currently the most secure.
-Both the [SSL security plugin] and [AES security plugin] provide strong caller
-identification, this is used by the [SimpleRPC] framework for [Authorization]
-and [Auditing].
-
-As every organisation has its own needs almost all aspects of the security
-system is pluggable.  This is an overview of the current state of SSL based
-Authentication, Authorization and Auditing.
-
-<center><img src="/mcollective/images/mcollective-aaa.png"></center>
-
-The image above is a reference to use in the following pages, it shows a
-MCollective Setup and indicates the areas of discussion.
-
-The focus here is on ActiveMQ, some of the details and capabilities will
-differ between middleware systems.
-
-## Client Connections and Credentials
-
-Every STOMP connection has a username and password, this is used to gain basic
-access to the ActiveMQ system.  We have a [ActiveMQ Security] sample setup
-documented.
-
-ActiveMQ can use LDAP and other security providers, details of this is out of
-scope here, you should use their documentation or the recently released book
-for details of that.
-
-### MCollective Protocol Security
-The main protocol used by MCollective keeps track of message creation time and
-a per message TTL.  Messages that are older than the TTL are not accepted in
-future we will also do full replay protection.
-
-Both the AES+RSA and the SSL plugin secures these 2 properties cryptographically
-to make sure they are not tampered with.
-
-### The AES+RSA securith plugin
-When using the [AES security plugin] each user also gets a private and public
-key, like with SSH you need to ensure that the private keys remain private
-and not shared between users.
-
-This plugin can be configured to distribute public keys at the cost of some
-security, you can also manually distribute keys for the most secure setup.
-
-The public / private key pair is used to encrypt using AES and then to encrypt
-the key used during the AES phase using RSA.  This provides encrypted payloads
-securing the reply strucutres.
-
-The client embeds a _caller_ structure in each request, if RSA decryption
-pass the rest of the MCollective agents, auditing etc can securely know who
-initiated a request.
-
-This caller is used later during Authorization and Auditing.
-
-The plugin secures the TTL and Message Time properties of the message making sure
-someone cannot intercept, tamper and replay these messages.
-
-This plugin comes with a significant setup, maintenance and performance overhead
-if all you need is to securely identify users use the SSL security plugin instead.
-
-### The SSL security plugin
-When using the [SSL security plugin] each user also gets a private and public
-certificate, like with SSH you need to ensure that the private keys remain
-private and not be shared between users.  The public part needs to be
-distributed to all nodes.
-
-The private key is used to cryptographically sign each request being made by a
-client, later the public key will be used to validate the signature for
-authenticity.
-
-The client embeds a _caller_ structure in each request, if SSL signature
-validation pass the rest of the MCollective agents, auditing etc can securely
-know who initiated a request.
-
-This caller is used later during Authorization and Auditing.
-
-The plugin secures the TTL and Message Time properties of the message making sure
-someone cannot intercept, tamper and replay these messages.
-
-## Connection to Middleware
-
-By default the connections between Middleware and Nodes are not encrypted, just
-signed using the SSL keys above.  [ActiveMQ supports TLS][ActiveMQ TLS] and the
-[stomp connector][ActiveMQ STOMP] supports this including full CA based
-certificate verification.
-
-The [MCollective STOMP Connector] also supports TLS, to configure MCollective
-to speak TLS to your nodes please follow our notes about [ActiveMQ SSL].
-
-Enabling TLS throughout will secure your connections from any kind of sniffing
-and Man in The Middle attacks.
-
-## Middleware Authorization and Authentication
-
-As mentioned above ActiveMQ has it's own users and every node and client
-authenticates using these.
-
-In addition to this you can on the middleware layer restrict access to topics,
-you can for example run a development and production collective on the same
-ActiveMQ infrastructure and allow your developers access to just the development
-collective using these controls.  They are not very fine grained but should be a
-import step to configure for any real setup.
-
-We have a sample [ActiveMQ Security] setup documented that has this kind of
-control.
-
-By combining this topic level restrictions with [Subcollectives] you can create
-virtually isolated groups of nodes and give certain users access to only those
-subcollectives.  Effectively partitioning out a subset of machines and giving
-secure access to just those.
-
-## Node connections and credentials
-
-As with the client the node needs a username and password to connect to the
-middleware and can also use TLS.
-
-It's not a problem if all the nodes share a username and password for the
-connection since generally nodes do not make new requests.  You can enable
-registration features that will see your nodes make connections, you should
-restrict this as outlined in the previous section.
-
-When using the [SSL security plugin] all the nodes share a same SSL private
-and public key, all replies are signed using this key.  It would not be
-impossible to add a per node certificate setup but I do not think this will
-add a significant level of security over what we have today.
-
-When using the [AES security plugin] nodes can have their own sets of keys
-and registration data can be secured.  Replies are encrypted using the clients
-key and so only the client who made the request can read the replies.
-
-## SimpleRPC Authorization
-
-The RPC framework has a pluggable [Authorization] system, you can create very
-fine grain control over requests, for example using the [ActionPolicy] setup you
-can create a policy like this:
-
-{% highlight text %}
-policy default deny
-allow   cert=rip      *                       *                *
-allow   cert=john     *                       customer=acme    acme::devserver
-allow   cert=john     enable disable status   customer=acme    *
-{% endhighlight %}
-
-This applied to the service agent will allow different level of access to
-actions to different people.  The caller id is based directly on the SSL Private
-Key in use and subject to validation on every node.
-
-As with other aspects of mcollective authorization is tied closely with meta
-data like facts and classes so you can use these to structure your authorization
-as can be seen above.
-
-You can provide your own authorization layers to fit your ogranizational needs,
-they can be specific to an agent or apply to the entire collective.
-
-## SimpleRPC Auditing
-
-The RPC layer can keep detailed [Auditing] records of every request received,
-the audit log shows the - SSL signature or RSA verified - caller, what agent, action
-and any arguments that was sent for every request.
-
-The audit layer is a plugin based system, we provide one that logs to a file on
-every node and there are [community plugins][CentralAudit] that keeps a centralized
-log both in log files and in MongoDB NoSQL database.
-
-Which to use depends on your usecase, obviously a centralized auditing system
-for thousands of nodes is very complex and will require a special plugin to be
-developed the community centralized audit log is ok for roughly 100 nodes or
-so.
diff --git a/website/simplerpc/agents.md b/website/simplerpc/agents.md
deleted file mode 100644 (file)
index bae20be..0000000
+++ /dev/null
@@ -1,526 +0,0 @@
----
-layout: default
-title: Writing SimpleRPC Agents
----
-[WritingAgents]: /mcollective/reference/basic/basic_agent_and_client.html
-[SimpleRPCClients]: /mcollective/simplerpc/clients.html
-[ResultsandExceptions]: /mcollective/simplerpc/clients.html#Results_and_Exceptions
-[SimpleRPCAuditing]: /mcollective/simplerpc/auditing.html
-[SimpleRPCAuthorization]: /mcollective/simplerpc/authorization.html
-[DDL]: /mcollective/reference/plugins/ddl.html
-[WritingAgentsScreenCast]: http://mcollective.blip.tv/file/3808928/
-[RPCUtil]: /mcollective/reference/plugins/rpcutil.html
-[ValidatorPlugins]: /mcollective/reference/plugins/validator.html
-
-Simple RPC works because it makes a lot of assumptions about how you write agents, we'll try to capture those assumptions here and show you how to apply them to our Helloworld agent.
-
-We've recorded a [tutorial that will give you a quick look at what is involved in writing agents][WritingAgentsScreenCast].
-
-## Conventions regarding Incoming Data
-
-As you've seen in [SimpleRPCClients] our clients will send requests like:
-
-{% highlight ruby %}
-mc.echo(:msg => "Welcome to MCollective Simple RPC")
-{% endhighlight %}
-
-A more complex example might be:
-
-{% highlight ruby %}
-exim.setsender(:msgid => "1NOTVx-00028U-7G", :sender => "foo@bar.com")
-{% endhighlight %}
-
-Effectively this creates a hash with the members _:msgid_ and _:sender_.
-
-Your data types should be preserved if your Security plugin supports that - the default one does - so you can pass in Arrays, Hashes, OpenStructs, Hashes of Hashes but you should always pass something in and it should be key/value pairs like a Hash expects.
-
-You cannot use the a data item called _:process_results_ as this has special meaning to the agent and client.  This will indicate to the agent that the client is'nt going to be waiting to process results.  You might choose not to send back a reply based on this.
-
-## Sample Agent
-Here's our sample *Helloworld* agent:
-
-{% highlight ruby linenos %}
-module MCollective
-  module Agent
-    class Helloworld<RPC::Agent
-      # Basic echo server
-      action "echo" do
-        validate :msg, String
-
-        reply[:msg] = request[:msg]
-      end
-    end
-  end
-end
-
-{% endhighlight %}
-
-Strictly speaking this Agent will work but isn't considered complete - there's no meta data and no help.
-
-A helper agent called [_rpcutil_][RPCUtil] is included that helps you gather stats, inventory etc about the running daemon.  It's a full SimpleRPC agent including DDL, you can look at it for an example.
-
-### Agent Name
-The agent name is derived from the class name, the example code creates *MCollective::Agent::Helloworld* and the agent name would be *helloworld*.
-
-<a name="Meta_Data_and_Initialization">&nbsp;</a>
-
-### Meta Data and Initialization
-Simple RPC agents still need meta data like in [WritingAgents], without it you'll just have some defaults assigned, code below adds the meta data to our agent:
-
-**NOTE**: As of version 2.1.1 the _metadata_ section is deprecated, all agents must have DDL files with this information in them.
-
-{% highlight ruby linenos %}
-module MCollective
-  module Agent
-    class Helloworld<RPC::Agent
-      metadata :name        => "helloworld",
-               :description => "Echo service for MCollective",
-               :author      => "R.I.Pienaar",
-               :license     => "GPLv2",
-               :version     => "1.1",
-               :url         => "http://projects.puppetlabs.com/projects/mcollective-plugins/wiki",
-               :timeout     => 60
-
-      # Basic echo server
-      action "echo" do
-        validate :msg, String
-
-        reply[:msg] = request[:msg]
-      end
-    end
-  end
-end
-{% endhighlight %}
-
-The added code sets our creator info, license and version as well as a timeout.  The timeout is how long MCollective will let your agent run for before killing them, this is a very important number and should be given careful consideration.  If you set it too low your agents will be terminated before their work is done.
-
-The default timeout for SimpleRPC agents is *10*.
-
-### Writing Actions
-Actions are the individual tasks that your agent can do:
-
-{% highlight ruby linenos %}
-action "echo" do
-  validate :msg, String
-
-  reply[:msg] = request[:msg]
-end
-{% endhighlight %}
-
-Creates an action called "echo".  They don't and can't take any arguments.
-
-## Agent Activation
-In the past you had to copy an agent only to machines that they should be running on as
-all agents were activated regardless of dependencies.
-
-To make deployment simpler agents support the ability to determine if they should run
-on a particular platform.  By default SimpleRPC agents can be configured to activate
-or not:
-
-{% highlight ini %}
-plugin.helloworld.activate_agent = false
-{% endhighlight %}
-
-You can also place the following in _/etc/mcollective/plugins.d/helloworld.cfg_:
-
-{% highlight ini %}
-activate_agent = false
-{% endhighlight %}
-
-This is a simple way to enable or disable an agent on your machine, agents can also
-declare their own logic that will get called each time an agent gets loaded from disk.
-
-{% highlight ruby %}
-module MCollective
-  module Agent
-    class Helloworld<RPC::Agent
-
-      activate_when do
-        File.executable?("/usr/bin/puppet")
-      end
-    end
-  end
-end
-{% endhighlight %}
-
-If this block returns false or raises an exception then the agent will not be active on
-this machine and it will not be discovered.
-
-When the agent gets loaded it will test if _/usr/bin/puppet_ exist and only if it does
-will this agent be enabled.
-
-## Help and the Data Description Language
-We have a separate file that goes together with an agent and is used to describe the agent in detail, a DDL file for the above echo agent can be seen below:
-
-**NOTE**: As of version 2.1.1 the DDL files are required to be on the the nodes before an agent will be activated
-
-{% highlight ruby linenos %}
-metadata :name        => "echo",
-         :description => "Echo service for MCollective",
-         :author      => "R.I.Pienaar",
-         :license     => "GPLv2",
-         :version     => "1.1",
-         :url         => "http://projects.puppetlabs.com/projects/mcollective-plugins/wiki",
-         :timeout     => 60
-
-action "echo", :description => "Echos back any message it receives" do
-   input :msg,
-         :prompt      => "Service Name",
-         :description => "The service to get the status for",
-         :type        => :string,
-         :validation  => '^[a-zA-Z\-_\d]+$',
-         :optional    => false,
-         :maxlength   => 30
-
-   output :msg,
-          :description => "The message we received",
-          :display_as  => "Message"
-end
-{% endhighlight %}
-
-As you can see the DDL file expand on the basic syntax adding a lot of markup, help and other important validation data.  This information - when available - helps in making more robust clients and also potentially auto generating user interfaces.
-
-The DDL is a complex topic, read all about it in [DDL].
-
-## Validating Input
-If you've followed the conventions and put the incoming data in a Hash structure then you can use a few of the provided validators to make sure your data that you received is what you expected.
-
-If you didn't use Hashes for input the validators would not be usable to you.  In future validation will happen automatically based on the [DDL] so I strongly suggest you follow the agent design pattern shown here using hashes.
-
-In the sample action above we validate the *:msg* input to be of type *String*, here are a few more examples:
-
-{% highlight ruby linenos %}
-   validate :msg, /[a-zA-Z]+/
-   validate :ipaddr, :ipv4address
-   validate :ipaddr, :ipv6address
-   validate :commmand, :shellsafe
-   validate :mode, ["all", "packages"]
-{% endhighlight %}
-
-The table below shows the validators we support currently
-
-|Type of Check|Description|Example|
-|-------------|-----------|-------|
-|Regular Expressions|Matches the input against the supplied regular expression|validate :msg, /\[a-zA-Z\]+/|
-|Type Checks|Verifies that input is of a given ruby data type|validate :msg, String|
-|IPv4 Checks|Validates an ip v4 address, note 5.5.5.5 is technically a valid address|validate :ipaddr, :ipv4address|
-|IPv6 Checks|Validates an ip v6 address|validate :ipaddr, :ipv6address|
-|system call safety checks|Makes sure the input is a string and has no &gt;&lt;backtick, semi colon, dollar, ambersand or pipe characters in it|validate :command, :shellsafe|
-|Boolean|Ensures a input value is either real boolean true or false|validate :enable, :bool|
-|List of valid options|Ensures the input data is one of a list of known good values|validate :mode, \["all", "packages"\]|
-
-All of these checks will raise an InvalidRPCData exception, you shouldn't catch this exception as the Simple RPC framework catches those and handles them appropriately.
-
-We'll make input validators plugins so you can provide your own types of validation easily.
-
-Additionally if can escape strings being passed to a shell, escaping is done in line with the _Shellwords#shellescape_ method that is in newer version of Ruby:
-
-{% highlight ruby linenos %}
-   safe = shellescape(request[:foo])
-{% endhighlight %}
-
-As of version 2.2.0 you can add your own types of validation using [Validator Plugins][ValidatorPlugins].
-
-## Agent Configuration
-
-You can save configuration for your agents in the main server config file:
-
-{% highlight ini %}
- plugin.helloworld.setting = foo
-{% endhighlight %}
-
-In your code you can retrieve the config setting like this:
-
-{% highlight ini %}
- setting = config.pluginconf["helloworld.setting"] || ""
-{% endhighlight %}
-
-This will set the setting to whatever is the config file of "" if unset.
-
-## Accessing the Input
-As you see from the echo example our input is easy to get to by just looking in *request*, this would be a Hash of exactly what was sent in by the client in the original request.
-
-The request object is in instance of *MCollective::RPC::Request*, you can also gain access to the following:
-
-|Property|Description|
-|--------|-----------|
-|time|The time the message was sent|
-|action|The action it is directed at|
-|data|The actual hash of data|
-|sender|The id of the sender|
-|agent|Which agent it was directed at|
-
-Since data is the actual Hash you can gain access to your input like:
-
-{% highlight ruby %}
- request.data[:msg]
-{% endhighlight %}
-
-OR
-
-{% highlight ruby %}
-request[:msg]
-{% endhighlight %}
-
-Accessing it via the first will give you full access to all the normal Hash methods where the 2nd will only give you access to *include?*.
-
-## Running Shell Commands
-
-A helper function exist that makes it easier to run shell commands and gain
-access to their _STDOUT_ and _STDERR_.
-
-We recommend everyone use this method for calling to shell commands as it forces
-*LC_ALL* to *C* as well as wait on all the children and avoids zombies, you can
-set unique working directories and shell environments that would be impossible
-using simple _system_ that is provided with Ruby.
-
-The simplest case is just to run a command and send output back to the client:
-
-{% highlight ruby %}
-reply[:status] = run("echo 'hello world'", :stdout => :out, :stderr => :err)
-{% endhighlight %}
-
-Here you will have set _reply`[`:out`]`_, _reply`[`:err`]`_ and _reply`[`:status`]`_ based
-on the output from the command
-
-You can append the output of the command to any string:
-
-{% highlight ruby %}
-out = []
-err = ""
-status = run("echo 'hello world'", :stdout => out, :stderr => err)
-{% endhighlight %}
-
-Here the STDOUT of the command will be saved in the variable _out_ and not sent
-back to the caller.  The only caveat is that the variables _out_ and _err_ should
-have the _<<_ method, so if you supplied an array each line of output will be a
-single member of the array.  In the example _out_ would be an array of lines
-while _err_ would just be a big multi line string.
-
-By default any trailing new lines will be included in the output and error:
-
-{% highlight ruby %}
-reply[:status] = run("echo 'hello world'", :stdout => :out, :stderr => :err)
-reply[:stdout].chomp!
-reply[:stderr].chomp!
-{% endhighlight %}
-
-You can shorten this to:
-
-{% highlight ruby %}
-reply[:status] = run("echo 'hello world'", :stdout => :out, :stderr => :err, :chomp => true)
-{% endhighlight %}
-
-This will remove a trailing new line from the _reply`[`:out`]`_ and _reply`[`:err`]`_.
-
-If you wanted this command to run from the _/tmp_ directory:
-
-{% highlight ruby %}
-reply[:status] = run("echo 'hello world'", :stdout => :out, :stderr => :err, :cwd => "/tmp")
-{% endhighlight %}
-
-Or if you wanted to include a shell Environment variable:
-
-{% highlight ruby %}
-reply[:status] = run("echo 'hello world'", :stdout => :out, :stderr => :err, :environment => {"FOO" => "BAR"})
-{% endhighlight %}
-
-The status returned will be the exit code from the program you ran, if the program
-completely failed to run in the case where the file doesn't exist, resources were
-not available etc the exit code will be -1
-
-You have to set the cwd and environment through these options, do not simply
-call _chdir_ or adjust the _ENV_ hash in an agent as that will not be safe in
-the context of a multi threaded Ruby application.
-
-## Constructing Replies
-
-### Reply Data
-The reply data is in the *reply* variable and is an instance of *MCollective::RPC::Reply*.
-
-{% highlight ruby %}
-reply[:msg] = request[:msg]
-{% endhighlight %}
-
-### Reply Status
-As pointed out in the [ResultsandExceptions] page results all include status messages and the reply object has a helper to create those.
-
-{% highlight ruby %}
-def rmmsg_action
-  validate :msg, String
-  validate :msg, /[a-zA-Z]+-[a-zA-Z]+-[a-zA-Z]+-[a-zA-Z]+/
-  reply.fail "No such message #{request[:msg]}", 1 unless have_msg?(request[:msg])
-
-  # check all the validation passed before doing any work
-  return unless reply.statuscode == 0
-
-  # now remove the message from the queue
-end
-
-{% endhighlight %}
-
-The number in *reply.fail* corresponds to the codes in [ResultsandExceptions] it would default to *1* so you could just say:
-
-{% highlight ruby %}
-reply.fail "No such message #{request[:msg]}" unless have_msg?(request[:msg])
-{% endhighlight %}
-
-This is hypothetical action that is supposed to remove a message from some queue, if we do have a String as input that matches our message id's we then check that we do have such a message and if we don't we fail with a helpful message.
-
-Technically this will just set *statuscode* and *statusmsg* fields in the reply to appropriate values.
-
-It won't actually raise exceptions or exit your action though you should do that yourself as in the example here.
-
-There is also a *fail!* instead of just *fail* it does the same basic function but also raises exceptions.  This lets you abort processing of the agent immediately without performing your own checks on *statuscode* as above later on.
-
-## Actions in external scripts
-Actions can be implemented using other programming languages as long as they support JSON.
-
-{% highlight ruby %}
-action "test" do
-  implemented_by "/some/external/script"
-end
-{% endhighlight %}
-
-The script _/some/external/script_ will be called with 2 arguments:
-
- * The path to a file with the request in JSON format
- * The path to a file where you should write your response as a JSON hash
-
-You can also access these 2 file paths in the *MCOLLECTIVE_REPLY_FILE* and *MCOLLECTIVE_REQUEST_FILE* environment variables
-
-Simply write your reply as a JSON hash into the reply file.
-
-The exit code of your script should correspond to the ones in [ResultsandExceptions].  Any text in STDERR will be
-logged on the server at *error* level and used in the text for the fail text.
-
-Any text to STDOUT will be logged on the server at level *info*.
-
-These scripts can be placed in a standard location:
-
-{% highlight ruby %}
-action "test" do
-  implemented_by "script.py"
-end
-{% endhighlight %}
-
-This will search each configured libdir for _libdir/agent/agent_name/script.py_. If you specified a full path it will not try to find the file in libdirs.
-
-## Sharing code between agents
-Sometimes you have code that is needed by multiple agents or shared between the agent and client.  MCollective has
-name space called *MCollective::Util* for this kind of code and the packagers and so forth supports it.
-
-Create a class with your shared code given a name like *MCollective::Util::Yourco* and save this file in the libdir in *util/yourco.rb*
-
-A sample class can be seen here:
-
-{% highlight ruby %}
-module MCollective
-  module Util
-    class Yourco
-      def dosomething
-      end
-    end
-  end
-end
-{% endhighlight %}
-
-You can now use it in your agent or clients by first loading it from the MCollective lib directories:
-
-{% highlight ruby %}
-MCollective::Util.loadclass("MCollective::Util::Yourco")
-
-helpers = MCollective::Util::Yourco.new
-helpers.dosomething
-{% endhighlight %}
-
-## Authorization
-You can write a fine grained Authorization system to control access to actions and agents, please see [SimpleRPCAuthorization] for full details.
-
-## Auditing
-The actions that agents perform can be Audited by code you provide, potentially creating a centralized audit log of all actions.  See [SimpleRPCAuditing] for full details.
-
-## Logging
-You can write to the server log file using the normal logger class:
-
-{% highlight ruby %}
-Log.debug ("Hello from your agent")
-{% endhighlight %}
-
-You can log at levels *info*, *warn*, *debug*, *fatal* or *error*.
-
-## Data Caching
-As of version 2.2.0 there is a system wide Cache you can use to store data that might be costly to create on each request.
-
-The Cache is thread safe and can be used even with multiple concurrent requests for the same agent.
-
-Imagine your agent interacts with a customer database on the node that is slow to read data from but this data does not
-change often. Using the cache you can arrange for this be read only every 10 minutes:
-
-{% highlight ruby %}
-action "get_customer_data" do
-  # Create a new cache called 'customer' with a 600 second TTL,
-  # noop if it already exist
-  Cache.setup(:customer, 600)
-
-  begin
-    customer = Cache.read(:customer, request[:customerid])
-  rescue
-    customer = Cache.write(:customer, request[:customerid], get_customer(request[:customerid])
-  end
-
-  # do something with the customer data
-end
-{% endhighlight %}
-
-Here we setup a new cache table called *:customer* if it does not already exist, the cache has a 10 minute validity.
-We then try to read a cached customer record for *request\[:customerid\]* and if it's not been put in the cache
-before or if it expired I create a new customer record using a method called *get_customer* and then save it
-into the cache.
-
-If you have critical code in an agent that can only ever be run once you can use the Mutex from the same cache
-to synchronize the code:
-
-{% highlight ruby %}
-action "get_customer_data" do
-  # Create a new cache called 'customer' with a 600 second TTL,
-  # noop if it already exist
-  Cache.setup(:customer, 600)
-
-  Cache(:customer).synchronize do
-     # Update customer record
-  end
-end
-{% endhighlight %}
-
-Here we are using the same Cache that was previously setup and just gaining access to the Mutex protecting the
-cache data.  The code inside the synchronize block will only be run once so you won't get competing updates to
-your customer data.
-
-If the lock is held too long by anyone the mcollectived will kill the threads in line with the Agent timeout.
-
-## Processing Hooks
-We provide a few hooks into the processing of a message, you've already used this earlier to <a href="#Meta_Data_and_Initialization">set meta data</a>.
-
-You'd use these hooks to add some functionality into the processing chain of agents, maybe you want to add extra logging for audit purposes of the raw incoming message and replies, these hooks will let you do that.
-
-|Hook Function Name|Description|
-|------------------|-----------|
-|startup_hook|Called at the end of the initialize method of the _RPC::Agent_ base class|
-|before_processing_hook(msg, connection)|Before processing of a message starts, pass in the raw message and the <em>MCollective::Connector</em> class|
-|after_processing_hook|Just before the message is dispatched to the client|
-
-### *startup_hook*
-Called at the end of the _RPC::Agent_ standard initialize method use this to adjust meta parameters, timeouts and any setup you need to do.
-
-This will not be called right when the daemon starts up, we use lazy loading and initialization so it will only be called the first time a request for this agent arrives.
-
-### *before_processing_hook*
-Called just after a message was received from the middleware before it gets passed to the handlers.  *request* and *reply* will already be set, the msg passed is the message as received from the normal mcollective runner and the connection is the actual connector.
-
-You can in theory send off new messages over the connector maybe for auditing or something, probably limited use case in simple agents.
-
-### *after_processing_hook*
-Called at the end of processing just before the response gets sent to the middleware.
-
-This gets run outside of the main exception handling block of the agent so you should handle any exceptions you could raise yourself.  The reason  it is outside of the block is so you'll have access to even status codes set by the exception handlers.  If you do raise an exception it will just be passed onto the runner and processing will fail.
diff --git a/website/simplerpc/auditing.md b/website/simplerpc/auditing.md
deleted file mode 100644 (file)
index 2981a19..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
----
-layout: default
-title: SimpleRPC Auditing
-toc: false
----
-[SimpleRPCIntroduction]: index.html
-[AuditCentralRPCLog]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/AuditCentralRPC
-
-# {{page.title}}
-
-As part of the [SimpleRPC][SimpleRPCIntroduction] framework we've added an auditing system that you can use to log all requests received into a file or even send it over mcollective to a central auditing system.  What actually happens with audit data is pluggable and you can provide your own plugins to do what you need.
-
-The clients will include the _uid_ of the process running the client library in the requests and the audit function will have access to that on the requests.
-
-## Configuration
-To enable logging you should set an option to enable it and also one to configure which plugin to use:
-
-{% highlight ini %}
-rpcaudit = 1
-rpcauditprovider = Logfile
-{% endhighlight %}
-
-This sets it up to use _MCollective::Audit::Logfile_ plugin for logging evens.
-
-The client will embed a caller id - the Unix UID of the program running it or SSL cert - in requests which you can find in the _request_ object.
-
-## Logfile plugin
-
-Auditing is implemented using plugins that you should install in the normal plugin directory under _mcollective/audit/_.  We have a sample Logfile plugin that you can see below:
-
-{% highlight ruby %}
-module MCollective
-    module RPC
-        class Logfile<Audit
-           require 'pp'
-
-            def audit_request(request, connection)
-                logfile = Config.instance.pluginconf["rpcaudit.logfile"] || "/var/log/mcollective-audit.log"
-
-                now = Time.now
-                now_tz = tz = now.utc? ? "Z" : now.strftime("%z")
-                now_iso8601 = "%s.%06d%s" % [now.strftime("%Y-%m-%dT%H:%M:%S"), now.tv_usec, now_tz]
-
-                File.open(logfile, "w") do |f|
-                    f.puts("#{now_iso8601}: reqid=#{request.uniqid}: reqtime=#{request.time} caller=#{request.caller}@#{request.sender} agent=#{request.agent} action=#{request.action} data=#{request.data.pretty_print_inspect}")
-                end
-            end
-        end
-    end
-end
-{% endhighlight %}
-
-As you can see you only need to provide one method called _audit_request_, you will get the request in the form of an _MCollective::RPC::Request_ object as well as the connection to the middleware should you wish to send logs to a central host.
-
-The Logfile plugin takes a configuration option:
-
-{% highlight ini %}
-plugin.rpcaudit.logfile = /var/log/mcollective-audit.log
-{% endhighlight %}
-
-We do not do log rotation of this file so you should do that yourself if you enable this plugin.
-
-This log lines like:
-
-{% highlight ruby %}
-2010-12-28T17:09:03.889113+0000: reqid=319719cc475f57fda3f734136a31e19b: reqtime=1293556143 caller=cert=nagios@monitor1 agent=nrpe action=runcommand data={:process_results=>true, :command=>"check_mailq"}
-{% endhighlight %}
-
-Other plugins can be found on the community site like [a centralized logging plugin][AuditCentralRPCLog].
diff --git a/website/simplerpc/authorization.md b/website/simplerpc/authorization.md
deleted file mode 100644 (file)
index ad1ea18..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
----
-layout: default
-title: SimpleRPC Authorization
-toc: false
----
-[SimpleRPCIntroduction]: index.html
-[SecurityWithActiveMQ]: /mcollective/reference/integration/activemq_security.html
-[SimpleRPCAuditing]: /mcollective/simplerpc/auditing.html
-[ActionPolicy]: http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/AuthorizationActionPolicy
-
-As part of the [SimpleRPC][SimpleRPCIntroduction] framework we've added an authorization system that you can use to exert fine grained control over who can call agents and actions.
-
-Combined with [Connection Security][SecurityWithActiveMQ], [Centralized Auditing][SimpleRPCAuditing] and Crypto signed messages this rounds out a series of extremely important features for large companies that in combination allow for very precise control over your MCollective Cluster.
-
-The clients will include the _uid_ of the process running the client library in the requests and the authorization function will have access to that on the requests.
-
-There is a sample full featured plugin called [ActionPolicy] that you can use or get some inspiration from.
-
-## Writing Authorization Plugins
-
-Writing an Authorization plugin is pretty simple, the below example will only allow RPC calls from Unix UID 500.
-
-{% highlight ruby linenos %}
-module MCollective::Util
-    class AuthorizeIt
-        def self.authorize(request)
-            if request.caller != "uid=500"
-                raise("Not authorized")
-            end
-        end
-    end
-end
-{% endhighlight %}
-
-Any exception thrown by your class will just result in the message not being processed or audited.
-
-You'd install this in your libdir where you should already have a Util directory for these kinds of classes.
-
-To use your authorization plugin in an agent simply do something like this:
-
-{% highlight ruby linenos %}
-module MCollective::Agent
-    class Service<RPC::Agent
-        authorized_by :authorize_it
-
-        # ...
-    end
-end
-{% endhighlight %}
-
-The call extra _authorized`_`by :authorize`_`it_ line tells your agent to use the _MCollective::Util::AuthorizeIt_ class for authorization.
-
-## Enabling RPC authorization globally
-You can enable a specific plugin on all RPC agents in the server config file.  If you do this and an agent also specify it's own authorization the agent will take priority.
-
-{% highlight ini %}
-rpcauthorization = yes
-rpcauthprovider = action_policy
-{% endhighlight %}
-
-Note setting _rpcauthorization = no_ here doesn't disable it everywhere, agents that specify authorization will still be used.  This boolean enables the global auth policy not the per agent.
diff --git a/website/simplerpc/clients.md b/website/simplerpc/clients.md
deleted file mode 100644 (file)
index 167fdc1..0000000
+++ /dev/null
@@ -1,578 +0,0 @@
----
-layout: default
-title: Writing SimpleRPC Clients
----
-[SimpleRPCIntroduction]: index.html
-[WritingAgents]: agents.html
-[RPCUtil]: /mcollective/reference/plugins/rpcutil.html
-[WritingAgentsScreenCast]: http://mcollective.blip.tv/file/3808928/
-[RubyMixin]: http://juixe.com/techknow/index.php/2006/06/15/mixins-in-ruby/
-[OptionParser]: http://github.com/puppetlabs/marionette-collective/blob/master/lib/mcollective/optionparser.rb
-[AppPlugin]: ../reference/plugins/application.html
-
-As pointed out in the [SimpleRPCIntroduction] page you can use the _mco rpc_ CLI
-to call agents and it will do it's best to print results in a sane way.  When
-this is not enough you can write your own clients.
-
-Simple RPC clients can do most of what a normal [client][WritingAgents] can do
-but it makes a lot of things much easier if you stick to the Simple RPC
-conventions.
-
-This guide shows how to write standalone scripts to interact with your
-collective.  There is a single executable system.  You can apply most of
-the techniques documented here to writing plugins for that application system.
-See the full reference for the plugin system [here][AppPlugin].  You should try
-to write your general agent CLIs using this plugin system rather than the stand
-alone scripts detailed below as that promote a unified interface that behave in a
-consistant manner.
-
-We've recorded a [tutorial that will give you a quick look at what is involved
-in writing agents and a very simple client][WritingAgentsScreenCast].
-
-We'll walk through building a ever more complex example of Hello World here.
-
-## The Basic Client
-The client is mostly a bunch of helper methods that you use as a [Ruby
-Mixin][RubyMixin] in your own code, it provides:
-
- * Standard command line option parsing with help output
- * Ability to add your own command line options
- * Simple access to agents and actions
- * Tools to help you print results
- * Tools to print stats
- * Tools to construct your own filters
- * While retaining full power of _MCollective::Client_ if you need the additional feature sets
- * And being as simple or as complex to match your level of code proficiency
-
-We'll write a client for the _Helloworld_ agent that you saw in the
-[SimpleRPCIntroduction].
-
-## Call an Agent and print the result
-A basic hello world client can be seen below:
-
-{% highlight ruby linenos %}
-#!/usr/bin/ruby
-
-require 'mcollective'
-
-include MCollective::RPC
-
-mc = rpcclient("helloworld")
-
-printrpc mc.echo(:msg => "Welcome to MCollective Simple RPC")
-
-printrpcstats
-
-mc.disconnect
-{% endhighlight %}
-
-Save this into _hello.rb_ and run it with _--help_, you should see the standard basic help including filters for discovery.
-
-If you've set up the Agent and run the client you should see something along these lines:
-
-{% highlight ruby %}
-$ hello.rb
-
-Finished processing 44 hosts in 375.57 ms
-{% endhighlight %}
-
-While it ran you would have seen a little progress bar and then just the summary line.  The idea is that if you're talking to a 1000 machine there's no point in seeing a thousand _OK_, you only want to see what failed and this is exactly what happens here, you're only seeing errors.
-
-If you run it with _--verbose_ you'll see a line of text for every host and also a larger summary of results.
-
-I'll explain each major line in the code below then add some more features from there:
-
-{% highlight ruby %}
-include MCollective::RPC
-
-mc = rpcclient("helloworld")
-{% endhighlight %}
-
-The first line pulls in the various helper functions that we provide, this is the Mixin we mentioned earlier.
-
-We then create a new client to the agent "helloworld" that you access through the _mc_ variable.
-
-{% highlight ruby %}
-printrpc mc.echo(:msg => "Welcome to MCollective Simple RPC")
-
-printrpcstats
-{% endhighlight %}
-
-To call a specific action you simply have to do _mc.echo_ this calls the _echo_ action, we pass a _:msg_ parameter into it with the string we want echo'd back.  The parameters will differ from action to action.  It returns a simple array of the results that you can print any way you want, we'll show that later.
-
-_printrpc_ and _printrpcstats_ are functions used to print the results and stats respectively.
-
-{% highlight ruby %}
-mc.disconnect
-{% endhighlight %}
-
-This cleanly disconnects the client from the middleware, some middleware tools like ActiveMQ will log confusing exceptions if you do not do this.  It's good form to always disconnect but isn't strictly required.
-
-## Adjusting the output
-
-### Verbosely displaying results
-As you see there's no indication that discovery is happening and as pointed out we do not display results that are ok, you can force verbosity as below on individual requests:
-
-{% highlight ruby %}
-mc = rpcclient("helloworld")
-
-mc.discover :verbose => true
-
-printrpc mc.echo(:msg => "Welcome to MCollective Simple RPC"), :verbose => true
-{% endhighlight %}
-
-Here we've added a _:verbose_ flag and we've specifically called the discover method.  Usually you don't need to call discover it will do it on demand.  Doing it this way you'll always see the line:
-
-{% highlight console %}
-Determining the amount of hosts matching filter for 2 seconds .... 44
-{% endhighlight %}
-
-Passing verbose to _printrpc_ forces it to print all the results, failures or not.
-
-If you just wanted to force verbose on for all client interactions, do:
-
-{% highlight ruby %}
-mc = rpcclient("helloworld")
-mc.verbose = true
-
-printrpc mc.echo(:msg => "Welcome to MCollective Simple RPC")
-{% endhighlight %}
-
-In this case everything will be verbose, regardless of command line options.
-
-### Disabling the progress indicator
-You can disable the twirling progress indicator easily:
-
-{% highlight ruby %}
-mc = rpcclient("helloworld")
-mc.progress = false
-{% endhighlight %}
-
-Now whenever you call an action you will not see the progress indicator.
-
-### Saving the reports in variables without printing
-You can retrieve the stats from the clients and also get text of reports without printing them:
-
-{% highlight ruby %}
-stats = mc.echo(:msg => "Welcome to MCollective Simple RPC").stats
-
-report = stats.report
-{% endhighlight %}
-
-_report_ will now have the text that would have been displayed by 'printrpcstats' you can also use _no_response_report_ to get report text for just the list of hosts that didnt respond.
-
-If you didn't want to just print the results out to STDOUT you can also get them back as just text:
-
-{% highlight ruby %}
-report = rpcresults mc.echo(:msg => "Welcome to MCollective Simple RPC")
-{% endhighlight %}
-
-
-## Applying filters programatically
-You can pass filters on the command line using the normal _--with-`*`_ options but you can also do it programatically.  Here's a new version of the client that only calls machines with the configuration management class _/dev_server/_ and the fact _country=uk_
-
-{% highlight ruby %}
-mc = rpcclient("helloworld")
-
-mc.class_filter /dev_server/
-mc.fact_filter "country", "uk"
-
-printrpc mc.echo(:msg => "Welcome to MCollective Simple RPC")
-{% endhighlight %}
-
-You can set other filters like _agent`_`filter_, _identity`_`filter_ and _compound`_`filter_.
-
-The fact_filter method supports a few other forms in adition to above:
-
-{% highlight ruby %}
-mc.fact_filter "country=uk"
-mc.fact_filter "physicalprocessorcount", "4", ">="
-{% endhighlight %}
-
-This will limit it to all machines in the UK with more than 3 processors.
-
-## Resetting filters to empty
-If while using the client you wish to reset the filters to an empty set of filters - containing only the agent name that you're busy addressing you can do it as follows:
-
-{% highlight ruby %}
-mc = rpcclient("helloworld")
-
-mc.class_filter /dev_server/
-
-mc.reset_filter
-{% endhighlight %}
-
-After this code snippet the filter will only have an agent filter of _helloworld_ set.
-
-## Processing Agents in Batches
-By default the client will communicate with all machines at the same time.
-This might not be desired as you might affect a DOS on related components.
-
-You can instruct the client to communicate with remote agents in batches
-and sleep between each batch.
-
-Any client application has this capability using the _--batch_ and _--batch-sleep-time_
-command line options.
-
-You can also enable this programatically either per client or per request:
-
-{% highlight ruby %}
-mc = rpcclient("helloworld")
-mc.batch_size = 10
-mc.batch_sleep_time = 5
-
-mc.echo(:msg => "hello world")
-{% endhighlight %}
-
-{% highlight ruby %}
-mc = rpcclient("helloworld")
-
-mc.echo(:msg => "hello world", :batch_size => 10, :batch_sleep_time => 5)
-{% endhighlight %}
-
-By default batching is disabled and sleep time is 1
-
-Setting the batch_size to 0 will disable batch mode in both examples above,
-effectively overriding what was supplied on the command line.
-
-## Forcing Rediscovery
-By default it will only do discovery once per script and then re-use the results, you can though force rediscovery if you had to adjust filters mid run for example.
-
-{% highlight ruby %}
-mc = rpcclient("helloworld")
-
-mc.class_filter /dev_server/
-printrpc mc.echo(:msg => "Welcome to MCollective Simple RPC")
-
-mc.reset
-
-mc.fact_filter "country", "uk"
-printrpc mc.echo(:msg => "Welcome to MCollective Simple RPC")
-{% endhighlight %}
-
-Here we make one _echo_ call - which would do a discovery - we then reset the client, adjust filters and call it again.  The 2nd call would do a new discovery and have new client lists etc.
-
-## Supplying your own discovery information
-
-A new core messaging mode has been introduced that enables direct non filtered communicatin to specific nodes.  This has enabled us to provide an discovery-optional
-mode but only if the collective is configured to support direct messaging.
-
-{%highlight ruby %}
-mc = rpcclient("helloworld")
-
-mc.discover(:nodes => ["host1", "host2", "host3"]
-
-printrpc mc.echo(:msg => "Welcome to MCollective Simple RPC")
-{% endhighlight %}
-
-This will immediately, without doing discovery, communicate just with these 3 hosts.  It will do normal failure reporting as with normal discovery based
-requests but will just be much faster as the 2 second discovery overhead is avoided.
-
-The goal with this feature is for cases such as deployment tools where you have a known expectation of which machines to deploy to and you always want
-to know if that fails.  In that use case a discovery based approach is not 100% suitable as you won't know about down machines.  This way you can provide
-your own source of truth.
-
-When using the direct mode messages have a TTL associated with them that defaults to 60 seconds.  Since 1.3.2 you can set the TTL globally in the configuration
-file but you can also set it on the client:
-
-{%highlight ruby %}
-mc = rpcclient("helloworld")
-mc.ttl = 3600
-
-mc.discover(:nodes => ["host1", "host2", "host3"]
-
-printrpc mc.echo(:msg => "Welcome to MCollective Simple RPC")
-{% endhighlight %}
-
-With the TTL set to 3600 if any of the hosts are down at the time of the request the request will wait on the middleware and should they come back up
-before 3600 has passed since request time they will then perform the requested action.
-
-## Only sending requests to a subset of discovered nodes
-By default all nodes that get discovered will get the request.  This isn't always desirable maybe you want to deploy only to a random subset of hosts or maybe you have a service exposed over MCollective that you want to treat as a HA service and so only speak with one host that provides the functionality.
-
-You can limit the hosts to talk to either using a number or a percentage, the code below shows both:
-
-{%highlight ruby %}
-mc = rpcclient("helloworld")
-
-mc.limit_targets = "10%"
-printrpc mc.echo(:msg => "Welcome to MCollective Simple RPC")
-{% endhighlight %}
-
-This will pick 10% of the discovered hosts - or 1 if 10% is less than 1 - and only target those nodes with your request.  You can also set it to an integer.
-
-There are two possible modes for choosing the targets.  You can configure a global default method but also set it on your client:
-
-{%highlight ruby %}
-mc = rpcclient("helloworld")
-
-mc.limit_targets = "10%"
-mc.limit_method = :random
-printrpc mc.echo(:msg => "Welcome to MCollective Simple RPC")
-{% endhighlight %}
-
-The above code will force a _random_ selection, you can also set it to _:first_
-
-## Gaining access to the full MCollective::Client
-If you wanted to work with the Client directly as in [WritingAgents] after perhaps setting up some queries or gathering data first you can gain access to the client, you might also need access to the options array that was parsed out from the command line and any subsequent filters that you added.
-
-{% highlight ruby %}
-mc = rpcclient("helloworld")
-
-client = mc.client
-options = mc.options
-{% endhighlight %}
-
-The first call will set up the CLI option parsing, create clients etc, you can then just grab the client and options and go on as per [WritingAgents].  This is a much quicker way to write full power clients, by just by short-circuiting the options parsing etc.
-
-## Dealing with the results directly
-The biggest reason that you'd write custom clients is probably if you wanted to do custom processing of the results, there are 2 options to do it.
-
-<a name="Results_and_Exceptions"> </a>
-
-### Results and Exceptions
-Results have a set structure and depending on how you access the results you will either get Exceptions or result codes.
-
-|Status Code|Description|Exception Class|
-|-----------|-----------|---------------|
-|0|OK| |
-|1|OK, failed.  All the data parsed ok, we have a action matching the request but the requested action could not be completed.|RPCAborted|
-|2|Unknown action|UnknownRPCAction|
-|3|Missing data|MissingRPCData|
-|4|Invalid data|InvalidRPCData|
-|5|Other error|UnknownRPCError|
-
-Just note these now, I'll reference them later down.
-
-### Simple RPC style results
-Simple RPC provides a trimmed down version of results from the basic Client library.  You'd choose to use this if you just want to do simple things or maybe you're just learning Ruby.  You'll get to process the results _after_ the call is either done or timed out completely.
-
-This is an important difference between the two approaches, in one you can parse the results as it comes in, in the other you will only get results after processing is done.  This would be the main driving facter for choosing one over the other.
-
-Here's an example that will print out results in a custom way.
-
-{% highlight ruby %}
-mc.echo(:msg => "hello world").each do |resp|
-   printf("%-40s: %s\n", resp[:sender], resp[:data][:msg])
-end
-{% endhighlight %}
-
-This will produce a result something like this:
-
-{% highlight console %}
-dev1.you.net                          : hello world
-dev2.you.net                          : hello world
-dev3.you.net                          : hello world
-{% endhighlight %}
-
-The _each_ in the above code just loops through the array of results.  Results are an array of Hashes, the data you got for above has the following structure:
-
-{% highlight console %}
-[{:statusmsg=>"OK",
- :sender=>"dev1.your.net",
- :data=>{:msg => "hello world"},
- :statuscode=>0},
-{:statusmsg=>"OK",
- :sender=>"dev2.your.net",
- :data=>{:msg => "hello world"},
- :statuscode=>0}]
-{% endhighlight %}
-
-The _:statuscode_ matches the table above so you can make decisions based on each result's status.
-
-### Gaining access to MCollective::Client#req results
-You can get access to each result in real time, in this case you will need to handle the exceptions in the table above and you'll get a different style of result set.  The result set will be exactly as from the full blown client.
-
-In this mode there will be no progress indicator, you'll deal with results as and when they come in not after the fact as in the previous example.
-
-{% highlight ruby %}
-mc.echo(:msg => "hello world") do |resp|
-   begin
-      printf("%-40s: %s\n", resp[:senderid], resp[:body][:data])
-   rescue RPCError => e
-      puts "The RPC agent returned an error: #{e}"
-   end
-end
-{% endhighlight %}
-
-The output will be the same as above
-
-In this mode the results you get will be like this:
-
-{% highlight ruby %}
-{:msgtarget=>"/topic/mcollective.helloworld.reply",
- :senderid=>"dev2.your.net",
- :msgtime=>1261696663,
- :hash=>"2d37daf690c4bcef5b5380b1e0c55f0c",
- :body=>{:statusmsg=>"OK", :statuscode=>0, :data=>{:msg => "hello world"}},
- :requestid=>"2884afb0b52cb38ea4d4a3146d18ef5f",
- :senderagent=>"helloworld"}
-{% endhighlight %}
-
-Note how here we need to catch the exceptions, just handing _:statuscode_ will not be enough as the RPC client will raise exceptions - all descendant from _RPCError_ so you can easily catch just those.
-
-You can additionally gain access to a SimpleRPC style result in addition to the more complex native client results:
-
-{% highlight ruby %}
-mc.echo(:msg => "hello world") do |resp, simpleresp|
-   begin
-      printf("%-40s: %s\n", simpleresp[:sender], simpleresp[:data][:msg])
-   rescue RPCError => e
-      puts "The RPC agent returned an error: #{e}"
-   end
-end
-{% endhighlight %}
-
-You can still use printrpc to print these style of results and gain advantage of the DDL and so forth:
-
-{% highlight ruby %}
-mc.echo(:msg => "hello world") do |resp, simpleresp|
-   begin
-      printrpc simpleresp
-   rescue RPCError => e
-      puts "The RPC agent returned an error: #{e}"
-   end
-end
-{% endhighlight %}
-
-You will need to handle exceptions yourself but you have a simpler result set to deal with
-
-## Adding custom command line options
-You can look at the _mco rpc_ script for a big sample, here I am just adding a simple _--msg_ option to our script so you can customize the message that will be sent and received.
-
-{% highlight ruby linenos %}
-#!/usr/bin/ruby
-
-require 'mcollective'
-
-include MCollective::RPC
-
-options = rpcoptions do |parser, options|
-   parser.define_head "Generic Echo Client"
-   parser.banner = "Usage: hello [options] [filters] --msg MSG"
-
-   parser.on('-m', '--msg MSG', 'Message to pass') do |v|
-      options[:msg] = v
-   end
-end
-
-unless options.include?(:msg)
-   puts("You need to specify a message with --msg")
-   exit! 1
-end
-
-mc = rpcclient("helloworld", :options => options)
-
-mc.echo(:msg => options[:msg]).each do |resp|
-   printf("%-40s: %s\n", resp[:sender], resp[:data][:msg])
-end
-{% endhighlight %}
-
-This version of the code should be run like this:
-
-{% highlight console %}
-% test.rb --msg foo
-dev1.you.net                          : foo
-dev2.you.net                          : foo
-dev3.you.net                          : foo
-{% endhighlight %}
-
-Documentation for the Options Parser can be found [in it's code][OptionParser].
-
-And finally if you add options as above rather than try to parse it yourself you will get help integration for free:
-
-{% highlight console %}
-% hello.rb --help
-Usage: hello [options] [filters] --msg MSG
-Generic Echo Client
-    -m, --msg MSG                    Message to pass
-
-Common Options
-    -c, --config FILE                Load configuratuion from file rather than default
-        --dt SECONDS                 Timeout for doing discovery
-        --discovery-timeout
-    -t, --timeout SECONDS            Timeout for calling remote agents
-    -q, --quiet                      Do not be verbose
-    -v, --verbose                    Be verbose
-    -h, --help                       Display this screen
-
-Host Filters
-        --wf, --with-fact fact=val   Match hosts with a certain fact
-        --wc, --with-class CLASS     Match hosts with a certain configuration management class
-        --wa, --with-agent AGENT     Match hosts with a certain agent
-        --wi, --with-identity IDENT  Match hosts with a certain configured identity
-{% endhighlight %}
-
-## Disabling command line parsing and supplying your options programatically
-
-Sometimes, perhaps when embedding an MCollective client into another tool like Puppet, you do not want MCollective to do any command line parsing as there might be conflicting command line options etc.
-
-This can be achieved by supplying an options hash to the SimpleRPC client:
-
-{% highlight ruby %}
-include MCollective::RPC
-
-options =  MCollective::Util.default_options
-
-client = rpcclient("test", {:options => options})
-{% endhighlight %}
-
-This will create a RPC client for the agent test without any options parsing at all.
-
-To set options like discovery timeout and so forth you will need use either the client utilities or manipulate the hash upfront, the client utility methods is the best.   The code below sets the discovery timeout in a way that does not require you to know any internal structures or the content of the options hash.
-
-{% highlight ruby %}
-options =  MCollective::Util.default_options
-
-client = rpcclient("test", {:options => options})
-client.discovery_timeout = 4
-{% endhighlight %}
-
-Using this method of creating custom options hashes mean we can make internal changes to MCollective without affecting your code in the future.
-
-## Sending SimpleRPC requests without discovery and blocking
-
-Usually this section will not apply to you.  The client libraries support sending a request without waiting for a reply.  This could be useful if you want to clean yum caches but don't really care if it actually happens everywhere.
-
-You will loose these abilities:
-
- * Knowing if your request was received by any agents
- * Any stats about processing times etc
- * Any information about the success or failure of your request
-
-The above should make it clear already that this is a limited use case, it's essentially a broadcast request with no feedback loop.
-
-The code below will send a request to the _runonce_ action for an agent _puppetd_, once the request is dispatched I will have no idea if it got handled etc, my code will just continue onwards.
-
-{% highlight ruby %}
-p = rpcclient("puppetd")
-
-p.identity_filter "your.box.com"
-reqid = p.runonce(:forcerun => true, :process_results => false)
-{% endhighlight %}
-
-This will honor any attached filters set either programatically or through the command line, it will send the request but will
-just not handle any responses.  All it will do is return the request id.
-
-## Doing your own discovery
-For web applications you'd probably use cached copied of Registration data to do discovery rather than wait for MC to do discovery between each request.
-
-To do this, you'll need to construct a filter and a list of expected hosts and then do a custom call:
-
-{% highlight ruby %}
-puppet = rpcclient("puppetd")
-
-printrpc puppet.custom_request("runonce", {:forcerun => true}, "your.box.com", {"identity" => "your.box.com"})
-{% endhighlight %}
-
-This will do a call with exactly the same stats, block and other semantics as a normal call like:
-
-{% highlight ruby %}
-printrpc puppet.runonce(:forcerun => true)
-{% endhighlight %}
-
-But instead of doing any discovery it will use the host list and filter you supplied in the call.
-
-## The _rpcutil_ Helper Agent
-
-A helper agent called [_rpcutil_][RPCUtil] is included that helps you gather stats, inventory etc about the running daemon.
diff --git a/website/simplerpc/index.md b/website/simplerpc/index.md
deleted file mode 100644 (file)
index 4440b54..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
----
-layout: default
-title: SimpleRPC Introduction
-toc: false
----
-[WritingAgents]: /mcollective/reference/basic/basic_agent_and_client.html
-[SimpleRPCAgents]: /mcollective/simplerpc/agents.html
-[SimpleRPCClients]: /mcollective/simplerpc/clients.html
-[SimpleRPCAuditing]: /mcollective/simplerpc/auditing.html
-[SimpleRPCAuthorization]: /mcollective/simplerpc/authorization.html
-[DDL]: /mcollective/reference/plugins/ddl.html
-[SimpleRPCMessageFormat]: /mcollective/simplerpc/messageformat.html
-[RPCUtil]: /mcollective/reference/plugins/rpcutil.html
-[WritingAgentsScreenCast]: http://mcollective.blip.tv/file/3808928/
-[RestGateway]: http://github.com/puppetlabs/marionette-collective/blob/master/ext/mc-rpc-restserver.rb
-
-MCollective is a framework for writing feature full agents and clients and provides a [rich system to do that][WritingAgents].  MCollective's native Client though is very low level, a bit like TCP/IP is to HTTP.  Like TCP/IP the native client does not provide any Authentication, Authorization etc.
-
-MCollective Simple RPC is a framework on top of the standard client that abstracts away a lot of the complexity and provides a lot of convention and standards.  It's a bit like using HTTP ontop of TCP/IP to create REST services.
-
-SimpleRPC is a framework that provides the following:
-
- * Provide simple conventions for writing [agents][SimpleRPCAgents] and [clients][SimpleRPCClients], favoring convention over custom design
- * Very easy to write agents including input validation and a sensible feedback mechanism in case of error
- * Provide [audit logging][SimpleRPCAuditing] abilities of calls to agents
- * Provide the ability to do [fine grain Authorization][SimpleRPCAuthorization] of calls to agents and actions.
- * Has a [Data Definition Language][DDL] used to describe agents and assist in giving hints to auto generating user interfaces.
- * The provided generic calling tool should be able to speak to most compliant agents
- * Should you need to you can still write your own clients, this should be very easy too
- * Return data should be easy to print, in most cases the framework should be able to print a sensible output with a single, provided, function.  The [DDL] is used here to improve the standard one-size-fits-all methods.
- * The full capabilities of the standard Client classes shouldddl still be exposed in case you want to write advanced agents and clients
- * A documented [standard message format][SimpleRPCMessageFormat] built ontop of the core format.
-
-
-We've provided full tutorials on [Writing Simple RPC Agents][SimpleRPCAgents] and [Clients][SimpleRPCClients].  There is also a [screencast that will give you a quick look at what is involved in writing agents][WritingAgentsScreenCast].
-
-
-A bit of code probably says more than lots of English, so here's a simple hello world Agent, it just echo's back everything you send it in the _:msg_ argument:
-
-{% highlight ruby linenos %}
-module MCollective
-  module Agent
-    class Helloworld<RPC::Agent
-      # Basic echo server
-      def echo_action
-        validate :msg, String
-
-        reply.data = request[:msg]
-      end
-    end
-  end
-end
-{% endhighlight %}
-
-The nice thing about using a standard abstraction for clients is that you often won't even need to write a client for it, we ship a standard client that you can use to call the agent above:
-
-{% highlight console %}
- % mco rpc helloworld echo msg="Welcome to MCollective Simple RPC"
- Determining the amount of hosts matching filter for 2 seconds .... 1
-
- devel.your.com                          : OK
-     "Welcome to MCollective Simple RPC"
-
-
-
- ---- rpctest#echo call stats ----
-            Nodes: 1
-       Start Time: Wed Dec 23 20:49:14 +0000 2009
-   Discovery Time: 0.00ms
-       Agent Time: 54.35ms
-       Total Time: 54.35ms
-{% endhighlight %}
-
-Note: This example is not complete. Please see the [agents][SimpleRPCAgents] and [clients][SimpleRPCClients] pages for a walkthrough.
-
-You could also use *mco rpc* like this and achieve the same result:
-
-{% highlight console %}
- % mco rpc helloworld echo msg="Welcome to MCollective Simple RPC"
-{% endhighlight %}
-
-For multiple options just add more *key=val* pairs at the end
-
-But you can still write your own clients, it's incredibly simple, full details of a client is out of scope for the introduction - see the [SimpleRPCClients] page instead for full details - but here is some sample code to do the same call as above including full discovery and help output:
-
-{% highlight ruby linenos %}
-#!/usr/bin/ruby
-
-require 'mcollective'
-
-include MCollective::RPC
-
-mc = rpcclient("helloworld")
-
-printrpc mc.echo(:msg => "Welcome to MCollective Simple RPC")
-
-printrpcstats
-{% endhighlight %}
-
-With a standard interface come a lot of possibilities, just like the standard one-size-fits-all CLI client above you can make web interfaces, there's a [simple MCollective <-> REST bridge in the ext directory][RestGateway].
-
-A helper agent called [_rpcutil_][RPCUtil] is included that helps you gather stats, inventory etc about the running daemon.
diff --git a/website/simplerpc/messageformat.md b/website/simplerpc/messageformat.md
deleted file mode 100644 (file)
index 9fbf011..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
----
-layout: default
-title: SimpleRPC Message Format
----
-[MessageFormat]: ../reference/basic/messageformat.html
-[ErrorCodes]: clients.html#dealing-with-the-results-directly
-
-SimpleRPC has a specific message structure that builds on the core
-[MessageFormat].  As such SimpleRPC is simply a plugin developed
-ontop of The Marionette Collective rather than an integrated part.
-
-The core messages has a _:body_ structure where agents and clients
-can send any data between nodes and clients.  All the SimpleRPC
-structures below goes in this body.  Filters, targets etc all use the
-standard core [MessageFormat].
-
-# Requests
-
-A basic SimpleRPC message can be seen below:
-
-{% highlight ruby %}
-{:agent           => "echo",
- :action          => "echo",
- :caller          => "cert=rip",
- :data            => {:message => "hello world"},
- :process_results => true}
-{% endhighlight %}
-
-This structure will be sent as the _:body_ of the core message, you might create
-this request using the command below:
-
-{% highlight ruby %}
-  e = rpcclient("echo")
-  e.echo(:message => "hello world")
-{% endhighlight %}
-
-## :agent
-
-Records the agent that this message is targetted at.
-
-## :action
-
-The action being called.  As the core protocol has no concept of actions per
-agent this provides the needed data to route the request to the right code in
-the SimpleRPC agent
-
-## :caller
-
-The callerid initiating the request.  This is redundant and might be removed
-later since the core message format also includes this information - the core
-did not always include it.  Removing it will only break backwards compatability
-with really old versions.
-
-## :data
-
-The data being sent to the SimpleRPC action as its _request_ structure,
-technically this can be any data but by SimpleRPC convention this would be a
-hash with keys being of the Symbol type as per the example above
-
-## :process_results
-
-Indicates the client preference to receive a result or not, the SimpleRPC agent
-should not send a response at all if this is true.
-
-# Replies
-
-As with requests the replies just build on the core [MessageFormat] and would be
-in the body of the standard message.
-
-A typical rely would look like:
-
-{% highlight ruby %}
-{:statuscode => 0
- :statusmsg  => "OK",
- :data       => {:message => "hello world"}}
-{% endhighlight %}
-
-## :statuscode and :statusmsg
-
-The statuscode and statusmsg are related and is used for error propagation
-through the collective.
-
-These are the [documented errors clients receive][ErrorCodes] and will result
-in exceptions raised on the client in some cases.
-
-The agent's _fail_ and _fail!_ methods will manipulate these structures.
-
-## :data
-
-This is a freeform variable for any data being returned by agents.  Technically
-it can be anything but by SimpleRPC convention it's a hash with keys being of
-type Symbol.
diff --git a/website/terminology.md b/website/terminology.md
deleted file mode 100644 (file)
index 122c13f..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
----
-layout: default
-title: Terminology
-toc: false
----
-[Software_agent]: http://en.wikipedia.org/wiki/Software_agent
-[Plugin]: http://en.wikipedia.org/wiki/Plugin
-[Publish_subscribe]: http://en.wikipedia.org/wiki/Publish_subscribe
-[Apache ActiveMQ]: http://activemq.apache.org/
-[SimpleRPCAgents]: /mcollective/simplerpc/agents.html
-[SimpleRPCIntroduction]: /mcollective/simplerpc/
-[WritingFactsPlugins]: /mcollective/reference/plugins/facts.html
-[Subcollective]: /mcollective/reference/basic/subcollectives.html
-[Registration]: /mcollective/reference/plugins/registration.html
-[SimpleRPCAuthorization]: /mcollective/simplerpc/authorization.html
-
-This page documents the various terms used in relation to mcollective.
-
-## Server
-The mcollective daemon, an app server for hosting Agents and managing
-the connection to your Middleware.
-
-## Node
-The Computer or Operating System that the Server runs on.
-
-## Agent
-A block of Ruby code that performs a specific role, the main reason for
-mcollective's existence is to host agents.  Agents can perform tasks like
-manipulate firewalls, services, packages etc. See [Wikipedia][Software_agent].
-
-Docs to write your own can be seen in [SimpleRPCAgents]
-
-## Plugins
-Ruby code that lives inside the server and takes on roles like security, connection
-handling, agents and so forth.  See [Wikipedia][Plugin]
-
-## Middleware
-A [publish subscribe][Publish_subscribe] based system like [Apache ActiveMQ].
-
-## Connector
-A plugin of the type *MCollective::Connector* that handles the communication with your chosen Middleware.
-
-## Name Space
-Currently messages are sent to the middleware directed at topics named */topic/mcollective.package.command*
-and replies come back on */topic/mcollective.package.reply*.
-
-In this example the namespace is "mcollective" and all servers and clients who wish to form part of the same
-Collective must use the same name space.
-
-Middleware can generally carry several namespaces and therefore several Collectives.
-
-## Collective
-A combination of Servers, Nodes and Middleware all operating in the same Namespace.
-
-Multiple collectives can be built sharing the same Middleware but kept separate by using different Namespaces.
-
-## Subcollective
-A server can belong to many Namespaces.  A [Subcollective] is a Namespace that only a subset of a full collectives nodes belong to.
-
-Subcolllectives are used to partition networks and to control broadcast domains in high traffic networks.
-
-## Simple RPC
-A Remote Procedure Call system built ontop of MCollective that makes it very simple to write feature
-full agents and clients.  See [SimpleRPCIntroduction].
-
-## Action
-Agents expose tasks, we call these tasks actions.  Each agent like a exim queue management agent might
-expose many tasks like *mailq*, *rm*, *retry* etc.  These are al actions provided by an agent.
-
-## Facts
-Discreet bits of information about your nodes. Examples could be the domain name, country,
-role, operating system release etc.
-
-Facts are provided by plugins of the type *MCollective::Facts*, you can read about writing
-your own in [WritingFactsPlugins]
-
-## Registration
-Servers can send regular messages to an agent called *registration*.  The code that sends the
-registration messages are plugins of the type *MCollective::Registration*.  See [Registration].
-
-## Security
-A plugin of the type *MCollective::Security* that takes care of encryption, authentication
-and encoding of messages on which will then be passed on to the Connector for delivery to the Collective.
-
-## Client
-Software that produce commands for agents to process, typically this would be a computer with
-the client package installed and someone using the commands like *mc-package* to interact with Agents.
-
-Often clients will use the *MCollective::Client* library to communicate to the Collective
-
-## User
-Servers and Clients all authenticate to the Middleware, user would generally refer to the username
-used to authenticate against the middleware.
-
-## Audit
-In relation to SimpleRPC an audit action is a step requests go through where they can get
-logged to disk or other similar action
-
-## Authorization
-In relation to SimpleRPC authorization is a processes whereby requests get allowed or denied
-based on some identifying information of the requester.  See [SimpleRPCAuthorization].