From 7c9314f502cde8daad23b61d10b24a542e04154a Mon Sep 17 00:00:00 2001 From: Dmitry Burmistrov Date: Fri, 15 Nov 2013 16:59:54 +0400 Subject: [PATCH] Update version according to OSCI-883 --- debian/changelog | 8 +- debian/control | 10 +- debian/mcollective-common.dirs | 1 - debian/mcollective.dirs | 2 + debian/mcollective.init | 3 + debian/mcollective.install | 8 +- debian/patches/00list | 1 - debian/patches/conffile.dpatch | 111 - debian/patches/initlsb.dpatch | 38 - debian/patches/makefile.dpatch | 49 - debian/patches/pluginsdir.dpatch | 30 - debian/patches/pluginsdir.patch | 24 + debian/patches/series | 1 + debian/rules | 17 +- debian/source/format | 1 + doc/Array.html | 427 +++ doc/COPYING.html | 530 ++++ doc/Dir.html | 471 +++ doc/Gemfile.html | 315 ++ doc/MCollective.html | 725 +++++ doc/MCollective/Agent.html | 341 ++ doc/MCollective/Agents.html | 824 +++++ doc/MCollective/Aggregate.html | 732 +++++ doc/MCollective/Aggregate/Base.html | 593 ++++ doc/MCollective/Aggregate/Result.html | 363 +++ doc/MCollective/Aggregate/Result/Base.html | 530 ++++ .../Aggregate/Result/CollectionResult.html | 403 +++ .../Aggregate/Result/NumericResult.html | 397 +++ .../MCollective/Application.html | 1892 ++++++----- doc/MCollective/Applications.html | 677 ++++ doc/MCollective/Cache.html | 762 +++++ doc/{classes => }/MCollective/Client.html | 1426 ++++++--- doc/MCollective/CodedError.html | 543 ++++ doc/MCollective/Config.html | 1286 ++++++++ doc/MCollective/Connector.html | 397 +++ doc/MCollective/Connector/Base.html | 395 +++ doc/MCollective/DDL.html | 670 ++++ doc/MCollective/DDL/AgentDDL.html | 960 ++++++ doc/{classes => }/MCollective/DDL/Base.html | 1241 +++++--- doc/MCollective/DDL/DataDDL.html | 516 +++ doc/MCollective/DDL/DiscoveryDDL.html | 512 +++ doc/MCollective/DDL/ValidatorDDL.html | 348 ++ doc/MCollective/DDLValidationError.html | 351 +++ doc/MCollective/Data.html | 699 +++++ doc/MCollective/Data/Base.html | 741 +++++ doc/MCollective/Data/Result.html | 581 ++++ doc/MCollective/Discovery.html | 872 +++++ doc/MCollective/Facts.html | 500 +++ doc/MCollective/Facts/Base.html | 636 ++++ doc/MCollective/Generators.html | 363 +++ .../Generators/AgentGenerator.html | 570 ++++ doc/MCollective/Generators/Base.html | 584 ++++ doc/MCollective/Generators/DataGenerator.html | 540 ++++ doc/MCollective/InvalidRPCData.html | 348 ++ doc/MCollective/Log.html | 1154 +++++++ doc/MCollective/Logger.html | 368 +++ doc/MCollective/Logger/Base.html | 744 +++++ doc/MCollective/Logger/Console_logger.html | 598 ++++ doc/MCollective/Logger/File_logger.html | 524 +++ doc/MCollective/Logger/Syslog_logger.html | 566 ++++ doc/{classes => }/MCollective/Matcher.html | 734 +++-- .../MCollective/Matcher/Parser.html | 769 +++-- doc/MCollective/Matcher/Scanner.html | 760 +++++ doc/MCollective/Message.html | 1265 ++++++++ doc/MCollective/MissingRPCData.html | 348 ++ doc/MCollective/MsgDoesNotMatchRequestID.html | 348 ++ doc/MCollective/MsgTTLExpired.html | 348 ++ doc/MCollective/NotTargettedAtUs.html | 348 ++ .../MCollective/Optionparser.html | 801 +++-- doc/MCollective/PluginManager.html | 894 ++++++ doc/MCollective/PluginPackager.html | 697 ++++ .../PluginPackager/AgentDefinition.html | 820 +++++ .../PluginPackager/StandardDefinition.html | 761 +++++ doc/MCollective/RPC.html | 848 +++++ doc/MCollective/RPC/ActionRunner.html | 953 ++++++ doc/MCollective/RPC/Agent.html | 1457 +++++++++ doc/MCollective/RPC/Audit.html | 471 +++ doc/{classes => }/MCollective/RPC/Client.html | 2795 +++++++++++------ .../MCollective/RPC/Helpers.html | 809 +++-- doc/MCollective/RPC/Progress.html | 490 +++ doc/MCollective/RPC/Reply.html | 753 +++++ doc/MCollective/RPC/Request.html | 811 +++++ doc/MCollective/RPC/Result.html | 649 ++++ doc/{classes => }/MCollective/RPC/Stats.html | 1601 +++++++--- doc/MCollective/RPCAborted.html | 348 ++ doc/MCollective/RPCError.html | 348 ++ doc/MCollective/Registration.html | 371 +++ doc/MCollective/Registration/Base.html | 655 ++++ doc/MCollective/Runner.html | 702 +++++ doc/MCollective/RunnerStats.html | 734 +++++ doc/{classes => }/MCollective/SSL.html | 1608 ++++++---- doc/MCollective/Security.html | 401 +++ .../MCollective/Security/Base.html | 1166 ++++--- doc/MCollective/SecurityValidationFailed.html | 348 ++ doc/MCollective/Shell.html | 678 ++++ doc/MCollective/Translatable.html | 495 +++ doc/MCollective/UnixDaemon.html | 456 +++ doc/MCollective/UnknownRPCAction.html | 348 ++ doc/MCollective/UnknownRPCError.html | 348 ++ doc/{classes => }/MCollective/Util.html | 2009 +++++++----- doc/MCollective/Validator.html | 646 ++++ doc/MCollective/ValidatorError.html | 348 ++ doc/MCollective/WindowsDaemon.html | 476 +++ doc/{files/install_rb.html => Object.html} | 991 +++--- doc/README.html | 300 ++ doc/Rakefile.html | 503 +++ doc/String.html | 435 +++ doc/Symbol.html | 409 +++ doc/bin/mc-call-agent.html | 56 + doc/bin/mco.html | 54 + doc/bin/mcollectived.html | 60 + doc/classes/Array.html | 181 -- doc/classes/Dir.html | 212 -- doc/classes/MCollective.html | 504 --- doc/classes/MCollective/Agent.html | 105 - doc/classes/MCollective/Agents.html | 493 --- doc/classes/MCollective/Aggregate.html | 390 --- doc/classes/MCollective/Aggregate/Base.html | 251 -- doc/classes/MCollective/Aggregate/Result.html | 125 - .../MCollective/Aggregate/Result/Base.html | 223 -- .../Aggregate/Result/CollectionResult.html | 156 - .../Aggregate/Result/NumericResult.html | 150 - doc/classes/MCollective/Applications.html | 381 --- doc/classes/MCollective/Cache.html | 438 --- doc/classes/MCollective/CodedError.html | 232 -- doc/classes/MCollective/Config.html | 612 ---- doc/classes/MCollective/Connector.html | 144 - doc/classes/MCollective/Connector/Base.html | 146 - doc/classes/MCollective/DDL.html | 387 --- doc/classes/MCollective/DDL/AgentDDL.html | 627 ---- doc/classes/MCollective/DDL/DataDDL.html | 256 -- doc/classes/MCollective/DDL/DiscoveryDDL.html | 253 -- doc/classes/MCollective/DDL/ValidatorDDL.html | 113 - .../MCollective/DDLValidationError.html | 119 - doc/classes/MCollective/Data.html | 381 --- doc/classes/MCollective/Data/Base.html | 383 --- doc/classes/MCollective/Data/Result.html | 278 -- doc/classes/MCollective/Discovery.html | 512 --- doc/classes/MCollective/Facts.html | 237 -- doc/classes/MCollective/Facts/Base.html | 343 -- doc/classes/MCollective/Generators.html | 125 - .../Generators/AgentGenerator.html | 267 -- doc/classes/MCollective/Generators/Base.html | 267 -- .../MCollective/Generators/DataGenerator.html | 247 -- doc/classes/MCollective/InvalidRPCData.html | 113 - doc/classes/MCollective/Log.html | 738 ----- doc/classes/MCollective/Logger.html | 130 - doc/classes/MCollective/Logger/Base.html | 264 -- .../MCollective/Logger/Console_logger.html | 308 -- .../MCollective/Logger/File_logger.html | 250 -- .../MCollective/Logger/Syslog_logger.html | 278 -- doc/classes/MCollective/Matcher/Scanner.html | 239 -- doc/classes/MCollective/Message.html | 728 ----- doc/classes/MCollective/MissingRPCData.html | 113 - .../MCollective/MsgDoesNotMatchRequestID.html | 111 - doc/classes/MCollective/MsgTTLExpired.html | 111 - doc/classes/MCollective/NotTargettedAtUs.html | 111 - doc/classes/MCollective/PluginManager.html | 562 ---- doc/classes/MCollective/PluginPackager.html | 383 --- .../PluginPackager/AgentDefinition.html | 394 --- .../PluginPackager/StandardDefinition.html | 340 -- doc/classes/MCollective/RPC.html | 539 ---- doc/classes/MCollective/RPC/ActionRunner.html | 534 ---- doc/classes/MCollective/RPC/Agent.html | 462 --- doc/classes/MCollective/RPC/Audit.html | 211 -- doc/classes/MCollective/RPC/Progress.html | 230 -- doc/classes/MCollective/RPC/Reply.html | 404 --- doc/classes/MCollective/RPC/Request.html | 401 --- doc/classes/MCollective/RPC/Result.html | 317 -- doc/classes/MCollective/RPCAborted.html | 113 - doc/classes/MCollective/RPCError.html | 111 - doc/classes/MCollective/Registration.html | 136 - .../MCollective/Registration/Base.html | 347 -- doc/classes/MCollective/Runner.html | 253 -- doc/classes/MCollective/RunnerStats.html | 412 --- doc/classes/MCollective/Security.html | 166 - .../MCollective/SecurityValidationFailed.html | 111 - doc/classes/MCollective/Shell.html | 303 -- doc/classes/MCollective/Translatable.html | 217 -- doc/classes/MCollective/UnixDaemon.html | 198 -- doc/classes/MCollective/UnknownRPCAction.html | 113 - doc/classes/MCollective/UnknownRPCError.html | 113 - doc/classes/MCollective/Validator.html | 342 -- doc/classes/MCollective/ValidatorError.html | 111 - doc/classes/MCollective/WindowsDaemon.html | 203 -- doc/classes/String.html | 180 -- doc/classes/Symbol.html | 159 - doc/created.rid | 2 +- doc/etc/client_cfg_dist.html | 304 ++ doc/etc/data-help_erb.html | 341 ++ doc/etc/discovery-help_erb.html | 303 ++ doc/etc/facts_yaml_dist.html | 291 ++ doc/etc/metadata-help_erb.html | 313 ++ doc/etc/msg-help_erb.html | 308 ++ doc/etc/rpc-help_erb.html | 370 +++ doc/etc/server_cfg_dist.html | 305 ++ doc/etc/ssl/PLACEHOLDER.html | 288 ++ doc/etc/ssl/clients/PLACEHOLDER.html | 288 ++ doc/files/lib/mcollective/agent_rb.html | 101 - doc/files/lib/mcollective/agents_rb.html | 101 - .../lib/mcollective/aggregate/base_rb.html | 101 - .../mcollective/aggregate/result/base_rb.html | 101 - .../result/collection_result_rb.html | 101 - .../aggregate/result/numeric_result_rb.html | 101 - .../lib/mcollective/aggregate/result_rb.html | 101 - doc/files/lib/mcollective/aggregate_rb.html | 101 - doc/files/lib/mcollective/application_rb.html | 101 - .../lib/mcollective/applications_rb.html | 101 - doc/files/lib/mcollective/cache_rb.html | 101 - doc/files/lib/mcollective/client_rb.html | 101 - doc/files/lib/mcollective/config_rb.html | 101 - .../lib/mcollective/connector/base_rb.html | 101 - doc/files/lib/mcollective/connector_rb.html | 101 - doc/files/lib/mcollective/data/base_rb.html | 101 - doc/files/lib/mcollective/data/result_rb.html | 101 - doc/files/lib/mcollective/data_rb.html | 101 - .../lib/mcollective/ddl/agentddl_rb.html | 101 - doc/files/lib/mcollective/ddl/base_rb.html | 101 - doc/files/lib/mcollective/ddl/dataddl_rb.html | 101 - .../lib/mcollective/ddl/discoveryddl_rb.html | 101 - .../lib/mcollective/ddl/validatorddl_rb.html | 101 - doc/files/lib/mcollective/ddl_rb.html | 101 - doc/files/lib/mcollective/discovery_rb.html | 101 - doc/files/lib/mcollective/exception_rb.html | 101 - doc/files/lib/mcollective/facts/base_rb.html | 101 - doc/files/lib/mcollective/facts_rb.html | 101 - .../generators/agent_generator_rb.html | 101 - .../lib/mcollective/generators/base_rb.html | 101 - .../generators/data_generator_rb.html | 101 - doc/files/lib/mcollective/generators_rb.html | 101 - doc/files/lib/mcollective/log_rb.html | 108 - doc/files/lib/mcollective/logger/base_rb.html | 101 - .../mcollective/logger/console_logger_rb.html | 101 - .../mcollective/logger/file_logger_rb.html | 108 - .../mcollective/logger/syslog_logger_rb.html | 108 - doc/files/lib/mcollective/logger_rb.html | 101 - .../lib/mcollective/matcher/parser_rb.html | 101 - .../lib/mcollective/matcher/scanner_rb.html | 101 - doc/files/lib/mcollective/matcher_rb.html | 101 - doc/files/lib/mcollective/message_rb.html | 101 - .../lib/mcollective/monkey_patches_rb.html | 127 - .../lib/mcollective/optionparser_rb.html | 101 - .../lib/mcollective/pluginmanager_rb.html | 101 - .../pluginpackager/agent_definition_rb.html | 101 - .../standard_definition_rb.html | 101 - .../lib/mcollective/pluginpackager_rb.html | 101 - .../lib/mcollective/registration/base_rb.html | 101 - .../lib/mcollective/registration_rb.html | 101 - .../lib/mcollective/rpc/actionrunner_rb.html | 101 - doc/files/lib/mcollective/rpc/agent_rb.html | 101 - doc/files/lib/mcollective/rpc/audit_rb.html | 101 - doc/files/lib/mcollective/rpc/client_rb.html | 101 - doc/files/lib/mcollective/rpc/helpers_rb.html | 101 - .../lib/mcollective/rpc/progress_rb.html | 101 - doc/files/lib/mcollective/rpc/reply_rb.html | 101 - doc/files/lib/mcollective/rpc/request_rb.html | 101 - doc/files/lib/mcollective/rpc/result_rb.html | 101 - doc/files/lib/mcollective/rpc/stats_rb.html | 101 - doc/files/lib/mcollective/rpc_rb.html | 108 - doc/files/lib/mcollective/runner_rb.html | 101 - doc/files/lib/mcollective/runnerstats_rb.html | 101 - .../lib/mcollective/security/base_rb.html | 101 - doc/files/lib/mcollective/security_rb.html | 101 - doc/files/lib/mcollective/shell_rb.html | 101 - doc/files/lib/mcollective/ssl_rb.html | 110 - .../lib/mcollective/translatable_rb.html | 101 - doc/files/lib/mcollective/unix_daemon_rb.html | 101 - doc/files/lib/mcollective/util_rb.html | 108 - doc/files/lib/mcollective/validator_rb.html | 101 - .../lib/mcollective/windows_daemon_rb.html | 108 - doc/files/lib/mcollective_rb.html | 124 - doc/fr_class_index.html | 114 - doc/fr_file_index.html | 100 - doc/fr_method_index.html | 523 --- doc/images/brick.png | Bin 0 -> 452 bytes doc/images/brick_link.png | Bin 0 -> 764 bytes doc/images/bug.png | Bin 0 -> 774 bytes doc/images/bullet_black.png | Bin 0 -> 211 bytes doc/images/bullet_toggle_minus.png | Bin 0 -> 207 bytes doc/images/bullet_toggle_plus.png | Bin 0 -> 209 bytes doc/images/date.png | Bin 0 -> 626 bytes doc/images/find.png | Bin 0 -> 659 bytes doc/images/loadingAnimation.gif | Bin 0 -> 5886 bytes doc/images/macFFBgHack.png | Bin 0 -> 207 bytes doc/images/package.png | Bin 0 -> 853 bytes doc/images/page_green.png | Bin 0 -> 621 bytes doc/images/page_white_text.png | Bin 0 -> 342 bytes doc/images/page_white_width.png | Bin 0 -> 309 bytes doc/images/plugin.png | Bin 0 -> 591 bytes doc/images/ruby.png | Bin 0 -> 592 bytes doc/images/tag_green.png | Bin 0 -> 613 bytes doc/images/wrench.png | Bin 0 -> 610 bytes doc/images/wrench_orange.png | Bin 0 -> 584 bytes doc/images/zoom.png | Bin 0 -> 692 bytes doc/index.html | 1330 +++++++- doc/install_rb.html | 66 + doc/js/darkfish.js | 116 + doc/js/jquery.js | 32 + doc/js/quicksearch.js | 114 + doc/js/thickbox-compressed.js | 10 + doc/lib/mcollective/agent_rb.html | 52 + doc/lib/mcollective/agents_rb.html | 52 + doc/lib/mcollective/aggregate/base_rb.html | 52 + .../mcollective/aggregate/result/base_rb.html | 52 + .../result/collection_result_rb.html | 52 + .../aggregate/result/numeric_result_rb.html | 52 + doc/lib/mcollective/aggregate/result_rb.html | 52 + doc/lib/mcollective/aggregate_rb.html | 52 + doc/lib/mcollective/application_rb.html | 52 + doc/lib/mcollective/applications_rb.html | 52 + doc/lib/mcollective/cache_rb.html | 52 + doc/lib/mcollective/client_rb.html | 52 + doc/lib/mcollective/config_rb.html | 52 + doc/lib/mcollective/connector/base_rb.html | 52 + doc/lib/mcollective/connector_rb.html | 52 + doc/lib/mcollective/data/base_rb.html | 52 + doc/lib/mcollective/data/result_rb.html | 52 + doc/lib/mcollective/data_rb.html | 52 + doc/lib/mcollective/ddl/agentddl_rb.html | 52 + doc/lib/mcollective/ddl/base_rb.html | 52 + doc/lib/mcollective/ddl/dataddl_rb.html | 52 + doc/lib/mcollective/ddl/discoveryddl_rb.html | 52 + doc/lib/mcollective/ddl/validatorddl_rb.html | 52 + doc/lib/mcollective/ddl_rb.html | 52 + doc/lib/mcollective/discovery_rb.html | 52 + doc/lib/mcollective/exception_rb.html | 52 + doc/lib/mcollective/facts/base_rb.html | 52 + doc/lib/mcollective/facts_rb.html | 52 + .../generators/agent_generator_rb.html | 52 + doc/lib/mcollective/generators/base_rb.html | 52 + .../generators/data_generator_rb.html | 52 + .../templates/action_snippet_erb.html | 306 ++ .../templates/data_input_snippet_erb.html | 298 ++ .../generators/templates/ddl_erb.html | 300 ++ .../generators/templates/plugin_erb.html | 305 ++ doc/lib/mcollective/generators_rb.html | 52 + doc/lib/mcollective/locales/en_yml.html | 636 ++++ doc/lib/mcollective/log_rb.html | 54 + doc/lib/mcollective/logger/base_rb.html | 52 + .../mcollective/logger/console_logger_rb.html | 52 + .../mcollective/logger/file_logger_rb.html | 54 + .../mcollective/logger/syslog_logger_rb.html | 54 + doc/lib/mcollective/logger_rb.html | 52 + doc/lib/mcollective/matcher/parser_rb.html | 52 + doc/lib/mcollective/matcher/scanner_rb.html | 52 + doc/lib/mcollective/matcher_rb.html | 52 + doc/lib/mcollective/message_rb.html | 52 + doc/lib/mcollective/monkey_patches_rb.html | 57 + doc/lib/mcollective/optionparser_rb.html | 52 + doc/lib/mcollective/pluginmanager_rb.html | 52 + .../pluginpackager/agent_definition_rb.html | 52 + .../standard_definition_rb.html | 52 + doc/lib/mcollective/pluginpackager_rb.html | 52 + doc/lib/mcollective/registration/base_rb.html | 52 + doc/lib/mcollective/registration_rb.html | 52 + doc/lib/mcollective/rpc/actionrunner_rb.html | 52 + doc/lib/mcollective/rpc/agent_rb.html | 52 + doc/lib/mcollective/rpc/audit_rb.html | 52 + doc/lib/mcollective/rpc/client_rb.html | 52 + doc/lib/mcollective/rpc/helpers_rb.html | 52 + doc/lib/mcollective/rpc/progress_rb.html | 52 + doc/lib/mcollective/rpc/reply_rb.html | 52 + doc/lib/mcollective/rpc/request_rb.html | 52 + doc/lib/mcollective/rpc/result_rb.html | 52 + doc/lib/mcollective/rpc/stats_rb.html | 52 + doc/lib/mcollective/rpc_rb.html | 54 + doc/lib/mcollective/runner_rb.html | 52 + doc/lib/mcollective/runnerstats_rb.html | 52 + doc/lib/mcollective/security/base_rb.html | 52 + doc/lib/mcollective/security_rb.html | 52 + doc/lib/mcollective/shell_rb.html | 52 + doc/lib/mcollective/ssl_rb.html | 58 + doc/lib/mcollective/translatable_rb.html | 52 + doc/lib/mcollective/unix_daemon_rb.html | 52 + doc/lib/mcollective/util_rb.html | 54 + doc/lib/mcollective/validator_rb.html | 52 + doc/lib/mcollective/windows_daemon_rb.html | 54 + doc/lib/mcollective_rb.html | 86 + doc/mcollective_init.html | 416 +++ doc/rdoc-style.css | 208 -- doc/rdoc.css | 696 ++++ ext/Makefile.debian | 46 - ext/action_helpers/perl/.gitignore | 3 - ext/build_defaults.yaml | 21 + ext/debian/changelog | 5 + ext/debian/control | 10 +- ext/debian/mcollective-common.dirs | 1 - ext/debian/mcollective.dirs | 2 + ext/debian/mcollective.init | 3 + ext/debian/mcollective.install | 8 +- ext/debian/patches/00list | 1 - ext/debian/patches/conffile.dpatch | 111 - ext/debian/patches/initlsb.dpatch | 38 - ext/debian/patches/makefile.dpatch | 49 - ext/debian/patches/pluginsdir.dpatch | 30 - ext/debian/patches/pluginsdir.patch | 24 + ext/debian/patches/series | 1 + ext/debian/rules | 17 +- ext/debian/source/format | 1 + ext/packaging.rake | 36 + ext/project_data.yaml | 45 + ext/redhat/mcollective.service | 14 + ext/redhat/mcollective.spec | 156 +- install.rb | 306 ++ lib/mcollective.rb | 2 +- lib/mcollective/rpc/agent.rb | 2 +- lib/mcollective/shell.rb | 49 +- lib/mcollective/vendor/i18n/.gitignore | 8 - lib/mcollective/vendor/i18n/.travis.yml | 7 - lib/mcollective/vendor/json/.gitignore | 8 - lib/mcollective/vendor/json/.travis.yml | 15 - lib/mcollective/vendor/json/diagrams/.keep | 0 .../vendor/json/lib/json/ext/.keep | 0 mcollective.init | 91 +- plugins/mcollective/application/plugin.rb | 11 +- .../pluginpackager/debpackage_packager.rb | 2 +- .../pluginpackager/modulepackage_packager.rb | 127 + .../pluginpackager/ospackage_packager.rb | 6 +- .../pluginpackager/rpmpackage_packager.rb | 2 +- .../templates/module/Modulefile.erb | 5 + .../templates/module/README.md.erb | 37 + .../templates/module/_manifest.pp.erb | 9 + 422 files changed, 71159 insertions(+), 36698 deletions(-) delete mode 100644 debian/mcollective-common.dirs create mode 100644 debian/mcollective.dirs mode change 100644 => 100755 debian/mcollective.init delete mode 100644 debian/patches/00list delete mode 100644 debian/patches/conffile.dpatch delete mode 100644 debian/patches/initlsb.dpatch delete mode 100644 debian/patches/makefile.dpatch delete mode 100644 debian/patches/pluginsdir.dpatch create mode 100755 debian/patches/pluginsdir.patch create mode 100644 debian/patches/series create mode 100644 debian/source/format create mode 100644 doc/Array.html create mode 100644 doc/COPYING.html create mode 100644 doc/Dir.html create mode 100644 doc/Gemfile.html create mode 100644 doc/MCollective.html create mode 100644 doc/MCollective/Agent.html create mode 100644 doc/MCollective/Agents.html create mode 100644 doc/MCollective/Aggregate.html create mode 100644 doc/MCollective/Aggregate/Base.html create mode 100644 doc/MCollective/Aggregate/Result.html create mode 100644 doc/MCollective/Aggregate/Result/Base.html create mode 100644 doc/MCollective/Aggregate/Result/CollectionResult.html create mode 100644 doc/MCollective/Aggregate/Result/NumericResult.html rename doc/{classes => }/MCollective/Application.html (56%) create mode 100644 doc/MCollective/Applications.html create mode 100644 doc/MCollective/Cache.html rename doc/{classes => }/MCollective/Client.html (57%) create mode 100644 doc/MCollective/CodedError.html create mode 100644 doc/MCollective/Config.html create mode 100644 doc/MCollective/Connector.html create mode 100644 doc/MCollective/Connector/Base.html create mode 100644 doc/MCollective/DDL.html create mode 100644 doc/MCollective/DDL/AgentDDL.html rename doc/{classes => }/MCollective/DDL/Base.html (53%) create mode 100644 doc/MCollective/DDL/DataDDL.html create mode 100644 doc/MCollective/DDL/DiscoveryDDL.html create mode 100644 doc/MCollective/DDL/ValidatorDDL.html create mode 100644 doc/MCollective/DDLValidationError.html create mode 100644 doc/MCollective/Data.html create mode 100644 doc/MCollective/Data/Base.html create mode 100644 doc/MCollective/Data/Result.html create mode 100644 doc/MCollective/Discovery.html create mode 100644 doc/MCollective/Facts.html create mode 100644 doc/MCollective/Facts/Base.html create mode 100644 doc/MCollective/Generators.html create mode 100644 doc/MCollective/Generators/AgentGenerator.html create mode 100644 doc/MCollective/Generators/Base.html create mode 100644 doc/MCollective/Generators/DataGenerator.html create mode 100644 doc/MCollective/InvalidRPCData.html create mode 100644 doc/MCollective/Log.html create mode 100644 doc/MCollective/Logger.html create mode 100644 doc/MCollective/Logger/Base.html create mode 100644 doc/MCollective/Logger/Console_logger.html create mode 100644 doc/MCollective/Logger/File_logger.html create mode 100644 doc/MCollective/Logger/Syslog_logger.html rename doc/{classes => }/MCollective/Matcher.html (59%) rename doc/{classes => }/MCollective/Matcher/Parser.html (53%) create mode 100644 doc/MCollective/Matcher/Scanner.html create mode 100644 doc/MCollective/Message.html create mode 100644 doc/MCollective/MissingRPCData.html create mode 100644 doc/MCollective/MsgDoesNotMatchRequestID.html create mode 100644 doc/MCollective/MsgTTLExpired.html create mode 100644 doc/MCollective/NotTargettedAtUs.html rename doc/{classes => }/MCollective/Optionparser.html (55%) create mode 100644 doc/MCollective/PluginManager.html create mode 100644 doc/MCollective/PluginPackager.html create mode 100644 doc/MCollective/PluginPackager/AgentDefinition.html create mode 100644 doc/MCollective/PluginPackager/StandardDefinition.html create mode 100644 doc/MCollective/RPC.html create mode 100644 doc/MCollective/RPC/ActionRunner.html create mode 100644 doc/MCollective/RPC/Agent.html create mode 100644 doc/MCollective/RPC/Audit.html rename doc/{classes => }/MCollective/RPC/Client.html (70%) rename doc/{classes => }/MCollective/RPC/Helpers.html (68%) create mode 100644 doc/MCollective/RPC/Progress.html create mode 100644 doc/MCollective/RPC/Reply.html create mode 100644 doc/MCollective/RPC/Request.html create mode 100644 doc/MCollective/RPC/Result.html rename doc/{classes => }/MCollective/RPC/Stats.html (50%) create mode 100644 doc/MCollective/RPCAborted.html create mode 100644 doc/MCollective/RPCError.html create mode 100644 doc/MCollective/Registration.html create mode 100644 doc/MCollective/Registration/Base.html create mode 100644 doc/MCollective/Runner.html create mode 100644 doc/MCollective/RunnerStats.html rename doc/{classes => }/MCollective/SSL.html (53%) create mode 100644 doc/MCollective/Security.html rename doc/{classes => }/MCollective/Security/Base.html (53%) create mode 100644 doc/MCollective/SecurityValidationFailed.html create mode 100644 doc/MCollective/Shell.html create mode 100644 doc/MCollective/Translatable.html create mode 100644 doc/MCollective/UnixDaemon.html create mode 100644 doc/MCollective/UnknownRPCAction.html create mode 100644 doc/MCollective/UnknownRPCError.html rename doc/{classes => }/MCollective/Util.html (65%) create mode 100644 doc/MCollective/Validator.html create mode 100644 doc/MCollective/ValidatorError.html create mode 100644 doc/MCollective/WindowsDaemon.html rename doc/{files/install_rb.html => Object.html} (59%) create mode 100644 doc/README.html create mode 100644 doc/Rakefile.html create mode 100644 doc/String.html create mode 100644 doc/Symbol.html create mode 100644 doc/bin/mc-call-agent.html create mode 100644 doc/bin/mco.html create mode 100644 doc/bin/mcollectived.html delete mode 100644 doc/classes/Array.html delete mode 100644 doc/classes/Dir.html delete mode 100644 doc/classes/MCollective.html delete mode 100644 doc/classes/MCollective/Agent.html delete mode 100644 doc/classes/MCollective/Agents.html delete mode 100644 doc/classes/MCollective/Aggregate.html delete mode 100644 doc/classes/MCollective/Aggregate/Base.html delete mode 100644 doc/classes/MCollective/Aggregate/Result.html delete mode 100644 doc/classes/MCollective/Aggregate/Result/Base.html delete mode 100644 doc/classes/MCollective/Aggregate/Result/CollectionResult.html delete mode 100644 doc/classes/MCollective/Aggregate/Result/NumericResult.html delete mode 100644 doc/classes/MCollective/Applications.html delete mode 100644 doc/classes/MCollective/Cache.html delete mode 100644 doc/classes/MCollective/CodedError.html delete mode 100644 doc/classes/MCollective/Config.html delete mode 100644 doc/classes/MCollective/Connector.html delete mode 100644 doc/classes/MCollective/Connector/Base.html delete mode 100644 doc/classes/MCollective/DDL.html delete mode 100644 doc/classes/MCollective/DDL/AgentDDL.html delete mode 100644 doc/classes/MCollective/DDL/DataDDL.html delete mode 100644 doc/classes/MCollective/DDL/DiscoveryDDL.html delete mode 100644 doc/classes/MCollective/DDL/ValidatorDDL.html delete mode 100644 doc/classes/MCollective/DDLValidationError.html delete mode 100644 doc/classes/MCollective/Data.html delete mode 100644 doc/classes/MCollective/Data/Base.html delete mode 100644 doc/classes/MCollective/Data/Result.html delete mode 100644 doc/classes/MCollective/Discovery.html delete mode 100644 doc/classes/MCollective/Facts.html delete mode 100644 doc/classes/MCollective/Facts/Base.html delete mode 100644 doc/classes/MCollective/Generators.html delete mode 100644 doc/classes/MCollective/Generators/AgentGenerator.html delete mode 100644 doc/classes/MCollective/Generators/Base.html delete mode 100644 doc/classes/MCollective/Generators/DataGenerator.html delete mode 100644 doc/classes/MCollective/InvalidRPCData.html delete mode 100644 doc/classes/MCollective/Log.html delete mode 100644 doc/classes/MCollective/Logger.html delete mode 100644 doc/classes/MCollective/Logger/Base.html delete mode 100644 doc/classes/MCollective/Logger/Console_logger.html delete mode 100644 doc/classes/MCollective/Logger/File_logger.html delete mode 100644 doc/classes/MCollective/Logger/Syslog_logger.html delete mode 100644 doc/classes/MCollective/Matcher/Scanner.html delete mode 100644 doc/classes/MCollective/Message.html delete mode 100644 doc/classes/MCollective/MissingRPCData.html delete mode 100644 doc/classes/MCollective/MsgDoesNotMatchRequestID.html delete mode 100644 doc/classes/MCollective/MsgTTLExpired.html delete mode 100644 doc/classes/MCollective/NotTargettedAtUs.html delete mode 100644 doc/classes/MCollective/PluginManager.html delete mode 100644 doc/classes/MCollective/PluginPackager.html delete mode 100644 doc/classes/MCollective/PluginPackager/AgentDefinition.html delete mode 100644 doc/classes/MCollective/PluginPackager/StandardDefinition.html delete mode 100644 doc/classes/MCollective/RPC.html delete mode 100644 doc/classes/MCollective/RPC/ActionRunner.html delete mode 100644 doc/classes/MCollective/RPC/Agent.html delete mode 100644 doc/classes/MCollective/RPC/Audit.html delete mode 100644 doc/classes/MCollective/RPC/Progress.html delete mode 100644 doc/classes/MCollective/RPC/Reply.html delete mode 100644 doc/classes/MCollective/RPC/Request.html delete mode 100644 doc/classes/MCollective/RPC/Result.html delete mode 100644 doc/classes/MCollective/RPCAborted.html delete mode 100644 doc/classes/MCollective/RPCError.html delete mode 100644 doc/classes/MCollective/Registration.html delete mode 100644 doc/classes/MCollective/Registration/Base.html delete mode 100644 doc/classes/MCollective/Runner.html delete mode 100644 doc/classes/MCollective/RunnerStats.html delete mode 100644 doc/classes/MCollective/Security.html delete mode 100644 doc/classes/MCollective/SecurityValidationFailed.html delete mode 100644 doc/classes/MCollective/Shell.html delete mode 100644 doc/classes/MCollective/Translatable.html delete mode 100644 doc/classes/MCollective/UnixDaemon.html delete mode 100644 doc/classes/MCollective/UnknownRPCAction.html delete mode 100644 doc/classes/MCollective/UnknownRPCError.html delete mode 100644 doc/classes/MCollective/Validator.html delete mode 100644 doc/classes/MCollective/ValidatorError.html delete mode 100644 doc/classes/MCollective/WindowsDaemon.html delete mode 100644 doc/classes/String.html delete mode 100644 doc/classes/Symbol.html create mode 100644 doc/etc/client_cfg_dist.html create mode 100644 doc/etc/data-help_erb.html create mode 100644 doc/etc/discovery-help_erb.html create mode 100644 doc/etc/facts_yaml_dist.html create mode 100644 doc/etc/metadata-help_erb.html create mode 100644 doc/etc/msg-help_erb.html create mode 100644 doc/etc/rpc-help_erb.html create mode 100644 doc/etc/server_cfg_dist.html create mode 100644 doc/etc/ssl/PLACEHOLDER.html create mode 100644 doc/etc/ssl/clients/PLACEHOLDER.html delete mode 100644 doc/files/lib/mcollective/agent_rb.html delete mode 100644 doc/files/lib/mcollective/agents_rb.html delete mode 100644 doc/files/lib/mcollective/aggregate/base_rb.html delete mode 100644 doc/files/lib/mcollective/aggregate/result/base_rb.html delete mode 100644 doc/files/lib/mcollective/aggregate/result/collection_result_rb.html delete mode 100644 doc/files/lib/mcollective/aggregate/result/numeric_result_rb.html delete mode 100644 doc/files/lib/mcollective/aggregate/result_rb.html delete mode 100644 doc/files/lib/mcollective/aggregate_rb.html delete mode 100644 doc/files/lib/mcollective/application_rb.html delete mode 100644 doc/files/lib/mcollective/applications_rb.html delete mode 100644 doc/files/lib/mcollective/cache_rb.html delete mode 100644 doc/files/lib/mcollective/client_rb.html delete mode 100644 doc/files/lib/mcollective/config_rb.html delete mode 100644 doc/files/lib/mcollective/connector/base_rb.html delete mode 100644 doc/files/lib/mcollective/connector_rb.html delete mode 100644 doc/files/lib/mcollective/data/base_rb.html delete mode 100644 doc/files/lib/mcollective/data/result_rb.html delete mode 100644 doc/files/lib/mcollective/data_rb.html delete mode 100644 doc/files/lib/mcollective/ddl/agentddl_rb.html delete mode 100644 doc/files/lib/mcollective/ddl/base_rb.html delete mode 100644 doc/files/lib/mcollective/ddl/dataddl_rb.html delete mode 100644 doc/files/lib/mcollective/ddl/discoveryddl_rb.html delete mode 100644 doc/files/lib/mcollective/ddl/validatorddl_rb.html delete mode 100644 doc/files/lib/mcollective/ddl_rb.html delete mode 100644 doc/files/lib/mcollective/discovery_rb.html delete mode 100644 doc/files/lib/mcollective/exception_rb.html delete mode 100644 doc/files/lib/mcollective/facts/base_rb.html delete mode 100644 doc/files/lib/mcollective/facts_rb.html delete mode 100644 doc/files/lib/mcollective/generators/agent_generator_rb.html delete mode 100644 doc/files/lib/mcollective/generators/base_rb.html delete mode 100644 doc/files/lib/mcollective/generators/data_generator_rb.html delete mode 100644 doc/files/lib/mcollective/generators_rb.html delete mode 100644 doc/files/lib/mcollective/log_rb.html delete mode 100644 doc/files/lib/mcollective/logger/base_rb.html delete mode 100644 doc/files/lib/mcollective/logger/console_logger_rb.html delete mode 100644 doc/files/lib/mcollective/logger/file_logger_rb.html delete mode 100644 doc/files/lib/mcollective/logger/syslog_logger_rb.html delete mode 100644 doc/files/lib/mcollective/logger_rb.html delete mode 100644 doc/files/lib/mcollective/matcher/parser_rb.html delete mode 100644 doc/files/lib/mcollective/matcher/scanner_rb.html delete mode 100644 doc/files/lib/mcollective/matcher_rb.html delete mode 100644 doc/files/lib/mcollective/message_rb.html delete mode 100644 doc/files/lib/mcollective/monkey_patches_rb.html delete mode 100644 doc/files/lib/mcollective/optionparser_rb.html delete mode 100644 doc/files/lib/mcollective/pluginmanager_rb.html delete mode 100644 doc/files/lib/mcollective/pluginpackager/agent_definition_rb.html delete mode 100644 doc/files/lib/mcollective/pluginpackager/standard_definition_rb.html delete mode 100644 doc/files/lib/mcollective/pluginpackager_rb.html delete mode 100644 doc/files/lib/mcollective/registration/base_rb.html delete mode 100644 doc/files/lib/mcollective/registration_rb.html delete mode 100644 doc/files/lib/mcollective/rpc/actionrunner_rb.html delete mode 100644 doc/files/lib/mcollective/rpc/agent_rb.html delete mode 100644 doc/files/lib/mcollective/rpc/audit_rb.html delete mode 100644 doc/files/lib/mcollective/rpc/client_rb.html delete mode 100644 doc/files/lib/mcollective/rpc/helpers_rb.html delete mode 100644 doc/files/lib/mcollective/rpc/progress_rb.html delete mode 100644 doc/files/lib/mcollective/rpc/reply_rb.html delete mode 100644 doc/files/lib/mcollective/rpc/request_rb.html delete mode 100644 doc/files/lib/mcollective/rpc/result_rb.html delete mode 100644 doc/files/lib/mcollective/rpc/stats_rb.html delete mode 100644 doc/files/lib/mcollective/rpc_rb.html delete mode 100644 doc/files/lib/mcollective/runner_rb.html delete mode 100644 doc/files/lib/mcollective/runnerstats_rb.html delete mode 100644 doc/files/lib/mcollective/security/base_rb.html delete mode 100644 doc/files/lib/mcollective/security_rb.html delete mode 100644 doc/files/lib/mcollective/shell_rb.html delete mode 100644 doc/files/lib/mcollective/ssl_rb.html delete mode 100644 doc/files/lib/mcollective/translatable_rb.html delete mode 100644 doc/files/lib/mcollective/unix_daemon_rb.html delete mode 100644 doc/files/lib/mcollective/util_rb.html delete mode 100644 doc/files/lib/mcollective/validator_rb.html delete mode 100644 doc/files/lib/mcollective/windows_daemon_rb.html delete mode 100644 doc/files/lib/mcollective_rb.html delete mode 100644 doc/fr_class_index.html delete mode 100644 doc/fr_file_index.html delete mode 100644 doc/fr_method_index.html create mode 100755 doc/images/brick.png create mode 100755 doc/images/brick_link.png create mode 100644 doc/images/bug.png create mode 100755 doc/images/bullet_black.png create mode 100755 doc/images/bullet_toggle_minus.png create mode 100755 doc/images/bullet_toggle_plus.png create mode 100755 doc/images/date.png create mode 100755 doc/images/find.png create mode 100644 doc/images/loadingAnimation.gif create mode 100644 doc/images/macFFBgHack.png create mode 100755 doc/images/package.png create mode 100755 doc/images/page_green.png create mode 100755 doc/images/page_white_text.png create mode 100755 doc/images/page_white_width.png create mode 100755 doc/images/plugin.png create mode 100755 doc/images/ruby.png create mode 100755 doc/images/tag_green.png create mode 100755 doc/images/wrench.png create mode 100755 doc/images/wrench_orange.png create mode 100755 doc/images/zoom.png create mode 100644 doc/install_rb.html create mode 100644 doc/js/darkfish.js create mode 100644 doc/js/jquery.js create mode 100644 doc/js/quicksearch.js create mode 100644 doc/js/thickbox-compressed.js create mode 100644 doc/lib/mcollective/agent_rb.html create mode 100644 doc/lib/mcollective/agents_rb.html create mode 100644 doc/lib/mcollective/aggregate/base_rb.html create mode 100644 doc/lib/mcollective/aggregate/result/base_rb.html create mode 100644 doc/lib/mcollective/aggregate/result/collection_result_rb.html create mode 100644 doc/lib/mcollective/aggregate/result/numeric_result_rb.html create mode 100644 doc/lib/mcollective/aggregate/result_rb.html create mode 100644 doc/lib/mcollective/aggregate_rb.html create mode 100644 doc/lib/mcollective/application_rb.html create mode 100644 doc/lib/mcollective/applications_rb.html create mode 100644 doc/lib/mcollective/cache_rb.html create mode 100644 doc/lib/mcollective/client_rb.html create mode 100644 doc/lib/mcollective/config_rb.html create mode 100644 doc/lib/mcollective/connector/base_rb.html create mode 100644 doc/lib/mcollective/connector_rb.html create mode 100644 doc/lib/mcollective/data/base_rb.html create mode 100644 doc/lib/mcollective/data/result_rb.html create mode 100644 doc/lib/mcollective/data_rb.html create mode 100644 doc/lib/mcollective/ddl/agentddl_rb.html create mode 100644 doc/lib/mcollective/ddl/base_rb.html create mode 100644 doc/lib/mcollective/ddl/dataddl_rb.html create mode 100644 doc/lib/mcollective/ddl/discoveryddl_rb.html create mode 100644 doc/lib/mcollective/ddl/validatorddl_rb.html create mode 100644 doc/lib/mcollective/ddl_rb.html create mode 100644 doc/lib/mcollective/discovery_rb.html create mode 100644 doc/lib/mcollective/exception_rb.html create mode 100644 doc/lib/mcollective/facts/base_rb.html create mode 100644 doc/lib/mcollective/facts_rb.html create mode 100644 doc/lib/mcollective/generators/agent_generator_rb.html create mode 100644 doc/lib/mcollective/generators/base_rb.html create mode 100644 doc/lib/mcollective/generators/data_generator_rb.html create mode 100644 doc/lib/mcollective/generators/templates/action_snippet_erb.html create mode 100644 doc/lib/mcollective/generators/templates/data_input_snippet_erb.html create mode 100644 doc/lib/mcollective/generators/templates/ddl_erb.html create mode 100644 doc/lib/mcollective/generators/templates/plugin_erb.html create mode 100644 doc/lib/mcollective/generators_rb.html create mode 100644 doc/lib/mcollective/locales/en_yml.html create mode 100644 doc/lib/mcollective/log_rb.html create mode 100644 doc/lib/mcollective/logger/base_rb.html create mode 100644 doc/lib/mcollective/logger/console_logger_rb.html create mode 100644 doc/lib/mcollective/logger/file_logger_rb.html create mode 100644 doc/lib/mcollective/logger/syslog_logger_rb.html create mode 100644 doc/lib/mcollective/logger_rb.html create mode 100644 doc/lib/mcollective/matcher/parser_rb.html create mode 100644 doc/lib/mcollective/matcher/scanner_rb.html create mode 100644 doc/lib/mcollective/matcher_rb.html create mode 100644 doc/lib/mcollective/message_rb.html create mode 100644 doc/lib/mcollective/monkey_patches_rb.html create mode 100644 doc/lib/mcollective/optionparser_rb.html create mode 100644 doc/lib/mcollective/pluginmanager_rb.html create mode 100644 doc/lib/mcollective/pluginpackager/agent_definition_rb.html create mode 100644 doc/lib/mcollective/pluginpackager/standard_definition_rb.html create mode 100644 doc/lib/mcollective/pluginpackager_rb.html create mode 100644 doc/lib/mcollective/registration/base_rb.html create mode 100644 doc/lib/mcollective/registration_rb.html create mode 100644 doc/lib/mcollective/rpc/actionrunner_rb.html create mode 100644 doc/lib/mcollective/rpc/agent_rb.html create mode 100644 doc/lib/mcollective/rpc/audit_rb.html create mode 100644 doc/lib/mcollective/rpc/client_rb.html create mode 100644 doc/lib/mcollective/rpc/helpers_rb.html create mode 100644 doc/lib/mcollective/rpc/progress_rb.html create mode 100644 doc/lib/mcollective/rpc/reply_rb.html create mode 100644 doc/lib/mcollective/rpc/request_rb.html create mode 100644 doc/lib/mcollective/rpc/result_rb.html create mode 100644 doc/lib/mcollective/rpc/stats_rb.html create mode 100644 doc/lib/mcollective/rpc_rb.html create mode 100644 doc/lib/mcollective/runner_rb.html create mode 100644 doc/lib/mcollective/runnerstats_rb.html create mode 100644 doc/lib/mcollective/security/base_rb.html create mode 100644 doc/lib/mcollective/security_rb.html create mode 100644 doc/lib/mcollective/shell_rb.html create mode 100644 doc/lib/mcollective/ssl_rb.html create mode 100644 doc/lib/mcollective/translatable_rb.html create mode 100644 doc/lib/mcollective/unix_daemon_rb.html create mode 100644 doc/lib/mcollective/util_rb.html create mode 100644 doc/lib/mcollective/validator_rb.html create mode 100644 doc/lib/mcollective/windows_daemon_rb.html create mode 100644 doc/lib/mcollective_rb.html create mode 100644 doc/mcollective_init.html delete mode 100644 doc/rdoc-style.css create mode 100644 doc/rdoc.css delete mode 100644 ext/Makefile.debian delete mode 100644 ext/action_helpers/perl/.gitignore create mode 100644 ext/build_defaults.yaml create mode 100644 ext/debian/changelog delete mode 100644 ext/debian/mcollective-common.dirs create mode 100644 ext/debian/mcollective.dirs delete mode 100644 ext/debian/patches/00list delete mode 100755 ext/debian/patches/conffile.dpatch delete mode 100755 ext/debian/patches/initlsb.dpatch delete mode 100755 ext/debian/patches/makefile.dpatch delete mode 100755 ext/debian/patches/pluginsdir.dpatch create mode 100755 ext/debian/patches/pluginsdir.patch create mode 100644 ext/debian/patches/series create mode 100644 ext/debian/source/format create mode 100644 ext/packaging.rake create mode 100644 ext/project_data.yaml create mode 100644 ext/redhat/mcollective.service create mode 100755 install.rb delete mode 100644 lib/mcollective/vendor/i18n/.gitignore delete mode 100644 lib/mcollective/vendor/i18n/.travis.yml delete mode 100644 lib/mcollective/vendor/json/.gitignore delete mode 100644 lib/mcollective/vendor/json/.travis.yml delete mode 100644 lib/mcollective/vendor/json/diagrams/.keep delete mode 100644 lib/mcollective/vendor/json/lib/json/ext/.keep create mode 100644 plugins/mcollective/pluginpackager/modulepackage_packager.rb create mode 100644 plugins/mcollective/pluginpackager/templates/module/Modulefile.erb create mode 100644 plugins/mcollective/pluginpackager/templates/module/README.md.erb create mode 100644 plugins/mcollective/pluginpackager/templates/module/_manifest.pp.erb diff --git a/debian/changelog b/debian/changelog index 7b3c123..b559546 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,5 @@ -mcollective (2.3.2-1) unstable; urgency=low +mcollective (2.3.3-1puppetlabs1) unstable sid squeeze wheezy precise; urgency=low - * Automated release for 2.3.2-1 by rake deb + * Update to version 2.3.3-1puppetlabs1 - See http://marionette-collective.org/releasenotes.html for full details - - -- The Marionette Collective Fri, 08 Nov 2013 12:58:34 +0000 + -- Puppet Labs Release Fri, 15 Nov 2013 12:53:51 +0000 diff --git a/debian/control b/debian/control index 3d59c8b..469fe25 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: mcollective Section: utils Priority: extra Maintainer: Riccardo Setti -Build-Depends: debhelper (>= 7), dpatch, cdbs +Build-Depends: debhelper (>= 7), quilt, cdbs, ruby Standards-Version: 3.8.0 Homepage: http://marionette-collective.org/ @@ -10,14 +10,14 @@ Package: mcollective Architecture: all Depends: ruby (>= 1.8.1), mcollective-common (= ${source:Version}) Description: build server orchestration or parallel job execution systems - The Marionette Collective aka. mcollective is a framework + The Marionette Collective aka. mcollective is a framework to build server orchestration or parallel job execution systems. Package: mcollective-client Architecture: all Depends: ruby (>= 1.8.1), mcollective-common (= ${source:Version}) Description: build server orchestration or parallel job execution systems - The Marionette Collective aka. mcollective is a framework + The Marionette Collective aka. mcollective is a framework to build server orchestration or parallel job execution system Package: mcollective-common @@ -26,7 +26,7 @@ Breaks: mcollective (<< 2.0.0-1), mcollective-client (<< 2.0.0-1) Architecture: all 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 + The Marionette Collective aka. mcollective is a framework to build server orchestration or parallel job execution systems. . Common files for mcollective packages. @@ -35,7 +35,7 @@ Package: mcollective-doc Architecture: all Section: doc Description: Documentation for mcollective - The Marionette Collective aka. mcollective is a framework + 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 deleted file mode 100644 index 2b54b99..0000000 --- a/debian/mcollective-common.dirs +++ /dev/null @@ -1 +0,0 @@ -usr/lib/ruby/vendor_ruby diff --git a/debian/mcollective.dirs b/debian/mcollective.dirs new file mode 100644 index 0000000..cfb1fd7 --- /dev/null +++ b/debian/mcollective.dirs @@ -0,0 +1,2 @@ +etc/mcollective/ssl/clients +etc/mcollective/plugin.d diff --git a/debian/mcollective.init b/debian/mcollective.init old mode 100644 new mode 100755 index f599f4a..c4e822c --- a/debian/mcollective.init +++ b/debian/mcollective.init @@ -75,6 +75,9 @@ case "$1" in $0 start fi ;; + force-reload) + echo "not implemented" + ;; status) status_of_proc -p ${pidfile} ${mcollectived} ${name} && exit 0 || exit $? ;; diff --git a/debian/mcollective.install b/debian/mcollective.install index 64e7158..f099689 100644 --- a/debian/mcollective.install +++ b/debian/mcollective.install @@ -1,5 +1,3 @@ -usr/sbin/mcollectived usr/sbin -etc/mcollective/facts.yaml etc/mcollective -etc/mcollective/server.cfg etc/mcollective -etc/init.d etc/ -etc/mcollective/ssl +usr/sbin/mcollectived +etc/mcollective/facts.yaml +etc/mcollective/server.cfg diff --git a/debian/patches/00list b/debian/patches/00list deleted file mode 100644 index f356934..0000000 --- a/debian/patches/00list +++ /dev/null @@ -1 +0,0 @@ -pluginsdir.dpatch diff --git a/debian/patches/conffile.dpatch b/debian/patches/conffile.dpatch deleted file mode 100644 index 499ae7c..0000000 --- a/debian/patches/conffile.dpatch +++ /dev/null @@ -1,111 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## conffile.dpatch by -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: fix plugins dir - -@DPATCH@ -diff -urNad mcollective-1.1.4~/etc/client.cfg.dist mcollective-1.1.4/etc/client.cfg.dist ---- mcollective-1.1.4~/etc/client.cfg.dist 2011-04-06 14:13:08.829462165 -0700 -+++ mcollective-1.1.4/etc/client.cfg.dist 2011-04-06 14:12:53.129384114 -0700 -@@ -1,6 +1,6 @@ - main_collective = mcollective - collectives = mcollective --libdir = /usr/libexec/mcollective -+libdir = /usr/share/mcollective/plugins - logger_type = console - loglevel = warn - -diff -urNad mcollective-1.1.4~/etc/server.cfg.dist mcollective-1.1.4/etc/server.cfg.dist ---- mcollective-1.1.4~/etc/server.cfg.dist 2011-04-06 14:12:30.889527230 -0700 -+++ mcollective-1.1.4/etc/server.cfg.dist 2011-04-06 14:12:23.779407065 -0700 -@@ -1,6 +1,6 @@ - main_collective = mcollective - collectives = mcollective --libdir = /usr/libexec/mcollective -+libdir = /usr/share/mcollective/plugins - logfile = /var/log/mcollective.log - loglevel = info - daemonize = 1 - diff --git a/debian/patches/pluginsdir.patch b/debian/patches/pluginsdir.patch new file mode 100755 index 0000000..4fe0318 --- /dev/null +++ b/debian/patches/pluginsdir.patch @@ -0,0 +1,24 @@ +diff --git a/etc/client.cfg.dist b/etc/client.cfg.dist +index 1acffee..5c36486 100644 +--- a/etc/client.cfg.dist ++++ b/etc/client.cfg.dist +@@ -1,6 +1,6 @@ + main_collective = mcollective + collectives = mcollective +-libdir = /usr/libexec/mcollective ++libdir = /usr/share/mcollective/plugins + logger_type = console + loglevel = warn + +diff --git a/etc/server.cfg.dist b/etc/server.cfg.dist +index 2038324..c28a826 100644 +--- a/etc/server.cfg.dist ++++ b/etc/server.cfg.dist +@@ -1,6 +1,6 @@ + main_collective = mcollective + collectives = mcollective +-libdir = /usr/libexec/mcollective ++libdir = /usr/share/mcollective/plugins + logfile = /var/log/mcollective.log + loglevel = info + daemonize = 1 diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..15b17e6 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +pluginsdir.patch diff --git a/debian/rules b/debian/rules index 966ff75..70ad4c4 100755 --- a/debian/rules +++ b/debian/rules @@ -1,18 +1,15 @@ #!/usr/bin/make -f -DEB_MAKE_CLEAN_TARGET := -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.debian -C $(DEB_BUILDDIR) +BUILD_ROOT=$(CURDIR)/debian/tmp +RUBY_LIBDIR=$(shell /usr/bin/ruby -rrbconfig -e 'puts RbConfig::CONFIG["vendordir"]') +PLUGINDIR=/usr/share/mcollective/plugins +DOCDIR=$(BUILD_ROOT)/usr/share/doc/mcollective install/mcollective:: - mv $(CURDIR)/debian/tmp/etc/mcollective/server.cfg.dist $(CURDIR)/debian/tmp/etc/mcollective/server.cfg - mv $(CURDIR)/debian/tmp/etc/mcollective/client.cfg.dist $(CURDIR)/debian/tmp/etc/mcollective/client.cfg - mv $(CURDIR)/debian/tmp/etc/mcollective/facts.yaml.dist $(CURDIR)/debian/tmp/etc/mcollective/facts.yaml -# dh_installinit -pmcollective -o + /usr/bin/ruby install.rb --destdir=$(CURDIR)/debian/tmp --no-rdoc --sitelibdir=$(RUBY_LIBDIR) --ruby=/usr/bin/ruby --plugindir=$(PLUGINDIR) + mkdir -p $(DOCDIR) + cp -a doc/* $(DOCDIR) binary-fixup/mcollective:: chmod 640 $(CURDIR)/debian/mcollective/etc/mcollective/server.cfg diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/doc/Array.html b/doc/Array.html new file mode 100644 index 0000000..cef2de6 --- /dev/null +++ b/doc/Array.html @@ -0,0 +1,427 @@ + + + + + + + Class: Array + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

Array

+ +
+

+a method # that walks an array in groups, pass a block to call the block on +each sub array +

+ +
+ + + + + + + + + +
+

Public Instance Methods

+ + +
+ + +
+ + in_groups_of(chunk_size, padded_with=nil, &block) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/monkey_patches.rb, line 29
+29:   def in_groups_of(chunk_size, padded_with=nil, &block)
+30:     arr = self.clone
+31: 
+32:     # how many to add
+33:     padding = chunk_size - (arr.size % chunk_size)
+34: 
+35:     # pad at the end
+36:     arr.concat([padded_with] * padding) unless padding == chunk_size
+37: 
+38:     # how many chunks we'll make
+39:     count = arr.size / chunk_size
+40: 
+41:     # make that many arrays
+42:     result = []
+43:     count.times {|s| result <<  arr[s * chunk_size, chunk_size]}
+44: 
+45:     if block_given?
+46:       result.each_with_index do |a, i|
+47:         case block.arity
+48:           when 1
+49:             yield(a)
+50:           when 2
+51:             yield(a, (i == result.size - 1))
+52:           else
+53:             raise "Expected 1 or 2 arguments, got #{block.arity}"
+54:         end
+55:       end
+56:     else
+57:       result
+58:     end
+59:   end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/COPYING.html b/doc/COPYING.html new file mode 100644 index 0000000..9938792 --- /dev/null +++ b/doc/COPYING.html @@ -0,0 +1,530 @@ + + + + + + + + File: COPYING [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+
+                              Apache License
+                        Version 2.0, January 2004
+                     http://www.apache.org/licenses/
+
+

+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +

+
    +
  1. Definitions. + +

    +“License” shall mean the terms and conditions for use, +reproduction, and distribution as defined by Sections 1 through 9 of this +document. +

    +

    +“Licensor” shall mean the copyright owner or entity authorized +by the copyright owner that is granting the License. +

    +

    +“Legal Entity” shall mean the union of the acting entity and +all other entities that control, are controlled by, or are under common +control with that entity. For the purposes of this definition, +“control” means (i) the power, direct or indirect, to cause the +direction or management of such entity, whether by contract or otherwise, +or (ii) ownership of fifty percent (50%) or more of the outstanding shares, +or (iii) beneficial ownership of such entity. +

    +

    +“You” (or “Your”) shall mean an individual or Legal +Entity exercising permissions granted by this License. +

    +

    +“Source” form shall mean the preferred form for making +modifications, including but not limited to software source code, +documentation source, and configuration files. +

    +

    +“Object” form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but not limited +to compiled object code, generated documentation, and conversions to other +media types. +

    +

    +“Work” shall mean the work of authorship, whether in Source or +Object form, made available under the License, as +indicated by a copyright notice that is included in or attached to the work +(an example is provided in the Appendix below). +

    +

    +“Derivative Works” shall mean any work, whether in Source or Object form, that is based on (or derived from) the +Work and for which the editorial revisions, annotations, elaborations, or +other modifications represent, as a whole, an original work of authorship. +For the purposes of this License, Derivative Works shall not include works +that remain separable from, or merely link (or bind by name) to the +interfaces of, the Work and Derivative Works thereof. +

    +

    +“Contribution” shall mean any work of authorship, including the +original version of the Work and any modifications or additions to that +Work or Derivative Works thereof, that is intentionally submitted to +Licensor for inclusion in the Work by the copyright owner or by an +individual or Legal Entity authorized to submit on behalf of the copyright +owner. For the purposes of this definition, “submitted” means +any form of electronic, verbal, or written communication sent to the +Licensor or its representatives, including but not limited to communication +on electronic mailing lists, source code control systems, and issue +tracking systems that are managed by, or on behalf of, the Licensor for the +purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the +copyright owner as “Not a Contribution.“ +

    +

    +“Contributor” shall mean Licensor and any individual or Legal +Entity on behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. +

    +
  2. +
  3. Grant of Copyright License. Subject to the terms and conditions of this +License, each Contributor hereby grants to You a perpetual, worldwide, +non-exclusive, no-charge, royalty-free, irrevocable copyright license to +reproduce, prepare Derivative Works of, publicly display, publicly perform, +sublicense, and distribute the Work and such Derivative Works in Source or +Object form. + +
  4. +
  5. Grant of Patent License. Subject to the terms and conditions of this +License, each Contributor hereby grants to You a perpetual, worldwide, +non-exclusive, no-charge, royalty-free, irrevocable (except as stated in +this section) patent license to make, have made, use, offer to sell, sell, +import, and otherwise transfer the Work, where such license applies only to +those patent claims licensable by such Contributor that are necessarily +infringed by their Contribution(s) alone or by combination of their +Contribution(s) with the Work to which such Contribution(s) was submitted. +If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or +contributory patent infringement, then any patent licenses granted to You +under this License for that Work shall terminate as of the date such +litigation is filed. + +
  6. +
  7. Redistribution. You may reproduce and distribute copies of the Work or +Derivative Works thereof in any medium, with or without modifications, and +in Source or Object form, provided that You meet +the following conditions: + +

    +(a) You must give any other recipients of the Work or +

    +
    +    Derivative Works a copy of this License; and
    +
    +

    +(b) You must cause any modified files to carry prominent notices +

    +
    +    stating that You changed the files; and
    +
    +

    +© You must retain, in the Source form of any Derivative Works +

    +
    +    that You distribute, all copyright, patent, trademark, and
    +    attribution notices from the Source form of the Work,
    +    excluding those notices that do not pertain to any part of
    +    the Derivative Works; and
    +
    +

    +(d) If the Work includes a “NOTICE” text file as part of its +

    +
    +    distribution, then any Derivative Works that You distribute must
    +    include a readable copy of the attribution notices contained
    +    within such NOTICE file, excluding those notices that do not
    +    pertain to any part of the Derivative Works, in at least one
    +    of the following places: within a NOTICE text file distributed
    +    as part of the Derivative Works; within the Source form or
    +    documentation, if provided along with the Derivative Works; or,
    +    within a display generated by the Derivative Works, if and
    +    wherever such third-party notices normally appear. The contents
    +    of the NOTICE file are for informational purposes only and
    +    do not modify the License. You may add Your own attribution
    +    notices within Derivative Works that You distribute, alongside
    +    or as an addendum to the NOTICE text from the Work, provided
    +    that such additional attribution notices cannot be construed
    +    as modifying the License.
    +
    +

    +You may add Your own copyright statement to Your modifications and may +provide additional or different license terms and conditions for use, +reproduction, or distribution of Your modifications, or for any such +Derivative Works as a whole, provided Your use, reproduction, and +distribution of the Work otherwise complies with the conditions stated in +this License. +

    +
  8. +
  9. Submission of Contributions. Unless You explicitly state otherwise, any +Contribution intentionally submitted for inclusion in the Work by You to +the Licensor shall be under the terms and conditions of this License, +without any additional terms or conditions. Notwithstanding the above, +nothing herein shall supersede or modify the terms of any separate license +agreement you may have executed with Licensor regarding such Contributions. + +
  10. +
  11. Trademarks. This License does not grant permission to use the trade names, +trademarks, service marks, or product names of the Licensor, except as +required for reasonable and customary use in describing the origin of the +Work and reproducing the content of the NOTICE file. + +
  12. +
  13. Disclaimer of Warranty. Unless required by applicable law or agreed to in +writing, Licensor provides the Work (and each Contributor provides its +Contributions) on an “AS IS” BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied, including, without +limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, +MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely +responsible for determining the appropriateness of using or redistributing +the Work and assume any risks associated with Your exercise of permissions +under this License. + +
  14. +
  15. Limitation of Liability. In no event and under no legal theory, whether in +tort (including negligence), contract, or otherwise, unless required by +applicable law (such as deliberate and grossly negligent acts) or agreed to +in writing, shall any Contributor be liable to You for damages, including +any direct, indirect, special, incidental, or consequential damages of any +character arising as a result of this License or out of the use or +inability to use the Work (including but not limited to damages for loss of +goodwill, work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses), even if such Contributor has been +advised of the possibility of such damages. + +
  16. +
  17. Accepting Warranty or Additional Liability. While redistributing the Work +or Derivative Works thereof, You may choose to offer, and charge a fee for, +acceptance of support, warranty, indemnity, or other liability obligations +and/or rights consistent with this License. However, in accepting such +obligations, You may act only on Your own behalf and on Your sole +responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any +liability incurred by, or claims asserted against, such Contributor by +reason of your accepting any such warranty or additional liability. + +
  18. +
+

+END OF TERMS AND CONDITIONS +

+

+APPENDIX: How to apply the Apache License to your work. +

+
+   To apply the Apache License to your work, attach the following
+   boilerplate notice, with the fields enclosed by brackets "[]"
+   replaced with your own identifying information. (Don't include
+   the brackets!)  The text should be enclosed in the appropriate
+   comment syntax for the file format. We also recommend that a
+   file or class name and description of purpose be included on the
+   same "printed page" as the copyright notice for easier
+   identification within third-party archives.
+
+

+Copyright 2010, 2011 Puppet Labs +

+

+Licensed under the Apache License, Version 2.0 (the “License”); +you may not use this file except in compliance with the License. You may +obtain a copy of the License at +

+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+

+Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an “AS IS” +BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied. See the License for the specific language governing permissions +and limitations under the License. +

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/Dir.html b/doc/Dir.html new file mode 100644 index 0000000..660c01c --- /dev/null +++ b/doc/Dir.html @@ -0,0 +1,471 @@ + + + + + + + Class: Dir + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

Dir

+ +
+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + mktmpdir(prefix_suffix=nil, tmpdir=nil) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/monkey_patches.rb, line 72
+ 72:   def self.mktmpdir(prefix_suffix=nil, tmpdir=nil)
+ 73:     case prefix_suffix
+ 74:     when nil
+ 75:       prefix = "d"
+ 76:       suffix = ""
+ 77:     when String
+ 78:       prefix = prefix_suffix
+ 79:       suffix = ""
+ 80:     when Array
+ 81:       prefix = prefix_suffix[0]
+ 82:       suffix = prefix_suffix[1]
+ 83:     else
+ 84:       raise ArgumentError, "unexpected prefix_suffix: #{prefix_suffix.inspect}"
+ 85:     end
+ 86:     tmpdir ||= Dir.tmpdir
+ 87:     t = Time.now.strftime("%Y%m%d")
+ 88:     n = nil
+ 89:     begin
+ 90:       path = "#{tmpdir}/#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
+ 91:       path << "-#{n}" if n
+ 92:       path << suffix
+ 93:       Dir.mkdir(path, 0700)
+ 94:     rescue Errno::EEXIST
+ 95:       n ||= 0
+ 96:       n += 1
+ 97:       retry
+ 98:     end
+ 99: 
+100:     if block_given?
+101:       begin
+102:         yield path
+103:       ensure
+104:         FileUtils.remove_entry_secure path
+105:       end
+106:     else
+107:       path
+108:     end
+109:   end
+
+ +
+ + +
+ + +
+ + +
+ + tmpdir() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/monkey_patches.rb, line 111
+111:   def self.tmpdir
+112:     tmp = '.'
+113:     for dir in [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], '/tmp']
+114:       if dir and stat = File.stat(dir) and stat.directory? and stat.writable?
+115:         tmp = dir
+116:         break
+117:       end rescue nil
+118:     end
+119:     File.expand_path(tmp)
+120:   end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/Gemfile.html b/doc/Gemfile.html new file mode 100644 index 0000000..69703b3 --- /dev/null +++ b/doc/Gemfile.html @@ -0,0 +1,315 @@ + + + + + + + + File: Gemfile [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

+source ‘rubygems.org‘ +

+

+gem ‘json’ gem ‘stomp’ gem ‘systemu’ +

+

+group :dev do +

+
+  gem 'rake'
+
+

+end +

+

+group :test do +

+
+  gem 'rdoc'
+  gem 'rspec', '~> 2.11.0'
+  gem 'mocha', '~> 0.10.0'
+  gem 'mcollective-test'
+
+

+end +

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/MCollective.html b/doc/MCollective.html new file mode 100644 index 0000000..499d45d --- /dev/null +++ b/doc/MCollective.html @@ -0,0 +1,725 @@ + + + + + + + Module: MCollective + + + + + + + + + + + +
+
+
+

In Files

+
+ +
+
+ + +
+ +
+ + + + + + +
+

Namespace

+ +
+ + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective

+ +
+

The Marionette Collective

+

+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. +

+

+For an overview of the idea behind this and what it enables please see: +

+
+  http://www.devco.net/archives/2009/10/18/middleware_for_systems_administration.php
+
+ +
+ + + +
+

Constants

+
+ +
VERSION
+ +
(Not documented)
+ + +
+
+ + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + version() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective.rb, line 65
+65:   def self.version
+66:     VERSION
+67:   end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Agent.html b/doc/MCollective/Agent.html new file mode 100644 index 0000000..fbc3158 --- /dev/null +++ b/doc/MCollective/Agent.html @@ -0,0 +1,341 @@ + + + + + + + Module: MCollective::Agent + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Agent

+ +
+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Agents.html b/doc/MCollective/Agents.html new file mode 100644 index 0000000..92e274d --- /dev/null +++ b/doc/MCollective/Agents.html @@ -0,0 +1,824 @@ + + + + + + + Class: MCollective::Agents + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Agents

+ +
+

+A collection of agents, loads them, reloads them and dispatches messages to +them. It uses the PluginManager to store, +load and manage instances of plugins. +

+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + agentlist() + click to toggle source + +
+ +
+ +

+Get a list of agents that we have +

+ + + +
+
+     # File lib/mcollective/agents.rb, line 145
+145:     def self.agentlist
+146:       @@agents.keys
+147:     end
+
+ +
+ + +
+ + +
+ + +
+ + new(agents = {}) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/agents.rb, line 5
+ 5:     def initialize(agents = {})
+ 6:       @config = Config.instance
+ 7:       raise ("Configuration has not been loaded, can't load agents") unless @config.configured
+ 8: 
+ 9:       @@agents = agents
+10: 
+11:       loadagents
+12:     end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + activate_agent?(agent) + click to toggle source + +
+ +
+ +

+Checks if a plugin should be activated by calling activate? on it if it +responds to that method else always activate it +

+ + + +
+
+    # File lib/mcollective/agents.rb, line 85
+85:     def activate_agent?(agent)
+86:       klass = Kernel.const_get("MCollective").const_get("Agent").const_get(agent.capitalize)
+87: 
+88:       if klass.respond_to?("activate?")
+89:         return klass.activate?
+90:       else
+91:         Log.debug("#{klass} does not have an activate? method, activating as default")
+92:         return true
+93:       end
+94:     rescue Exception => e
+95:       Log.warn("Agent activation check for #{agent} failed: #{e.class}: #{e}")
+96:       return false
+97:     end
+
+ +
+ + +
+ + +
+ + +
+ + class_for_agent(agent) + click to toggle source + +
+ +
+ +

+Builds a class name string given a Agent name +

+ + + +
+
+    # File lib/mcollective/agents.rb, line 78
+78:     def class_for_agent(agent)
+79:       "MCollective::Agent::#{agent.capitalize}"
+80:     end
+
+ +
+ + +
+ + +
+ + +
+ + clear!() + click to toggle source + +
+ +
+ +

+Deletes all agents +

+ + + +
+
+    # File lib/mcollective/agents.rb, line 15
+15:     def clear!
+16:       @@agents.each_key do |agent|
+17:         PluginManager.delete "#{agent}_agent"
+18:         Util.unsubscribe(Util.make_subscriptions(agent, :broadcast))
+19:       end
+20: 
+21:       @@agents = {}
+22:     end
+
+ +
+ + +
+ + +
+ + +
+ + dispatch(request, connection) + click to toggle source + +
+ +
+ +

+Dispatches a message to an agent, accepts a block that will get run if +there are any replies to process from the agent +

+ + + +
+
+     # File lib/mcollective/agents.rb, line 118
+118:     def dispatch(request, connection)
+119:       Log.debug("Dispatching a message to agent #{request.agent}")
+120: 
+121:       Thread.new do
+122:         begin
+123:           agent = PluginManager["#{request.agent}_agent"]
+124: 
+125:           Timeout::timeout(agent.timeout) do
+126:             replies = agent.handlemsg(request.payload, connection)
+127: 
+128:             # Agents can decide if they wish to reply or not,
+129:             # returning nil will mean nothing goes back to the
+130:             # requestor
+131:             unless replies == nil
+132:               yield(replies)
+133:             end
+134:           end
+135:         rescue Timeout::Error => e
+136:           Log.warn("Timeout while handling message for #{request.agent}")
+137:         rescue Exception => e
+138:           Log.error("Execution of #{request.agent} failed: #{e}")
+139:           Log.error(e.backtrace.join("\n\t\t"))
+140:         end
+141:       end
+142:     end
+
+ +
+ + +
+ + +
+ + +
+ + findagentfile(agentname) + click to toggle source + +
+ +
+ +

+searches the libdirs for agents +

+ + + +
+
+     # File lib/mcollective/agents.rb, line 100
+100:     def findagentfile(agentname)
+101:       @config.libdir.each do |libdir|
+102:         agentfile = File.join([libdir, "mcollective", "agent", "#{agentname}.rb"])
+103:         if File.exist?(agentfile)
+104:           Log.debug("Found #{agentname} at #{agentfile}")
+105:           return agentfile
+106:         end
+107:       end
+108:       return false
+109:     end
+
+ +
+ + +
+ + +
+ + +
+ + include?(agentname) + click to toggle source + +
+ +
+ +

+Determines if we have an agent with a certain name +

+ + + +
+
+     # File lib/mcollective/agents.rb, line 112
+112:     def include?(agentname)
+113:       PluginManager.include?("#{agentname}_agent")
+114:     end
+
+ +
+ + +
+ + +
+ + +
+ + loadagent(agentname) + click to toggle source + +
+ +
+ +

+Loads a specified agent from disk if available +

+ + + +
+
+    # File lib/mcollective/agents.rb, line 42
+42:     def loadagent(agentname)
+43:       agentfile = findagentfile(agentname)
+44:       return false unless agentfile
+45:       classname = class_for_agent(agentname)
+46: 
+47:       PluginManager.delete("#{agentname}_agent")
+48: 
+49:       begin
+50:         single_instance = ["registration", "discovery"].include?(agentname)
+51: 
+52:         PluginManager.loadclass(classname)
+53: 
+54:         if activate_agent?(agentname)
+55:           PluginManager << {:type => "#{agentname}_agent", :class => classname, :single_instance => single_instance}
+56: 
+57:           # Attempt to instantiate the agent once so any validation and hooks get run
+58:           # this does a basic sanity check on the agent as a whole, if this fails it
+59:           # will be removed from the plugin list
+60:           PluginManager["#{agentname}_agent"]
+61: 
+62:           Util.subscribe(Util.make_subscriptions(agentname, :broadcast)) unless @@agents.include?(agentname)
+63: 
+64:           @@agents[agentname] = {:file => agentfile}
+65:           return true
+66:         else
+67:           Log.debug("Not activating agent #{agentname} due to agent policy in activate? method")
+68:           return false
+69:         end
+70:       rescue Exception => e
+71:         Log.error("Loading agent #{agentname} failed: #{e}")
+72:         PluginManager.delete("#{agentname}_agent")
+73:         return false
+74:       end
+75:     end
+
+ +
+ + +
+ + +
+ + +
+ + loadagents() + click to toggle source + +
+ +
+ +

+Loads all agents from disk +

+ + + +
+
+    # File lib/mcollective/agents.rb, line 25
+25:     def loadagents
+26:       Log.debug("Reloading all agents from disk")
+27: 
+28:       clear!
+29: 
+30:       @config.libdir.each do |libdir|
+31:         agentdir = "#{libdir}/mcollective/agent"
+32:         next unless File.directory?(agentdir)
+33: 
+34:         Dir.new(agentdir).grep(/\.rb$/).each do |agent|
+35:           agentname = File.basename(agent, ".rb")
+36:           loadagent(agentname) unless PluginManager.include?("#{agentname}_agent")
+37:         end
+38:       end
+39:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Aggregate.html b/doc/MCollective/Aggregate.html new file mode 100644 index 0000000..7afc5c4 --- /dev/null +++ b/doc/MCollective/Aggregate.html @@ -0,0 +1,732 @@ + + + + + + + Class: MCollective::Aggregate + + + + + + + + + + + +
+ + +
+ + + +
+

Parent

+ + + +
+ + + + +
+

Namespace

+ +
+ + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Aggregate

+ +
+ +
+ + + + + + +
+

Attributes

+ + +
+ + + + +
+ ddl[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ functions[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ action[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ failed[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(ddl) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/aggregate.rb, line 8
+ 8:     def initialize(ddl)
+ 9:       @functions = []
+10:       @ddl = ddl
+11:       @action = ddl[:action]
+12:       @failed = []
+13: 
+14:       create_functions
+15:     end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + call_functions(reply) + click to toggle source + +
+ +
+ +

+Call all the appropriate functions with the reply data received from RPC::Client +

+ + + +
+
+    # File lib/mcollective/aggregate.rb, line 45
+45:     def call_functions(reply)
+46:       @functions.each do |function|
+47:         Log.debug("Calling aggregate function #{function} for result")
+48:         begin
+49:           function.process_result(reply[:data][function.output_name], reply)
+50:         rescue Exception => e
+51:           Log.error("Could not process aggregate function for '#{function.output_name}'. #{e.to_s}")
+52:           @failed << {:name => function.output_name, :type => :process_result}
+53:           @functions.delete(function)
+54:         end
+55:       end
+56:     end
+
+ +
+ + +
+ + +
+ + +
+ + contains_output?(output) + click to toggle source + +
+ +
+ +

+Check if the function param is defined as an output for the action in the +ddl +

+ + + +
+
+    # File lib/mcollective/aggregate.rb, line 40
+40:     def contains_output?(output)
+41:       @ddl[:output].keys.include?(output)
+42:     end
+
+ +
+ + +
+ + +
+ + +
+ + create_functions() + click to toggle source + +
+ +
+ +

+Creates instances of the Aggregate functions +and stores them in the function array. All aggregate call and summarize +method calls operate on these function as a batch. +

+ + + +
+
+    # File lib/mcollective/aggregate.rb, line 19
+19:     def create_functions
+20:       @ddl[:aggregate].each_with_index do |agg, i|
+21:         output = agg[:args][0]
+22: 
+23:         if contains_output?(output)
+24:           arguments = agg[:args][1]
+25:           format = (arguments.delete(:format) if arguments) || nil
+26:           begin
+27:             @functions << load_function(agg[:function]).new(output, arguments, format, @action)
+28:           rescue Exception => e
+29:             Log.error("Cannot create aggregate function '#{output}'. #{e.to_s}")
+30:             @failed << {:name => output, :type => :startup}
+31:           end
+32:         else
+33:           Log.error("Cannot create aggregate function '#{output}'. '#{output}' has not been specified as a valid ddl output.")
+34:           @failed << {:name => output, :type => :create}
+35:         end
+36:       end
+37:     end
+
+ +
+ + +
+ + +
+ + +
+ + load_function(function_name) + click to toggle source + +
+ +
+ +

+Loads function from disk for use +

+ + + +
+
+    # File lib/mcollective/aggregate.rb, line 76
+76:     def load_function(function_name)
+77:       function_name = function_name.to_s.capitalize
+78: 
+79:       PluginManager.loadclass("MCollective::Aggregate::#{function_name}") unless Aggregate.const_defined?(function_name)
+80:       Aggregate.const_get(function_name)
+81:     rescue Exception
+82:       raise "Aggregate function file '#{function_name.downcase}.rb' cannot be loaded"
+83:     end
+
+ +
+ + +
+ + +
+ + +
+ + summarize() + click to toggle source + +
+ +
+ +

+Finalizes the function returning a result object +

+ + + +
+
+    # File lib/mcollective/aggregate.rb, line 59
+59:     def summarize
+60:       summary = @functions.map do |function|
+61:         begin
+62:           function.summarize
+63:         rescue Exception => e
+64:           Log.error("Could not summarize aggregate result for '#{function.output_name}'. #{e.to_s}")
+65:           @failed << {:name => function.output_name, :type => :summarize}
+66:           nil
+67:         end
+68:       end
+69: 
+70:       summary.reject{|x| x.nil?}.sort do |x,y|
+71:         x.result[:output] <=> y.result[:output]
+72:       end
+73:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Aggregate/Base.html b/doc/MCollective/Aggregate/Base.html new file mode 100644 index 0000000..e8b1de1 --- /dev/null +++ b/doc/MCollective/Aggregate/Base.html @@ -0,0 +1,593 @@ + + + + + + + Class: MCollective::Aggregate::Base + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Aggregate::Base

+ +
+ +
+ + + + + + +
+

Attributes

+ + +
+ + + + +
+ name[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ result[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ output_name[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ action[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ aggregate_format[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ arguments[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(output_name, arguments, aggregate_format, action) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/aggregate/base.rb, line 6
+ 6:       def initialize(output_name, arguments, aggregate_format, action)
+ 7:         @name = self.class.to_s
+ 8:         @output_name = output_name
+ 9: 
+10:         # Any additional arguments passed in the ddl after the output field will
+11:         # be stored in the arguments array which can be used in the function
+12:         @arguments = arguments
+13:         @aggregate_format = aggregate_format
+14:         @action = action
+15:         @result = {:value => nil, :type => nil, :output => output_name}
+16: 
+17:         startup_hook
+18:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + result_class(type) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/aggregate/base.rb, line 35
+35:       def result_class(type)
+36:         Result.const_get("#{type.to_s.capitalize}Result")
+37:       end
+
+ +
+ + +
+ + +
+ + +
+ + summarize() + click to toggle source + +
+ +
+ +

+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 +

+ + + +
+
+    # File lib/mcollective/aggregate/base.rb, line 29
+29:       def summarize
+30:         raise "Result type is not set while trying to summarize aggregate function results" unless @result[:type]
+31: 
+32:         result_class(@result[:type]).new(@result, @aggregate_format, @action)
+33:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Aggregate/Result.html b/doc/MCollective/Aggregate/Result.html new file mode 100644 index 0000000..7f8bd09 --- /dev/null +++ b/doc/MCollective/Aggregate/Result.html @@ -0,0 +1,363 @@ + + + + + + + Module: MCollective::Aggregate::Result + + + + + + + + + + + +
+ + + + +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Aggregate::Result

+ +
+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Aggregate/Result/Base.html b/doc/MCollective/Aggregate/Result/Base.html new file mode 100644 index 0000000..f52b7e2 --- /dev/null +++ b/doc/MCollective/Aggregate/Result/Base.html @@ -0,0 +1,530 @@ + + + + + + + Class: MCollective::Aggregate::Result::Base + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Aggregate::Result::Base

+ +
+ +
+ + + + + + +
+

Attributes

+ + +
+ + + + +
+ result[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ aggregate_format[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ action[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(result, aggregate_format, action) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/aggregate/result/base.rb, line 7
+ 7:         def initialize(result, aggregate_format, action)
+ 8:           raise "No aggregate_format defined in ddl or aggregate function" unless aggregate_format
+ 9: 
+10:           @result = result
+11:           @aggregate_format = aggregate_format
+12:           @action = action
+13:         end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + result_type() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/aggregate/result/base.rb, line 19
+19:         def result_type
+20:           @result[:type]
+21:         end
+
+ +
+ + +
+ + +
+ + +
+ + to_s() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/aggregate/result/base.rb, line 15
+15:         def to_s
+16:           raise "'to_s' method not implemented for result class '#{self.class}'"
+17:         end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Aggregate/Result/CollectionResult.html b/doc/MCollective/Aggregate/Result/CollectionResult.html new file mode 100644 index 0000000..cb6e1e3 --- /dev/null +++ b/doc/MCollective/Aggregate/Result/CollectionResult.html @@ -0,0 +1,403 @@ + + + + + + + Class: MCollective::Aggregate::Result::CollectionResult + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Aggregate::Result::CollectionResult

+ +
+ +
+ + + + + + + + + +
+

Public Instance Methods

+ + +
+ + +
+ + to_s() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/aggregate/result/collection_result.rb, line 5
+ 5:         def to_s
+ 6:           return "" if @result[:value].keys.include?(nil)
+ 7: 
+ 8:           result = StringIO.new
+ 9: 
+10:           @result[:value].sort{|x,y| x[1] <=> y[1]}.reverse.each do |value|
+11:             result.puts @aggregate_format % [value[0], value[1]]
+12:           end
+13: 
+14:           result.string.chomp
+15:         end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Aggregate/Result/NumericResult.html b/doc/MCollective/Aggregate/Result/NumericResult.html new file mode 100644 index 0000000..e38409d --- /dev/null +++ b/doc/MCollective/Aggregate/Result/NumericResult.html @@ -0,0 +1,397 @@ + + + + + + + Class: MCollective::Aggregate::Result::NumericResult + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Aggregate::Result::NumericResult

+ +
+ +
+ + + + + + + + + +
+

Public Instance Methods

+ + +
+ + +
+ + to_s() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+   # File lib/mcollective/aggregate/result/numeric_result.rb, line 5
+5:         def to_s
+6:           return "" if @result[:value].nil?
+7: 
+8:           return @aggregate_format % @result[:value]
+9:         end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/classes/MCollective/Application.html b/doc/MCollective/Application.html similarity index 56% rename from doc/classes/MCollective/Application.html rename to doc/MCollective/Application.html index 7e02d82..662e0e9 100644 --- a/doc/classes/MCollective/Application.html +++ b/doc/MCollective/Application.html @@ -1,271 +1,566 @@ - - - + + - Class: MCollective::Application - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Application
In: - - lib/mcollective/application.rb - -
-
Parent: - Object -
-
- - -
- - - -
- - - -
- - - -
- - - -
-

Included Modules

+ -
- RPC -
-
+ Class: MCollective::Application -
+ + + + + - - - - - - - -
-

Public Class methods

- -
- - - - -
-

-retrieves a specific option + + + +

+
+
+

In Files

+ +
+ + +
+ + + +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Application

+ +
+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + [](option) + click to toggle source + +
+ +
+ +

+retrieves a specific option

-

[Source]

-
+ + + +
     # File lib/mcollective/application.rb, line 20
 20:       def [](option)
 21:         intialize_application_options unless @application_options
 22:         @application_options[option]
-23:       end
-
-
-
-
- -
- - - - -
-

-set an option in the options hash +23: end +

+ +
+ + +
+ + +
+ + +
+ + []=(option, value) + click to toggle source + +
+ +
+ +

+set an option in the options hash

-

[Source]

-
+ + + +
     # File lib/mcollective/application.rb, line 14
 14:       def []=(option, value)
 15:         intialize_application_options unless @application_options
 16:         @application_options[option] = value
-17:       end
-
-
-
-
- -
- - - - -
-

-Intialize a blank set of options if -its the first time used else returns active options +17: end +

+ +
+ + +
+ + +
+ + +
+ + application_options() + click to toggle source + +
+ +
+ +

+Intialize a blank set of options if its the first time used else returns +active options

-

[Source]

-
+ + + +
     # File lib/mcollective/application.rb, line 8
  8:       def application_options
  9:         intialize_application_options unless @application_options
 10:         @application_options
-11:       end
-
-
-
-
- -
- - - - -
-

-Sets the application description, -there can be only one description -per application so multiple calls will just change the description +11: end +

+ +
+ + +
+ + +
+ + +
+ + description(descr) + click to toggle source + +
+ +
+ +

+Sets the application description, there can be only one description per +application so multiple calls will just change the description

-

[Source]

-
+ + + +
     # File lib/mcollective/application.rb, line 28
 28:       def description(descr)
 29:         self[:description] = descr
-30:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+30: end +
+ +
+ + +
+ + +
+ + +
+ + exclude_argument_sections(*sections) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File lib/mcollective/application.rb, line 38
 38:       def exclude_argument_sections(*sections)
@@ -277,28 +572,36 @@ href="Application.html#M000348">description
 44: 
 45:         intialize_application_options unless @application_options
 46:         self[:exclude_arg_sections] = sections
-47:       end
-
-
-
-
- -
- - - - -
-

-Creates an empty set of options +47: end +

+ +
+ + +
+ + +
+ + +
+ + intialize_application_options() + click to toggle source + +
+ +
+ +

+Creates an empty set of options

-

[Source]

-
+ + + +
     # File lib/mcollective/application.rb, line 79
 79:       def intialize_application_options
@@ -306,25 +609,30 @@ Creates an empty set of options
 81:                                 :usage                => [],
 82:                                 :cli_arguments        => [],
 83:                                 :exclude_arg_sections => []}
-84:       end
-
-
-
-
- -
- - - - -
-

-Wrapper to create command line options +84: end +

+ +
+ + +
+ + +
+ + +
+ + option(name, arguments) + click to toggle source + +
+ +
+ +

+Wrapper to create command line options

  - name: varaible name that will be used to access the option value
@@ -341,12 +649,13 @@ href="Application.html#M000354">options
          :arguments   => ["--foo ARG"]
 

-after this the value supplied will be in configuration[:foo] +after this the value supplied will be in configuration[:foo]

-

[Source]

-
+ + + +
     # File lib/mcollective/application.rb, line 65
 65:       def option(name, arguments)
@@ -360,113 +669,146 @@ href="Application.html#M000353">configuration[:foo]
 73:         arguments.each_pair{|k,v| opt[k] = v}
 74: 
 75:         self[:cli_arguments] << opt
-76:       end
-
-
-
-
- -
- - - - -
-

-Supplies usage information, calling -multiple times will create multiple usage lines in —help output +76: end +

+ +
+ + +
+ + +
+ + +
+ + usage(usage) + click to toggle source + +
+ +
+ +

+Supplies usage information, calling multiple times will create multiple +usage lines in —help output

-

[Source]

-
+ + + +
     # File lib/mcollective/application.rb, line 34
 34:       def usage(usage)
 35:         self[:usage] << usage
-36:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

+36: end +

+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + application_cli_arguments() + click to toggle source + +
+ +
+ +

Returns an array of all the arguments built using calls to optin

-

[Source]

-
+ + + +
      # File lib/mcollective/application.rb, line 247
 247:     def application_cli_arguments
 248:       application_options[:cli_arguments]
-249:     end
-
-
-
-
- -
- - - - -
-

-Retrieve the current application description +249: end +

+ +
+ + +
+ + +
+ + +
+ + application_description() + click to toggle source + +
+ +
+ +

+Retrieve the current application description

-

[Source]

-
+ + + +
      # File lib/mcollective/application.rb, line 234
 234:     def application_description
 235:       application_options[:description]
-236:     end
-
-
-
-
- -
- - - - -
-

-Handles failure, if we‘re far enough in the initialization phase it +236: end +

+ +
+ + +
+ + +
+ + +
+ + application_failure(e, err_dest=STDERR) + click to toggle source + +
+ +
+ +

+Handles failure, if we’re far enough in the initialization phase it will log backtraces if its in verbose mode only

-

[Source]

-
+ + + +
      # File lib/mcollective/application.rb, line 253
 253:     def application_failure(e, err_dest=STDERR)
@@ -502,57 +844,71 @@ will log backtraces if its in verbose mode only
 283:       disconnect
 284: 
 285:       exit 1
-286:     end
-
-
-
-
- -
- - - - -
-

-Retrieves the full hash of application options +286: end +

+ +
+ + +
+ + +
+ + +
+ + application_options() + click to toggle source + +
+ +
+ +

+Retrieves the full hash of application options

-

[Source]

-
+ + + +
      # File lib/mcollective/application.rb, line 229
 229:     def application_options
 230:       self.class.application_options
-231:     end
-
-
-
-
- -
- - - - -
-

-Builds an ObjectParser config, parse the CLI options and validates based on the option config +231: end +

+ +
+ + +
+ + +
+ + +
+ + application_parse_options(help=false) + click to toggle source + +
+ +
+ +

+Builds an ObjectParser config, parse the CLI options and validates based on +the option config

-

[Source]

-
+ + + +
      # File lib/mcollective/application.rb, line 135
 135:     def application_parse_options(help=false)
@@ -625,59 +981,73 @@ href="Application.html#M000351">option config
 202:           end
 203:         end
 204:       end
-205:     end
-
-
-
-
- -
- - - - -
-

-Return the current usage text false -if nothing is set +205: end +

+ +
+ + +
+ + +
+ + +
+ + application_usage() + click to toggle source + +
+ +
+ +

+Return the current usage text false if nothing is set

-

[Source]

-
+ + + +
      # File lib/mcollective/application.rb, line 239
 239:     def application_usage
 240:       usage = application_options[:usage]
 241: 
 242:       usage.empty? ? false : usage
-243:     end
-
-
-
-
- -
- - - - -
-

-Creates a standard options hash, -pass in a block to add extra headings etc see Optionparser +243: end +

+ +
+ + +
+ + +
+ + +
+ + clioptions(help) + click to toggle source + +
+ +
+ +

+Creates a standard options hash, pass in a block to add extra headings etc +see Optionparser

-

[Source]

-
+ + + +
      # File lib/mcollective/application.rb, line 111
 111:     def clioptions(help)
@@ -700,112 +1070,145 @@ href="Optionparser.html">Optionparser
 128:       return options
 129:     rescue Exception => e
 130:       application_failure(e)
-131:     end
-
-
-
-
- -
- - - - -
-

-The application configuration built -from CLI arguments +131: end +

+ +
+ + +
+ + +
+ + +
+ + configuration() + click to toggle source + +
+ +
+ +

+The application configuration built from CLI arguments

-

[Source]

-
+ + + +
     # File lib/mcollective/application.rb, line 88
 88:     def configuration
 89:       @application_configuration ||= {}
 90:       @application_configuration
-91:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
+91: end +
+ +
+ + +
+ + +
+ + +
+ + disconnect() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/application.rb, line 310
 310:     def disconnect
 311:       MCollective::PluginManager["connector_plugin"].disconnect
 312:     rescue
-313:     end
-
-
-
-
- -
- - - - -
-

+313: end +

+ +
+ + +
+ + +
+ + +
+ + halt(stats) + click to toggle source + +
+ +
+ +

A helper that creates a consistent exit code for applications by looking at an instance of MCollective::RPC::Stats

Exit with 0 if nodes were discovered and all passed Exit with 0 if no -discovery were done and > 0 responses were received, all ok Exit with 1 -if no nodes were discovered Exit with 2 if nodes were discovered but some -RPC requests failed Exit with 3 if nodes were +discovery were done and > 0 responses were received, all ok Exit with 1 if +no nodes were discovered Exit with 2 if nodes were discovered but some RPC 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

-

[Source]

-
+ + + +
      # File lib/mcollective/application.rb, line 345
 345:     def halt(stats)
 346:       exit(halt_code(stats))
-347:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
+347: end +
+ +
+ + +
+ + +
+ + +
+ + halt_code(stats) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/application.rb, line 322
 322:     def halt_code(stats)
@@ -820,112 +1223,140 @@ and no responses were received
 331:       return 1 if request_stats[:discovered] == 0
 332:       return 0 if request_stats[:discoverytime] == 0 && request_stats[:discovered] == request_stats[:okcount]
 333:       return 0 if request_stats[:discovered] == request_stats[:okcount]
-334:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
+334: end +
+ +
+ + +
+ + +
+ + +
+ + help() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/application.rb, line 288
 288:     def help
 289:       application_parse_options(true)
-290:     end
-
-
-
-
- -
- - - - -
-

+290: end +

+ +
+ + +
+ + +
+ + +
+ + main() + click to toggle source + +
+ +
+ +

Fake abstract class that logs if the user tries to use an application -without supplying a main override -method. +without supplying a main override method.

-

[Source]

-
+ + + +
      # File lib/mcollective/application.rb, line 317
 317:     def main
 318:       STDERR.puts "Applications need to supply a 'main' method"
 319:       exit 1
-320:     end
-
-
-
-
- -
- - - - -
-

-The active options hash used for -MC::Client and other configuration +320: end +

+ +
+ + +
+ + +
+ + +
+ + options() + click to toggle source + +
+ +
+ +

+The active options hash used for MC::Client and other configuration

-

[Source]

-
+ + + +
     # File lib/mcollective/application.rb, line 94
 94:     def options
 95:       @options
-96:     end
-
-
-
-
- -
- - - - -
-

-Wrapper around MC::RPC#rpcclient that -forcably supplies our options hash -if someone forgets to pass in options in an application the filters -and other cli options wouldnt take -effect which could have a disasterous outcome +96: end +

+ +
+ + +
+ + +
+ + +
+ + rpcclient(agent, flags = {}) + click to toggle source + +
+ +
+ +

+Wrapper around MC::RPC#rpcclient that forcably supplies our options hash if +someone forgets to pass in options in an application the filters and other +cli options wouldnt take effect which could have a disasterous outcome

-

[Source]

-
+ + + +
      # File lib/mcollective/application.rb, line 352
 352:     def rpcclient(agent, flags = {})
@@ -933,33 +1364,39 @@ effect which could have a disasterous outcome
 354:       flags[:exit_on_failure] = false
 355: 
 356:       super
-357:     end
-
-
-
-
- -
- - - - -
-

-The main logic loop, builds up the -options, validate configuration and calls the main as supplied by the user. -Disconnects when done and pass any exception onto the application_failure helper +357: end +

+ +
+ + +
+ + +
+ + +
+ + run() + click to toggle source + +
+ +
+ +

+The main logic loop, builds up the options, validate configuration and +calls the main as supplied by the user. Disconnects when done and pass any +exception onto the application_failure helper

-

[Source]

-
+ + + +
      # File lib/mcollective/application.rb, line 295
 295:     def run
@@ -975,25 +1412,34 @@ href="Application.html#M000363">application_failure helper
 305: 
 306:     rescue Exception => e
 307:       application_failure(e)
-308:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
+308: end +
+ +
+ + +
+ + +
+ + +
+ + validate_cli_options() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/application.rb, line 207
 207:     def validate_cli_options
@@ -1015,30 +1461,37 @@ href="Application.html#M000363">application_failure helper
 223:       end
 224: 
 225: 
-226:     end
-
-
-
-
- -
- - - - -
-

-Calls the supplied block in an option for validation, an error raised -will log to STDERR and exit the application +226: end +

+ +
+ + +
+ + +
+ + +
+ + validate_option(blk, name, value) + click to toggle source + +
+ +
+ +

+Calls the supplied block in an option for validation, an error raised will +log to STDERR and exit the application

-

[Source]

-
+ + + +
      # File lib/mcollective/application.rb, line 100
 100:     def validate_option(blk, name, value)
@@ -1048,22 +1501,33 @@ will log to STDERR and exit the application
 104:         STDERR.puts "Validation of #{name} failed: #{validation_result}"
 105:         exit 1
 106:       end
-107:     end
-
-
-
-
+107: end +
+ +
+ +
-
+ +
+ +
-
+
+ +

Disabled; run with --debug to generate this.

+ +
- +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
- \ No newline at end of file + + diff --git a/doc/MCollective/Applications.html b/doc/MCollective/Applications.html new file mode 100644 index 0000000..f0f346a --- /dev/null +++ b/doc/MCollective/Applications.html @@ -0,0 +1,677 @@ + + + + + + + Class: MCollective::Applications + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Applications

+ +
+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + [](appname) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+   # File lib/mcollective/applications.rb, line 3
+3:     def self.[](appname)
+4:       load_application(appname)
+5:       PluginManager["#{appname}_application"]
+6:     end
+
+ +
+ + +
+ + +
+ + +
+ + filter_extra_options(opts) + click to toggle source + +
+ +
+ +

+Filters a string of opts out using Shellwords keeping only things related +to —config and -c +

+ + + +
+
+    # File lib/mcollective/applications.rb, line 49
+49:     def self.filter_extra_options(opts)
+50:       res = ""
+51:       words = Shellwords.shellwords(opts)
+52:       words.each_with_index do |word,idx|
+53:         if word == "-c"
+54:           return "--config=#{words[idx + 1]}"
+55:         elsif word == "--config"
+56:           return "--config=#{words[idx + 1]}"
+57:         elsif word =~ /\-c=/
+58:           return word
+59:         elsif word =~ /\-\-config=/
+60:           return word
+61:         end
+62:       end
+63: 
+64:       return ""
+65:     end
+
+ +
+ + +
+ + +
+ + +
+ + list() + click to toggle source + +
+ +
+ +

+Returns an array of applications found in the lib dirs +

+ + + +
+
+    # File lib/mcollective/applications.rb, line 36
+36:     def self.list
+37:       load_config
+38: 
+39:       PluginManager.find("application")
+40:     rescue SystemExit
+41:       exit 1
+42:     rescue Exception => e
+43:       STDERR.puts "Failed to generate application list: #{e.class}: #{e}"
+44:       exit 1
+45:     end
+
+ +
+ + +
+ + +
+ + +
+ + load_application(appname) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/applications.rb, line 26
+26:     def self.load_application(appname)
+27:       return if PluginManager.include?("#{appname}_application")
+28: 
+29:       load_config
+30: 
+31:       PluginManager.loadclass "MCollective::Application::#{appname.capitalize}"
+32:       PluginManager << {:type => "#{appname}_application", :class => "MCollective::Application::#{appname.capitalize}"}
+33:     end
+
+ +
+ + +
+ + +
+ + +
+ + load_config() + click to toggle source + +
+ +
+ +

+We need to know the config file in order to know the libdir so that we can +find applications. +

+

+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. +

+

+We’re parsing and filtering MCOLLECTIVE_EXTRA_OPTS removing all but +config related options and parsing the options looking just for the config +file. +

+

+We’re handling failures gracefully and finally restoring the ARG and +MCOLLECTIVE_EXTRA_OPTS to the state they were before we started parsing. +

+

+This is mostly a hack, when we’re redoing how config works this stuff +should be made less sucky +

+ + + +
+
+     # File lib/mcollective/applications.rb, line 84
+ 84:     def self.load_config
+ 85:       return if Config.instance.configured
+ 86: 
+ 87:       original_argv = ARGV.clone
+ 88:       original_extra_opts = ENV["MCOLLECTIVE_EXTRA_OPTS"].clone rescue nil
+ 89:       configfile = nil
+ 90: 
+ 91:       parser = OptionParser.new
+ 92:       parser.on("--config CONFIG", "-c", "Config file") do |f|
+ 93:         configfile = f
+ 94:       end
+ 95: 
+ 96:       parser.program_name = $0
+ 97: 
+ 98:       parser.on("--help")
+ 99: 
+100:       # avoid option parsers own internal version handling that sux
+101:       parser.on("-v", "--verbose")
+102: 
+103:       if original_extra_opts
+104:         begin
+105:           # optparse will parse the whole ENV in one go and refuse
+106:           # to play along with the retry trick I do below so in
+107:           # order to handle unknown options properly I parse out
+108:           # only -c and --config deleting everything else and
+109:           # then restore the environment variable later when I
+110:           # am done with it
+111:           ENV["MCOLLECTIVE_EXTRA_OPTS"] = filter_extra_options(ENV["MCOLLECTIVE_EXTRA_OPTS"].clone)
+112:           parser.environment("MCOLLECTIVE_EXTRA_OPTS")
+113:         rescue Exception => e
+114:           Log.error("Failed to parse MCOLLECTIVE_EXTRA_OPTS: #{e}")
+115:         end
+116: 
+117:         ENV["MCOLLECTIVE_EXTRA_OPTS"] = original_extra_opts.clone
+118:       end
+119: 
+120:       begin
+121:         parser.parse!
+122:       rescue OptionParser::InvalidOption => e
+123:         retry
+124:       end
+125: 
+126:       ARGV.clear
+127:       original_argv.each {|a| ARGV << a}
+128: 
+129:       configfile = Util.config_file_for_user unless configfile
+130: 
+131:       Config.instance.loadconfig(configfile)
+132:     end
+
+ +
+ + +
+ + +
+ + +
+ + run(appname) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/applications.rb, line 8
+ 8:     def self.run(appname)
+ 9:       load_config
+10: 
+11:       begin
+12:         load_application(appname)
+13:       rescue Exception => e
+14:         e.backtrace.first << Util.colorize(:red, "  <----")
+15:         STDERR.puts "Application '#{appname}' failed to load:"
+16:         STDERR.puts
+17:         STDERR.puts Util.colorize(:red, "   #{e} (#{e.class})")
+18:         STDERR.puts
+19:         STDERR.puts "       %s" % [e.backtrace.join("\n       ")]
+20:         exit 1
+21:       end
+22: 
+23:       PluginManager["#{appname}_application"].run
+24:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Cache.html b/doc/MCollective/Cache.html new file mode 100644 index 0000000..977ec44 --- /dev/null +++ b/doc/MCollective/Cache.html @@ -0,0 +1,762 @@ + + + + + + + Module: MCollective::Cache + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Cache

+ +
+

+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. +

+

+This cache is setup 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 Agent or something. +

+
+   # sets up a new cache, noop if it already exist
+   Cache.setup(:ddl, 600)
+   => true
+
+   # writes an item to the :ddl cache, this item will
+   # be valid on the cache for 600 seconds
+   Cache.write(:ddl, :something, "value")
+   => "value"
+
+   # reads from the cache, read failures due to non existing
+   # data or expired data will raise an exception
+   Cache.read(:ddl, :something)
+   => "value"
+
+   # time left till expiry, raises if nothing is found
+   Cache.ttl(:ddl, :something)
+   => 500
+
+   # forcibly evict something from the cache
+   Cache.invalidate!(:ddl, :something)
+   => "value"
+
+   # deletes an entire named cache and its mutexes
+   Cache.delete!(:ddl)
+   => true
+
+   # you can also just use this cache as a global mutex store
+   Cache.setup(:mylock)
+
+   Cache.synchronize(:mylock) do
+     do_something()
+   end
+
+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + check_cache!(cache_name) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/cache.rb, line 70
+70:     def self.check_cache!(cache_name)
+71:       raise_code(:PLMC13, "Could not find a cache called '%{cache_name}'", :debug, :cache_name => cache_name) unless has_cache?(cache_name)
+72:     end
+
+ +
+ + +
+ + +
+ + +
+ + delete!(cache_name) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/cache.rb, line 80
+80:     def self.delete!(cache_name)
+81:       check_cache!(cache_name)
+82: 
+83:       @locks_mutex.synchronize do
+84:         @cache_locks.delete(cache_name)
+85:         @cache.delete(cache_name)
+86:       end
+87: 
+88:       true
+89:     end
+
+ +
+ + +
+ + +
+ + +
+ + has_cache?(cache_name) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/cache.rb, line 74
+74:     def self.has_cache?(cache_name)
+75:       @locks_mutex.synchronize do
+76:         @cache.include?(cache_name)
+77:       end
+78:     end
+
+ +
+ + +
+ + +
+ + +
+ + invalidate!(cache_name, key) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/cache.rb, line 139
+139:     def self.invalidate!(cache_name, key)
+140:       check_cache!(cache_name)
+141: 
+142:       @cache_locks[cache_name].synchronize do
+143:         return false unless @cache[cache_name].include?(key)
+144: 
+145:         @cache[cache_name].delete(key)
+146:       end
+147:     end
+
+ +
+ + +
+ + +
+ + +
+ + read(cache_name, key) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/cache.rb, line 103
+103:     def self.read(cache_name, key)
+104:       check_cache!(cache_name)
+105: 
+106:       unless ttl(cache_name, key) > 0
+107:         raise_code(:PLMC11, "Cache expired on '%{cache_name}' key '%{item}'", :debug, :cache_name => cache_name, :item => key)
+108:       end
+109: 
+110:       log_code(:PLMC12, "Cache hit on '%{cache_name}' key '%{item}'", :debug, :cache_name => cache_name, :item => key)
+111: 
+112:       @cache_locks[cache_name].synchronize do
+113:         @cache[cache_name][key][:value]
+114:       end
+115:     end
+
+ +
+ + +
+ + +
+ + +
+ + setup(cache_name, ttl=300) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/cache.rb, line 56
+56:     def self.setup(cache_name, ttl=300)
+57:       @locks_mutex.synchronize do
+58:         break if @cache_locks.include?(cache_name)
+59: 
+60:         @cache_locks[cache_name] = Mutex.new
+61: 
+62:         @cache_locks[cache_name].synchronize do
+63:           @cache[cache_name] = {:max_age => Float(ttl)}
+64:         end
+65:       end
+66: 
+67:       true
+68:     end
+
+ +
+ + +
+ + +
+ + +
+ + synchronize(cache_name) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/cache.rb, line 129
+129:     def self.synchronize(cache_name)
+130:       check_cache!(cache_name)
+131: 
+132:       raise_code(:PLMC14, "No block supplied to synchronize on cache '%{cache_name}'", :debug, :cache_name => cache_name) unless block_given?
+133: 
+134:       @cache_locks[cache_name].synchronize do
+135:         yield
+136:       end
+137:     end
+
+ +
+ + +
+ + +
+ + +
+ + ttl(cache_name, key) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/cache.rb, line 117
+117:     def self.ttl(cache_name, key)
+118:       check_cache!(cache_name)
+119: 
+120:       @cache_locks[cache_name].synchronize do
+121:         unless @cache[cache_name].include?(key)
+122:           raise_code(:PLMC15, "No item called '%{item}' for cache '%{cache_name}'", :debug, :cache_name => cache_name, :item => key)
+123:         end
+124: 
+125:         @cache[cache_name][:max_age] - (Time.now - @cache[cache_name][key][:cache_create_time])
+126:       end
+127:     end
+
+ +
+ + +
+ + +
+ + +
+ + write(cache_name, key, value) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/cache.rb, line 91
+ 91:     def self.write(cache_name, key, value)
+ 92:       check_cache!(cache_name)
+ 93: 
+ 94:       @cache_locks[cache_name].synchronize do
+ 95:         @cache[cache_name][key] ||= {}
+ 96:         @cache[cache_name][key][:cache_create_time] = Time.now
+ 97:         @cache[cache_name][key][:value] = value
+ 98:       end
+ 99: 
+100:       value
+101:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/classes/MCollective/Client.html b/doc/MCollective/Client.html similarity index 57% rename from doc/classes/MCollective/Client.html rename to doc/MCollective/Client.html index 14106d0..3356cd4 100644 --- a/doc/classes/MCollective/Client.html +++ b/doc/MCollective/Client.html @@ -1,172 +1,457 @@ - - - + + - Class: MCollective::Client - - - - - - - - - + -
- - - - - - - - - + Class: MCollective::Client - - - - -
ClassMCollective::Client
In: - - lib/mcollective/client.rb - -
-
Parent: - Object -
-
- + -
+ + + + - - -
- -
-

+ + + +

+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Client

+ +
+

Helpers for writing clients that can talk to agents, do discovery and so forth

-
- - -
- -
-

Methods

- -
- collective   - createreq   - disconnect   - discover   - discovered_req   - display_stats   - new   - receive   - req   - sendreq   - start_publisher   - start_receiver   - subscribe   - threaded_req   - unsubscribe   - unthreaded_req   - update_stat   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - -
discoverer [RW] 
options [RW] 
stats [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
+
+ + + + + + +
+

Attributes

+ + +
+ + + + +
+ options[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ stats[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ discoverer[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(configfile) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File lib/mcollective/client.rb, line 6
  6:     def initialize(configfile)
@@ -182,32 +467,43 @@ forth
 16: 
 17:       @discoverer = Discovery.new(self)
 18:       @connection.connect
-19:     end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Returns the configured main collective if -no specific collective is specified as -options +19: end +

+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + collective() + click to toggle source + +
+ +
+ +

+Returns the configured main collective if no specific collective is +specified as options

-

[Source]

-
+ + + +
     # File lib/mcollective/client.rb, line 23
 23:     def collective
@@ -216,25 +512,34 @@ options
 26:       else
 27:         @options[:collective]
 28:       end
-29:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
+29: end +
+ +
+ + +
+ + +
+ + +
+ + createreq(msg, agent, filter ={}) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File lib/mcollective/client.rb, line 48
 48:     def createreq(msg, agent, filter ={})
@@ -250,50 +555,64 @@ options
 58:       request.encode!
 59:       subscribe(agent, :reply) unless request.reply_to
 60:       request
-61:     end
-
-
-
-
- -
- - - - -
-

+61: end +

+ +
+ + +
+ + +
+ + +
+ + disconnect() + click to toggle source + +
+ +
+ +

Disconnects cleanly from the middleware

-

[Source]

-
+ + + +
     # File lib/mcollective/client.rb, line 32
 32:     def disconnect
 33:       Log.debug("Disconnecting from the middleware")
 34:       @connection.disconnect
-35:     end
-
-
-
-
- -
- - - - -
-

+35: end +

+ +
+ + +
+ + +
+ + +
+ + discover(filter, timeout, limit=0) + click to toggle source + +
+ +
+ +

Performs a discovery of nodes matching the filter passed returns an array of nodes

@@ -301,59 +620,78 @@ of nodes 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

-

[Source]

-
+ + + +
      # File lib/mcollective/client.rb, line 117
 117:     def discover(filter, timeout, limit=0)
 118:       discovered = @discoverer.discover(filter, timeout, limit)
-119:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
+119: end +
+ +
+ + +
+ + +
+ + +
+ + discovered_req(body, agent, options=false) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/client.rb, line 233
 233:     def discovered_req(body, agent, options=false)
 234:       raise "Client#discovered_req has been removed, please port your agent and client to the SimpleRPC framework"
-235:     end
-
-
-
-
- -
- - - - -
-

-Prints out the stats returns from req and -discovered_req in a nice way +235: end +

+ +
+ + +
+ + +
+ + +
+ + display_stats(stats, options=false, caption="stomp call summary") + click to toggle source + +
+ +
+ +

+Prints out the stats returns from req and discovered_req in a nice way

-

[Source]

-
+ + + +
      # File lib/mcollective/client.rb, line 238
 238:     def display_stats(stats, options=false, caption="stomp call summary")
@@ -391,34 +729,42 @@ Prints out the stats returns from req and
 270: 
 271:         puts
 272:       end
-273:     end
-
-
-
-
- -
- - - - -
-

+273: end +

+ +
+ + +
+ + +
+ + +
+ + receive(requestid = nil) + click to toggle source + +
+ +
+ +

Blocking call that waits for ever for a message to arrive.

-If you give it a requestid this means you‘ve previously send a +If you give it a requestid this means you’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.

-

[Source]

-
+ + + +
      # File lib/mcollective/client.rb, line 88
  88:     def receive(requestid = nil)
@@ -442,28 +788,34 @@ at it and keep waiting for more till it finds a matching message.
 106:       end
 107: 
 108:       reply
-109:     end
-
-
-
-
- - + + +
+ + +
+ + +
+ + req(body, agent=nil, options=false, waitfor=0, &block) + click to toggle source + +
+ +
+ +

Send a request, performs the passed block for each response

-times = req("status", -"mcollectived", options, client) {|resp| +times = req(“status”, “mcollectived”, options, +client) {|resp|

   pp resp
@@ -476,9 +828,11 @@ 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
 

-

[Source]

-
+ + + +
      # File lib/mcollective/client.rb, line 129
 129:     def req(body, agent=nil, options=false, waitfor=0, &block)
@@ -510,30 +864,38 @@ href="Optionparser.html">MCollective::Optionparser
 155:       end
 156: 
 157:       return update_stat(stat, hosts_responded, request.requestid)
-158:     end
-
-
-
-
- -
- - - - -
-

-Sends a request and returns the generated request id, doesn‘t wait -for responses and doesn‘t execute any passed in code blocks for +158: end +

+ +
+ + +
+ + +
+ + +
+ + sendreq(msg, agent, filter = {}) + click to toggle source + +
+ +
+ +

+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

-

[Source]

-
+ + + +
     # File lib/mcollective/client.rb, line 39
 39:     def sendreq(msg, agent, filter = {})
@@ -543,28 +905,36 @@ responses
 43: 
 44:       request.publish
 45:       request.requestid
-46:     end
-
-
-
-
- - + + +
+ + +
+ + +
+ + start_publisher(request, publish_timeout) + click to toggle source + +
+ +
+ +

Starts the request publishing routine

-

[Source]

-
+ + + +
      # File lib/mcollective/client.rb, line 191
 191:     def start_publisher(request, publish_timeout)
@@ -577,29 +947,37 @@ Starts the request publishing routine
 198:       rescue Timeout::Error => e
 199:         Log.warn("Could not publish all messages. Publishing timed out.")
 200:       end
-201:     end
-
-
-
-
- - + + +
+ + +
+ + +
+ + start_receiver(requestid, waitfor, timeout, &block) + click to toggle source + +
+ +
+ +

Starts the response receiver routine Expected to return the amount of received responses.

-

[Source]

-
+ + + +
      # File lib/mcollective/client.rb, line 205
 205:     def start_receiver(requestid, waitfor, timeout, &block)
@@ -618,25 +996,34 @@ received responses.
 218:       end
 219: 
 220:       hosts_responded
-221:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
+221: end +
+ +
+ + +
+ + +
+ + +
+ + subscribe(agent, type) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File lib/mcollective/client.rb, line 63
 63:     def subscribe(agent, type)
@@ -647,29 +1034,37 @@ received responses.
 68:         Util.subscribe(subscription)
 69:         @subscriptions[agent] = 1
 70:       end
-71:     end
-
-
-
-
- - + + +
+ + +
+ + +
+ + threaded_req(request, publish_timeout, timeout, waitfor, &block) + click to toggle source + +
+ +
+ +

Starts the client receiver and publisher in threads. This is activated when the ‘threader_client’ configuration option is set.

-

[Source]

-
+ + + +
      # File lib/mcollective/client.rb, line 170
 170:     def threaded_req(request, publish_timeout, timeout, waitfor, &block)
@@ -690,25 +1085,34 @@ the ‘threader_client’ configuration option is set.
 185: 
 186:       receiver.join
 187:       hosts_responded
-188:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
+188: end +
+ +
+ + +
+ + +
+ + +
+ + unsubscribe(agent, type) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File lib/mcollective/client.rb, line 73
 73:     def unsubscribe(agent, type)
@@ -719,53 +1123,70 @@ the ‘threader_client’ configuration option is set.
 78:         Util.unsubscribe(subscription)
 79:         @subscriptions.delete(agent)
 80:       end
-81:     end
-
-
-
-
- - + + +
+ + +
+ + +
+ + unthreaded_req(request, publish_timeout, timeout, waitfor, &block) + click to toggle source + +
+ +
+ +

Starts the client receiver and publisher unthreaded. This is the default client behaviour.

-

[Source]

-
+ + + +
      # File lib/mcollective/client.rb, line 162
 162:     def unthreaded_req(request, publish_timeout, timeout, waitfor, &block)
 163:       start_publisher(request, publish_timeout)
 164:       start_receiver(request.requestid, waitfor, timeout, &block)
-165:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
+165: end +
+ +
+ + +
+ + +
+ + +
+ + update_stat(stat, hosts_responded, requestid) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/client.rb, line 223
 223:     def update_stat(stat, hosts_responded, requestid)
@@ -776,22 +1197,33 @@ client behaviour.
 228:       stat[:requestid] = requestid
 229: 
 230:       @stats = stat
-231:     end
-
-
-
-
+231: end +
+ +
+ +
-
+ +
+ +
-
+
+ +

Disabled; run with --debug to generate this.

+ +
- +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
- \ No newline at end of file + + diff --git a/doc/MCollective/CodedError.html b/doc/MCollective/CodedError.html new file mode 100644 index 0000000..b0897da --- /dev/null +++ b/doc/MCollective/CodedError.html @@ -0,0 +1,543 @@ + + + + + + + Class: MCollective::CodedError + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::CodedError

+ +
+ +
+ + + + + + +
+

Attributes

+ + +
+ + +
+ code[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ args[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ log_level[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ default[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(msgid, default, level=:debug, args={}) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/exception.rb, line 5
+ 5:     def initialize(msgid, default, level=:debug, args={})
+ 6:       @code = msgid
+ 7:       @log_level = level
+ 8:       @args = args
+ 9:       @default = default
+10: 
+11:       msg = Util.t(@code, {:default => default}.merge(@args))
+12: 
+13:       super(msg)
+14:     end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + log(level, log_backtrace=false) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/exception.rb, line 21
+21:     def log(level, log_backtrace=false)
+22:       Log.logexception(@code, level, self, log_backtrace)
+23:     end
+
+ +
+ + +
+ + +
+ + +
+ + set_backtrace(trace) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/exception.rb, line 16
+16:     def set_backtrace(trace)
+17:       super
+18:       log(@log_level)
+19:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Config.html b/doc/MCollective/Config.html new file mode 100644 index 0000000..fafa11d --- /dev/null +++ b/doc/MCollective/Config.html @@ -0,0 +1,1286 @@ + + + + + + + Class: MCollective::Config + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + + + +
+

Included Modules

+ +
+ +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Config

+ +
+

+A pretty sucky config class, ripe for refactoring/improving +

+ +
+ + + + + + +
+

Attributes

+ + +
+ + + + +
+ mode[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ daemonize[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ pluginconf[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ libdir[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ configured[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ logfile[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ keeplogs[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ max_log_size[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ loglevel[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ logfacility[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ identity[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ daemonize[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ connector[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ securityprovider[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ factsource[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ registration[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ registerinterval[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ classesfile[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ rpcauditprovider[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ rpcaudit[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ configdir[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ rpcauthprovider[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ rpcauthorization[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ color[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ configfile[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ rpclimitmethod[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ logger_type[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ fact_cache_time[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ collectives[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ main_collective[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ ssl_cipher[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ registration_collective[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ direct_addressing[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ direct_addressing_threshold[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ ttl[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ default_discovery_method[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ default_discovery_options[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ publish_timeout[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ threaded[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/config.rb, line 20
+20:     def initialize
+21:       @configured = false
+22:     end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + loadconfig(configfile) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/config.rb, line 24
+ 24:     def loadconfig(configfile)
+ 25:       set_config_defaults(configfile)
+ 26: 
+ 27:       if File.exists?(configfile)
+ 28:         File.readlines(configfile).each do |line|
+ 29: 
+ 30:           # strip blank spaces, tabs etc off the end of all lines
+ 31:           line.gsub!(/\s*$/, "")
+ 32: 
+ 33:           unless line =~ /^#|^$/
+ 34:             if (line =~ /(.+?)\s*=\s*(.+)/)
+ 35:               key = $1.strip
+ 36:               val = $2
+ 37: 
+ 38:               case key
+ 39:                 when "registration"
+ 40:                   @registration = val.capitalize
+ 41:                 when "registration_collective"
+ 42:                   @registration_collective = val
+ 43:                 when "registerinterval"
+ 44:                   @registerinterval = val.to_i
+ 45:                 when "collectives"
+ 46:                   @collectives = val.split(",").map {|c| c.strip}
+ 47:                 when "main_collective"
+ 48:                   @main_collective = val
+ 49:                 when "logfile"
+ 50:                   @logfile = val
+ 51:                 when "keeplogs"
+ 52:                   @keeplogs = val.to_i
+ 53:                 when "max_log_size"
+ 54:                   @max_log_size = val.to_i
+ 55:                 when "loglevel"
+ 56:                   @loglevel = val
+ 57:                 when "logfacility"
+ 58:                   @logfacility = val
+ 59:                 when "libdir"
+ 60:                   paths = val.split(File::PATH_SEPARATOR)
+ 61:                   paths.each do |path|
+ 62:                     raise("libdir paths should be absolute paths but '%s' is relative" % path) unless Util.absolute_path?(path)
+ 63: 
+ 64:                     @libdir << path
+ 65:                     unless $LOAD_PATH.include?(path)
+ 66:                       $LOAD_PATH << path
+ 67:                     end
+ 68:                   end
+ 69:                 when "identity"
+ 70:                   @identity = val
+ 71:                 when "direct_addressing"
+ 72:                   @direct_addressing = Util.str_to_bool(val)
+ 73:                 when "direct_addressing_threshold"
+ 74:                   @direct_addressing_threshold = val.to_i
+ 75:                 when "color"
+ 76:                   @color = Util.str_to_bool(val)
+ 77:                 when "daemonize"
+ 78:                   @daemonize = Util.str_to_bool(val)
+ 79:                 when "securityprovider"
+ 80:                   @securityprovider = val.capitalize
+ 81:                 when "factsource"
+ 82:                   @factsource = val.capitalize
+ 83:                 when "connector"
+ 84:                   @connector = val.capitalize
+ 85:                 when "classesfile"
+ 86:                   @classesfile = val
+ 87:                 when /^plugin.(.+)$/
+ 88:                   @pluginconf[$1] = val
+ 89:                 when "publish_timeout"
+ 90:                   @publish_timeout = val.to_i
+ 91:                 when "rpcaudit"
+ 92:                   @rpcaudit = Util.str_to_bool(val)
+ 93:                 when "rpcauditprovider"
+ 94:                   @rpcauditprovider = val.capitalize
+ 95:                 when "rpcauthorization"
+ 96:                   @rpcauthorization = Util.str_to_bool(val)
+ 97:                 when "rpcauthprovider"
+ 98:                   @rpcauthprovider = val.capitalize
+ 99:                 when "rpclimitmethod"
+100:                   @rpclimitmethod = val.to_sym
+101:                 when "logger_type"
+102:                   @logger_type = val
+103:                 when "fact_cache_time"
+104:                   @fact_cache_time = val.to_i
+105:                 when "ssl_cipher"
+106:                   @ssl_cipher = val
+107:                 when "threaded"
+108:                   @threaded = Util.str_to_bool(val)
+109:                 when "ttl"
+110:                   @ttl = val.to_i
+111:                 when "default_discovery_options"
+112:                   @default_discovery_options << val
+113:                 when "default_discovery_method"
+114:                   @default_discovery_method = val
+115:                 else
+116:                   raise("Unknown config parameter '#{key}'")
+117:               end
+118:             end
+119:           end
+120:         end
+121: 
+122:         raise('The %s config file does not specify a libdir setting, cannot continue' % configfile) if @libdir.empty?
+123: 
+124:         I18n.load_path = Dir[File.expand_path(File.join(File.dirname(__FILE__), "locales", "*.yml"))]
+125:         I18n.locale = :en
+126: 
+127:         read_plugin_config_dir("#{@configdir}/plugin.d")
+128: 
+129:         raise 'Identities can only match /\w\.\-/' unless @identity.match(/^[\w\.\-]+$/)
+130: 
+131:         @configured = true
+132: 
+133:         @libdir.each {|dir| Log.warn("Cannot find libdir: #{dir}") unless File.directory?(dir)}
+134: 
+135:         if @logger_type == "syslog"
+136:           raise "The sylog logger is not usable on the Windows platform" if Util.windows?
+137:         end
+138: 
+139:         PluginManager.loadclass("Mcollective::Facts::#{@factsource}_facts")
+140:         PluginManager.loadclass("Mcollective::Connector::#{@connector}")
+141:         PluginManager.loadclass("Mcollective::Security::#{@securityprovider}")
+142:         PluginManager.loadclass("Mcollective::Registration::#{@registration}")
+143:         PluginManager.loadclass("Mcollective::Audit::#{@rpcauditprovider}") if @rpcaudit
+144:         PluginManager << {:type => "global_stats", :class => RunnerStats.new}
+145: 
+146:         Log.logmsg(:PLMC1, "The Marionette Collective version %{version} started by %{name} using config file %{config}", :info, :version => MCollective::VERSION, :name => $0, :config => configfile)
+147:       else
+148:         raise("Cannot find config file '#{configfile}'")
+149:       end
+150:     end
+
+ +
+ + +
+ + +
+ + +
+ + read_plugin_config_dir(dir) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/config.rb, line 192
+192:     def read_plugin_config_dir(dir)
+193:       return unless File.directory?(dir)
+194: 
+195:       Dir.new(dir).each do |pluginconfigfile|
+196:         next unless pluginconfigfile =~ /^([\w]+).cfg$/
+197: 
+198:         plugin = $1
+199:         File.open("#{dir}/#{pluginconfigfile}", "r").each do |line|
+200:           # strip blank lines
+201:           line.gsub!(/\s*$/, "")
+202:           next if line =~ /^#|^$/
+203:           if (line =~ /(.+?)\s*=\s*(.+)/)
+204:             key = $1.strip
+205:             val = $2
+206:             @pluginconf["#{plugin}.#{key}"] = val
+207:           end
+208:         end
+209:       end
+210:     end
+
+ +
+ + +
+ + +
+ + +
+ + set_config_defaults(configfile) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/config.rb, line 152
+152:     def set_config_defaults(configfile)
+153:       @stomp = Hash.new
+154:       @subscribe = Array.new
+155:       @pluginconf = Hash.new
+156:       @connector = "activemq"
+157:       @securityprovider = "Psk"
+158:       @factsource = "Yaml"
+159:       @identity = Socket.gethostname
+160:       @registration = "Agentlist"
+161:       @registerinterval = 0
+162:       @registration_collective = nil
+163:       @classesfile = "/var/lib/puppet/state/classes.txt"
+164:       @rpcaudit = false
+165:       @rpcauditprovider = ""
+166:       @rpcauthorization = false
+167:       @rpcauthprovider = ""
+168:       @configdir = File.dirname(configfile)
+169:       @color = !Util.windows?
+170:       @configfile = configfile
+171:       @logger_type = "file"
+172:       @keeplogs = 5
+173:       @max_log_size = 2097152
+174:       @rpclimitmethod = :first
+175:       @libdir = Array.new
+176:       @fact_cache_time = 300
+177:       @loglevel = "info"
+178:       @logfacility = "user"
+179:       @collectives = ["mcollective"]
+180:       @main_collective = @collectives.first
+181:       @ssl_cipher = "aes-256-cbc"
+182:       @direct_addressing = true
+183:       @direct_addressing_threshold = 10
+184:       @default_discovery_method = "mc"
+185:       @default_discovery_options = []
+186:       @ttl = 60
+187:       @mode = :client
+188:       @publish_timeout = 2
+189:       @threaded = false
+190:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Connector.html b/doc/MCollective/Connector.html new file mode 100644 index 0000000..37cf8b1 --- /dev/null +++ b/doc/MCollective/Connector.html @@ -0,0 +1,397 @@ + + + + + + + Module: MCollective::Connector + + + + + + + + + + + +
+
+ + + +
+ +
+ + + + + + +
+

Namespace

+ +
+ + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Connector

+ +
+

+Connectors take care of transporting messages between clients and agents, +the design doesn’t your middleware to be very rich in features. All +it really needs is the ability to send and receive messages to named +queues/topics. +

+

+At present there are assumptions about the naming of topics and queues that +is compatible with Stomp, ie. +

+

+/topic/foo.bar/baz /queue/foo.bar/baz +

+

+This is the only naming format that is supported, but you could replace +Stomp with something else that supports the above, see +MCollective::Connector::Stomp for the default connector. +

+

+Connector plugins handle the communications +with the middleware, you can provide your own to speak to something other +than Stomp, your plugins must inherit from MCollective::Connector::Base and should +provide the following methods: +

+

+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 +

+
+                was received.  It should get data from all subscribed channels/topics.  Individual messages
+                should be returned as MCollective::Request objects with the payload provided
+
+

+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 +

+

+These methods are all that’s needed for a new connector protocol and +should hopefully be simple enough to not have tied us to Stomp. +

+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Connector/Base.html b/doc/MCollective/Connector/Base.html new file mode 100644 index 0000000..317144b --- /dev/null +++ b/doc/MCollective/Connector/Base.html @@ -0,0 +1,395 @@ + + + + + + + Class: MCollective::Connector::Base + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Connector::Base

+ +
+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + inherited(klass) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/connector/base.rb, line 19
+19:       def self.inherited(klass)
+20:         PluginManager << {:type => "connector_plugin", :class => klass.to_s}
+21:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/DDL.html b/doc/MCollective/DDL.html new file mode 100644 index 0000000..8c2c028 --- /dev/null +++ b/doc/MCollective/DDL.html @@ -0,0 +1,670 @@ + + + + + + + Module: MCollective::DDL + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::DDL

+ +
+

+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 +

+

+DDL files are used for input validation, +constructing outputs, producing online help, informing the various display +routines and so forth. +

+

+A sample DDL for an agent be seen below, you’d +put this in your agent dir as .ddl +

+
+   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://mcollective-plugins.googlecode.com/",
+            :timeout     => 60
+
+   action "status", :description => "Gets the status of a service" do
+      display :always
+
+      input :service,
+            :prompt      => "Service Name",
+            :description => "The service to get the status for",
+            :type        => :string,
+            :validation  => '^[a-zA-Z\-_\d]+$',
+            :optional    => true,
+            :maxlength   => 30
+
+      output :status,
+             :description => "The status of service",
+             :display_as  => "Service Status"
+  end
+
+

+There are now many types of DDL and ultimately all +pugins should have DDL files. The code is organized +so that any plugin type will magically just work - they will be an instane +of Base which has metadata and a few common +cases. +

+

+For plugin types that require more specific behaviors they can just add a +class here that inherits from Base and add +their specific behavior. +

+

+Base defines a specific behavior for input, +output and metadata which we’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 AgentDDL class for an +example where agents want a :required argument to be always set. +

+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + load_and_cache(*args) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/ddl.rb, line 71
+71:     def self.load_and_cache(*args)
+72:       Cache.setup(:ddl, 300)
+73: 
+74:       plugin = args.first
+75:       args.size > 1 ? type = args[1].to_s : type = "agent"
+76:       path = "%s/%s" % [type, plugin]
+77: 
+78:       begin
+79:         ddl = Cache.read(:ddl, path)
+80:       rescue
+81:         begin
+82:           klass = DDL.const_get("%sDDL" % type.capitalize)
+83:         rescue NameError
+84:           klass = Base
+85:         end
+86: 
+87:         ddl = Cache.write(:ddl, path, klass.new(*args))
+88:       end
+89: 
+90:       return ddl
+91:     end
+
+ +
+ + +
+ + +
+ + +
+ + new(*args, &blk) + click to toggle source + +
+ +
+ +

+There used to be only one big nasty DDL class with a +bunch of mashed together behaviors. It’s been around for ages and we +would rather not ask all the users to change their DDL.new calls to some other factory method that +would have this exact same behavior. +

+

+So we override the behavior of new which is +a hugely sucky thing to do but ultimately it’s what would be least +disrupting to code out there today. We did though change DDL to a module to make it possibly a little less +suprising, possibly. +

+ + + +
+
+    # File lib/mcollective/ddl.rb, line 67
+67:     def self.new(*args, &blk)
+68:       load_and_cache(*args)
+69:     end
+
+ +
+ + +
+ + +
+ + +
+ + string_to_boolean(val) + click to toggle source + +
+ +
+ +

+As we’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 “true”/“yes” or +“false”/“no” turn them into the matching boolean +

+ + + +
+
+     # File lib/mcollective/ddl.rb, line 98
+ 98:     def self.string_to_boolean(val)
+ 99:       return true if ["true", "t", "yes", "y", "1"].include?(val.downcase)
+100:       return false if ["false", "f", "no", "n", "0"].include?(val.downcase)
+101: 
+102:       raise_code(:PLMC17, "%{value} does not look like a boolean argument", :debug, :value => val)
+103:     end
+
+ +
+ + +
+ + +
+ + +
+ + string_to_number(val) + click to toggle source + +
+ +
+ +

+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 +

+ + + +
+
+     # File lib/mcollective/ddl.rb, line 108
+108:     def self.string_to_number(val)
+109:       return val.to_f if val =~ /^\d+\.\d+$/
+110:       return val.to_i if val =~ /^\d+$/
+111: 
+112:       raise_code(:PLMC16, "%{value} does not look like a numeric value", :debug, :value => val)
+113:     end
+
+ +
+ + +
+ + +
+ + +
+ + validation_fail!(code, default, level, args={}) + click to toggle source + +
+ +
+ +

+Various DDL implementations will validate and raise +on error, this is a utility method to correctly setup a DDLValidationError exceptions and raise +them +

+ + + +
+
+     # File lib/mcollective/ddl.rb, line 117
+117:     def self.validation_fail!(code, default, level, args={})
+118:       exception = DDLValidationError.new(code, default, level, args)
+119:       exception.set_backtrace caller
+120: 
+121:       raise exception
+122:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/DDL/AgentDDL.html b/doc/MCollective/DDL/AgentDDL.html new file mode 100644 index 0000000..c273898 --- /dev/null +++ b/doc/MCollective/DDL/AgentDDL.html @@ -0,0 +1,960 @@ + + + + + + + Class: MCollective::DDL::AgentDDL + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::DDL::AgentDDL

+ +
+

+A DDL class specific to agent plugins. +

+

+A full DDL can be seen below with all the +possible bells and whistles present. +

+

+metadata :name => “Utilities and Helpers for SimpleRPC Agents”, +

+
+            :description => "General helpful actions that expose stats and internals to SimpleRPC clients",
+            :author      => "R.I.Pienaar <rip@devco.net>",
+            :license     => "Apache License, Version 2.0",
+            :version     => "1.0",
+            :url         => "http://marionette-collective.org/",
+            :timeout     => 10
+
+

+action “get_fact“, :description => “Retrieve a single +fact from the fact store” do +

+
+     display :always
+
+     input :fact,
+           :prompt      => "The name of the fact",
+           :description => "The fact to retrieve",
+           :type        => :string,
+           :validation  => '^[\w\-\.]+$',
+           :optional    => false,
+           :maxlength   => 40,
+           :default     => "fqdn"
+
+     output :fact,
+            :description => "The name of the fact being returned",
+            :display_as  => "Fact"
+
+     output :value,
+            :description => "The value of the fact",
+            :display_as  => "Value",
+            :default     => ""
+
+    summarize do
+        aggregate summary(:value)
+    end
+
+

+end +

+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(plugin, plugintype=:agent, loadddl=true) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/ddl/agentddl.rb, line 41
+41:       def initialize(plugin, plugintype=:agent, loadddl=true)
+42:         @process_aggregate_functions = nil
+43: 
+44:         super
+45:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + action(name, input, &block) + click to toggle source + +
+ +
+ +

+Creates the definition for an action, you can nest input definitions inside +the action to attach inputs and validation to the actions +

+
+   action "status", :description => "Restarts a Service" do
+      display :always
+
+      input  "service",
+             :prompt      => "Service Action",
+             :description => "The action to perform",
+             :type        => :list,
+             :optional    => true,
+             :list        => ["start", "stop", "restart", "status"]
+
+      output "status",
+             :description => "The status of the service after the action"
+
+   end
+
+ + + +
+
+     # File lib/mcollective/ddl/agentddl.rb, line 112
+112:       def action(name, input, &block)
+113:         raise "Action needs a :description property" unless input.include?(:description)
+114: 
+115:         unless @entities.include?(name)
+116:           @entities[name] = {}
+117:           @entities[name][:action] = name
+118:           @entities[name][:input] = {}
+119:           @entities[name][:output] = {}
+120:           @entities[name][:display] = :failed
+121:           @entities[name][:description] = input[:description]
+122:         end
+123: 
+124:         # if a block is passed it might be creating input methods, call it
+125:         # we set @current_entity so the input block can know what its talking
+126:         # to, this is probably an epic hack, need to improve.
+127:         @current_entity = name
+128:         block.call if block_given?
+129:         @current_entity = nil
+130:       end
+
+ +
+ + +
+ + +
+ + +
+ + action_interface(name) + click to toggle source + +
+ +
+ +

+Returns the interface for a specific action +

+ + + +
+
+     # File lib/mcollective/ddl/agentddl.rb, line 198
+198:       def action_interface(name)
+199:         @entities[name] || {}
+200:       end
+
+ +
+ + +
+ + +
+ + +
+ + actions() + click to toggle source + +
+ +
+ +

+Returns an array of actions this agent support +

+ + + +
+
+     # File lib/mcollective/ddl/agentddl.rb, line 203
+203:       def actions
+204:         @entities.keys
+205:       end
+
+ +
+ + +
+ + +
+ + +
+ + aggregate(function, format = {:format => nil}) + click to toggle source + +
+ +
+ +

+Sets the aggregate array for the given action +

+ + + +
+
+    # File lib/mcollective/ddl/agentddl.rb, line 70
+70:       def aggregate(function, format = {:format => nil})
+71:         DDL.validation_fail!(:PLMC28, "Formats supplied to aggregation functions should be a hash", :error) unless format.is_a?(Hash)
+72:         DDL.validation_fail!(:PLMC27, "Formats supplied to aggregation functions must have a :format key", :error) unless format.keys.include?(:format)
+73:         DDL.validation_fail!(:PLMC26, "Functions supplied to aggregate should be a hash", :error) unless function.is_a?(Hash)
+74: 
+75:         unless (function.keys.include?(:args)) && function[:args]
+76:           DDL.validation_fail!(:PLMC25, "aggregate method for action '%{action}' missing a function parameter", :error, :action => entities[@current_entity][:action])
+77:         end
+78: 
+79:         entities[@current_entity][:aggregate] ||= []
+80:         entities[@current_entity][:aggregate] << (format[:format].nil? ? function : function.merge(format))
+81:       end
+
+ +
+ + +
+ + +
+ + +
+ + display(pref) + click to toggle source + +
+ +
+ +

+Sets the display preference to either :ok, :failed, :flatten or :always +operates on action level +

+ + + +
+
+    # File lib/mcollective/ddl/agentddl.rb, line 85
+85:       def display(pref)
+86:         # defaults to old behavior, complain if its supplied and invalid
+87:         unless [:ok, :failed, :flatten, :always].include?(pref)
+88:           raise "Display preference #{pref} is not valid, should be :ok, :failed, :flatten or :always"
+89:         end
+90: 
+91:         action = @current_entity
+92:         @entities[action][:display] = pref
+93:       end
+
+ +
+ + +
+ + +
+ + +
+ + input(argument, properties) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/ddl/agentddl.rb, line 47
+47:       def input(argument, properties)
+48:         raise "Input needs a :optional property" unless properties.include?(:optional)
+49: 
+50:         super
+51:       end
+
+ +
+ + +
+ + +
+ + +
+ + is_function?(method_name) + click to toggle source + +
+ +
+ +

+Checks if a method name matches a aggregate plugin. This is used by method +missing so that we dont greedily assume that every method_missing call in an agent ddl has +hit a aggregate function. +

+ + + +
+
+     # File lib/mcollective/ddl/agentddl.rb, line 146
+146:       def is_function?(method_name)
+147:         PluginManager.find("aggregate").include?(method_name.to_s)
+148:       end
+
+ +
+ + +
+ + +
+ + +
+ + method_missing(name, *args, &block) + click to toggle source + +
+ +
+ +

+If the method name matches a # aggregate 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 summarize block +

+ + + +
+
+     # File lib/mcollective/ddl/agentddl.rb, line 135
+135:       def method_missing(name, *args, &block)
+136:         unless @process_aggregate_functions || is_function?(name)
+137:           raise NoMethodError, "undefined local variable or method `#{name}'", caller
+138:         end
+139: 
+140:         return {:function => name, :args => args}
+141:       end
+
+ +
+ + +
+ + +
+ + +
+ + set_default_input_arguments(action, arguments) + click to toggle source + +
+ +
+ +

+For a given action and arguments look up the DDL +interface to that action and if any arguments in the DDL have a :default value assign that to any input +that does not have an argument in the input arguments +

+

+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 input validation +

+ + + +
+
+     # File lib/mcollective/ddl/agentddl.rb, line 159
+159:       def set_default_input_arguments(action, arguments)
+160:         input = action_interface(action)[:input]
+161: 
+162:         return unless input
+163: 
+164:         input.keys.each do |key|
+165:           if !arguments.include?(key) && !input[key][:default].nil? && !input[key][:optional]
+166:             Log.debug("Setting default value for input '%s' to '%s'" % [key, input[key][:default]])
+167:             arguments[key] = input[key][:default]
+168:           end
+169:         end
+170:       end
+
+ +
+ + +
+ + +
+ + +
+ + summarize(&block) + click to toggle source + +
+ +
+ +

+Calls the summarize block defined in the ddl. Block will not be called if +the ddl is getting processed on the server side. This means that aggregate +plugins only have to be present on the client side. +

+

+The @process_aggregate_functions variable is used by the method_missing block to determine if it +should kick in, this way we very tightly control where we activate the method_missing behavior turning it into a +noop otherwise to maximise the chance of providing good user feedback +

+ + + +
+
+    # File lib/mcollective/ddl/agentddl.rb, line 61
+61:       def summarize(&block)
+62:         unless @config.mode == :server
+63:           @process_aggregate_functions = true
+64:           block.call
+65:           @process_aggregate_functions = nil
+66:         end
+67:       end
+
+ +
+ + +
+ + +
+ + +
+ + validate_rpc_request(action, arguments) + click to toggle source + +
+ +
+ +

+Helper to use the DDL to figure out if the remote +call to an agent should be allowed based on action name and inputs. +

+ + + +
+
+     # File lib/mcollective/ddl/agentddl.rb, line 174
+174:       def validate_rpc_request(action, arguments)
+175:         # is the action known?
+176:         unless actions.include?(action)
+177:           DDL.validation_fail!(:PLMC29, "Attempted to call action %{action} for %{plugin} but it's not declared in the DDL", :debug, :action => action, :plugin => @pluginname)
+178:         end
+179: 
+180:         input = action_interface(action)[:input] || {}
+181: 
+182:         input.keys.each do |key|
+183:           unless input[key][:optional]
+184:             unless arguments.keys.include?(key)
+185:               DDL.validation_fail!(:PLMC30, "Action '%{action}' needs a '%{key}' argument", :debug, :action => action, :key => key)
+186:             end
+187:           end
+188: 
+189:           if arguments.keys.include?(key)
+190:             validate_input_argument(input, key, arguments[key])
+191:           end
+192:         end
+193: 
+194:         true
+195:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/classes/MCollective/DDL/Base.html b/doc/MCollective/DDL/Base.html similarity index 53% rename from doc/classes/MCollective/DDL/Base.html rename to doc/MCollective/DDL/Base.html index 0ffb57d..7625233 100644 --- a/doc/classes/MCollective/DDL/Base.html +++ b/doc/MCollective/DDL/Base.html @@ -1,85 +1,364 @@ - - - + + - Class: MCollective::DDL::Base - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::DDL::Base
In: - - lib/mcollective/ddl/base.rb - -
-
Parent: - Object -
-
- - -
+ + Class: MCollective::DDL::Base + -
+ + + + -
-

+ + + +

+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + + + +
+

Included Modules

+ +
+ +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::DDL::Base

+ +
+

The base class for all kinds of DDL files. DDL files when run gets parsed and builds up a hash of the basic primitive types, ideally restricted so it can be converted to @@ -88,119 +367,147 @@ laster on.

The Hash being built should be stored in @entities, the format is generally -not prescribed but there‘s a definite feel to how DDL files look so study the agent and discovery ones to see how the structure applies to very different use cases.

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 ‘metadata’ in your plugin DDL then add a PlugintypeDDL class here and add your specific behaviors to those.

-
- - -
- -
-

Methods

- -
- findddlfile   - help   - input   - loadddlfile   - metadata   - new   - output   - requires   - template_for_plugintype   - usage   - validate_input_argument   - validate_requirements   -
-
- -
- - - -
-

Included Modules

- - -
- -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
entities [R] 
meta [R] 
pluginname [R] 
plugintype [R] 
requirements [R] 
usage [R] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
+
+ + + + + + +
+

Attributes

+ + +
+ + +
+ meta[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ entities[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ pluginname[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ plugintype[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ usage[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ requirements[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(plugin, plugintype=:agent, loadddl=true) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File lib/mcollective/ddl/base.rb, line 24
 24:       def initialize(plugin, plugintype=:agent, loadddl=true)
@@ -213,27 +520,40 @@ specific behaviors to those.
 31:         @requirements = {}
 32: 
 33:         loadddlfile if loadddl
-34:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
+34: end +
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + findddlfile(ddlname=nil, ddltype=nil) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/ddl/base.rb, line 89
  89:       def findddlfile(ddlname=nil, ddltype=nil)
@@ -248,26 +568,31 @@ specific behaviors to those.
  98:           end
  99:         end
 100:         return false
-101:       end
-
-
-
-
- -
- - - - -
-

-Generates help using the template based on -the data created with metadata and input. +101: end +

+ +
+ + +
+ + +
+ + +
+ + help(template=nil) + click to toggle source + +
+ +
+ +

+Generates help using the template based on the data created with metadata +and input.

If no template name is provided one will be chosen based on the plugin @@ -275,9 +600,11 @@ 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

-

[Source]

-
+ + + +
     # File lib/mcollective/ddl/base.rb, line 44
 44:       def help(template=nil)
@@ -297,32 +624,39 @@ be loaded either from the config dir and if that does not exist, default to
 58: 
 59:         erb = ERB.new(template, 0, '%')
 60:         erb.result(binding)
-61:       end
-
-
-
-
- -
- - - - -
-

-Registers an input argument for a given -action +61: end +

+ +
+ + +
+ + +
+ + +
+ + input(argument, properties) + click to toggle source + +
+ +
+ +

+Registers an input argument for a given action

See the documentation for action for how to use this

-

[Source]

-
+ + + +
      # File lib/mcollective/ddl/base.rb, line 153
 153:       def input(argument, properties)
@@ -353,25 +687,34 @@ See the documentation for action for how to use this
 178: 
 179:             @entities[entity][:input][argument][:list] = properties[:list]
 180:         end
-181:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+181: end +
+ +
+ + +
+ + +
+ + +
+ + loadddlfile() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File lib/mcollective/ddl/base.rb, line 81
 81:       def loadddlfile
@@ -380,28 +723,36 @@ See the documentation for action for how to use this
 84:         else
 85:           raise_code(:PLMC40, "Can't find DDL for %{type} plugin '%{name}'", :debug, :type => @plugintype, :name => @pluginname)
 86:         end
-87:       end
-
-
-
-
- -
- - - - -
-

+87: end +

+ +
+ + +
+ + +
+ + +
+ + metadata(meta) + click to toggle source + +
+ +
+ +

Registers meta data for the introspection hash

-

[Source]

-
+ + + +
      # File lib/mcollective/ddl/base.rb, line 215
 215:       def metadata(meta)
@@ -410,32 +761,39 @@ Registers meta data for the introspection hash
 218:         end
 219: 
 220:         @meta = meta
-221:       end
-
-
-
-
- -
- - - - -
-

-Registers an output argument for a given -action +221: end +

+ +
+ + +
+ + +
+ + +
+ + output(argument, properties) + click to toggle source + +
+ +
+ +

+Registers an output argument for a given action

See the documentation for action for how to use this

-

[Source]

-
+ + + +
      # File lib/mcollective/ddl/base.rb, line 186
 186:       def output(argument, properties)
@@ -448,25 +806,34 @@ See the documentation for action for how to use this
 193:         @entities[action][:output][argument] = {:description => properties[:description],
 194:                                                 :display_as  => properties[:display_as],
 195:                                                 :default     => properties[:default]}
-196:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+196: end +
+ +
+ + +
+ + +
+ + +
+ + requires(requirement) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/ddl/base.rb, line 198
 198:       def requires(requirement)
@@ -483,25 +850,34 @@ See the documentation for action for how to use this
 209:         end
 210: 
 211:         validate_requirements
-212:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+212: end +
+ +
+ + +
+ + +
+ + +
+ + template_for_plugintype() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File lib/mcollective/ddl/base.rb, line 67
 67:       def template_for_plugintype
@@ -516,47 +892,62 @@ See the documentation for action for how to use this
 76:             return "metadata-help.erb"
 77:           end
 78:         end
-79:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+79: end +
+ +
+ + +
+ + +
+ + +
+ + usage(usage_text) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File lib/mcollective/ddl/base.rb, line 63
 63:       def usage(usage_text)
 64:         @usage = usage_text
-65:       end
-
-
-
-
- -
- - - - -
-

-validate strings, lists and booleans, we‘ll add more types of +65: end +

+ +
+ + +
+ + +
+ + +
+ + validate_input_argument(input, key, argument) + click to toggle source + +
+ +
+ +

+validate strings, lists and booleans, we’ll add more types of validators when all the use cases are clear

@@ -568,9 +959,11 @@ safe assumption, just to skip them. :string can have maxlength and regex. A maxlength of 0 will bypasss checks :list has a array of valid values

-

[Source]

-
+ + + +
      # File lib/mcollective/ddl/base.rb, line 127
 127:       def validate_input_argument(input, key, argument)
@@ -594,25 +987,34 @@ safe assumption, just to skip them.
 145:         return true
 146:       rescue => e
 147:         DDL.validation_fail!(:PLMC21, "Cannot validate input '%{input}': %{error}", :debug, :input => key, :error => e.to_s)
-148:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+148: end +
+ +
+ + +
+ + +
+ + +
+ + validate_requirements() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/ddl/base.rb, line 103
 103:       def validate_requirements
@@ -628,22 +1030,33 @@ safe assumption, just to skip them.
 113:         end
 114: 
 115:         true
-116:       end
-
-
-
-
+116: end +
+ +
+ +
-
+ +
+ +
-
+
+ +

Disabled; run with --debug to generate this.

+ +
- +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
- \ No newline at end of file + + diff --git a/doc/MCollective/DDL/DataDDL.html b/doc/MCollective/DDL/DataDDL.html new file mode 100644 index 0000000..a98eb0e --- /dev/null +++ b/doc/MCollective/DDL/DataDDL.html @@ -0,0 +1,516 @@ + + + + + + + Class: MCollective::DDL::DataDDL + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::DDL::DataDDL

+ +
+

+A DDL file for the data query plugins. +

+

+Query plugins can today take only one input by convention in the DDL that is called :query, otherwise the input is +identical to the standard input. +

+

+metadata :name => “Agent”, +

+
+            :description => "Meta data about installed MColletive Agents",
+            :author      => "R.I.Pienaar <rip@devco.net>",
+            :license     => "ASL 2.0",
+            :version     => "1.0",
+            :url         => "http://marionette-collective.org/",
+            :timeout     => 1
+
+

+dataquery :description => “Agent Meta +Data” do +

+
+    input :query,
+          :prompt => "Agent Name",
+          :description => "Valid agent name",
+          :type => :string,
+          :validation => /^[\w\_]+$/,
+          :maxlength => 20
+
+    [:license, :timeout, :description, :url, :version, :author].each do |item|
+      output item,
+             :description => "Agent #{item}",
+             :display_as => item.to_s.capitalize
+    end
+
+

+end +

+ +
+ + + + + + + + + +
+

Public Instance Methods

+ + +
+ + +
+ + dataquery(input, &block) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/ddl/dataddl.rb, line 31
+31:       def dataquery(input, &block)
+32:         raise "Data queries need a :description" unless input.include?(:description)
+33:         raise "Data queries can only have one definition" if @entities[:data]
+34: 
+35:         @entities[:data]  = {:description => input[:description],
+36:                              :input => {},
+37:                              :output => {}}
+38: 
+39:         @current_entity = :data
+40:         block.call if block_given?
+41:         @current_entity = nil
+42:       end
+
+ +
+ + +
+ + +
+ + +
+ + dataquery_interface() + click to toggle source + +
+ +
+ +

+Returns the interface for the data query +

+ + + +
+
+    # File lib/mcollective/ddl/dataddl.rb, line 51
+51:       def dataquery_interface
+52:         @entities[:data] || {}
+53:       end
+
+ +
+ + +
+ + +
+ + +
+ + input(argument, properties) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/ddl/dataddl.rb, line 44
+44:       def input(argument, properties)
+45:         raise "The only valid input name for a data query is 'query'" if argument != :query
+46: 
+47:         super
+48:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/DDL/DiscoveryDDL.html b/doc/MCollective/DDL/DiscoveryDDL.html new file mode 100644 index 0000000..2f373b5 --- /dev/null +++ b/doc/MCollective/DDL/DiscoveryDDL.html @@ -0,0 +1,512 @@ + + + + + + + Class: MCollective::DDL::DiscoveryDDL + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::DDL::DiscoveryDDL

+ +
+

+DDL for discovery plugins, a full example can be +seen below +

+

+metadata :name => “mc”, +

+
+            :description => "MCollective Broadcast based discovery",
+            :author      => "R.I.Pienaar <rip@devco.net>",
+            :license     => "ASL 2.0",
+            :version     => "0.1",
+            :url         => "http://marionette-collective.org/",
+            :timeout     => 2
+
+

+discovery do +

+
+    capabilities [:classes, :facts, :identity, :agents, :compound]
+
+

+end +

+ +
+ + + + + + + + + +
+

Public Instance Methods

+ + +
+ + +
+ + capabilities(*caps) + click to toggle source + +
+ +
+ +

+records valid capabilities for discovery plugins +

+ + + +
+
+    # File lib/mcollective/ddl/discoveryddl.rb, line 22
+22:       def capabilities(*caps)
+23:         caps = [caps].flatten
+24: 
+25:         raise "Discovery plugin capabilities can't be empty" if caps.empty?
+26: 
+27:         caps.each do |cap|
+28:           if [:classes, :facts, :identity, :agents, :compound].include?(cap)
+29:             @entities[:discovery][:capabilities] << cap
+30:           else
+31:             raise "%s is not a valid capability, valid capabilities are :classes, :facts, :identity, :agents and :compound" % cap
+32:           end
+33:         end
+34:       end
+
+ +
+ + +
+ + +
+ + +
+ + discovery(&block) + click to toggle source + +
+ +
+ +

+Creates the definition for new discovery plugins +

+
+   discovery do
+      capabilities [:classes, :facts, :identity, :agents, :compound]
+   end
+
+ + + +
+
+    # File lib/mcollective/ddl/discoveryddl.rb, line 41
+41:       def discovery(&block)
+42:         raise "Discovery plugins can only have one definition" if @entities[:discovery]
+43: 
+44:         @entities[:discovery] = {:capabilities => []}
+45: 
+46:         @current_entity = :discovery
+47:         block.call if block_given?
+48:         @current_entity = nil
+49:       end
+
+ +
+ + +
+ + +
+ + +
+ + discovery_interface() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/ddl/discoveryddl.rb, line 17
+17:       def discovery_interface
+18:         @entities[:discovery]
+19:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/DDL/ValidatorDDL.html b/doc/MCollective/DDL/ValidatorDDL.html new file mode 100644 index 0000000..0cf9bc2 --- /dev/null +++ b/doc/MCollective/DDL/ValidatorDDL.html @@ -0,0 +1,348 @@ + + + + + + + Class: MCollective::DDL::ValidatorDDL + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::DDL::ValidatorDDL

+ +
+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/DDLValidationError.html b/doc/MCollective/DDLValidationError.html new file mode 100644 index 0000000..87d1b5c --- /dev/null +++ b/doc/MCollective/DDLValidationError.html @@ -0,0 +1,351 @@ + + + + + + + Class: MCollective::DDLValidationError + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::DDLValidationError

+ +
+

+Exceptions for the RPC system +

+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Data.html b/doc/MCollective/Data.html new file mode 100644 index 0000000..01bb3a3 --- /dev/null +++ b/doc/MCollective/Data.html @@ -0,0 +1,699 @@ + + + + + + + Module: MCollective::Data + + + + + + + + + + + +
+ + +
+ + + + + + +
+

Namespace

+ +
+ + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Data

+ +
+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + [](plugin) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data.rb, line 26
+26:     def self.[](plugin)
+27:       PluginManager[pluginname(plugin)]
+28:     end
+
+ +
+ + +
+ + +
+ + +
+ + ddl(plugin) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data.rb, line 37
+37:     def self.ddl(plugin)
+38:       DDL.new(pluginname(plugin), :data)
+39:     end
+
+ +
+ + +
+ + +
+ + +
+ + ddl_has_output?(ddl, output) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data.rb, line 62
+62:     def self.ddl_has_output?(ddl, output)
+63:       ddl.entities[:data][:output].include?(output.to_sym) rescue false
+64:     end
+
+ +
+ + +
+ + +
+ + +
+ + ddl_transform_input(ddl, input) + click to toggle source + +
+ +
+ +

+For an input where the DDL requests a boolean or +some number this will convert the input to the right type where possible +else just returns the origin input unedited +

+

+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 DDL validation will fail and the user will get an +error, no need to be too defensive here +

+ + + +
+
+    # File lib/mcollective/data.rb, line 74
+74:     def self.ddl_transform_input(ddl, input)
+75:       begin
+76:         type = ddl.entities[:data][:input][:query][:type]
+77: 
+78:         case type
+79:           when :boolean
+80:             return DDL.string_to_boolean(input)
+81: 
+82:           when :number, :integer, :float
+83:             return DDL.string_to_number(input)
+84:         end
+85:       rescue
+86:       end
+87: 
+88:       return input
+89:     end
+
+ +
+ + +
+ + +
+ + +
+ + ddl_validate(ddl, argument) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data.rb, line 41
+41:     def self.ddl_validate(ddl, argument)
+42:       name = ddl.meta[:name]
+43:       query = ddl.entities[:data]
+44: 
+45:       DDL.validation_fail!(:PLMC31, "No dataquery has been defined in the DDL for data plugin '%{plugin}'", :error, :plugin => name)  unless query
+46: 
+47:       input = query.fetch(:input, {})
+48:       output = query.fetch(:output, {})
+49: 
+50:       DDL.validation_fail!(:PLMC32, "No output has been defined in the DDL for data plugin %{plugin}", :error, :plugin => name) if output.keys.empty?
+51: 
+52:       if input[:query]
+53:         return true if argument.nil? && input[:query][:optional]
+54: 
+55:         ddl.validate_input_argument(input, :query, argument)
+56:       else
+57:         DDL.validation_fail!(:PLMC33, "No data plugin argument was declared in the '%{plugin}' DDL but an input was supplied", :error, :plugin => name) if argument
+58:         return true
+59:       end
+60:     end
+
+ +
+ + +
+ + +
+ + +
+ + load_data_sources() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data.rb, line 6
+ 6:     def self.load_data_sources
+ 7:       PluginManager.find_and_load("data")
+ 8: 
+ 9:       PluginManager.grep(/_data$/).each do |plugin|
+10:         begin
+11:           unless PluginManager[plugin].class.activate?
+12:             Log.debug("Disabling data plugin %s due to plugin activation policy" % plugin)
+13:             PluginManager.delete(plugin)
+14:           end
+15:         rescue Exception => e
+16:           Log.debug("Disabling data plugin %s due to exception #{e.class}: #{e}" % plugin)
+17:           PluginManager.delete(plugin)
+18:         end
+19:       end
+20:     end
+
+ +
+ + +
+ + +
+ + +
+ + method_missing(method, *args) + click to toggle source + +
+ +
+ +

+Data.package(“httpd”).architecture +

+ + + +
+
+    # File lib/mcollective/data.rb, line 31
+31:     def self.method_missing(method, *args)
+32:       super unless PluginManager.include?(pluginname(method))
+33: 
+34:       PluginManager[pluginname(method)].lookup(args.first)
+35:     end
+
+ +
+ + +
+ + +
+ + +
+ + pluginname(plugin) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data.rb, line 22
+22:     def self.pluginname(plugin)
+23:       plugin.to_s =~ /_data$/i ? plugin.to_s.downcase : "%s_data" % plugin.to_s.downcase
+24:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Data/Base.html b/doc/MCollective/Data/Base.html new file mode 100644 index 0000000..a7d86bb --- /dev/null +++ b/doc/MCollective/Data/Base.html @@ -0,0 +1,741 @@ + + + + + + + Class: MCollective::Data::Base + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Data::Base

+ +
+ +
+ + + + + + +
+

Attributes

+ + +
+ + +
+ name[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ result[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ ddl[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ timeout[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + activate?() + click to toggle source + +
+ +
+ +

+Always be active unless a specific block is given with activate_when +

+ + + +
+
+    # File lib/mcollective/data/base.rb, line 60
+60:       def self.activate?
+61:         return true
+62:       end
+
+ +
+ + +
+ + +
+ + +
+ + activate_when(&block) + click to toggle source + +
+ +
+ +

+activate_when do +

+
+   file.exist?("/usr/bin/puppet")
+
+

+end +

+ + + +
+
+    # File lib/mcollective/data/base.rb, line 53
+53:       def self.activate_when(&block)
+54:         (class << self; self; end).instance_eval do
+55:           define_method("activate?", &block)
+56:         end
+57:       end
+
+ +
+ + +
+ + +
+ + +
+ + inherited(klass) + click to toggle source + +
+ +
+ +

+Register plugins that inherits base +

+ + + +
+
+    # File lib/mcollective/data/base.rb, line 7
+ 7:       def self.inherited(klass)
+ 8:         type = klass.to_s.split("::").last.downcase
+ 9: 
+10:         PluginManager << {:type => type, :class => klass.to_s, :single_instance => false}
+11:       end
+
+ +
+ + +
+ + +
+ + +
+ + new() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data/base.rb, line 13
+13:       def initialize
+14:         @name = self.class.to_s.split("::").last.downcase
+15:         @ddl = DDL.new(@name, :data)
+16:         @result = Result.new(@ddl.dataquery_interface[:output])
+17:         @timeout = @ddl.meta[:timeout] || 1
+18: 
+19:         startup_hook
+20:       end
+
+ +
+ + +
+ + +
+ + +
+ + query(&block) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data/base.rb, line 42
+42:       def self.query(&block)
+43:         self.module_eval { define_method("query_data", &block) }
+44:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + ddl_validate(what) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data/base.rb, line 46
+46:       def ddl_validate(what)
+47:         Data.ddl_validate(@ddl, what)
+48:       end
+
+ +
+ + +
+ + +
+ + +
+ + lookup(what) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data/base.rb, line 22
+22:       def lookup(what)
+23:         ddl_validate(what)
+24: 
+25:         Log.debug("Doing data query %s for '%s'" % [ @name, what ])
+26: 
+27:         Timeout::timeout(@timeout) do
+28:           query_data(what)
+29:         end
+30: 
+31:         @result
+32:       rescue Timeout::Error
+33:         # Timeout::Error is a inherited from Interrupt which seems a really
+34:         # strange choice, making it an equivelant of ^C and such.  Catch it
+35:         # and raise something less critical that will not the runner to just
+36:         # give up the ghost
+37:         msg = "Data plugin %s timed out on query '%s'" % [@name, what]
+38:         Log.error(msg)
+39:         raise MsgTTLExpired, msg
+40:       end
+
+ +
+ + +
+ + +
+ + +
+ + startup_hook() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data/base.rb, line 64
+64:       def startup_hook;end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Data/Result.html b/doc/MCollective/Data/Result.html new file mode 100644 index 0000000..0e7b553 --- /dev/null +++ b/doc/MCollective/Data/Result.html @@ -0,0 +1,581 @@ + + + + + + + Class: MCollective::Data::Result + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Data::Result

+ +
+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(outputs) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data/result.rb, line 9
+ 9:       def initialize(outputs)
+10:         @data = {}
+11: 
+12:         outputs.keys.each do |output|
+13:           @data[output] = Marshal.load(Marshal.dump(outputs[output].fetch(:default, nil)))
+14:         end
+15:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + [](key) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data/result.rb, line 21
+21:       def [](key)
+22:         @data[key.to_sym]
+23:       end
+
+ +
+ + +
+ + +
+ + +
+ + []=(key, val) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data/result.rb, line 25
+25:       def []=(key, val)
+26:         raise "Can only store String, Integer, Float or Boolean data but got #{val.class} for key #{key}" unless [String, Fixnum, Bignum, Float, TrueClass, FalseClass].include?(val.class)
+27: 
+28:         @data[key.to_sym] = val
+29:       end
+
+ +
+ + +
+ + +
+ + +
+ + include?(key) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data/result.rb, line 17
+17:       def include?(key)
+18:         @data.include?(key.to_sym)
+19:       end
+
+ +
+ + +
+ + +
+ + +
+ + keys() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data/result.rb, line 31
+31:       def keys
+32:         @data.keys
+33:       end
+
+ +
+ + +
+ + +
+ + +
+ + method_missing(method, *args) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data/result.rb, line 35
+35:       def method_missing(method, *args)
+36:         key = method.to_sym
+37: 
+38:         raise NoMethodError, "undefined local variable or method `%s'" % key unless include?(key)
+39: 
+40:         @data[key]
+41:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Discovery.html b/doc/MCollective/Discovery.html new file mode 100644 index 0000000..f4c8a47 --- /dev/null +++ b/doc/MCollective/Discovery.html @@ -0,0 +1,872 @@ + + + + + + + Class: MCollective::Discovery + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ + + +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Discovery

+ +
+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(client) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+   # File lib/mcollective/discovery.rb, line 3
+3:     def initialize(client)
+4:       @known_methods = find_known_methods
+5:       @default_method = Config.instance.default_discovery_method
+6:       @client = client
+7:     end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + check_capabilities(filter) + click to toggle source + +
+ +
+ +

+Agent 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 +

+ + + +
+
+    # File lib/mcollective/discovery.rb, line 62
+62:     def check_capabilities(filter)
+63:       capabilities = ddl.discovery_interface[:capabilities]
+64: 
+65:       unless capabilities.include?(:classes)
+66:         raise "Cannot use class filters while using the '%s' discovery method" % discovery_method unless filter["cf_class"].empty?
+67:       end
+68: 
+69:       unless capabilities.include?(:facts)
+70:         raise "Cannot use fact filters while using the '%s' discovery method" % discovery_method unless filter["fact"].empty?
+71:       end
+72: 
+73:       unless capabilities.include?(:identity)
+74:         raise "Cannot use identity filters while using the '%s' discovery method" % discovery_method unless filter["identity"].empty?
+75:       end
+76: 
+77:       unless capabilities.include?(:compound)
+78:         raise "Cannot use compound filters while using the '%s' discovery method" % discovery_method unless filter["compound"].empty?
+79:       end
+80:     end
+
+ +
+ + +
+ + +
+ + +
+ + ddl() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/discovery.rb, line 47
+47:     def ddl
+48:       @ddl ||= DDL.new(discovery_method, :discovery)
+49: 
+50:       # if the discovery method got changed we might have an old DDL cached
+51:       # this will detect that and reread the correct DDL from disk
+52:       unless @ddl.meta[:name] == discovery_method
+53:         @ddl = DDL.new(discovery_method, :discovery)
+54:       end
+55: 
+56:       return @ddl
+57:     end
+
+ +
+ + +
+ + +
+ + +
+ + discover(filter, timeout, limit) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/discovery.rb, line 127
+127:     def discover(filter, timeout, limit)
+128:       raise "Limit has to be an integer" unless limit.is_a?(Fixnum)
+129: 
+130:       force_discovery_method_by_filter(filter)
+131: 
+132:       check_capabilities(filter)
+133: 
+134:       discovered = discovery_class.discover(filter, discovery_timeout(timeout, filter), limit, @client)
+135: 
+136:       if limit > 0
+137:         return discovered[0,limit]
+138:       else
+139:         return discovered
+140:       end
+141:     end
+
+ +
+ + +
+ + +
+ + +
+ + discovery_class() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/discovery.rb, line 39
+39:     def discovery_class
+40:       method = discovery_method.capitalize
+41: 
+42:       PluginManager.loadclass("MCollective::Discovery::#{method}") unless self.class.const_defined?(method)
+43: 
+44:       self.class.const_get(method)
+45:     end
+
+ +
+ + +
+ + +
+ + +
+ + discovery_method() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/discovery.rb, line 21
+21:     def discovery_method
+22:       method = "mc"
+23: 
+24:       if @client.options[:discovery_method]
+25:         method = @client.options[:discovery_method]
+26:       else
+27:         method = @default_method
+28:       end
+29: 
+30:       raise "Unknown discovery method %s" % method unless has_method?(method)
+31: 
+32:       unless method == "mc"
+33:         raise "Custom discovery methods require direct addressing mode" unless Config.instance.direct_addressing
+34:       end
+35: 
+36:       return method
+37:     end
+
+ +
+ + +
+ + +
+ + +
+ + discovery_timeout(timeout, filter) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/discovery.rb, line 117
+117:     def discovery_timeout(timeout, filter)
+118:       timeout = ddl.meta[:timeout] unless timeout
+119: 
+120:       unless (filter["compound"] && filter["compound"].empty?)
+121:         timeout + timeout_for_compound_filter(filter["compound"])
+122:       else
+123:         timeout
+124:       end
+125:     end
+
+ +
+ + +
+ + +
+ + +
+ + find_known_methods() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/discovery.rb, line 9
+ 9:     def find_known_methods
+10:       PluginManager.find("discovery")
+11:     end
+
+ +
+ + +
+ + +
+ + +
+ + force_direct_mode?() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/discovery.rb, line 17
+17:     def force_direct_mode?
+18:       discovery_method != "mc"
+19:     end
+
+ +
+ + +
+ + +
+ + +
+ + force_discovery_method_by_filter(filter) + click to toggle source + +
+ +
+ +

+checks if compound filters are used and then forces the ‘mc’ +discovery plugin +

+ + + +
+
+    # File lib/mcollective/discovery.rb, line 83
+83:     def force_discovery_method_by_filter(filter)
+84:       unless discovery_method == "mc"
+85:         unless filter["compound"].empty?
+86:           Log.info "Switching to mc discovery method because compound filters are used"
+87:           @client.options[:discovery_method] = "mc"
+88: 
+89:           return true
+90:         end
+91:       end
+92: 
+93:       return false
+94:     end
+
+ +
+ + +
+ + +
+ + +
+ + has_method?(method) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/discovery.rb, line 13
+13:     def has_method?(method)
+14:       @known_methods.include?(method)
+15:     end
+
+ +
+ + +
+ + +
+ + +
+ + timeout_for_compound_filter(compound_filter) + click to toggle source + +
+ +
+ +

+if a compound filter is specified and it has any function then we read the +DDL for each of those plugins and sum up the timeout +declared in the DDL +

+ + + +
+
+     # File lib/mcollective/discovery.rb, line 99
+ 99:     def timeout_for_compound_filter(compound_filter)
+100:       return 0 if compound_filter.nil? || compound_filter.empty?
+101: 
+102:       timeout = 0
+103: 
+104:       compound_filter.each do |filter|
+105:         filter.each do |statement|
+106:           if statement["fstatement"]
+107:             pluginname = Data.pluginname(statement["fstatement"]["name"])
+108:             ddl = DDL.new(pluginname, :data)
+109:             timeout += ddl.meta[:timeout]
+110:           end
+111:         end
+112:       end
+113: 
+114:       timeout
+115:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Facts.html b/doc/MCollective/Facts.html new file mode 100644 index 0000000..683954f --- /dev/null +++ b/doc/MCollective/Facts.html @@ -0,0 +1,500 @@ + + + + + + + Module: MCollective::Facts + + + + + + + + + + + +
+
+ + + +
+ +
+ + + + + + +
+

Namespace

+ +
+ + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Facts

+ +
+

+This is a class that gives access to the configured fact provider such as +MCollectives::Facts::Facter that uses Reductive Labs facter +

+

+The actual provider is pluggable and configurable using the +‘factsource’ configuration option. +

+

+To develop a new factsource simply create a class under +MCollective::Facts:: and provide the following classes: +

+
+  self.get_fact(fact)
+  self.has_fact?(fact)
+
+

+You can also just inherit from MCollective::Facts::Base and provide just the +

+
+  self.get_facts
+
+

+method that should return a hash of facts. +

+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + [](fact) + click to toggle source + +
+ +
+ +

+Get the value of a fact +

+ + + +
+
+    # File lib/mcollective/facts.rb, line 35
+35:     def self.[](fact)
+36:       PluginManager["facts_plugin"].get_fact(fact)
+37:     end
+
+ +
+ + +
+ + +
+ + +
+ + get_fact(fact) + click to toggle source + +
+ +
+ +

+Get the value of a fact +

+ + + +
+
+    # File lib/mcollective/facts.rb, line 30
+30:     def self.get_fact(fact)
+31:       PluginManager["facts_plugin"].get_fact(fact)
+32:     end
+
+ +
+ + +
+ + +
+ + +
+ + has_fact?(fact, value) + click to toggle source + +
+ +
+ +

+True if we know of a specific fact else false +

+ + + +
+
+    # File lib/mcollective/facts.rb, line 25
+25:     def self.has_fact?(fact, value)
+26:       PluginManager["facts_plugin"].get_fact(fact) == value ? true : false
+27:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Facts/Base.html b/doc/MCollective/Facts/Base.html new file mode 100644 index 0000000..210d562 --- /dev/null +++ b/doc/MCollective/Facts/Base.html @@ -0,0 +1,636 @@ + + + + + + + Class: MCollective::Facts::Base + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Facts::Base

+ +
+

+A base class for fact providers, to make a new fully functional fact +provider inherit from this and simply provide a self.get_facts method that +returns a hash like: +

+
+ {"foo" => "bar",
+  "bar" => "baz"}
+
+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + inherited(klass) + click to toggle source + +
+ +
+ +

+Registers new fact sources into the plugin manager +

+ + + +
+
+    # File lib/mcollective/facts/base.rb, line 17
+17:       def self.inherited(klass)
+18:         PluginManager << {:type => "facts_plugin", :class => klass.to_s}
+19:       end
+
+ +
+ + +
+ + +
+ + +
+ + new() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/facts/base.rb, line 10
+10:       def initialize
+11:         @facts = {}
+12:         @last_good_facts = {}
+13:         @last_facts_load = 0
+14:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + force_reload?() + click to toggle source + +
+ +
+ +

+Plugins can override this to provide forced fact invalidation +

+ + + +
+
+    # File lib/mcollective/facts/base.rb, line 81
+81:       def force_reload?
+82:         false
+83:       end
+
+ +
+ + +
+ + +
+ + +
+ + get_fact(fact=nil) + click to toggle source + +
+ +
+ +

+Returns the value of a single fact +

+ + + +
+
+    # File lib/mcollective/facts/base.rb, line 22
+22:       def get_fact(fact=nil)
+23:         config = Config.instance
+24: 
+25:         cache_time = config.fact_cache_time || 300
+26: 
+27:         Thread.exclusive do
+28:           begin
+29:             if (Time.now.to_i - @last_facts_load > cache_time.to_i ) || force_reload?
+30:               Log.debug("Resetting facter cache, now: #{Time.now.to_i} last-known-good: #{@last_facts_load}")
+31: 
+32:               tfacts = load_facts_from_source
+33: 
+34:               # Force reset to last known good state on empty facts
+35:               raise "Got empty facts" if tfacts.empty?
+36: 
+37:               @facts.clear
+38: 
+39:               tfacts.each_pair do |key,value|
+40:                 @facts[key.to_s] = value.to_s
+41:               end
+42: 
+43:               @last_good_facts = @facts.clone
+44:               @last_facts_load = Time.now.to_i
+45:             else
+46:               Log.debug("Using cached facts now: #{Time.now.to_i} last-known-good: #{@last_facts_load}")
+47:             end
+48:           rescue Exception => e
+49:             Log.error("Failed to load facts: #{e.class}: #{e}")
+50: 
+51:             # Avoid loops where failing fact loads cause huge CPU
+52:             # loops, this way it only retries once every cache_time
+53:             # seconds
+54:             @last_facts_load = Time.now.to_i
+55: 
+56:             # Revert to last known good state
+57:             @facts = @last_good_facts.clone
+58:           end
+59:         end
+60: 
+61: 
+62:         # If you do not supply a specific fact all facts will be returned
+63:         if fact.nil?
+64:           return @facts
+65:         else
+66:           @facts.include?(fact) ? @facts[fact] : nil
+67:         end
+68:       end
+
+ +
+ + +
+ + +
+ + +
+ + get_facts() + click to toggle source + +
+ +
+ +

+Returns all facts +

+ + + +
+
+    # File lib/mcollective/facts/base.rb, line 71
+71:       def get_facts
+72:         get_fact(nil)
+73:       end
+
+ +
+ + +
+ + +
+ + +
+ + has_fact?(fact) + click to toggle source + +
+ +
+ +

+Returns true if we know about a specific fact, false otherwise +

+ + + +
+
+    # File lib/mcollective/facts/base.rb, line 76
+76:       def has_fact?(fact)
+77:         get_fact(nil).include?(fact)
+78:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Generators.html b/doc/MCollective/Generators.html new file mode 100644 index 0000000..18df2b9 --- /dev/null +++ b/doc/MCollective/Generators.html @@ -0,0 +1,363 @@ + + + + + + + Module: MCollective::Generators + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Generators

+ +
+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Generators/AgentGenerator.html b/doc/MCollective/Generators/AgentGenerator.html new file mode 100644 index 0000000..81dd3a9 --- /dev/null +++ b/doc/MCollective/Generators/AgentGenerator.html @@ -0,0 +1,570 @@ + + + + + + + Class: MCollective::Generators::AgentGenerator + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Generators::AgentGenerator

+ +
+ +
+ + + + + + +
+

Attributes

+ + +
+ + + + +
+ ddl[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ content[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(plugin_name, actions = [], name = nil, description = nil, author = nil , license = nil, version = nil, url = nil, timeout = nil) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/generators/agent_generator.rb, line 7
+ 7:       def initialize(plugin_name, actions = [],  name = nil, description = nil, author = nil ,
+ 8:                      license = nil, version = nil, url = nil, timeout = nil)
+ 9: 
+10:         super(name, description, author, license, version, url, timeout)
+11:         @plugin_name = plugin_name
+12:         @actions = actions || []
+13:         @ddl = create_ddl
+14:         @mod_name = "Agent"
+15:         @pclass = "RPC::Agent"
+16:         @content = create_plugin_content
+17:         @plugin = create_plugin_string
+18:         write_plugins
+19:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + action_help() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/generators/agent_generator.rb, line 45
+45:       def action_help
+46:         action_snippet = File.read(File.join(File.dirname(__FILE__), "templates", "action_snippet.erb"))
+47:         ERB.new(action_snippet).result
+48:       end
+
+ +
+ + +
+ + +
+ + +
+ + create_ddl() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/generators/agent_generator.rb, line 21
+21:       def create_ddl
+22:         action_text = ""
+23:         @actions.each_with_index do |action, i|
+24:           action_text += "action \"#{action}\", :description => \"%ACTIONDESCRIPTION%\" do\n"
+25:           action_text += action_help if i == 0
+26:           action_text += "end\n"
+27:           action_text += "\n" unless @actions.size == (i + 1)
+28:         end
+29:         # Use inherited method to create metadata part of the ddl
+30:         create_metadata_string + action_text
+31:       end
+
+ +
+ + +
+ + +
+ + +
+ + create_plugin_content() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/generators/agent_generator.rb, line 33
+33:       def create_plugin_content
+34:         content_text = ""
+35: 
+36:         # Add actions to agent file
+37:         @actions.each_with_index do |action, i|
+38:           content_text +=  "%6s%s" % [" ", "action \"#{action}\" do\n"]
+39:           content_text +=  "%6s%s" % [" ", "end\n"]
+40:           content_text += "\n" unless @actions.size == (i + 1)
+41:         end
+42:         content_text
+43:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Generators/Base.html b/doc/MCollective/Generators/Base.html new file mode 100644 index 0000000..9fea03a --- /dev/null +++ b/doc/MCollective/Generators/Base.html @@ -0,0 +1,584 @@ + + + + + + + Class: MCollective::Generators::Base + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Generators::Base

+ +
+ +
+ + + + + + +
+

Attributes

+ + +
+ + + + +
+ meta[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ plugin_name[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ mod_name[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(name, description, author, license, version, url, timeout) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/generators/base.rb, line 5
+ 5:       def initialize(name, description, author, license, version, url, timeout)
+ 6:         @meta = {:name => name,
+ 7:                  :description => description,
+ 8:                  :author => author,
+ 9:                  :license => license,
+10:                  :version => version,
+11:                  :url => url,
+12:                  :timeout => timeout}
+13:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + create_metadata_string() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/generators/base.rb, line 15
+15:       def create_metadata_string
+16:         ddl_template = File.read(File.join(File.dirname(__FILE__), "templates", "ddl.erb"))
+17:         ERB.new(ddl_template, nil, "-").result(binding)
+18:       end
+
+ +
+ + +
+ + +
+ + +
+ + create_plugin_string() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/generators/base.rb, line 20
+20:       def create_plugin_string
+21:         plugin_template = File.read(File.join(File.dirname(__FILE__), "templates", "plugin.erb"))
+22:         ERB.new(plugin_template, nil, "-").result(binding)
+23:       end
+
+ +
+ + +
+ + +
+ + +
+ + write_plugins() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/generators/base.rb, line 25
+25:       def write_plugins
+26:         begin
+27:           Dir.mkdir @plugin_name
+28:           dirname = File.join(@plugin_name, @mod_name.downcase)
+29:           Dir.mkdir dirname
+30:           puts "Created plugin directory : #{@plugin_name}"
+31: 
+32:           File.open(File.join(dirname, "#{@plugin_name}.ddl"), "w"){|f| f.puts @ddl}
+33:           puts "Created DDL file : #{File.join(dirname, "#{@plugin_name}.ddl")}"
+34: 
+35:           File.open(File.join(dirname, "#{@plugin_name}.rb"), "w"){|f| f.puts @plugin}
+36:           puts "Created #{@mod_name} file : #{File.join(dirname, "#{@plugin_name}.rb")}"
+37:         rescue Errno::EEXIST
+38:           raise "cannot generate '#{@plugin_name}' : plugin directory already exists."
+39:         rescue Exception => e
+40:           FileUtils.rm_rf(@plugin_name) if File.directory?(@plugin_name)
+41:           raise "cannot generate plugin - #{e}"
+42:         end
+43:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Generators/DataGenerator.html b/doc/MCollective/Generators/DataGenerator.html new file mode 100644 index 0000000..5159485 --- /dev/null +++ b/doc/MCollective/Generators/DataGenerator.html @@ -0,0 +1,540 @@ + + + + + + + Class: MCollective::Generators::DataGenerator + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Generators::DataGenerator

+ +
+ +
+ + + + + + +
+

Attributes

+ + +
+ + + + +
+ ddl[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ content[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(plugin_name, outputs = [], name = nil, description = nil, author = nil , license = nil, version = nil, url = nil, timeout = nil) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/generators/data_generator.rb, line 7
+ 7:       def initialize(plugin_name, outputs = [],  name = nil, description = nil, author = nil ,
+ 8:                      license = nil, version = nil, url = nil, timeout = nil)
+ 9: 
+10:         super(name, description, author, license, version, url, timeout)
+11:         @mod_name = "Data"
+12:         @pclass = "Base"
+13:         @plugin_name = plugin_name
+14:         @outputs = outputs
+15:         @ddl = create_ddl
+16:         @content = create_plugin_content
+17:         @plugin = create_plugin_string
+18:         write_plugins
+19:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + create_ddl() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/generators/data_generator.rb, line 21
+21:       def create_ddl
+22:         query_text = "dataquery :description => \"Query information\" do\n"
+23:         query_text += ERB.new(File.read(File.join(File.dirname(__FILE__), "templates", "data_input_snippet.erb"))).result
+24: 
+25:         @outputs.each_with_index do |output,i|
+26:           query_text += "%2s%s" % [" ", "output :#{output},\n"]
+27:           query_text += "%9s%s" % [" ", ":description => \"%DESCRIPTION%\",\n"]
+28:           query_text += "%9s%s" % [" ", ":display_as => \"%DESCRIPTION%\"\n"]
+29:           query_text += "\n" unless @outputs.size == (i + 1)
+30:         end
+31: 
+32:         query_text += "end"
+33: 
+34:         # Use inherited method to create metadata part of the ddl
+35:         create_metadata_string + query_text
+36:       end
+
+ +
+ + +
+ + +
+ + +
+ + create_plugin_content() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/generators/data_generator.rb, line 38
+38:       def create_plugin_content
+39:         content_text = "%6s%s" % [" ", "query do |what|\n"]
+40: 
+41:         @outputs.each do |output|
+42:            content_text += "%8s%s" % [" ", "result[:#{output}] = nil\n"]
+43:         end
+44:         content_text += "%6s%s" % [" ", "end\n"]
+45: 
+46:         # Add actions to agent file
+47:         content_text
+48:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/InvalidRPCData.html b/doc/MCollective/InvalidRPCData.html new file mode 100644 index 0000000..60e1e1d --- /dev/null +++ b/doc/MCollective/InvalidRPCData.html @@ -0,0 +1,348 @@ + + + + + + + Class: MCollective::InvalidRPCData + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::InvalidRPCData

+ +
+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Log.html b/doc/MCollective/Log.html new file mode 100644 index 0000000..6515f34 --- /dev/null +++ b/doc/MCollective/Log.html @@ -0,0 +1,1154 @@ + + + + + + + Class: MCollective::Log + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Log

+ +
+

+A simple class that allows logging at various levels. +

+ +
+ + + +
+

Constants

+
+ +
VALID_LEVELS
+ +
(Not documented)
+ + +
+
+ + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + check_level(level) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/log.rb, line 55
+55:       def check_level(level)
+56:         raise "Unknown log level" unless valid_level?(level)
+57:       end
+
+ +
+ + +
+ + +
+ + +
+ + config_and_check_level(level) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/log.rb, line 49
+49:       def config_and_check_level(level)
+50:         configure unless @configured
+51:         check_level(level)
+52:         @logger.should_log?(level)
+53:       end
+
+ +
+ + +
+ + +
+ + +
+ + configure(logger=nil) + click to toggle source + +
+ +
+ +

+configures the logger 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 log method will keep attempting to configure the logger +till we eventually get a logging preference from the config module +

+ + + +
+
+     # File lib/mcollective/log.rb, line 130
+130:       def configure(logger=nil)
+131:         unless logger
+132:           logger_type = "console"
+133: 
+134:           config = Config.instance
+135: 
+136:           if config.configured
+137:             logger_type = config.logger_type
+138:             @configured = true
+139:           end
+140: 
+141:           require "mcollective/logger/%s_logger" % logger_type.downcase
+142: 
+143:           logger_class = MCollective::Logger.const_get("%s_logger" % logger_type.capitalize)
+144: 
+145:           set_logger(logger_class.new)
+146:         else
+147:           set_logger(logger)
+148:           @configured = true
+149:         end
+150: 
+151: 
+152:         @logger.start
+153:       rescue Exception => e
+154:         @configured = false
+155:         STDERR.puts "Could not start logger: #{e.class} #{e}"
+156:       end
+
+ +
+ + +
+ + +
+ + +
+ + cycle_level() + click to toggle source + +
+ +
+ +

+increments the active log level +

+ + + +
+
+    # File lib/mcollective/log.rb, line 45
+45:       def cycle_level
+46:         @logger.cycle_level if @configured
+47:       end
+
+ +
+ + +
+ + +
+ + +
+ + debug(msg) + click to toggle source + +
+ +
+ +

+Logs at debug level +

+ + + +
+
+    # File lib/mcollective/log.rb, line 25
+25:       def debug(msg)
+26:         log(:debug, msg)
+27:       end
+
+ +
+ + +
+ + +
+ + +
+ + error(msg) + click to toggle source + +
+ +
+ +

+Logs at error level +

+ + + +
+
+    # File lib/mcollective/log.rb, line 35
+35:       def error(msg)
+36:         log(:error, msg)
+37:       end
+
+ +
+ + +
+ + +
+ + +
+ + execution_stack() + click to toggle source + +
+ +
+ +

+this method is here to facilitate testing +

+ + + +
+
+     # File lib/mcollective/log.rb, line 170
+170:       def execution_stack
+171:         caller
+172:       end
+
+ +
+ + +
+ + +
+ + +
+ + fatal(msg) + click to toggle source + +
+ +
+ +

+Logs at fatal level +

+ + + +
+
+    # File lib/mcollective/log.rb, line 30
+30:       def fatal(msg)
+31:         log(:fatal, msg)
+32:       end
+
+ +
+ + +
+ + +
+ + +
+ + from() + click to toggle source + +
+ +
+ +

+figures out the filename that called us +

+ + + +
+
+     # File lib/mcollective/log.rb, line 164
+164:       def from
+165:         path, line, method = execution_stack[3].split(/:(\d+)/)
+166:         "%s:%s%s" % [File.basename(path), line, method]
+167:       end
+
+ +
+ + +
+ + +
+ + +
+ + info(msg) + click to toggle source + +
+ +
+ +

+Logs at info level +

+ + + +
+
+    # File lib/mcollective/log.rb, line 15
+15:       def info(msg)
+16:         log(:info, msg)
+17:       end
+
+ +
+ + +
+ + +
+ + +
+ + instance() + click to toggle source + +
+ +
+ +

+handle old code that relied on this class being a singleton +

+ + + +
+
+    # File lib/mcollective/log.rb, line 40
+40:       def instance
+41:         self
+42:       end
+
+ +
+ + +
+ + +
+ + +
+ + log(level, msg, origin=nil) + click to toggle source + +
+ +
+ +

+logs a message at a certain level +

+ + + +
+
+     # File lib/mcollective/log.rb, line 106
+106:       def log(level, msg, origin=nil)
+107:         return unless config_and_check_level(level)
+108: 
+109:         origin = from unless origin
+110: 
+111:         if @logger
+112:           @logger.log(level, origin, msg)
+113:         else
+114:           t = Time.new.strftime("%H:%M:%S")
+115: 
+116:           STDERR.puts "#{t}: #{level}: #{origin}: #{msg}"
+117:         end
+118:       end
+
+ +
+ + +
+ + +
+ + +
+ + logexception(msgid, level, e, backtrace=false, args={}) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/log.rb, line 67
+67:       def logexception(msgid, level, e, backtrace=false, args={})
+68:         return false unless config_and_check_level(level)
+69: 
+70:         path, line, method = e.backtrace[1].split(/:(\d+)/)
+71:         origin = "%s:%s%s" % [File.basename(path), line, method]
+72: 
+73:         if e.is_a?(CodedError)
+74:           msg = "%s: %s" % [e.code, e.to_s]
+75:         else
+76:           error_string = "%s: %s" % [e.class, e.to_s]
+77:           msg = message_for(msgid, args.merge(:error => error_string))
+78:         end
+79: 
+80:         log(level, msg, origin)
+81: 
+82:         if backtrace
+83:           e.backtrace.each do |line|
+84:             log(level, "%s:          %s" % [msgid, line], origin)
+85:           end
+86:         end
+87:       end
+
+ +
+ + +
+ + +
+ + +
+ + logger() + click to toggle source + +
+ +
+ +

+Obtain the class name of the currently configured logger +

+ + + +
+
+    # File lib/mcollective/log.rb, line 10
+10:       def logger
+11:         @logger.class
+12:       end
+
+ +
+ + +
+ + +
+ + +
+ + logmsg(msgid, default, level, args={}) + click to toggle source + +
+ +
+ +

+Logs a message at a certain level, the message must be a token that will be +looked up from the i18n localization database +

+

+Messages can interprolate strings from the args hash, a message with +“foo %{bar}” in the localization database will use args[:bar] +for the value there, the interprolation is handled by the i18n library +itself +

+ + + +
+
+     # File lib/mcollective/log.rb, line 97
+ 97:       def logmsg(msgid, default, level, args={})
+ 98:         return false unless config_and_check_level(level)
+ 99: 
+100:         msg = message_for(msgid, {:default => default}.merge(args))
+101: 
+102:         log(level, msg)
+103:       end
+
+ +
+ + +
+ + +
+ + +
+ + message_for(msgid, args={}) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/log.rb, line 63
+63:       def message_for(msgid, args={})
+64:         "%s: %s" % [msgid, Util.t(msgid, args)]
+65:       end
+
+ +
+ + +
+ + +
+ + +
+ + set_logger(logger) + click to toggle source + +
+ +
+ +

+sets the logger class to use +

+ + + +
+
+     # File lib/mcollective/log.rb, line 121
+121:       def set_logger(logger)
+122:         @logger = logger
+123:       end
+
+ +
+ + +
+ + +
+ + +
+ + unconfigure() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/log.rb, line 158
+158:       def unconfigure
+159:         @configured = false
+160:         set_logger(nil)
+161:       end
+
+ +
+ + +
+ + +
+ + +
+ + valid_level?(level) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/log.rb, line 59
+59:       def valid_level?(level)
+60:         VALID_LEVELS.include?(level)
+61:       end
+
+ +
+ + +
+ + +
+ + +
+ + warn(msg) + click to toggle source + +
+ +
+ +

+Logs at warn level +

+ + + +
+
+    # File lib/mcollective/log.rb, line 20
+20:       def warn(msg)
+21:         log(:warn, msg)
+22:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Logger.html b/doc/MCollective/Logger.html new file mode 100644 index 0000000..60e9c42 --- /dev/null +++ b/doc/MCollective/Logger.html @@ -0,0 +1,368 @@ + + + + + + + Module: MCollective::Logger + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Logger

+ +
+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Logger/Base.html b/doc/MCollective/Logger/Base.html new file mode 100644 index 0000000..cb1fc5c --- /dev/null +++ b/doc/MCollective/Logger/Base.html @@ -0,0 +1,744 @@ + + + + + + + Class: MCollective::Logger::Base + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Logger::Base

+ +
+

+A base class for logging providers. +

+

+Logging providers should provide the following: +

+
+   * 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
+
+ +
+ + + + + + +
+

Attributes

+ + +
+ + +
+ active_level[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/logger/base.rb, line 14
+14:       def initialize
+15:         @known_levels = [:debug, :info, :warn, :error, :fatal]
+16: 
+17:         # Sanity check the class that impliments the logging
+18:         @known_levels.each do |lvl|
+19:           raise "Logger class did not specify a map for #{lvl}" unless valid_levels.include?(lvl)
+20:         end
+21:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + cycle_level() + click to toggle source + +
+ +
+ +

+Figures out the next level and sets it +

+ + + +
+
+    # File lib/mcollective/logger/base.rb, line 28
+28:       def cycle_level
+29:         lvl = get_next_level
+30:         set_level(lvl)
+31: 
+32:         log(lvl, "", "Logging level is now #{lvl.to_s.upcase}")
+33:       end
+
+ +
+ + +
+ + +
+ + +
+ + set_level(level) + click to toggle source + +
+ +
+ +

+Sets a new level and record it in @active_level +

+ + + +
+
+    # File lib/mcollective/logger/base.rb, line 36
+36:       def set_level(level)
+37:         set_logging_level(level)
+38:         @active_level = level.to_sym
+39:       end
+
+ +
+ + +
+ + +
+ + +
+ + should_log?(level) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/logger/base.rb, line 23
+23:       def should_log?(level)
+24:         @known_levels.index(level) >= @known_levels.index(@active_level)
+25:       end
+
+ +
+ + +
+ + +
+ +
+

Private Instance Methods

+ + +
+ + +
+ + get_next_level() + click to toggle source + +
+ +
+ +

+Gets the next level in the list, cycles down to the firt once it reaches +the end +

+ + + +
+
+    # File lib/mcollective/logger/base.rb, line 49
+49:       def get_next_level
+50:         # if all else fails, always go to debug mode
+51:         nextlvl = :debug
+52: 
+53:         if @known_levels.index(@active_level) == (@known_levels.size - 1)
+54:           nextlvl = @known_levels.first
+55:         else
+56:           idx = @known_levels.index(@active_level) + 1
+57:           nextlvl = @known_levels[idx]
+58:         end
+59: 
+60:         nextlvl
+61:       end
+
+ +
+ + +
+ + +
+ + +
+ + log(level, from, msg) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/logger/base.rb, line 68
+68:       def log(level, from, msg)
+69:         raise "The logging class did not supply a log method"
+70:       end
+
+ +
+ + +
+ + +
+ + +
+ + map_level(level) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/logger/base.rb, line 42
+42:       def map_level(level)
+43:         raise "Logger class do not know how to handle #{level} messages" unless valid_levels.include?(level.to_sym)
+44: 
+45:         valid_levels[level.to_sym]
+46:       end
+
+ +
+ + +
+ + +
+ + +
+ + start() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/logger/base.rb, line 72
+72:       def start
+73:         raise "The logging class did not supply a start method"
+74:       end
+
+ +
+ + +
+ + +
+ + +
+ + valid_levels() + click to toggle source + +
+ +
+ +

+Abstract methods to ensure the logging implimentations supply what they +should +

+ + + +
+
+    # File lib/mcollective/logger/base.rb, line 64
+64:       def valid_levels
+65:         raise "The logging class did not supply a valid_levels method"
+66:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Logger/Console_logger.html b/doc/MCollective/Logger/Console_logger.html new file mode 100644 index 0000000..f69c648 --- /dev/null +++ b/doc/MCollective/Logger/Console_logger.html @@ -0,0 +1,598 @@ + + + + + + + Class: MCollective::Logger::Console_logger + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Logger::Console_logger

+ +
+

+Implements a syslog based logger using the standard ruby syslog class +

+ +
+ + + + + + + + + +
+

Public Instance Methods

+ + +
+ + +
+ + color(level) + click to toggle source + +
+ +
+ +

+Set some colors for various logging levels, will honor the color +configuration option and return nothing if its configured not to +

+ + + +
+
+    # File lib/mcollective/logger/console_logger.rb, line 37
+37:       def color(level)
+38:         colorize = Config.instance.color
+39: 
+40:         colors = {:error => Util.color(:red),
+41:                   :fatal => Util.color(:red),
+42:                   :warn  => Util.color(:yellow),
+43:                   :info  => Util.color(:green),
+44:                   :reset => Util.color(:reset)}
+45: 
+46:         if colorize
+47:           return colors[level] || ""
+48:         else
+49:           return ""
+50:         end
+51:       end
+
+ +
+ + +
+ + +
+ + +
+ + colorize(level, msg) + click to toggle source + +
+ +
+ +

+Helper to return a string in specific color +

+ + + +
+
+    # File lib/mcollective/logger/console_logger.rb, line 54
+54:       def colorize(level, msg)
+55:         "%s%s%s" % [ color(level), msg, color(:reset) ]
+56:       end
+
+ +
+ + +
+ + +
+ + +
+ + log(level, from, msg, normal_output=STDERR, last_resort_output=STDERR) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/logger/console_logger.rb, line 24
+24:       def log(level, from, msg, normal_output=STDERR, last_resort_output=STDERR)
+25:         time = Time.new.strftime("%Y/%m/%d %H:%M:%S")
+26: 
+27:         normal_output.puts("%s %s: %s %s" % [colorize(level, level), time, from, msg])
+28:       rescue
+29:         # if this fails we probably cant show the user output at all,
+30:         # STDERR it as last resort
+31:         last_resort_output.puts("#{level}: #{msg}")
+32:       end
+
+ +
+ + +
+ + +
+ + +
+ + set_logging_level(level) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/logger/console_logger.rb, line 12
+12:       def set_logging_level(level)
+13:         # nothing to do here, we ignore high levels when we log
+14:       end
+
+ +
+ + +
+ + +
+ + +
+ + start() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/logger/console_logger.rb, line 5
+ 5:       def start
+ 6:         set_level(:info)
+ 7: 
+ 8:         config = Config.instance
+ 9:         set_level(config.loglevel.to_sym) if config.configured
+10:       end
+
+ +
+ + +
+ + +
+ + +
+ + valid_levels() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/logger/console_logger.rb, line 16
+16:       def valid_levels
+17:         {:info  => :info,
+18:          :warn  => :warning,
+19:          :debug => :debug,
+20:          :fatal => :crit,
+21:          :error => :err}
+22:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Logger/File_logger.html b/doc/MCollective/Logger/File_logger.html new file mode 100644 index 0000000..4298755 --- /dev/null +++ b/doc/MCollective/Logger/File_logger.html @@ -0,0 +1,524 @@ + + + + + + + Class: MCollective::Logger::File_logger + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Logger::File_logger

+ +
+

+Impliments a file based logger using the standard ruby logger class +

+

+To configure you should set: +

+
+  - config.logfile
+  - config.keeplogs defaults to 2097152
+  - config.max_log_size defaults to 5
+
+ +
+ + + + + + + + + +
+

Public Instance Methods

+ + +
+ + +
+ + log(level, from, msg) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/logger/file_logger.rb, line 37
+37:       def log(level, from, msg)
+38:         @logger.add(map_level(level)) { "#{from} #{msg}" }
+39:       rescue
+40:         # if this fails we probably cant show the user output at all,
+41:         # STDERR it as last resort
+42:         STDERR.puts("#{level}: #{msg}")
+43:       end
+
+ +
+ + +
+ + +
+ + +
+ + set_logging_level(level) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/logger/file_logger.rb, line 22
+22:       def set_logging_level(level)
+23:         @logger.level = map_level(level)
+24:       rescue Exception => e
+25:         @logger.level = ::Logger::DEBUG
+26:         log(:error, "", "Could not set logging to #{level} using debug instead: #{e.class} #{e}")
+27:       end
+
+ +
+ + +
+ + +
+ + +
+ + start() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/logger/file_logger.rb, line 13
+13:       def start
+14:         config = Config.instance
+15: 
+16:         @logger = ::Logger.new(config.logfile, config.keeplogs, config.max_log_size)
+17:         @logger.formatter = ::Logger::Formatter.new
+18: 
+19:         set_level(config.loglevel.to_sym)
+20:       end
+
+ +
+ + +
+ + +
+ + +
+ + valid_levels() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/logger/file_logger.rb, line 29
+29:       def valid_levels
+30:         {:info  => ::Logger::INFO,
+31:          :warn  => ::Logger::WARN,
+32:          :debug => ::Logger::DEBUG,
+33:          :fatal => ::Logger::FATAL,
+34:          :error => ::Logger::ERROR}
+35:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Logger/Syslog_logger.html b/doc/MCollective/Logger/Syslog_logger.html new file mode 100644 index 0000000..46ceaf9 --- /dev/null +++ b/doc/MCollective/Logger/Syslog_logger.html @@ -0,0 +1,566 @@ + + + + + + + Class: MCollective::Logger::Syslog_logger + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+

Included Modules

+ +
+ +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Logger::Syslog_logger

+ +
+

+Implements a syslog based logger using the standard ruby syslog class +

+ +
+ + + + + + + + + +
+

Public Instance Methods

+ + +
+ + +
+ + log(level, from, msg) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/logger/syslog_logger.rb, line 42
+42:       def log(level, from, msg)
+43:         Syslog.send(map_level(level), "#{from} #{msg}")
+44:       rescue
+45:         # if this fails we probably cant show the user output at all,
+46:         # STDERR it as last resort
+47:         STDERR.puts("#{level}: #{msg}")
+48:       end
+
+ +
+ + +
+ + +
+ + +
+ + set_logging_level(level) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/logger/syslog_logger.rb, line 30
+30:       def set_logging_level(level)
+31:         # noop
+32:       end
+
+ +
+ + +
+ + +
+ + +
+ + start() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/logger/syslog_logger.rb, line 9
+ 9:       def start
+10:         config = Config.instance
+11: 
+12:         facility = syslog_facility(config.logfacility)
+13:         level = config.loglevel.to_sym
+14: 
+15:         Syslog.close if Syslog.opened?
+16:         Syslog.open(File.basename($0), 3, facility)
+17: 
+18:         set_level(level)
+19:       end
+
+ +
+ + +
+ + +
+ + +
+ + syslog_facility(facility) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/logger/syslog_logger.rb, line 21
+21:       def syslog_facility(facility)
+22:         begin
+23:           Syslog.const_get("LOG_#{facility.upcase}")
+24:         rescue NameError => e
+25:           STDERR.puts "Invalid syslog facility #{facility} supplied, reverting to USER"
+26:           Syslog::LOG_USER
+27:         end
+28:       end
+
+ +
+ + +
+ + +
+ + +
+ + valid_levels() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/logger/syslog_logger.rb, line 34
+34:       def valid_levels
+35:         {:info  => :info,
+36:          :warn  => :warning,
+37:          :debug => :debug,
+38:          :fatal => :crit,
+39:          :error => :err}
+40:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/classes/MCollective/Matcher.html b/doc/MCollective/Matcher.html similarity index 59% rename from doc/classes/MCollective/Matcher.html rename to doc/MCollective/Matcher.html index 1e8d9ef..69b8471 100644 --- a/doc/classes/MCollective/Matcher.html +++ b/doc/MCollective/Matcher.html @@ -1,87 +1,349 @@ - - - + + - Module: MCollective::Matcher - - - - + + + Module: MCollective::Matcher + + + + + + + - - - - - - - -
- - - -
- -
-

+ + +

+ + +
+ + + + + + +
+

Namespace

+ +
+ + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Matcher

+ +
+

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 @@ -90,71 +352,48 @@ language Language EBNF

-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} +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}

-
- - -
- - - -
- - - - -
+
-
-

Classes and Modules

+ + - Class MCollective::Matcher::Parser
-Class MCollective::Matcher::Scanner
+ + -
+ + +
+

Public Class Methods

+ +
+ +
+ + create_compound_callstack(call_string) + click to toggle source + +
- - - - - -
-

Public Class methods

- -
- - - - -
-

+

+ +

Creates a callstack to be evaluated from a compound evaluation string

-

[Source]

-
+ + + +
      # File lib/mcollective/matcher.rb, line 181
 181:     def self.create_compound_callstack(call_string)
@@ -165,28 +404,36 @@ Creates a callstack to be evaluated from a compound evaluation string
 186:         end
 187:       end
 188:       callstack
-189:     end
-
-
-
-
- -
- - - - -
-

+189: end +

+ +
+ + +
+ + +
+ + +
+ + create_function_hash(function_call) + click to toggle source + +
+ +
+ +

Helper creates a hash from a function call string

-

[Source]

-
+ + + +
     # File lib/mcollective/matcher.rb, line 17
 17:     def self.create_function_hash(function_call)
@@ -247,29 +494,37 @@ Helper creates a hash from a function call string
 72:       end
 73: 
 74:       func_hash
-75:     end
-
-
-
-
- -
- - - - -
-

+75: end +

+ +
+ + +
+ + +
+ + +
+ + eval_compound_fstatement(function_hash) + click to toggle source + +
+ +
+ +

Returns the result of an evaluated compound statement that includes a function

-

[Source]

-
+ + + +
      # File lib/mcollective/matcher.rb, line 135
 135:     def self.eval_compound_fstatement(function_hash)
@@ -315,28 +570,36 @@ function
 175:         result = eval("#{l_compare} #{function_hash["operator"]} #{function_hash["r_compare"]}")
 176:         (result.nil?) ? false : result
 177:       end
-178:     end
-
-
-
-
- -
- - - - -
-

+178: end +

+ +
+ + +
+ + +
+ + +
+ + eval_compound_statement(expression) + click to toggle source + +
+ +
+ +

Evaluates a compound statement

-

[Source]

-
+ + + +
      # File lib/mcollective/matcher.rb, line 115
 115:     def self.eval_compound_statement(expression)
@@ -355,28 +618,36 @@ Evaluates a compound statement
 128:       else
 129:         return Util.has_cf_class?(expression.values.first)
 130:       end
-131:     end
-
-
-
-
- -
- - - - -
-

+131: end +

+ +
+ + +
+ + +
+ + +
+ + execute_function(function_hash) + click to toggle source + +
+ +
+ +

Returns the result of an executed function

-

[Source]

-
+ + + +
      # File lib/mcollective/matcher.rb, line 78
  78:     def self.execute_function(function_hash)
@@ -413,22 +684,33 @@ Returns the result of an executed function
 109:     rescue NoMethodError
 110:       Log.debug("cannot execute discovery function '#{function_hash["name"]}'. data plugin not found")
 111:       raise DDLValidationError
-112:     end
-
-
-
-
+112: end +
+ +
+ +
-
+ +
+ +
-
+
+ +

Disabled; run with --debug to generate this.

+ +
- +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
- \ No newline at end of file + + diff --git a/doc/classes/MCollective/Matcher/Parser.html b/doc/MCollective/Matcher/Parser.html similarity index 53% rename from doc/classes/MCollective/Matcher/Parser.html rename to doc/MCollective/Matcher/Parser.html index a32d2cc..81092b1 100644 --- a/doc/classes/MCollective/Matcher/Parser.html +++ b/doc/MCollective/Matcher/Parser.html @@ -1,148 +1,408 @@ - - - + + - Class: MCollective::Matcher::Parser - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Matcher::Parser
In: - - lib/mcollective/matcher/parser.rb - -
-
Parent: - Object -
-
- - -
- - - -
- - - -
- -
-

Methods

+ - -
+ Class: MCollective::Matcher::Parser -
+ + + + + - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - -
execution_stack [R] 
scanner [R] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
+ + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Matcher::Parser

+ +
+ +
+ + + + + + +
+

Attributes

+ + +
+ + +
+ scanner[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ execution_stack[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(args) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File lib/mcollective/matcher/parser.rb, line 6
  6:       def initialize(args)
@@ -155,27 +415,40 @@
 13:         exit_with_token_errors if @token_errors.size > 0
 14:         exit_with_parse_errors if @parse_errors.size > 0
 15:         exit_with_paren_errors if @paren_errors.size > 0
-16:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
+16: end +
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + exit_with_paren_errors() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File lib/mcollective/matcher/parser.rb, line 37
 37:       def exit_with_paren_errors
@@ -183,25 +456,34 @@
 39:           @scanner.arguments[i] = Util.colorize(:red, @scanner.arguments[i])
 40:         end
 41:         raise "Missing parenthesis found while parsing -S input #{@scanner.arguments.join}"
-42:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+42: end +
+ +
+ + +
+ + +
+ + +
+ + exit_with_parse_errors() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File lib/mcollective/matcher/parser.rb, line 28
 28:       def exit_with_parse_errors
@@ -211,28 +493,36 @@
 32:           end
 33:         end
 34:         raise "Parse errors found while parsing -S input #{ @scanner.arguments.join}"
-35:       end
-
-
-
-
- -
- - - - -
-

+35: end +

+ +
+ + +
+ + +
+ + +
+ + exit_with_token_errors() + click to toggle source + +
+ +
+ +

Exit and highlight any malformed tokens

-

[Source]

-
+ + + +
     # File lib/mcollective/matcher/parser.rb, line 19
 19:       def exit_with_token_errors
@@ -242,28 +532,36 @@ Exit and highlight any malformed tokens
 23:           end
 24:         end
 25:         raise "Malformed token(s) found while parsing -S input #{@scanner.arguments.join}"
-26:       end
-
-
-
-
- -
- - - - -
-

+26: end +

+ +
+ + +
+ + +
+ + +
+ + parse() + click to toggle source + +
+ +
+ +

Parse the input string, one token at a time a contruct the call stack

-

[Source]

-
+ + + +
      # File lib/mcollective/matcher/parser.rb, line 45
  45:       def parse
@@ -346,22 +644,33 @@ Parse the input string, one token at a time a contruct the call stack
 122:           end
 123:           pre_index = @scanner.token_index
 124:         end
-125:       end
-
-
-
-
+125: end +
+ +
+ +
-
+ +
+ +
-
+
+ +

Disabled; run with --debug to generate this.

+ +
- +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
- \ No newline at end of file + + diff --git a/doc/MCollective/Matcher/Scanner.html b/doc/MCollective/Matcher/Scanner.html new file mode 100644 index 0000000..f5952bf --- /dev/null +++ b/doc/MCollective/Matcher/Scanner.html @@ -0,0 +1,760 @@ + + + + + + + Class: MCollective::Matcher::Scanner + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Matcher::Scanner

+ +
+ +
+ + + + + + +
+

Attributes

+ + +
+ + + + +
+ arguments[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ token_index[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(arguments) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/matcher/scanner.rb, line 6
+ 6:       def initialize(arguments)
+ 7:         @token_index = 0
+ 8:         @arguments = arguments.split("")
+ 9:         @seperation_counter = 0
+10:         @white_spaces = 0
+11:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + get_token() + click to toggle source + +
+ +
+ +

+Scans the input string and identifies single language tokens +

+ + + +
+
+    # File lib/mcollective/matcher/scanner.rb, line 14
+14:       def get_token
+15:         if @token_index >= @arguments.size
+16:           return nil
+17:         end
+18: 
+19:         case @arguments[@token_index]
+20:         when "("
+21:           return "(", "("
+22: 
+23:         when ")"
+24:           return ")", ")"
+25: 
+26:         when "n"
+27:           if (@arguments[@token_index + 1] == "o") && (@arguments[@token_index + 2] == "t") && ((@arguments[@token_index + 3] == " ") || (@arguments[@token_index + 3] == "("))
+28:             @token_index += 2
+29:             return "not", "not"
+30:           else
+31:             gen_statement
+32:           end
+33: 
+34:         when "!"
+35:           return "not", "not"
+36: 
+37:         when "a"
+38:           if (@arguments[@token_index + 1] == "n") && (@arguments[@token_index + 2] == "d") && ((@arguments[@token_index + 3] == " ") || (@arguments[@token_index + 3] == "("))
+39:             @token_index += 2
+40:             return "and", "and"
+41:           else
+42:             gen_statement
+43:           end
+44: 
+45:         when "o"
+46:           if (@arguments[@token_index + 1] == "r") && ((@arguments[@token_index + 2] == " ") || (@arguments[@token_index + 2] == "("))
+47:             @token_index += 1
+48:             return "or", "or"
+49:           else
+50:             gen_statement
+51:           end
+52: 
+53:         when " "
+54:           return " ", " "
+55: 
+56:         else
+57:           gen_statement
+58:         end
+59:       end
+
+ +
+ + +
+ + +
+ +
+

Private Instance Methods

+ + +
+ + +
+ + gen_statement() + click to toggle source + +
+ +
+ +

+Helper generates a statement token +

+ + + +
+
+     # File lib/mcollective/matcher/scanner.rb, line 63
+ 63:       def gen_statement
+ 64:         func = false
+ 65:         current_token_value = ""
+ 66:         j = @token_index
+ 67: 
+ 68:         begin
+ 69:           if (@arguments[j] == "/")
+ 70:             begin
+ 71:               current_token_value << @arguments[j]
+ 72:               j += 1
+ 73:             end until (j >= @arguments.size) || (@arguments[j] =~ /\s/)
+ 74:           elsif (@arguments[j] =~ /=|<|>/)
+ 75:             while !(@arguments[j] =~ /=|<|>/)
+ 76:               current_token_value << @arguments[j]
+ 77:               j += 1
+ 78:             end
+ 79: 
+ 80:             current_token_value << @arguments[j]
+ 81:             j += 1
+ 82: 
+ 83:             if @arguments[j] == "/"
+ 84:               begin
+ 85:                 current_token_value << @arguments[j]
+ 86:                 j += 1
+ 87:                 if @arguments[j] == "/"
+ 88:                   current_token_value << "/"
+ 89:                   break
+ 90:                 end
+ 91:               end until (j >= @arguments.size) || (@arguments[j] =~ /\//)
+ 92:             else
+ 93:               while (j < @arguments.size) && ((@arguments[j] != " ") && (@arguments[j] != ")"))
+ 94:                 current_token_value << @arguments[j]
+ 95:                 j += 1
+ 96:               end
+ 97:             end
+ 98:           else
+ 99:             begin
+100:               # Identify and tokenize regular expressions by ignoring everything between /'s
+101:               if @arguments[j] == '/'
+102:                 current_token_value << '/'
+103:                 j+=1
+104:                 while(j < @arguments.size && @arguments[j] != '/')
+105:                   current_token_value << @arguments[j]
+106:                   j += 1
+107:                 end
+108:                 current_token_value << @arguments[j] if @arguments[j]
+109:                 break
+110:               end
+111:               if @arguments[j+1] == "("
+112:                 func = true
+113:                 be_greedy = true
+114:               end
+115:               current_token_value << @arguments[j]
+116:               if be_greedy
+117:                 while !(j+1 >= @arguments.size) && @arguments[j] != ')'
+118:                   j += 1
+119:                   current_token_value << @arguments[j]
+120:                 end
+121:                 j += 1
+122:                 be_greedy = false
+123:               else
+124:                 j += 1
+125:               end
+126:               if(@arguments[j] == ' ')
+127:                 break if(is_klass?(j) && !(@arguments[j-1] =~ /=|<|>/))
+128:               end
+129:               if( (@arguments[j] == ' ') && (@seperation_counter < 2) && !(current_token_value.match(/^.+(=|<|>).+$/)) )
+130:                 if((index = lookahead(j)))
+131:                   j = index
+132:                 end
+133:               end
+134:             end until (j >= @arguments.size) || (@arguments[j] =~ /\s|\)/)
+135:             @seperation_counter = 0
+136:           end
+137:         rescue Exception => e
+138:           raise "An exception was raised while trying to tokenize '#{current_token_value} - #{e}'"
+139:         end
+140: 
+141:         @token_index += current_token_value.size + @white_spaces - 1
+142:         @white_spaces = 0
+143: 
+144:         # bar(
+145:         if current_token_value.match(/.+?\($/)
+146:           return "bad_token", [@token_index - current_token_value.size + 1, @token_index]
+147:         # /foo/=bar
+148:         elsif current_token_value.match(/^\/.+?\/(<|>|=).+/)
+149:           return "bad_token", [@token_index - current_token_value.size + 1, @token_index]
+150:         elsif current_token_value.match(/^.+?\/(<|>|=).+/)
+151:           return "bad_token", [@token_index - current_token_value.size + 1, @token_index]
+152:         else
+153:           if func
+154:             if current_token_value.match(/^.+?\((\s*(')[^']*(')\s*(,\s*(')[^']*('))*)?\)(\.[a-zA-Z0-9_]+)?((!=|<=|>=|=|>|<).+)?$/) ||
+155:               current_token_value.match(/^.+?\((\s*(")[^"]*(")\s*(,\s*(")[^"]*("))*)?\)(\.[a-zA-Z0-9_]+)?((!=|<=|>=|=|>|<).+)?$/)
+156:               return "fstatement", current_token_value
+157:             else
+158:               return "bad_token", [@token_index - current_token_value.size + 1, @token_index]
+159:             end
+160:           else
+161:             slash_err = false
+162:             current_token_value.split('').each do |c|
+163:               if c == '/'
+164:                 slash_err = !slash_err
+165:               end
+166:             end
+167:             return "bad_token", [@token_index - current_token_value.size + 1, @token_index] if slash_err
+168:             return "statement", current_token_value
+169:           end
+170:         end
+171:       end
+
+ +
+ + +
+ + +
+ + +
+ + is_klass?(j) + click to toggle source + +
+ +
+ +

+Deal with special puppet class statement +

+ + + +
+
+     # File lib/mcollective/matcher/scanner.rb, line 174
+174:       def is_klass?(j)
+175:         while(j < @arguments.size && @arguments[j] == ' ')
+176:           j += 1
+177:         end
+178: 
+179:         if @arguments[j] =~ /=|<|>/
+180:           return false
+181:         else
+182:           return true
+183:         end
+184:       end
+
+ +
+ + +
+ + +
+ + +
+ + lookahead(index) + click to toggle source + +
+ +
+ +

+Eat spaces while looking for the next comparison symbol +

+ + + +
+
+     # File lib/mcollective/matcher/scanner.rb, line 187
+187:       def lookahead(index)
+188:         index += 1
+189:         while(index <= @arguments.size)
+190:           @white_spaces += 1
+191:           unless(@arguments[index] =~ /\s/)
+192:             @seperation_counter +=1
+193:             return index
+194:           end
+195:           index += 1
+196:         end
+197:         return nil
+198:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Message.html b/doc/MCollective/Message.html new file mode 100644 index 0000000..f361275 --- /dev/null +++ b/doc/MCollective/Message.html @@ -0,0 +1,1265 @@ + + + + + + + Class: MCollective::Message + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Message

+ +
+

+container for a message, its headers, agent, collective and other meta data +

+ +
+ + + +
+

Constants

+
+ +
VALIDTYPES
+ +
(Not documented)
+ + +
+
+ + + + +
+

Attributes

+ + +
+ + +
+ message[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ request[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ validated[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ msgtime[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ payload[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ type[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ expected_msgid[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ reply_to[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ headers[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ agent[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ collective[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ filter[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ requestid[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ discovered_hosts[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ options[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ ttl[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(payload, message, options = {}) + click to toggle source + +
+ +
+ +

+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 +

+ + + +
+
+    # File lib/mcollective/message.rb, line 23
+23:     def initialize(payload, message, options = {})
+24:       options = {:base64 => false,
+25:                  :agent => nil,
+26:                  :headers => {},
+27:                  :type => :message,
+28:                  :request => nil,
+29:                  :filter => Util.empty_filter,
+30:                  :options => {},
+31:                  :ttl => 60,
+32:                  :expected_msgid => nil,
+33:                  :requestid => nil,
+34:                  :collective => nil}.merge(options)
+35: 
+36:       @payload = payload
+37:       @message = message
+38:       @requestid = options[:requestid]
+39:       @discovered_hosts = nil
+40:       @reply_to = nil
+41: 
+42:       @type = options[:type]
+43:       @headers = options[:headers]
+44:       @base64 = options[:base64]
+45:       @filter = options[:filter]
+46:       @expected_msgid = options[:expected_msgid]
+47:       @options = options[:options]
+48: 
+49:       @ttl = @options[:ttl] || Config.instance.ttl
+50:       @msgtime = 0
+51: 
+52:       @validated = false
+53: 
+54:       if options[:request]
+55:         @request = options[:request]
+56:         @agent = request.agent
+57:         @collective = request.collective
+58:         @type = :reply
+59:       else
+60:         @agent = options[:agent]
+61:         @collective = options[:collective]
+62:       end
+63: 
+64:       base64_decode!
+65:     end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + base64?() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/message.rb, line 129
+129:     def base64?
+130:       @base64
+131:     end
+
+ +
+ + +
+ + +
+ + +
+ + base64_decode!() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/message.rb, line 115
+115:     def base64_decode!
+116:       return unless @base64
+117: 
+118:       @payload = SSL.base64_decode(@payload)
+119:       @base64 = false
+120:     end
+
+ +
+ + +
+ + +
+ + +
+ + base64_encode!() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/message.rb, line 122
+122:     def base64_encode!
+123:       return if @base64
+124: 
+125:       @payload = SSL.base64_encode(@payload)
+126:       @base64 = true
+127:     end
+
+ +
+ + +
+ + +
+ + +
+ + create_reqid() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/message.rb, line 226
+226:     def create_reqid
+227:       # we gsub out the -s so that the format of the id does not
+228:       # change from previous versions, these should just be more
+229:       # unique than previous ones
+230:       SSL.uuid.gsub("-", "")
+231:     end
+
+ +
+ + +
+ + +
+ + +
+ + decode!() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/message.rb, line 175
+175:     def decode!
+176:       raise "Cannot decode message type #{type}" unless [:request, :reply].include?(type)
+177: 
+178:       @payload = PluginManager["security_plugin"].decodemsg(self)
+179: 
+180:       if type == :request
+181:         raise 'callerid in request is not valid, surpressing reply to potentially forged request' unless PluginManager["security_plugin"].valid_callerid?(payload[:callerid])
+182:       end
+183: 
+184:       [:collective, :agent, :filter, :requestid, :ttl, :msgtime].each do |prop|
+185:         instance_variable_set("@#{prop}", payload[prop]) if payload.include?(prop)
+186:       end
+187:     end
+
+ +
+ + +
+ + +
+ + +
+ + encode!() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/message.rb, line 133
+133:     def encode!
+134:       case type
+135:         when :reply
+136:           raise "Cannot encode a reply message if no request has been associated with it" unless request
+137:           raise 'callerid in original request is not valid, surpressing reply to potentially forged request' unless PluginManager["security_plugin"].valid_callerid?(request.payload[:callerid])
+138: 
+139:           @requestid = request.payload[:requestid]
+140:           @payload = PluginManager["security_plugin"].encodereply(agent, payload, requestid, request.payload[:callerid])
+141:         when :request, :direct_request
+142:           validate_compound_filter(@filter["compound"]) unless @filter["compound"].empty?
+143: 
+144:           @requestid = create_reqid unless @requestid
+145:           @payload = PluginManager["security_plugin"].encoderequest(Config.instance.identity, payload, requestid, filter, agent, collective, ttl)
+146:         else
+147:           raise "Cannot encode #{type} messages"
+148:       end
+149:     end
+
+ +
+ + +
+ + +
+ + +
+ + expected_msgid=(msgid) + click to toggle source + +
+ +
+ +

+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. +

+ + + +
+
+     # File lib/mcollective/message.rb, line 110
+110:     def expected_msgid=(msgid)
+111:       raise "Can only store the expected msgid for reply messages" unless @type == :reply
+112:       @expected_msgid = msgid
+113:     end
+
+ +
+ + +
+ + +
+ + +
+ + publish() + click to toggle source + +
+ +
+ +

+publish a reply message by creating a target name and sending it +

+ + + +
+
+     # File lib/mcollective/message.rb, line 213
+213:     def publish
+214:       # If we've been specificaly told about hosts that were discovered
+215:       # use that information to do P2P calls if appropriate else just
+216:       # send it as is.
+217:       config = Config.instance
+218:       if @discovered_hosts && config.direct_addressing && (@discovered_hosts.size <= config.direct_addressing_threshold)
+219:         self.type = :direct_request
+220:         Log.debug("Handling #{requestid} as a direct request")
+221:       end
+222: 
+223:       PluginManager['connector_plugin'].publish(self)
+224:     end
+
+ +
+ + +
+ + +
+ + +
+ + reply_to=(target) + click to toggle source + +
+ +
+ +

+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 +

+ + + +
+
+     # File lib/mcollective/message.rb, line 99
+ 99:     def reply_to=(target)
+100:       raise "Custom reply targets can only be set on requests" unless [:request, :direct_request].include?(@type)
+101: 
+102:       @reply_to = target
+103:     end
+
+ +
+ + +
+ + +
+ + +
+ + type=(type) + click to toggle source + +
+ +
+ +

+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. +

+

+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. +

+ + + +
+
+    # File lib/mcollective/message.rb, line 76
+76:     def type=(type)
+77:       raise "Unknown message type #{type}" unless VALIDTYPES.include?(type)
+78: 
+79:       if type == :direct_request
+80:         raise "Direct requests is not enabled using the direct_addressing config option" unless Config.instance.direct_addressing
+81: 
+82:         unless @discovered_hosts && !@discovered_hosts.empty?
+83:           raise "Can only set type to :direct_request if discovered_hosts have been set"
+84:         end
+85: 
+86:         # clear out the filter, custom discovery sources might interpret the filters
+87:         # different than the remote mcollectived and in directed mode really the only
+88:         # filter that matters is the agent filter
+89:         @filter = Util.empty_filter
+90:         @filter["agent"] << @agent
+91:       end
+92: 
+93:       @type = type
+94:     end
+
+ +
+ + +
+ + +
+ + +
+ + validate() + click to toggle source + +
+ +
+ +

+Perform validation against the message by checking filters and ttl +

+ + + +
+
+     # File lib/mcollective/message.rb, line 190
+190:     def validate
+191:       raise "Can only validate request messages" unless type == :request
+192: 
+193:       msg_age = Time.now.utc.to_i - msgtime
+194: 
+195:       if msg_age > ttl
+196:         cid = ""
+197:         cid += payload[:callerid] + "@" if payload.include?(:callerid)
+198:         cid += payload[:senderid]
+199: 
+200:         if msg_age > ttl
+201:           PluginManager["global_stats"].ttlexpired
+202: 
+203:           raise(MsgTTLExpired, "message #{requestid} from #{cid} created at #{msgtime} is #{msg_age} seconds old, TTL is #{ttl}")
+204:         end
+205:       end
+206: 
+207:       raise(NotTargettedAtUs, "Received message is not targetted to us") unless PluginManager["security_plugin"].validate_filter?(payload[:filter])
+208: 
+209:       @validated = true
+210:     end
+
+ +
+ + +
+ + +
+ + +
+ + validate_compound_filter(compound_filter) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/message.rb, line 151
+151:     def validate_compound_filter(compound_filter)
+152:       compound_filter.each do |filter|
+153:         filter.each do |statement|
+154:           if statement["fstatement"]
+155:             functionname = statement["fstatement"]["name"]
+156:             pluginname = Data.pluginname(functionname)
+157:             value = statement["fstatement"]["value"]
+158: 
+159:             ddl = DDL.new(pluginname, :data)
+160: 
+161:             # parses numbers and booleans entered as strings into proper
+162:             # types of data so that DDL validation will pass
+163:             statement["fstatement"]["params"] = Data.ddl_transform_input(ddl, statement["fstatement"]["params"])
+164: 
+165:             Data.ddl_validate(ddl, statement["fstatement"]["params"])
+166: 
+167:             unless value && Data.ddl_has_output?(ddl, value)
+168:               DDL.validation_fail!(:PLMC41, "Data plugin '%{functionname}()' does not return a '%{value}' value", :error, {:functionname => functionname, :value => value})
+169:             end
+170:           end
+171:         end
+172:       end
+173:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/MissingRPCData.html b/doc/MCollective/MissingRPCData.html new file mode 100644 index 0000000..90d7372 --- /dev/null +++ b/doc/MCollective/MissingRPCData.html @@ -0,0 +1,348 @@ + + + + + + + Class: MCollective::MissingRPCData + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::MissingRPCData

+ +
+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/MsgDoesNotMatchRequestID.html b/doc/MCollective/MsgDoesNotMatchRequestID.html new file mode 100644 index 0000000..4c32689 --- /dev/null +++ b/doc/MCollective/MsgDoesNotMatchRequestID.html @@ -0,0 +1,348 @@ + + + + + + + Class: MCollective::MsgDoesNotMatchRequestID + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::MsgDoesNotMatchRequestID

+ +
+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/MsgTTLExpired.html b/doc/MCollective/MsgTTLExpired.html new file mode 100644 index 0000000..6cff0cb --- /dev/null +++ b/doc/MCollective/MsgTTLExpired.html @@ -0,0 +1,348 @@ + + + + + + + Class: MCollective::MsgTTLExpired + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::MsgTTLExpired

+ +
+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/NotTargettedAtUs.html b/doc/MCollective/NotTargettedAtUs.html new file mode 100644 index 0000000..642fa39 --- /dev/null +++ b/doc/MCollective/NotTargettedAtUs.html @@ -0,0 +1,348 @@ + + + + + + + Class: MCollective::NotTargettedAtUs + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::NotTargettedAtUs

+ +
+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/classes/MCollective/Optionparser.html b/doc/MCollective/Optionparser.html similarity index 55% rename from doc/classes/MCollective/Optionparser.html rename to doc/MCollective/Optionparser.html index 946d0f2..2a15570 100644 --- a/doc/classes/MCollective/Optionparser.html +++ b/doc/MCollective/Optionparser.html @@ -1,150 +1,396 @@ - - - + + - Class: MCollective::Optionparser - - - - - - - - - - -
- - - - - - - - - + - - - - -
ClassMCollective::Optionparser
In: - - lib/mcollective/optionparser.rb - -
-
Parent: - Object -
-
- + Class: MCollective::Optionparser -
+ + + + + - -
- -
-

+ + + +

+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Optionparser

+ +
+

A simple helper to build cli tools that supports a uniform command line layout.

-
- - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - -
parser [R] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

-Creates a new instance of the -parser, you can supply defaults and include named groups of options. +

+ + + + + + +
+

Attributes

+ + +
+ + +
+ parser[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(defaults = {}, include_sections = nil, exclude_sections = nil) + click to toggle source + +
+ +
+ +

+Creates a new instance of the parser, you can supply defaults and include +named groups of options.

Starts a parser that defaults to verbose and that includs the filter @@ -165,9 +411,11 @@ Starts a parser in verbose mode that does not show the common options:

  oparser = MCollective::Optionparser.new({:verbose => true}, "filter", "common")
 
-

[Source]

-
+ + + +
     # File lib/mcollective/optionparser.rb, line 20
 20:     def initialize(defaults = {}, include_sections = nil, exclude_sections = nil)
@@ -179,30 +427,42 @@ Starts a parser in verbose mode that does not show the common options:
 26:       @options = Util.default_options
 27: 
 28:       @options.merge!(defaults)
-29:     end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

+29: end +

+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + add_common_options() + click to toggle source + +
+ +
+ +

These options will be added to most cli tools

-

[Source]

-
+ + + +
      # File lib/mcollective/optionparser.rb, line 128
 128:     def add_common_options
@@ -257,29 +517,37 @@ These options will be added to most cli tools
 177:       @parser.on("--threaded", "Start publishing requests and receiving responses in threaded mode.") do |v|
 178:         @options[:threaded] = true
 179:       end
-180:     end
-
-
-
-
- -
- - - - -
-

+180: end +

+ +
+ + +
+ + +
+ + +
+ + add_filter_options() + click to toggle source + +
+ +
+ +

These options will be added if you pass ‘filter’ into the include list of the constructor.

-

[Source]

-
+ + + +
      # File lib/mcollective/optionparser.rb, line 73
  73:     def add_filter_options
@@ -318,28 +586,36 @@ include list of the constructor.
 106:       @parser.on('-I', '--wi', '--with-identity IDENT', 'Match hosts with a certain configured identity') do |a|
 107:         @options[:filter]["identity"] << a
 108:       end
-109:     end
-
-
-
-
- -
- - - - -
-

+109: end +

+ +
+ + +
+ + +
+ + +
+ + add_required_options() + click to toggle source + +
+ +
+ +

These options should always be present

-

[Source]

-
+ + + +
      # File lib/mcollective/optionparser.rb, line 112
 112:     def add_required_options
@@ -355,23 +631,29 @@ These options should always be present
 122:         puts @parser
 123:         exit! 1
 124:       end
-125:     end
-
-
-
-
- -
- - - - -
-

+125: end +

+ +
+ + +
+ + +
+ + +
+ + parse(&block) + click to toggle source + +
+ +
+ +

Parse the options returning the options, you can pass a block that adds additional options to the Optionparser.

@@ -394,9 +676,11 @@ message specific to this app. Users can set default options that get parsed in using the MCOLLECTIVE_EXTRA_OPTS environemnt variable

-

[Source]

-
+ + + +
     # File lib/mcollective/optionparser.rb, line 48
 48:     def parse(&block)
@@ -420,22 +704,73 @@ MCOLLECTIVE_EXTRA_OPTS environemnt variable
 66:       @options[:collective] = Config.instance.main_collective unless @options[:collective]
 67: 
 68:       @options
-69:     end
-
-
-
-
+69: end +
+ +
+ + +
+ + +
+ +
+

Private Instance Methods

+ + +
+ + +
+ + parse_fact(fact) + click to toggle source + +
+ +
+ +

+Parse a fact filter string like foo=bar into the tuple hash thats needed +

+ + +
+
+     # File lib/mcollective/optionparser.rb, line 184
+184:     def parse_fact(fact)
+185:       Util.parse_fact_string(fact)
+186:     end
+
+ +
-
+ +
+ +
+ -
+
- +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
- \ No newline at end of file + + diff --git a/doc/MCollective/PluginManager.html b/doc/MCollective/PluginManager.html new file mode 100644 index 0000000..2c4945e --- /dev/null +++ b/doc/MCollective/PluginManager.html @@ -0,0 +1,894 @@ + + + + + + + Module: MCollective::PluginManager + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::PluginManager

+ +
+

+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. +

+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + <<(plugin) + click to toggle source + +
+ +
+ +

+Adds a plugin to the list of plugins, we expect a hash like: +

+
+   {:type => "base",
+    :class => foo.new}
+
+

+or like: +

+
+   {:type => "base",
+    :class => "Foo::Bar"}
+
+

+In the event that we already have a class with the given type an exception +will be raised. +

+

+If the :class passed is a String 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. +

+

+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 [] +

+

+By default all plugin instances are cached and returned later so +there’s always a single instance. You can pass :single_instance => +false when calling this to instruct it to always return a new instance when +a copy is requested. This only works with sending a String for :class. +

+ + + +
+
+    # File lib/mcollective/pluginmanager.rb, line 30
+30:     def self.<<(plugin)
+31:       plugin[:single_instance] = true unless plugin.include?(:single_instance)
+32: 
+33:       type = plugin[:type]
+34:       klass = plugin[:class]
+35:       single = plugin[:single_instance]
+36: 
+37:       raise("Plugin #{type} already loaded") if @plugins.include?(type)
+38: 
+39: 
+40:       # If we get a string then store 'nil' as the instance, signalling that we'll
+41:       # create the class later on demand.
+42:       if klass.is_a?(String)
+43:         @plugins[type] = {:loadtime => Time.now, :class => klass, :instance => nil, :single => single}
+44:         Log.debug("Registering plugin #{type} with class #{klass} single_instance: #{single}")
+45:       else
+46:         @plugins[type] = {:loadtime => Time.now, :class => klass.class, :instance => klass, :single => true}
+47:         Log.debug("Registering plugin #{type} with class #{klass.class} single_instance: true")
+48:       end
+49:     end
+
+ +
+ + +
+ + +
+ + +
+ + [](plugin) + click to toggle source + +
+ +
+ +

+Gets a plugin by type +

+ + + +
+
+    # File lib/mcollective/pluginmanager.rb, line 72
+72:     def self.[](plugin)
+73:       raise("No plugin #{plugin} defined") unless @plugins.include?(plugin)
+74: 
+75:       klass = @plugins[plugin][:class]
+76: 
+77:       if @plugins[plugin][:single]
+78:         # Create an instance of the class if one hasn't been done before
+79:         if @plugins[plugin][:instance] == nil
+80:           Log.debug("Returning new plugin #{plugin} with class #{klass}")
+81:           @plugins[plugin][:instance] = create_instance(klass)
+82:         else
+83:           Log.debug("Returning cached plugin #{plugin} with class #{klass}")
+84:         end
+85: 
+86:         @plugins[plugin][:instance]
+87:       else
+88:         Log.debug("Returning new plugin #{plugin} with class #{klass}")
+89:         create_instance(klass)
+90:       end
+91:     end
+
+ +
+ + +
+ + +
+ + +
+ + clear() + click to toggle source + +
+ +
+ +

+deletes all registered plugins +

+ + + +
+
+    # File lib/mcollective/pluginmanager.rb, line 67
+67:     def self.clear
+68:       @plugins.clear
+69:     end
+
+ +
+ + +
+ + +
+ + +
+ + create_instance(klass) + click to toggle source + +
+ +
+ +

+use eval to create an instance of a class +

+ + + +
+
+     # File lib/mcollective/pluginmanager.rb, line 94
+ 94:     def self.create_instance(klass)
+ 95:       begin
+ 96:         eval("#{klass}.new")
+ 97:       rescue Exception => e
+ 98:         raise("Could not create instance of plugin #{klass}: #{e}")
+ 99:       end
+100:     end
+
+ +
+ + +
+ + +
+ + +
+ + delete(plugin) + click to toggle source + +
+ +
+ +

+Removes a plugim the list +

+ + + +
+
+    # File lib/mcollective/pluginmanager.rb, line 52
+52:     def self.delete(plugin)
+53:       @plugins.delete(plugin) if @plugins.include?(plugin)
+54:     end
+
+ +
+ + +
+ + +
+ + +
+ + find(type, extension="rb") + click to toggle source + +
+ +
+ +

+Finds plugins in all configured libdirs +

+
+  find("agent")
+
+

+will return an array of just agent names, for example: +

+
+  ["puppetd", "package"]
+
+

+Can also be used to find files of other extensions: +

+
+  find("agent", "ddl")
+
+

+Will return the same list but only of files with extension .ddl in the +agent subdirectory +

+ + + +
+
+     # File lib/mcollective/pluginmanager.rb, line 116
+116:     def self.find(type, extension="rb")
+117:       extension = ".#{extension}" unless extension.match(/^\./)
+118: 
+119:       plugins = []
+120: 
+121:       Config.instance.libdir.each do |libdir|
+122:         plugdir = File.join([libdir, "mcollective", type.to_s])
+123:         next unless File.directory?(plugdir)
+124: 
+125:         Dir.new(plugdir).grep(/#{extension}$/).map do |plugin|
+126:           plugins << File.basename(plugin, extension)
+127:         end
+128:       end
+129: 
+130:       plugins.sort.uniq
+131:     end
+
+ +
+ + +
+ + +
+ + +
+ + find_and_load(type, extension="rb") + click to toggle source + +
+ +
+ +

+Finds and loads from disk all plugins from all libdirs that match certain +criteria. +

+
+   find_and_load("pluginpackager")
+
+

+Will find all .rb files in the libdir/mcollective/pluginpackager/ directory +in all libdirs and load them from disk. +

+

+You can influence what plugins get loaded using a block notation: +

+
+   find_and_load("pluginpackager") do |plugin|
+      plugin.match(/puppet/)
+   end
+
+

+This will load only plugins matching /puppet/ +

+ + + +
+
+     # File lib/mcollective/pluginmanager.rb, line 148
+148:     def self.find_and_load(type, extension="rb")
+149:       extension = ".#{extension}" unless extension.match(/^\./)
+150: 
+151:       klasses = find(type, extension).map do |plugin|
+152:         if block_given?
+153:           next unless yield(plugin)
+154:         end
+155: 
+156:         "%s::%s::%s" % [ "MCollective", type.capitalize, plugin.capitalize ]
+157:       end.compact
+158: 
+159:       klasses.sort.uniq.each {|klass| loadclass(klass, true)}
+160:     end
+
+ +
+ + +
+ + +
+ + +
+ + grep(regex) + click to toggle source + +
+ +
+ +

+Grep’s over the plugin list and returns the list found +

+ + + +
+
+     # File lib/mcollective/pluginmanager.rb, line 176
+176:     def self.grep(regex)
+177:       @plugins.keys.grep(regex)
+178:     end
+
+ +
+ + +
+ + +
+ + +
+ + include?(plugin) + click to toggle source + +
+ +
+ +

+Finds out if we have a plugin with the given name +

+ + + +
+
+    # File lib/mcollective/pluginmanager.rb, line 57
+57:     def self.include?(plugin)
+58:       @plugins.include?(plugin)
+59:     end
+
+ +
+ + +
+ + +
+ + +
+ + loadclass(klass, squash_failures=false) + click to toggle source + +
+ +
+ +

+Loads a class from file by doing some simple search/replace on class names +and then doing a require. +

+ + + +
+
+     # File lib/mcollective/pluginmanager.rb, line 164
+164:     def self.loadclass(klass, squash_failures=false)
+165:       fname = klass.gsub("::", "/").downcase + ".rb"
+166: 
+167:       Log.debug("Loading #{klass} from #{fname}")
+168: 
+169:       load fname
+170:     rescue Exception => e
+171:       Log.error("Failed to load #{klass}: #{e}")
+172:       raise unless squash_failures
+173:     end
+
+ +
+ + +
+ + +
+ + +
+ + pluginlist() + click to toggle source + +
+ +
+ +

+Provides a list of plugins we know about +

+ + + +
+
+    # File lib/mcollective/pluginmanager.rb, line 62
+62:     def self.pluginlist
+63:       @plugins.keys.sort
+64:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/PluginPackager.html b/doc/MCollective/PluginPackager.html new file mode 100644 index 0000000..7bdf934 --- /dev/null +++ b/doc/MCollective/PluginPackager.html @@ -0,0 +1,697 @@ + + + + + + + Module: MCollective::PluginPackager + + + + + + + + + + + +
+ + + + +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::PluginPackager

+ +
+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + [](klass) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/pluginpackager.rb, line 12
+12:     def self.[](klass)
+13:       const_get("#{klass}")
+14:     end
+
+ +
+ + +
+ + +
+ + +
+ + check_dir_present(path) + click to toggle source + +
+ +
+ +

+Checks if a directory is present and not empty +

+ + + +
+
+    # File lib/mcollective/pluginpackager.rb, line 31
+31:     def self.check_dir_present(path)
+32:       (File.directory?(path) && !Dir.glob(File.join(path, "*")).empty?)
+33:     end
+
+ +
+ + +
+ + +
+ + +
+ + command_available?(build_tool) + click to toggle source + +
+ +
+ +

+Checks if a build tool is present on the system +

+ + + +
+
+    # File lib/mcollective/pluginpackager.rb, line 54
+54:     def self.command_available?(build_tool)
+55:       ENV["PATH"].split(File::PATH_SEPARATOR).each do |path|
+56:         builder = File.join(path, build_tool)
+57:         if File.exists?(builder)
+58:           return true
+59:         end
+60:       end
+61:       false
+62:     end
+
+ +
+ + +
+ + +
+ + +
+ + execute_verbosely(verbose, &block) + click to toggle source + +
+ +
+ +

+Quietly calls a block if verbose parameter is false +

+ + + +
+
+    # File lib/mcollective/pluginpackager.rb, line 36
+36:     def self.execute_verbosely(verbose, &block)
+37:       unless verbose
+38:         old_stdout = $stdout.clone
+39:         $stdout.reopen(File.new("/dev/null", "w"))
+40:         begin
+41:           block.call
+42:         rescue Exception => e
+43:           $stdout.reopen old_stdout
+44:           raise e
+45:         ensure
+46:           $stdout.reopen old_stdout
+47:         end
+48:       else
+49:         block.call
+50:       end
+51:     end
+
+ +
+ + +
+ + +
+ + +
+ + filter_dependencies(prefix, dependencies) + click to toggle source + +
+ +
+ +

+Filter out platform specific dependencies Given a list of dependencies +named - debian::foo redhat::bar PluginPackager.filter_dependencies(‘debian’, +dependencies) will return foo. +

+ + + +
+
+    # File lib/mcollective/pluginpackager.rb, line 74
+74:     def self.filter_dependencies(prefix, dependencies)
+75:       dependencies.map do |dependency|
+76:         if dependency[:name] =~ /^(\w+)::(\w+)/
+77:           if prefix == $1
+78:             dependency[:name] = $2
+79:             dependency
+80:           else
+81:             nil
+82:           end
+83:         else
+84:           dependency
+85:         end
+86:       end.reject{ |dependency| dependency == nil }
+87:     end
+
+ +
+ + +
+ + +
+ + +
+ + get_metadata(path, type) + click to toggle source + +
+ +
+ +

+Fetch and return metadata from plugin DDL +

+ + + +
+
+    # File lib/mcollective/pluginpackager.rb, line 17
+17:     def self.get_metadata(path, type)
+18:       ddl = DDL.new("package", type.to_sym, false)
+19: 
+20:       begin
+21:         ddl_file = File.read(Dir.glob(File.join(path, type, "*.ddl")).first)
+22:       rescue Exception
+23:         raise "failed to load ddl file in plugin directory : #{File.join(path, type)}"
+24:       end
+25:       ddl.instance_eval ddl_file
+26: 
+27:       return ddl.meta, ddl.requirements[:mcollective]
+28:     end
+
+ +
+ + +
+ + +
+ + +
+ + load_packagers() + click to toggle source + +
+ +
+ +

+Package implementation plugins +

+ + + +
+
+    # File lib/mcollective/pluginpackager.rb, line 8
+ 8:     def self.load_packagers
+ 9:       PluginManager.find_and_load("pluginpackager")
+10:     end
+
+ +
+ + +
+ + +
+ + +
+ + safe_system(*args) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/pluginpackager.rb, line 64
+64:     def self.safe_system(*args)
+65:       raise(RuntimeError, "Failed: #{args.join(' ')}") unless system *args
+66:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/PluginPackager/AgentDefinition.html b/doc/MCollective/PluginPackager/AgentDefinition.html new file mode 100644 index 0000000..c95beea --- /dev/null +++ b/doc/MCollective/PluginPackager/AgentDefinition.html @@ -0,0 +1,820 @@ + + + + + + + Class: MCollective::PluginPackager::AgentDefinition + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::PluginPackager::AgentDefinition

+ +
+

+MCollective Agent Plugin package +

+ +
+ + + + + + +
+

Attributes

+ + +
+ + + + +
+ path[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ packagedata[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ metadata[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ target_path[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ vendor[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ revision[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ preinstall[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ plugintype[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ dependencies[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ postinstall[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ mcname[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ mcversion[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(configuration, mcdependency, plugintype) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/pluginpackager/agent_definition.rb, line 8
+ 8:       def initialize(configuration, mcdependency, plugintype)
+ 9:         @plugintype = plugintype
+10:         @path = configuration[:target]
+11:         @packagedata = {}
+12:         @revision = configuration[:revision] || 1
+13:         @preinstall = configuration[:preinstall]
+14:         @postinstall = configuration[:postinstall]
+15:         @vendor = configuration[:vendor] || "Puppet Labs"
+16:         @dependencies = configuration[:dependency] || []
+17:         @target_path = File.expand_path(@path)
+18:         @metadata, mcversion = PluginPackager.get_metadata(@path, "agent")
+19:         @mcname = mcdependency[:mcname] ||  "mcollective"
+20:         @mcversion = mcdependency[:mcversion] || mcversion
+21:         @metadata[:version] = (configuration[:version] || @metadata[:version])
+22:         @dependencies << {:name => "#{@mcname}-common", :version => @mcversion}
+23:         @metadata[:name] = (configuration[:pluginname] || @metadata[:name]).downcase.gsub(/\s+|_/, "-")
+24:         identify_packages
+25:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + agent() + click to toggle source + +
+ +
+ +

+Obtain Agent package files and dependencies. +

+ + + +
+
+    # File lib/mcollective/pluginpackager/agent_definition.rb, line 38
+38:       def agent
+39:         agent = {:files => [],
+40:                  :dependencies => @dependencies.clone,
+41:                  :description => "Agent plugin for #{@metadata[:name]}"}
+42: 
+43:         agentdir = File.join(@path, "agent")
+44: 
+45:         if PluginPackager.check_dir_present agentdir
+46:           ddls = Dir.glob(File.join(agentdir, "*.ddl"))
+47:           agent[:files] = (Dir.glob(File.join(agentdir, "*")) - ddls)
+48:         else
+49:           return nil
+50:         end
+51:         agent[:plugindependency] = {:name => "#{@mcname}-#{@metadata[:name]}-common", :version => @metadata[:version], :revision => @revision}
+52:         agent
+53:       end
+
+ +
+ + +
+ + +
+ + +
+ + client() + click to toggle source + +
+ +
+ +

+Obtain client package files and dependencies. +

+ + + +
+
+    # File lib/mcollective/pluginpackager/agent_definition.rb, line 56
+56:       def client
+57:         client = {:files => [],
+58:                   :dependencies => @dependencies.clone,
+59:                   :description => "Client plugin for #{@metadata[:name]}"}
+60: 
+61:         clientdir = File.join(@path, "application")
+62:         aggregatedir = File.join(@path, "aggregate")
+63: 
+64:         client[:files] += Dir.glob(File.join(clientdir, "*")) if PluginPackager.check_dir_present clientdir
+65:         client[:files] += Dir.glob(File.join(aggregatedir, "*")) if PluginPackager.check_dir_present aggregatedir
+66:         client[:plugindependency] = {:name => "#{@mcname}-#{@metadata[:name]}-common", :version => @metadata[:version], :revision => @revision}
+67:         client[:files].empty? ? nil : client
+68:       end
+
+ +
+ + +
+ + +
+ + +
+ + common() + click to toggle source + +
+ +
+ +

+Obtain common package files and dependencies. +

+ + + +
+
+    # File lib/mcollective/pluginpackager/agent_definition.rb, line 71
+71:       def common
+72:         common = {:files =>[],
+73:                   :dependencies => @dependencies.clone,
+74:                   :description => "Common libraries for #{@metadata[:name]}"}
+75: 
+76:         datadir = File.join(@path, "data", "**")
+77:         utildir = File.join(@path, "util", "**", "**")
+78:         ddldir = File.join(@path, "agent", "*.ddl")
+79:         validatordir = File.join(@path, "validator", "**")
+80: 
+81:         [datadir, utildir, validatordir, ddldir].each do |directory|
+82:           common[:files] += Dir.glob(directory)
+83:         end
+84: 
+85:         # We fail if there is no ddl file present
+86:         if common[:files].grep(/^.*\.ddl$/).empty?
+87:           raise "cannot create package - No ddl file found in #{File.join(@path, "agent")}"
+88:         end
+89: 
+90:         common[:files].empty? ? nil : common
+91:       end
+
+ +
+ + +
+ + +
+ + +
+ + identify_packages() + click to toggle source + +
+ +
+ +

+Identify present packages and populate packagedata hash. +

+ + + +
+
+    # File lib/mcollective/pluginpackager/agent_definition.rb, line 28
+28:       def identify_packages
+29:         common_package = common
+30:         @packagedata[:common] = common_package if common_package
+31:         agent_package = agent
+32:         @packagedata[:agent] = agent_package if agent_package
+33:         client_package = client
+34:         @packagedata[:client] = client_package if client_package
+35:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/PluginPackager/StandardDefinition.html b/doc/MCollective/PluginPackager/StandardDefinition.html new file mode 100644 index 0000000..4888dbd --- /dev/null +++ b/doc/MCollective/PluginPackager/StandardDefinition.html @@ -0,0 +1,761 @@ + + + + + + + Class: MCollective::PluginPackager::StandardDefinition + + + + + + + + + + + +
+
+ + + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::PluginPackager::StandardDefinition

+ +
+ +
+ + + + + + +
+

Attributes

+ + +
+ + + + +
+ path[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ packagedata[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ metadata[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ target_path[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ vendor[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ revision[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ plugintype[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ preinstall[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ postinstall[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ dependencies[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ mcname[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ mcversion[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(configuration, mcdependency, plugintype) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/pluginpackager/standard_definition.rb, line 7
+ 7:       def initialize(configuration, mcdependency, plugintype)
+ 8:         @plugintype = plugintype
+ 9:         @path = configuration[:target]
+10:         @packagedata = {}
+11:         @revision = configuration[:revision] || 1
+12:         @preinstall = configuration[:preinstall]
+13:         @postinstall = configuration[:postinstall]
+14:         @vendor = configuration[:vendor] || "Puppet Labs"
+15:         @dependencies = configuration[:dependency] || []
+16:         @target_path = File.expand_path(@path)
+17:         @metadata, mcversion = PluginPackager.get_metadata(@path, @plugintype)
+18:         @mcname = mcdependency[:mcname] || "mcollective"
+19:         @mcversion = mcdependency[:mcversion] || mcversion
+20:         @dependencies << {:name => "#{mcname}-common", :version => @mcversion}
+21:         @metadata[:name] = (configuration[:pluginname] || @metadata[:name]).downcase.gsub(/\s+|_/, "-")
+22:         @metadata[:version] = (configuration[:version] || @metadata[:version])
+23:         identify_packages
+24:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + common() + click to toggle source + +
+ +
+ +

+Obtain list of common files +

+ + + +
+
+    # File lib/mcollective/pluginpackager/standard_definition.rb, line 54
+54:       def common
+55:         common = {:files => [],
+56:                   :dependencies => @dependencies.clone,
+57:                   :description => "Common libraries for #{@name} connector plugin"}
+58: 
+59:         commondir = File.join(@path, "util")
+60:         if PluginPackager.check_dir_present commondir
+61:           common[:files] = Dir.glob(File.join(commondir, "*"))
+62:           return common
+63:         else
+64:           return nil
+65:         end
+66:       end
+
+ +
+ + +
+ + +
+ + +
+ + identify_packages() + click to toggle source + +
+ +
+ +

+Identify present packages and populate the packagedata hash +

+ + + +
+
+    # File lib/mcollective/pluginpackager/standard_definition.rb, line 27
+27:       def identify_packages
+28:         common_package = common
+29:         @packagedata[:common] = common_package if common_package
+30:         plugin_package = plugin
+31:         @packagedata[@plugintype.to_sym] = plugin_package if plugin_package
+32:       end
+
+ +
+ + +
+ + +
+ + +
+ + plugin() + click to toggle source + +
+ +
+ +

+Obtain standard plugin files and dependencies +

+ + + +
+
+    # File lib/mcollective/pluginpackager/standard_definition.rb, line 35
+35:       def plugin
+36:         plugindata = {:files => [],
+37:                       :dependencies => @dependencies.clone,
+38:                       :description => "#{@name} #{@plugintype} plugin for the Marionette Collective."}
+39: 
+40:         plugindir = File.join(@path, @plugintype.to_s)
+41:         if PluginPackager.check_dir_present plugindir
+42:           plugindata[:files] = Dir.glob(File.join(plugindir, "*"))
+43:         else
+44:           return nil
+45:         end
+46: 
+47:         plugindata[:plugindependency] = {:name => "#{@mcname}-#{@metadata[:name]}-common",
+48:                                       :version => @metadata[:version],
+49:                                       :revision => @revision} if @packagedata[:common]
+50:         plugindata
+51:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/RPC.html b/doc/MCollective/RPC.html new file mode 100644 index 0000000..9749273 --- /dev/null +++ b/doc/MCollective/RPC.html @@ -0,0 +1,848 @@ + + + + + + + Module: MCollective::RPC + + + + + + + + + + + +
+ + + + +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::RPC

+ +
+

+Toolset to create a standard interface of client and agent using an RPC metaphor, standard compliant agents will make it +easier to create generic clients like web interfaces etc +

+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + const_missing(const_name) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/rpc.rb, line 175
+175:     def self.const_missing(const_name)
+176:       super unless const_name == :DDL
+177: 
+178:       Log.warn("MCollective::RPC::DDL is deprecatd, please use MCollective::DDL instead")
+179:       MCollective::DDL
+180:     end
+
+ +
+ + +
+ + +
+ + +
+ + discovered(discovered) + click to toggle source + +
+ +
+ +

+means for other classes to drop discovered hosts into this module its a bit +hacky but needed so that the mixin methods like printrpcstats can easily +get access to it without users having to pass it around in params. +

+ + + +
+
+     # File lib/mcollective/rpc.rb, line 107
+107:     def self.discovered(discovered)
+108:       @@discovered = discovered
+109:     end
+
+ +
+ + +
+ + +
+ + +
+ + stats(stats) + click to toggle source + +
+ +
+ +

+means for other classes to drop stats into this module its a bit hacky but +needed so that the mixin methods like printrpcstats can easily get access +to it without users having to pass it around in params. +

+ + + +
+
+     # File lib/mcollective/rpc.rb, line 99
+ 99:     def self.stats(stats)
+100:       @@stats = stats
+101:     end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + empty_filter?(options) + click to toggle source + +
+ +
+ +

+Wrapper for MCollective::Util.empty_filter? +to make clients less fugly to write - ticket 18 +

+ + + +
+
+     # File lib/mcollective/rpc.rb, line 167
+167:     def empty_filter?(options)
+168:       if options.include?(:filter)
+169:         Util.empty_filter?(options[:filter])
+170:       else
+171:         Util.empty_filter?(options)
+172:       end
+173:     end
+
+ +
+ + +
+ + +
+ + +
+ + printrpc(result, flags = {}) + click to toggle source + +
+ +
+ +

+Prints the result of an RPC call. +

+

+In the default quiet mode - no flattening or verbose - only results that +produce an error will be printed +

+

+To get details of each result run with the -v command line option. +

+ + + +
+
+     # File lib/mcollective/rpc.rb, line 146
+146:     def printrpc(result, flags = {})
+147:       verbose = @options[:verbose] rescue verbose = false
+148:       verbose = flags[:verbose] || verbose
+149:       flatten = flags[:flatten] || false
+150:       format = @options[:output_format]
+151:       forced_mode = @options[:force_display_mode] || false
+152: 
+153:       result_text =  Helpers.rpcresults(result, {:verbose => verbose, :flatten => flatten, :format => format, :force_display_mode => forced_mode})
+154: 
+155:       if result.is_a?(Array) && format == :console
+156:         puts "\n%s\n" % [ result_text ]
+157:       else
+158:         # when we get just one result to print dont pad them all with
+159:         # blank spaces etc, just print the individual result with no
+160:         # padding
+161:         puts result_text unless result_text == ""
+162:       end
+163:     end
+
+ +
+ + +
+ + +
+ + +
+ + printrpcstats(flags={}) + click to toggle source + +
+ +
+ +

+Prints stats, requires stats to be saved from elsewhere using the MCollective::RPC.stats method. +

+

+If you’ve passed -v on the command line a detailed stat block will be +printed, else just a one liner. +

+

+You can pass flags into it: +

+
+  printrpcstats :caption => "Foo", :summarize => true
+
+

+This will use “Foo” as the caption to the stats in verbose mode +and print out any aggregate summary information if present +

+ + + +
+
+     # File lib/mcollective/rpc.rb, line 123
+123:     def printrpcstats(flags={})
+124:       return unless @options[:output_format] == :console
+125: 
+126:       flags = {:summarize => false, :caption => "rpc stats"}.merge(flags)
+127: 
+128:       verbose = @options[:verbose] rescue verbose = false
+129: 
+130:       begin
+131:         stats = @@stats
+132:       rescue
+133:         puts("no stats to display")
+134:         return
+135:       end
+136: 
+137:       puts stats.report(flags[:caption], flags[:summarize], verbose)
+138:     end
+
+ +
+ + +
+ + +
+ + +
+ + rpcclient(agent, flags = {}) + click to toggle source + +
+ +
+ +

+Wrapper to create clients, supposed to be used as a mixin: +

+

+include MCollective::RPC +

+

+exim = rpcclient(“exim”) printrpc exim.mailq +

+

+or +

+

+rpcclient(“exim”) do |exim| +

+
+   printrpc exim.mailq
+
+

+end +

+

+It will take a few flags: +

+
+   :configfile => "etc/client.cfg"
+   :options => options
+   :exit_on_failure => true
+
+

+Options would be a build up options hash from the Optionparser you can use the rpcoptions helper +to create this +

+

+:exit_on_failure is true by default, and causes the application to exit if +there is a failure constructing the RPC client. Set +this flag to false to cause an Exception to be raised instead. +

+ + + +
+
+    # File lib/mcollective/rpc.rb, line 60
+60:     def rpcclient(agent, flags = {})
+61:       configfile = flags[:configfile] || "/etc/mcollective/client.cfg"
+62:       options = flags[:options] || nil
+63: 
+64:       if flags.key?(:exit_on_failure)
+65:         exit_on_failure = flags[:exit_on_failure]
+66:       else
+67:         # We exit on failure by default for CLI-friendliness
+68:         exit_on_failure = true
+69:       end
+70: 
+71:       begin
+72:         if options
+73:           rpc = Client.new(agent, :configfile => options[:config], :options => options)
+74:           @options = rpc.options
+75:         else
+76:           rpc = Client.new(agent, :configfile => configfile)
+77:           @options = rpc.options
+78:         end
+79:       rescue Exception => e
+80:         if exit_on_failure
+81:           puts("Could not create RPC client: #{e}")
+82:           exit!
+83:         else
+84:           raise e
+85:         end
+86:       end
+87: 
+88:       if block_given?
+89:         yield(rpc)
+90:       else
+91:         return rpc
+92:       end
+93:     end
+
+ +
+ + +
+ + +
+ + +
+ + rpcoptions() + click to toggle source + +
+ +
+ +

+Creates a standard options hash, pass in a block to add extra headings etc +see Optionparser +

+ + + +
+
+    # File lib/mcollective/rpc.rb, line 21
+21:     def rpcoptions
+22:       oparser = MCollective::Optionparser.new({:verbose => false, :progress_bar => true}, "filter")
+23: 
+24:       options = oparser.parse do |parser, options|
+25:         if block_given?
+26:           yield(parser, options)
+27:         end
+28: 
+29:         Helpers.add_simplerpc_options(parser, options)
+30:       end
+31: 
+32:       return options
+33:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/RPC/ActionRunner.html b/doc/MCollective/RPC/ActionRunner.html new file mode 100644 index 0000000..12d7df5 --- /dev/null +++ b/doc/MCollective/RPC/ActionRunner.html @@ -0,0 +1,953 @@ + + + + + + + Class: MCollective::RPC::ActionRunner + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::RPC::ActionRunner

+ +
+

+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 +

+

+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. +

+

+any STDERR gets logged at error level and any STDOUT gets logged at info +level. +

+

+It will interpret the exit code from the application the same way RPC::Reply#fail! and fail handles their codes +creating a consistent interface, the message part of the fail message will +come from STDERR +

+

+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 +

+

+It uses the MCollective::Shell wrapper to call +the external application +

+ +
+ + + + + + +
+

Attributes

+ + +
+ + +
+ command[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ agent[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ action[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ format[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ stdout[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ stderr[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ request[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(command, request, format=:json) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/actionrunner.rb, line 26
+26:       def initialize(command, request, format=:json)
+27:         @agent = request.agent
+28:         @action = request.action
+29:         @format = format
+30:         @request = request
+31:         @command = path_to_command(command)
+32:         @stdout = ""
+33:         @stderr = ""
+34:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + canrun?(command) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/rpc/actionrunner.rb, line 117
+117:       def canrun?(command)
+118:         File.executable?(command)
+119:       end
+
+ +
+ + +
+ + +
+ + +
+ + load_json_results(file) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/actionrunner.rb, line 91
+91:       def load_json_results(file)
+92:         return {} unless File.readable?(file)
+93: 
+94:         JSON.load(File.read(file)) || {}
+95:       rescue JSON::ParserError
+96:         {}
+97:       end
+
+ +
+ + +
+ + +
+ + +
+ + load_results(file) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/actionrunner.rb, line 73
+73:       def load_results(file)
+74:         Log.debug("Attempting to load results in #{format} format from #{file}")
+75: 
+76:         data = {}
+77: 
+78:         if respond_to?("load_#{format}_results")
+79:           tempdata = send("load_#{format}_results", file)
+80: 
+81:           tempdata.each_pair do |k,v|
+82:             data[k.to_sym] = v
+83:           end
+84:         end
+85: 
+86:         data
+87:       rescue Exception => e
+88:         {}
+89:       end
+
+ +
+ + +
+ + +
+ + +
+ + path_to_command(command) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/rpc/actionrunner.rb, line 129
+129:       def path_to_command(command)
+130:         unless command[0,1] == File::SEPARATOR
+131:           Config.instance.libdir.each do |libdir|
+132:             command_file = File.join(libdir, "agent", agent, command)
+133: 
+134:             return command_file if File.exist?(command_file)
+135:           end
+136:         end
+137: 
+138:         return command
+139:       end
+
+ +
+ + +
+ + +
+ + +
+ + run() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/actionrunner.rb, line 36
+36:       def run
+37:         unless canrun?(command)
+38:           Log.warn("Cannot run #{to_s}")
+39:           raise RPCAborted, "Cannot execute #{to_s}"
+40:         end
+41: 
+42:         Log.debug("Running #{to_s}")
+43: 
+44:         request_file = saverequest(request)
+45:         reply_file = tempfile("reply")
+46:         reply_file.close
+47: 
+48:         runner = shell(command, request_file.path, reply_file.path)
+49: 
+50:         runner.runcommand
+51: 
+52:         Log.debug("#{command} exited with #{runner.status.exitstatus}")
+53: 
+54:         stderr.each_line {|l| Log.error("#{to_s}: #{l.chomp}")} unless stderr.empty?
+55:         stdout.each_line {|l| Log.info("#{to_s}: #{l.chomp}")} unless stdout.empty?
+56: 
+57:         {:exitstatus => runner.status.exitstatus,
+58:          :stdout     => runner.stdout,
+59:          :stderr     => runner.stderr,
+60:          :data       => load_results(reply_file.path)}
+61:       ensure
+62:         request_file.close! if request_file.respond_to?("close!")
+63:         reply_file.close! if reply_file.respond_to?("close")
+64:       end
+
+ +
+ + +
+ + +
+ + +
+ + save_json_request(req) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/rpc/actionrunner.rb, line 113
+113:       def save_json_request(req)
+114:         req.to_json
+115:       end
+
+ +
+ + +
+ + +
+ + +
+ + saverequest(req) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/rpc/actionrunner.rb, line 99
+ 99:       def saverequest(req)
+100:         Log.debug("Attempting to save request in #{format} format")
+101: 
+102:         if respond_to?("save_#{format}_request")
+103:           data = send("save_#{format}_request", req)
+104: 
+105:           request_file = tempfile("request")
+106:           request_file.puts data
+107:           request_file.close
+108:         end
+109: 
+110:         request_file
+111:       end
+
+ +
+ + +
+ + +
+ + +
+ + shell(command, infile, outfile) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/actionrunner.rb, line 66
+66:       def shell(command, infile, outfile)
+67:         env = {"MCOLLECTIVE_REQUEST_FILE" => infile,
+68:                "MCOLLECTIVE_REPLY_FILE"   => outfile}
+69: 
+70:         Shell.new("#{command} #{infile} #{outfile}", :cwd => Dir.tmpdir, :stdout => stdout, :stderr => stderr, :environment => env)
+71:       end
+
+ +
+ + +
+ + +
+ + +
+ + tempfile(prefix) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/rpc/actionrunner.rb, line 125
+125:       def tempfile(prefix)
+126:         Tempfile.new("mcollective_#{prefix}", Dir.tmpdir)
+127:       end
+
+ +
+ + +
+ + +
+ + +
+ + to_s() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/rpc/actionrunner.rb, line 121
+121:       def to_s
+122:         "%s#%s command: %s" % [ agent, action, command ]
+123:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/RPC/Agent.html b/doc/MCollective/RPC/Agent.html new file mode 100644 index 0000000..77d1cd5 --- /dev/null +++ b/doc/MCollective/RPC/Agent.html @@ -0,0 +1,1457 @@ + + + + + + + Class: MCollective::RPC::Agent + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + + + +
+

Included Modules

+ +
+ +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::RPC::Agent

+ +
+

+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. +

+

+See marionette-collective.org/simplerpc/agents.html +

+

+It only really makes sense to use this with a Simple RPC client on the other end, basic usage would be: +

+
+   module MCollective
+     module Agent
+       class Helloworld<RPC::Agent
+         action "hello" do
+           reply[:msg] = "Hello #{request[:name]}"
+         end
+
+         action "foo" do
+           implemented_by "/some/script.sh"
+         end
+       end
+     end
+   end
+
+

+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. +

+

+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. +

+

+We also currently have the validation code in here, this will be moved to +plugins soon. +

+ +
+ + + + + + +
+

Attributes

+ + +
+ + + + +
+ reply[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ request[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ agent_name[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ logger[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ config[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ timeout[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ ddl[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ meta[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + actions() + click to toggle source + +
+ +
+ +

+Returns an array of actions this agent support +

+ + + +
+
+     # File lib/mcollective/rpc/agent.rb, line 157
+157:       def self.actions
+158:         public_instance_methods.sort.grep(/_action$/).map do |method|
+159:           $1 if method =~ /(.+)_action$/
+160:         end
+161:       end
+
+ +
+ + +
+ + +
+ + +
+ + activate?() + click to toggle source + +
+ +
+ +

+By default RPC Agents support a toggle in the configuration that +can enable and disable them based on the agent name +

+

+Example an agent called Foo can have: +

+

+plugin.foo.activate_agent = false +

+

+and this will prevent the agent from loading on this particular machine. +

+

+Agents can use the activate_when helper to override this for +example: +

+

+activate_when do +

+
+   File.exist?("/usr/bin/puppet")
+
+

+end +

+ + + +
+
+     # File lib/mcollective/rpc/agent.rb, line 142
+142:       def self.activate?
+143:         agent_name = self.to_s.split("::").last.downcase
+144: 
+145:         log_code(:PLMC37, "Starting default activation checks for the '%{agent}' agent", :debug, :agent => agent_name)
+146: 
+147:         should_activate = Util.str_to_bool(Config.instance.pluginconf.fetch("#{agent_name}.activate_agent", true))
+148: 
+149:         unless should_activate
+150:           log_code(:PLMC38, "Found plugin configuration '%{agent}.activate_agent' with value '%{should_activate}'", :debug, :agent => agent_name, :should_activate => should_activate)
+151:         end
+152: 
+153:         return should_activate
+154:       end
+
+ +
+ + +
+ + +
+ + +
+ + new() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/agent.rb, line 40
+40:       def initialize
+41:         @agent_name = self.class.to_s.split("::").last.downcase
+42: 
+43:         load_ddl
+44: 
+45:         @logger = Log.instance
+46:         @config = Config.instance
+47: 
+48:         # if we have a global authorization provider enable it
+49:         # plugins can still override it per plugin
+50:         self.class.authorized_by(@config.rpcauthprovider) if @config.rpcauthorization
+51: 
+52:         startup_hook
+53:       end
+
+ +
+ + +
+ + +
+ +
+

Private Class Methods

+ + +
+ + +
+ + action(name, &block) + click to toggle source + +
+ +
+ +

+Creates a new action with the block passed and sets some defaults +

+

+action “status” do +

+
+   # logic here to restart service
+
+

+end +

+ + + +
+
+     # File lib/mcollective/rpc/agent.rb, line 260
+260:       def self.action(name, &block)
+261:         raise "Need to pass a body for the action" unless block_given?
+262: 
+263:         self.module_eval { define_method("#{name}_action", &block) }
+264:       end
+
+ +
+ + +
+ + +
+ + +
+ + activate_when(&block) + click to toggle source + +
+ +
+ +

+Creates the needed activate? class in a manner similar to the other helpers +like action, authorized_by etc +

+

+activate_when do +

+
+   File.exist?("/usr/bin/puppet")
+
+

+end +

+ + + +
+
+     # File lib/mcollective/rpc/agent.rb, line 249
+249:       def self.activate_when(&block)
+250:         (class << self; self; end).instance_eval do
+251:           define_method("activate?", &block)
+252:         end
+253:       end
+
+ +
+ + +
+ + +
+ + +
+ + authorized_by(plugin) + click to toggle source + +
+ +
+ +

+Helper that creates a method on the class that will call your authorization +plugin. If your plugin raises an exception that will abort the request +

+ + + +
+
+     # File lib/mcollective/rpc/agent.rb, line 268
+268:       def self.authorized_by(plugin)
+269:         plugin = plugin.to_s.capitalize
+270: 
+271:         # turns foo_bar into FooBar
+272:         plugin = plugin.to_s.split("_").map {|v| v.capitalize}.join
+273:         pluginname = "MCollective::Util::#{plugin}"
+274: 
+275:         PluginManager.loadclass(pluginname) unless MCollective::Util.constants.include?(plugin)
+276: 
+277:         class_eval("
+278:                       def authorization_hook(request)
+279:                    #{pluginname}.authorize(request)
+280:                       end
+281:                    ")
+282:       end
+
+ +
+ + +
+ + +
+ + +
+ + metadata(data) + click to toggle source + +
+ +
+ +

+Registers meta data for the introspection hash +

+ + + +
+
+     # File lib/mcollective/rpc/agent.rb, line 237
+237:       def self.metadata(data)
+238:         agent = File.basename(caller.first).split(":").first
+239: 
+240:         log_code(:PLMC34, "setting meta data in agents have been deprecated, DDL files are now being used for this information. Please update the '%{agent}' agent", :warn,  :agent => agent)
+241:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + handlemsg(msg, connection) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+     # File lib/mcollective/rpc/agent.rb, line 64
+ 64:       def handlemsg(msg, connection)
+ 65:         @request = RPC::Request.new(msg, @ddl)
+ 66:         @reply = RPC::Reply.new(@request.action, @ddl)
+ 67: 
+ 68:         begin
+ 69:           # Incoming requests need to be validated against the DDL thus reusing
+ 70:           # all the work users put into creating DDLs and creating a consistent
+ 71:           # quality of input validation everywhere with the a simple once off
+ 72:           # investment of writing a DDL
+ 73:           @request.validate!
+ 74: 
+ 75:           # Calls the authorization plugin if any is defined
+ 76:           # if this raises an exception we wil just skip processing this
+ 77:           # message
+ 78:           authorization_hook(@request) if respond_to?("authorization_hook")
+ 79: 
+ 80:           # Audits the request, currently continues processing the message
+ 81:           # we should make this a configurable so that an audit failure means
+ 82:           # a message wont be processed by this node depending on config
+ 83:           audit_request(@request, connection)
+ 84: 
+ 85:           before_processing_hook(msg, connection)
+ 86: 
+ 87:           if respond_to?("#{@request.action}_action")
+ 88:             send("#{@request.action}_action")
+ 89:           else
+ 90:             log_code(:PLMC36, "Unknown action '%{action}' for agent '%{agent}'", :warn, :action => @request.action, :agent => @request.agent)
+ 91:             raise UnknownRPCAction, "Unknown action '#{@request.action}' for agent '#{@request.agent}'"
+ 92:           end
+ 93:         rescue RPCAborted => e
+ 94:           @reply.fail e.to_s, 1
+ 95: 
+ 96:         rescue UnknownRPCAction => e
+ 97:           @reply.fail e.to_s, 2
+ 98: 
+ 99:         rescue MissingRPCData => e
+100:           @reply.fail e.to_s, 3
+101: 
+102:         rescue InvalidRPCData, DDLValidationError => e
+103:           @reply.fail e.to_s, 4
+104: 
+105:         rescue UnknownRPCError => e
+106:           Log.error("%s#%s failed: %s: %s" % [@agent_name, @request.action, e.class, e.to_s])
+107:           Log.error(e.backtrace.join("\n\t"))
+108:           @reply.fail e.to_s, 5
+109: 
+110:         rescue Exception => e
+111:           Log.error("%s#%s failed: %s: %s" % [@agent_name, @request.action, e.class, e.to_s])
+112:           Log.error(e.backtrace.join("\n\t"))
+113:           @reply.fail e.to_s, 5
+114: 
+115:         end
+116: 
+117:         after_processing_hook
+118: 
+119:         if @request.should_respond?
+120:           return @reply.to_hash
+121:         else
+122:           log_code(:PLMC35, "Client did not request a response, surpressing reply", :debug)
+123:           return nil
+124:         end
+125:       end
+
+ +
+ + +
+ + +
+ + +
+ + load_ddl() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/agent.rb, line 55
+55:       def load_ddl
+56:         @ddl = DDL.new(@agent_name, :agent)
+57:         @meta = @ddl.meta
+58:         @timeout = @meta[:timeout] || 10
+59: 
+60:       rescue Exception => e
+61:         DDL.validation_fail!(:PLMC24, "Failed to load DDL for the '%{agent}' agent, DDLs are required: %{error_class}: %{error}", :error, :agent => @agent_name, :error_class => e.class, :error => e.to_s)
+62:       end
+
+ +
+ + +
+ + +
+ +
+

Private Instance Methods

+ + +
+ + +
+ + after_processing_hook() + click to toggle source + +
+ +
+ +

+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. +

+ + + +
+
+     # File lib/mcollective/rpc/agent.rb, line 356
+356:       def after_processing_hook
+357:       end
+
+ +
+ + +
+ + +
+ + +
+ + audit_request(msg, connection) + click to toggle source + +
+ +
+ +

+Gets called right after a request was received and calls audit plugins +

+

+Agents can disable auditing by just overriding +this method with a noop one this might be useful for agents that gets a lot +of requests or simply if you do not care for the auditing in a specific +agent. +

+ + + +
+
+     # File lib/mcollective/rpc/agent.rb, line 364
+364:       def audit_request(msg, connection)
+365:         PluginManager["rpcaudit_plugin"].audit_request(msg, connection) if @config.rpcaudit
+366:       rescue Exception => e
+367:         logexception(:PLMC39, "Audit failed with an error, processing the request will continue.", :warn, e)
+368:       end
+
+ +
+ + +
+ + +
+ + +
+ + before_processing_hook(msg, connection) + click to toggle source + +
+ +
+ +

+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. +

+ + + +
+
+     # File lib/mcollective/rpc/agent.rb, line 345
+345:       def before_processing_hook(msg, connection)
+346:       end
+
+ +
+ + +
+ + +
+ + +
+ + implemented_by(command, type=:json) + click to toggle source + +
+ +
+ +

+handles external actions +

+ + + +
+
+     # File lib/mcollective/rpc/agent.rb, line 313
+313:       def implemented_by(command, type=:json)
+314:         runner = ActionRunner.new(command, request, type)
+315: 
+316:         res = runner.run
+317: 
+318:         reply.fail! "Did not receive data from #{command}" unless res.include?(:data)
+319:         reply.fail! "Reply data from #{command} is not a Hash" unless res[:data].is_a?(Hash)
+320: 
+321:         reply.data.merge!(res[:data])
+322: 
+323:         if res[:exitstatus] > 0
+324:           reply.fail "Failed to run #{command}: #{res[:stderr]}", res[:exitstatus]
+325:         end
+326:       rescue Exception => e
+327:         Log.warn("Unhandled #{e.class} exception during #{request.agent}##{request.action}: #{e}")
+328:         reply.fail! "Unexpected failure calling #{command}: #{e.class}: #{e}"
+329:       end
+
+ +
+ + +
+ + +
+ + +
+ + run(command, options={}) + click to toggle source + +
+ +
+ +

+Runs a command via the MC::Shell wrapper, options are as per MC::Shell +

+

+The simplest use is: +

+
+  out = ""
+  err = ""
+  status = run("echo 1", :stdout => out, :stderr => err)
+
+  reply[:out] = out
+  reply[:error] = err
+  reply[:exitstatus] = status
+
+

+This can be simplified as: +

+
+  reply[:exitstatus] = run("echo 1", :stdout => :out, :stderr => :error)
+
+

+You can set a command specific environment and cwd: +

+
+  run("echo 1", :cwd => "/tmp", :environment => {"FOO" => "BAR"})
+
+

+This will run ‘echo 1’ from /tmp with FOO=BAR in addition to a +setting forcing LC_ALL = C. To prevent LC_ALL from being set either set it +specifically or: +

+
+  run("echo 1", :cwd => "/tmp", :environment => nil)
+
+

+Exceptions here will be handled by the usual agent exception handler or any +specific one you create, if you dont it will just fall through and be sent +to the client. +

+

+If the shell handler fails to return a Process::Status instance for exit +status this method will return -1 as the exit status +

+ + + +
+
+     # File lib/mcollective/rpc/agent.rb, line 195
+195:       def run(command, options={})
+196:         shellopts = {}
+197: 
+198:         # force stderr and stdout to be strings as the library
+199:         # will append data to them if given using the << method.
+200:         #
+201:         # if the data pased to :stderr or :stdin is a Symbol
+202:         # add that into the reply hash with that Symbol
+203:         [:stderr, :stdout].each do |k|
+204:           if options.include?(k)
+205:             if options[k].is_a?(Symbol)
+206:               reply[ options[k] ] = ""
+207:               shellopts[k] = reply[ options[k] ]
+208:             else
+209:               if options[k].respond_to?("<<")
+210:                 shellopts[k] = options[k]
+211:               else
+212:                 reply.fail! "#{k} should support << while calling run(#{command})"
+213:               end
+214:             end
+215:           end
+216:         end
+217: 
+218:         [:stdin, :cwd, :environment, :timeout].each do |k|
+219:           if options.include?(k)
+220:             shellopts[k] = options[k]
+221:           end
+222:         end
+223: 
+224:         shell = Shell.new(command, shellopts)
+225: 
+226:         shell.runcommand
+227: 
+228:         if options[:chomp]
+229:           shellopts[:stdout].chomp! if shellopts[:stdout].is_a?(String)
+230:           shellopts[:stderr].chomp! if shellopts[:stderr].is_a?(String)
+231:         end
+232: 
+233:         shell.status.exitstatus rescue -1
+234:       end
+
+ +
+ + +
+ + +
+ + +
+ + shellescape(str) + click to toggle source + +
+ +
+ +

+convenience wrapper around Util#shellescape +

+ + + +
+
+     # File lib/mcollective/rpc/agent.rb, line 308
+308:       def shellescape(str)
+309:         Util.shellescape(str)
+310:       end
+
+ +
+ + +
+ + +
+ + +
+ + startup_hook() + click to toggle source + +
+ +
+ +

+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. +

+ + + +
+
+     # File lib/mcollective/rpc/agent.rb, line 338
+338:       def startup_hook
+339:       end
+
+ +
+ + +
+ + +
+ + +
+ + validate(key, validation) + click to toggle source + +
+ +
+ +

+Validates a data member, if validation is a regex then it will try to match +it else it supports testing object types only: +

+

+validate :msg, String validate :msg, +/^[w\s]+$/ +

+

+There are also some special helper validators: +

+

+validate :command, :shellsafe validate :command, :ipv6address validate +:command, :ipv4address validate :command, :boolean validate :command, +[“start”, “stop”] +

+

+It will raise appropriate exceptions that the RPC +system understand +

+ + + +
+
+     # File lib/mcollective/rpc/agent.rb, line 299
+299:       def validate(key, validation)
+300:         raise MissingRPCData, "please supply a #{key} argument" unless @request.include?(key)
+301: 
+302:         Validator.validate(@request[key], validation)
+303:       rescue ValidatorError => e
+304:         raise InvalidRPCData, "Input %s did not pass validation: %s" % [ key, e.message ]
+305:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/RPC/Audit.html b/doc/MCollective/RPC/Audit.html new file mode 100644 index 0000000..77b2b6a --- /dev/null +++ b/doc/MCollective/RPC/Audit.html @@ -0,0 +1,471 @@ + + + + + + + Class: MCollective::RPC::Audit + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::RPC::Audit

+ +
+

+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 +

+

+We provide a simple one that logs to a logfile in the class +MCollective::Audit::Logfile you can create your own: +

+

+Create a class in plugins/mcollective/audit/.rb +

+

+You must inherit from MCollective::RPC::Audit +which will take care of registering you with the plugin system. +

+

+Your plugin must provide audit_request(request, connection) the +request parameter will be an instance of MCollective::RPC::Request +

+

+To enable auditing you should set: +

+

+rpcaudit = 1 rpcauditprovider = Logfile +

+

+in the config file this will enable logging using the +MCollective::Audit::Logile class +

+

+The Audit class acts as a base for audit plugins +and takes care of registering them with the plugin manager +

+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + inherited(klass) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/audit.rb, line 29
+29:       def self.inherited(klass)
+30:         PluginManager << {:type => "rpcaudit_plugin", :class => klass.to_s}
+31:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + audit_request(request, connection) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/audit.rb, line 33
+33:       def audit_request(request, connection)
+34:         @log.error("audit_request is not implimented in #{this.class}")
+35:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/classes/MCollective/RPC/Client.html b/doc/MCollective/RPC/Client.html similarity index 70% rename from doc/classes/MCollective/RPC/Client.html rename to doc/MCollective/RPC/Client.html index bdd115e..00f5ab6 100644 --- a/doc/classes/MCollective/RPC/Client.html +++ b/doc/MCollective/RPC/Client.html @@ -1,296 +1,784 @@ - - - + + - Class: MCollective::RPC::Client - - - - - - - - - + -
- - - - - - - - - + Class: MCollective::RPC::Client - - - - -
ClassMCollective::RPC::Client
In: - - lib/mcollective/rpc/client.rb - -
-
Parent: - Object -
-
- + -
+ + + + - - -
- -
-

+ + + +

+
+
+

In Files

+ +
+ + +
+ + + +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::RPC::Client

+ +
+

The main component of the Simple RPC client system, this wraps around MCollective::Client and just brings in a lot of convention and standard approached.

-
- - -
- - - -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
agent [R] 
batch_mode [R] 
batch_size [R] 
batch_sleep_time [R] 
client [R] 
config [RW] 
ddl [R] 
default_discovery_method [R] 
discovery_method [R] 
discovery_options [R] 
filter [RW] 
limit_method [R] 
limit_seed [R] 
limit_targets [R] 
output_format [R] 
progress [RW] 
reply_to [RW] 
stats [R] 
timeout [RW] 
ttl [RW] 
verbose [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

-Creates a stub for a remote agent, you can pass in an options array in the flags which will then -be used else it will just create a default options array with filtering enabled based -on the standard command line use. +

+ + + + + + +
+

Attributes

+ + +
+ + + + +
+ timeout[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ verbose[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ filter[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ config[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ progress[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ ttl[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ reply_to[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ client[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ stats[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ ddl[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ agent[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ limit_targets[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ limit_method[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ output_format[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ batch_size[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ batch_sleep_time[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ batch_mode[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ discovery_options[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ discovery_method[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ default_discovery_method[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ limit_seed[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(agent, flags = {}) + click to toggle source + +
+ +
+ +

+Creates a stub for a remote agent, you can pass in an options array in the +flags which will then be used else it will just create a default options +array with filtering enabled based on the standard command line use.

   rpc = RPC::Client.new("rpctest", :configfile => "client.cfg", :options => options)
 

-You typically would not call this directly you‘d use MCollective::RPC#rpcclient instead which is +You typically would not call this directly you’d use MCollective::RPC#rpcclient instead which is a wrapper around this that can be used as a Mixin

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 20
  20:       def initialize(agent, flags = {})
@@ -391,55 +879,76 @@ a wrapper around this that can be used as a Mixin
 115:           @stdout = STDOUT
 116:           @stdout.sync = true
 117:         end
-118:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

+118: end +

+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + agent_filter(agent) + click to toggle source + +
+ +
+ +

Sets the agent filter

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 422
 422:       def agent_filter(agent)
 423:         @filter["agent"] = @filter["agent"] | [agent]
 424:         @filter["agent"].compact!
 425:         reset
-426:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+426: end +
+ +
+ + +
+ + +
+ + +
+ + aggregate_reply(reply, aggregate) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/rpc/client.rb, line 687
 687:       def aggregate_reply(reply, aggregate)
@@ -450,28 +959,36 @@ Sets the agent filter
 692:       rescue Exception => e
 693:         Log.error("Failed to calculate aggregate summaries for reply from %s, calculating summaries disabled: %s: %s (%s)" % [reply[:senderid], e.backtrace.first, e.to_s, e.class])
 694:         return nil
-695:       end
-
-
-
-
- -
- - - - -
-

+695: end +

+ +
+ + +
+ + +
+ + +
+ + batch_size=(limit) + click to toggle source + +
+ +
+ +

Sets the batch size, if the size is set to 0 that will disable batch mode

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 608
 608:       def batch_size=(limit)
@@ -479,59 +996,75 @@ Sets the batch size, if the size is set to 0 that will disable batch mode
 610: 
 611:         @batch_size = Integer(limit)
 612:         @batch_mode = @batch_size > 0
-613:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+613: end +
+ +
+ + +
+ + +
+ + +
+ + batch_sleep_time=(time) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/rpc/client.rb, line 615
 615:       def batch_sleep_time=(time)
 616:         raise "Can only set batch sleep time if direct addressing is supported" unless Config.instance.direct_addressing
 617: 
 618:         @batch_sleep_time = Float(time)
-619:       end
-
-
-
-
- - + + +
+ + +
+ + +
+ + call_agent(action, args, opts, disc=:auto, &block) + click to toggle source + +
+ +
+ +

Handles traditional calls to the remote agents with full stats blocks, non blocks and everything else supported.

Other methods of calling the nodes can reuse this code by for example -specifying custom options and discovery -data +specifying custom options and discovery data

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 844
 844:       def call_agent(action, args, opts, disc=:auto, &block)
@@ -609,38 +1142,46 @@ data
 916:         else
 917:           return [results].flatten
 918:         end
-919:       end
-
-
-
-
- - + + +
+ + +
+ + +
+ + call_agent_batched(action, args, opts, batch_size, sleep_time, &block) + click to toggle source + +
+ +
+ +

Calls an agent in a way very similar to call_agent but it supports batching the +href="Client.html#M000480">call_agent but it supports batching the queries to the network.

The result sets, stats, block handling etc is all exactly like you would -expect from normal call_agent. +expect from normal call_agent.

-This is used by method_missing and works +This is used by method_missing and works only with direct addressing mode

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 759
 759:       def call_agent_batched(action, args, opts, batch_size, sleep_time, &block)
@@ -721,56 +1262,72 @@ only with direct addressing mode
 834:         else
 835:           return [results].flatten
 836:         end
-837:       end
-
-
-
-
- -
- - - - -
-

+837: end +

+ +
+ + +
+ + +
+ + +
+ + class_filter(klass) + click to toggle source + +
+ +
+ +

Sets the class filter

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 398
 398:       def class_filter(klass)
 399:         @filter["cf_class"] = @filter["cf_class"] | [klass]
 400:         @filter["cf_class"].compact!
 401:         reset
-402:       end
-
-
-
-
- -
- - - - -
-

+402: end +

+ +
+ + +
+ + +
+ + +
+ + collective=(c) + click to toggle source + +
+ +
+ +

Sets the collective we are communicating with

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 573
 573:       def collective=(c)
@@ -779,62 +1336,74 @@ Sets the collective we are communicating with
 576:         @collective = c
 577:         @client.options = options
 578:         reset
-579:       end
-
-
-
-
- -
- - - - -
-

+579: end +

+ +
+ + +
+ + +
+ + +
+ + compound_filter(filter) + click to toggle source + +
+ +
+ +

Set a compound filter

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 436
 436:       def compound_filter(filter)
 437:         @filter["compound"] = @filter["compound"] |  [Matcher.create_compound_callstack(filter)]
 438:         reset
-439:       end
-
-
-
-
- - + + +
+ + +
+ + +
+ + custom_request(action, args, expected_agents, filter = {}, &block) + click to toggle source + +
+ +
+ +

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.

-This will help you essentially short -circuit the traditional cycle of: +This will help you essentially short circuit the traditional cycle of:

-mc discover / call / wait for discovered -nodes +mc discover / call / wait for discovered nodes

by doing discovery however you like, contructing a filter and a list of @@ -846,12 +1415,11 @@ the same way, stats will be handled the same way etcetc

If you just wanted to contact one machine for example with a client that -already has other filter options setup -you can do: +already has other filter options setup you can do:

-puppet.custom_request("runonce", {}, ["your.box.com"], -{:identity => "your.box.com"}) +puppet.custom_request(“runonce”, {}, +[“your.box.com“], {:identity => “your.box.com“})

This will do runonce action on just ‘your.box.com’, no @@ -864,9 +1432,11 @@ 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

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 296
 296:       def custom_request(action, args, expected_agents, filter = {}, &block)
@@ -915,51 +1485,65 @@ mode with direct addressing disabled an exception will be raise
 339:         else
 340:           call_agent(action, args, custom_options, [expected_agents].flatten)
 341:         end
-342:       end
-
-
-
-
- -
- - - - -
-

+342: end +

+ +
+ + +
+ + +
+ + +
+ + disconnect() + click to toggle source + +
+ +
+ +

Disconnects cleanly from the middleware

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 121
 121:       def disconnect
 122:         @client.disconnect
-123:       end
-
-
-
-
- -
- - - - -
-

+123: end +

+ +
+ + +
+ + +
+ + +
+ + discover(flags={}) + click to toggle source + +
+ +
+ +

Does discovery based on the filters set, if a discovery was previously done -return that else do a new discovery. +return that else do a new discovery.

Alternatively if identity filters are given and none of them are regular @@ -977,12 +1561,13 @@ Will show a message indicating its doing discovery if running verbose or if the :verbose flag is passed in.

-Use reset to force a new discovery +Use reset to force a new discovery

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 468
 468:       def discover(flags={})
@@ -1069,23 +1654,29 @@ href="Client.html#M000085">new discovery
 549:         RPC.discovered(@discovered_agents)
 550: 
 551:         @discovered_agents
-552:       end
-
-
-
-
- -
- - - - -
-

+552: end +

+ +
+ + +
+ + +
+ + +
+ + discovery_method=(method) + click to toggle source + +
+ +
+ +

Sets the discovery method. If we change the method there are a number of steps to take:

@@ -1100,13 +1691,14 @@ steps to take:

The remaining item is the discovery timeout, we leave that as is since that -is the user supplied timeout either via initial options or via specifically setting it on -the client. +is the user supplied timeout either via initial options or via specifically +setting it on the client.

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 377
 377:       def discovery_method=(method)
@@ -1122,73 +1714,100 @@ the client.
 387:         @client.options = options
 388: 
 389:         reset
-390:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+390: end +
+ +
+ + +
+ + +
+ + +
+ + discovery_options=(options) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/rpc/client.rb, line 392
 392:       def discovery_options=(options)
 393:         @discovery_options = [options].flatten
 394:         reset
-395:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+395: end +
+ +
+ + +
+ + +
+ + +
+ + discovery_timeout() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/rpc/client.rb, line 344
 344:       def discovery_timeout
 345:         return @discovery_timeout if @discovery_timeout
 346:         return @client.discoverer.ddl.meta[:timeout]
-347:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+347: end +
+ +
+ + +
+ + +
+ + +
+ + discovery_timeout=(timeout) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/rpc/client.rb, line 349
 349:       def discovery_timeout=(timeout)
@@ -1203,28 +1822,36 @@ the client.
 358:         # calculate a correct timeout based on DDL timeout and the
 359:         # supplied discovery timeout
 360:         @timeout = @ddl.meta[:timeout] + discovery_timeout
-361:       end
-
-
-
-
- -
- - - - -
-

+361: end +

+ +
+ + +
+ + +
+ + +
+ + fact_filter(fact, value=nil, operator="=") + click to toggle source + +
+ +
+ +

Sets the fact filter

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 405
 405:       def fact_filter(fact, value=nil, operator="=")
@@ -1241,36 +1868,44 @@ Sets the fact filter
 416: 
 417:         @filter["fact"].compact!
 418:         reset
-419:       end
-
-
-
-
- - + + +
+ + +
+ + +
+ + fire_and_forget_request(action, args, filter=nil) + click to toggle source + +
+ +
+ +

for requests that do not care for results just return the request id and -don‘t do any of the response processing. +don’t do any of the response processing.

We send the :process_results flag with to the nodes so they can make decisions based on that.

-Should only be called via method_missing +Should only be called via method_missing

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 710
 710:       def fire_and_forget_request(action, args, filter=nil)
@@ -1291,82 +1926,103 @@ Should only be called via method_missing
 725:         end
 726: 
 727:         client.sendreq(message, nil)
-728:       end
-
-
-
-
- -
- - - - -
-

-Returns help for an agent if a DDL was found -

-

[Source]

-
+728: end +
+ +
+ + +
+ + +
+ + +
+ + help(template) + click to toggle source + +
+ +
+ +

+Returns help for an agent if a DDL was found +

+ + + +
      # File lib/mcollective/rpc/client.rb, line 126
 126:       def help(template)
 127:         @ddl.help(template)
-128:       end
-
-
-
-
- -
- - - - -
-

+128: end +

+ +
+ + +
+ + +
+ + +
+ + identity_filter(identity) + click to toggle source + +
+ +
+ +

Sets the identity filter

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 429
 429:       def identity_filter(identity)
 430:         @filter["identity"] = @filter["identity"] | [identity]
 431:         @filter["identity"].compact!
 432:         reset
-433:       end
-
-
-
-
- -
- - - - -
-

+433: end +

+ +
+ + +
+ + +
+ + +
+ + identity_filter_discovery_optimization() + click to toggle source + +
+ +
+ +

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 +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 @@ -1377,9 +2033,11 @@ 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

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 741
 741:       def identity_filter_discovery_optimization
@@ -1391,29 +2049,39 @@ should pass the full identity filter to them
 747:             @force_direct_request = true if Config.instance.direct_addressing
 748:           end
 749:         end
-750:       end
-
-
-
-
- -
- - - - -
-

-Sets and sanity check the limit_method variable used to determine how to -limit targets if limit_targets is set -

-

[Source]

-
+750: end +
+ +
+ + +
+ + +
+ + +
+ + limit_method=(method) + click to toggle source + +
+ +
+ +

+Sets and sanity check the limit_method variable used to determine +how to limit targets if limit_targets is set +

+ + + +
      # File lib/mcollective/rpc/client.rb, line 599
 599:       def limit_method=(method)
@@ -1422,29 +2090,38 @@ limit targets if limit_targets is set
 602:         raise "Unknown limit method #{method} must be :random or :first" unless [:random, :first].include?(method)
 603: 
 604:         @limit_method = method
-605:       end
-
-
-
-
- -
- - - - -
-

-Sets and sanity checks the limit_targets variable used to restrict how many -nodes we‘ll target -

-

[Source]

-
+605: end +
+ +
+ + +
+ + +
+ + +
+ + limit_targets=(limit) + click to toggle source + +
+ +
+ +

+Sets and sanity checks the limit_targets variable used to +restrict how many nodes we’ll target +

+ + + +
      # File lib/mcollective/rpc/client.rb, line 583
 583:       def limit_targets=(limit)
@@ -1459,25 +2136,34 @@ nodes we‘ll target
 592:         else
 593:           @limit_targets = Integer(limit)
 594:         end
-595:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+595: end +
+ +
+ + +
+ + +
+ + +
+ + load_aggregate_functions(action, ddl) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/rpc/client.rb, line 676
 676:       def load_aggregate_functions(action, ddl)
@@ -1489,28 +2175,34 @@ nodes we‘ll target
 682:       rescue => e
 683:         Log.error("Failed to load aggregate functions, calculating summaries disabled: %s: %s (%s)" % [e.backtrace.first, e.to_s, e.class])
 684:         return nil
-685:       end
-
-
-
-
- -
- - - - -
-

+685: end +

+ +
+ + +
+ + +
+ + +
+ + method_missing(method_name, *args, &block) + click to toggle source + +
+ +
+ +

Magic handler to invoke remote methods

Once the stub is created using the constructor or the RPC#rpcclient helper you can call remote +href="../RPC.html#M000314">RPC#rpcclient helper you can call remote actions easily:

@@ -1519,7 +2211,8 @@ actions easily:
 

This will call the ‘echo’ action of the ‘rpctest’ 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 +result set from the usual full MCollective::Client#req with additional error codes and error text:

@@ -1535,9 +2228,9 @@ error codes and error text: }

-If :statuscode is 0 then everything went find, if it‘s 1 then you +If :statuscode is 0 then everything went find, if it’s 1 then you supplied the correct arguments etc but the request could not be completed, -you‘ll find a human parsable reason in :statusmsg then. +you’ll find a human parsable reason in :statusmsg then.

Codes 2 to 5 maps directly to

-To get access to the full result of the MCollective::Client#req calls you -can pass in a block: +To get access to the full result of the MCollective::Client#req calls you can +pass in a block:

   rpc.echo(:msg => "hello world") do |resp|
@@ -1558,8 +2252,9 @@ can pass in a block:
   end
 

-In this case resp will the result from MCollective::Client#req. Instead of -returning simple text and codes as above you‘ll also need to handle +In this case resp will the result from MCollective::Client#req. Instead of +returning simple text and codes as above you’ll also need to handle the following exceptions:

@@ -1574,7 +2269,7 @@ prevented the agent from running

During calls a progress indicator will be shown of how many results -we‘ve received against how many nodes were discovered, you can +we’ve received against how many nodes were discovered, you can disable this by setting progress to false:

@@ -1582,7 +2277,7 @@ disable this by setting progress to false:
 

This supports a 2nd mode where it will send the SimpleRPC request and never -handle the responses. It‘s a bit like UDP, it sends the request with +handle the responses. It’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.

@@ -1605,9 +2300,11 @@ Batched processing is supported: This will do everything exactly as normal but communicate to only 5 agents at a time

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 231
 231:       def method_missing(method_name, *args, &block)
@@ -1645,28 +2342,34 @@ at a time
 263:         else
 264:           call_agent(action, args, options, :auto, &block)
 265:         end
-266:       end
-
-
-
-
- -
- - - - -
-

+266: end +

+ +
+ + +
+ + +
+ + +
+ + new_request(action, data) + click to toggle source + +
+ +
+ +

Creates a suitable request hash for the SimpleRPC agent.

-You‘d use this if you ever wanted to take care of sending requests on -your own - perhaps via Client#sendreq if you didn‘t care for +You’d use this if you ever wanted to take care of sending requests on +your own - perhaps via Client#sendreq if you didn’t care for responses.

@@ -1687,9 +2390,11 @@ all if the request was receieved or not Clearly the use of this technique should be limited and done only if your code requires such a thing

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 149
 149:       def new_request(action, data)
@@ -1701,29 +2406,37 @@ code requires such a thing
 155:          :action => action,
 156:          :caller => callerid,
 157:          :data   => data}
-158:       end
-
-
-
-
- -
- - - - -
-

-Provides a normal options hash like you -would get from Optionparser -

-

[Source]

-
+158: end +
+ +
+ + +
+ + +
+ + +
+ + options() + click to toggle source + +
+ +
+ +

+Provides a normal options hash like you would get from Optionparser +

+ + + +
      # File lib/mcollective/rpc/client.rb, line 556
 556:       def options
@@ -1740,23 +2453,29 @@ would get from Optionparser
 567:          :config => @config,
 568:          :publish_timeout => @publish_timeout,
 569:          :threaded => @threaded}
-570:       end
-
-
-
-
- -
- - - - -
-

+570: end +

+ +
+ + +
+ + +
+ + +
+ + pick_nodes_from_discovered(count) + click to toggle source + +
+ +
+ +

Pick a number of nodes from the discovered nodes

@@ -1774,9 +2493,11 @@ configuration option which can be either :first or anything else - if random chosen, and batch-seed set, then set srand for the generator, and reset afterwards -

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 635
 635:       def pick_nodes_from_discovered(count)
@@ -1818,30 +2539,38 @@ configuration option which can be either :first or anything else
 671:         end
 672: 
 673:         [result].flatten
-674:       end
-
-
-
-
- - + + +
+ + +
+ + +
+ + process_results_with_block(action, resp, block, aggregate) + click to toggle source + +
+ +
+ +

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

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 944
 944:       def process_results_with_block(action, resp, block, aggregate)
@@ -1879,29 +2608,37 @@ there are problems with the data
 976:         end
 977: 
 978:         return aggregate
-979:       end
-
-
-
-
- - + + +
+ + +
+ + +
+ + process_results_without_block(resp, action, aggregate) + click to toggle source + +
+ +
+ +

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

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 924
 924:       def process_results_without_block(resp, action, aggregate)
@@ -1918,101 +2655,132 @@ stats object and return a hash of the response to send to the caller
 935:         end
 936: 
 937:         [result, aggregate]
-938:       end
-
-
-
-
- -
- - - - -
-

+938: end +

+ +
+ + +
+ + +
+ + +
+ + reset() + click to toggle source + +
+ +
+ +

Resets various internal parts of the class, most importantly it clears out the cached discovery

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 443
 443:       def reset
 444:         @discovered_agents = nil
-445:       end
-
-
-
-
- -
- - - - -
-

+445: end +

+ +
+ + +
+ + +
+ + +
+ + reset_filter() + click to toggle source + +
+ +
+ +

Reet the filter to an empty one

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 448
 448:       def reset_filter
 449:         @filter = Util.empty_filter
 450:         agent_filter @agent
-451:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+451: end +
+ +
+ + +
+ + +
+ + +
+ + rpc_result_from_reply(agent, action, reply) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/rpc/client.rb, line 697
 697:       def rpc_result_from_reply(agent, action, reply)
 698:         Result.new(agent, action, {:sender => reply[:senderid], :statuscode => reply[:body][:statuscode],
 699:                                    :statusmsg => reply[:body][:statusmsg], :data => reply[:body][:data]})
-700:       end
-
-
-
-
- -
- - - - -
-

+700: end +

+ +
+ + +
+ + +
+ + +
+ + validate_request(action, args) + click to toggle source + +
+ +
+ +

For the provided arguments and action the input arguments get modified by supplying any defaults provided in the DDL for arguments that were not supplied in the request @@ -2021,9 +2789,11 @@ arguments that were not supplied in the request We then pass the modified arguments to the DDL for validation

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/client.rb, line 165
 165:       def validate_request(action, args)
@@ -2031,22 +2801,33 @@ for validation
 167: 
 168:         @ddl.set_default_input_arguments(action, args)
 169:         @ddl.validate_rpc_request(action, args)
-170:       end
-
-
-
-
+170: end +
+ +
+ +
-
+ +
+ +
-
+
+ +

Disabled; run with --debug to generate this.

+ +
- +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
- \ No newline at end of file + + diff --git a/doc/classes/MCollective/RPC/Helpers.html b/doc/MCollective/RPC/Helpers.html similarity index 68% rename from doc/classes/MCollective/RPC/Helpers.html rename to doc/MCollective/RPC/Helpers.html index 5e06bce..18f9afe 100644 --- a/doc/classes/MCollective/RPC/Helpers.html +++ b/doc/MCollective/RPC/Helpers.html @@ -1,141 +1,381 @@ - - - + + - Class: MCollective::RPC::Helpers - - - - - - - - - + -
- - - - - - - - - + Class: MCollective::RPC::Helpers - - - - -
ClassMCollective::RPC::Helpers
In: - - lib/mcollective/rpc/helpers.rb - -
-
Parent: - Object -
-
- + -
+ + + + - - -
- -
-

+ + + +

+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::RPC::Helpers

+ +
+

Various utilities for the RPC system

-
- - -
- - - -
- - - - -
- +
+ + + + + + +
+

Public Class Methods

- + +
+ +
+ + add_simplerpc_options(parser, options) + click to toggle source + +
- -
-

Public Class methods

- -
- - - - -
-

+

+ +

Add SimpleRPC common options

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/helpers.rb, line 254
 254:       def self.add_simplerpc_options(parser, options)
@@ -187,29 +427,37 @@ Add SimpleRPC common options
 300: 
 301:           raise "--display has to be one of 'ok', 'all' or 'failed'" unless [:ok, :failed, :always].include?(options[:force_display_mode])
 302:         end
-303:       end
-
-
-
-
- -
- - - - -
-

+303: end +

+ +
+ + +
+ + +
+ + +
+ + extract_hosts_from_array(hosts) + click to toggle source + +
+ +
+ +

Given an array of something, make sure each is a string chomp off any new lines and return just the array of hosts

-

[Source]

-
+ + + +
     # File lib/mcollective/rpc/helpers.rb, line 29
 29:       def self.extract_hosts_from_array(hosts)
@@ -217,25 +465,31 @@ lines and return just the array of hosts
 31:           raise "#{host} should be a string" unless host.is_a?(String)
 32:           host.chomp
 33:         end
-34:       end
-
-
-
-
- -
- - - - -
-

+34: end +

+ +
+ + +
+ + +
+ + +
+ + extract_hosts_from_json(json) + click to toggle source + +
+ +
+ +

Parse JSON output as produced by printrpc and extract the -"sender" of each rpc response +“sender” of each rpc response

The simplist valid JSON based data would be: @@ -250,9 +504,11 @@ The simplist valid JSON based data would be:

]

-

[Source]

-
+ + + +
     # File lib/mcollective/rpc/helpers.rb, line 14
 14:       def self.extract_hosts_from_json(json)
@@ -266,29 +522,37 @@ The simplist valid JSON based data would be:
 22: 
 23:           host["sender"]
 24:         end.uniq
-25:       end
-
-
-
-
- -
- - - - -
-

+25: end +

+ +
+ + +
+ + +
+ + +
+ + old_rpcresults(result, flags = {}) + click to toggle source + +
+ +
+ +

Backward compatible display block for results without a DDL

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/helpers.rb, line 202
 202:       def self.old_rpcresults(result, flags = {})
@@ -340,23 +604,29 @@ href="../DDL.html">DDL
 248:         end
 249: 
 250:         result_text << ""
-251:       end
-
-
-
-
- -
- - - - -
-

+251: end +

+ +
+ + +
+ + +
+ + +
+ + rpcresults(result, flags = {}) + click to toggle source + +
+ +
+ +

Returns a blob of text representing the results in a standard way

@@ -378,13 +648,15 @@ flags: printrpc exim.mailq, :verbose => true

-If you‘ve asked it to flatten the result it will not print sender -hostnames, it will just print the result as if it‘s one huge result, +If you’ve asked it to flatten the result it will not print sender +hostnames, it will just print the result as if it’s one huge result, handy for things like showing a combined mailq.

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/helpers.rb, line 54
  54:       def self.rpcresults(result, flags = {})
@@ -449,28 +721,36 @@ handy for things like showing a combined mailq.
 113:         end
 114: 
 115:         result_text
-116:       end
-
-
-
-
- -
- - - - -
-

+116: end +

+ +
+ + +
+ + +
+ + +
+ + text_for_flattened_result(status, result) + click to toggle source + +
+ +
+ +

Returns text representing a flattened result of only good data

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/helpers.rb, line 189
 189:       def self.text_for_flattened_result(status, result)
@@ -483,28 +763,36 @@ Returns text representing a flattened result of only good data
 196:             result_text << result
 197:           end
 198:         end
-199:       end
-
-
-
-
- - + + +
+ + +
+ + +
+ + text_for_result(sender, status, msg, result, ddl) + click to toggle source + +
+ +
+ +

Return text representing a result

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/helpers.rb, line 119
 119:       def self.text_for_result(sender, status, msg, result, ddl)
@@ -574,22 +862,33 @@ Return text representing a result
 183: 
 184:         result_text << "\n"
 185:         result_text
-186:       end
-
-
-
-
+186: end +
+ +
+ +
-
+ +
+ +
-
+
+ +

Disabled; run with --debug to generate this.

+ +
- +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
- \ No newline at end of file + + diff --git a/doc/MCollective/RPC/Progress.html b/doc/MCollective/RPC/Progress.html new file mode 100644 index 0000000..f9e876c --- /dev/null +++ b/doc/MCollective/RPC/Progress.html @@ -0,0 +1,490 @@ + + + + + + + Class: MCollective::RPC::Progress + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::RPC::Progress

+ +
+

+Class that shows a progress bar, currently only supports a twirling +progress bar. +

+

+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 = Progress.new 100.times {|i| print +p.twirl(i+1, 100) + “r“};puts +

+
+ * [ ==================================================> ] 100 / 100
+
+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(size=nil) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/progress.rb, line 15
+15:       def initialize(size=nil)
+16:         @twirl = ['|', '/', '-', "\\", '|', '/', '-', "\\"]
+17:         @twirldex = 0
+18: 
+19:         if size
+20:           @size = size
+21:         else
+22:           cols = Util.terminal_dimensions[0] - 22
+23: 
+24:           # Defaults back to old behavior if it
+25:           # couldn't figure out the size or if
+26:           # its more than 60 wide
+27:           if cols <= 0
+28:             @size = 0
+29:           elsif cols > 60
+30:             @size = 60
+31:           else
+32:             @size = cols
+33:           end
+34:         end
+35:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + twirl(current, total) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/progress.rb, line 37
+37:       def twirl(current, total)
+38:         # if the size is negative there is just not enough
+39:         # space on the terminal, return a simpler version
+40:         return "\r#{current} / #{total}" if @size == 0
+41: 
+42:         if current == total
+43:           txt = "\r %s [ " % Util.colorize(:green, "*")
+44:         else
+45:           txt = "\r %s [ " % Util.colorize(:red, @twirl[@twirldex])
+46:         end
+47: 
+48:         dashes = ((current.to_f / total) * @size).round
+49: 
+50:         dashes.times { txt << "=" }
+51:         txt << ">"
+52: 
+53:         (@size - dashes).times { txt << " " }
+54: 
+55:         txt << " ] #{current} / #{total}"
+56: 
+57:         @twirldex == 7 ? @twirldex = 0 : @twirldex += 1
+58: 
+59:         return txt
+60:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/RPC/Reply.html b/doc/MCollective/RPC/Reply.html new file mode 100644 index 0000000..c578c72 --- /dev/null +++ b/doc/MCollective/RPC/Reply.html @@ -0,0 +1,753 @@ + + + + + + + Class: MCollective::RPC::Reply + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::RPC::Reply

+ +
+

+Simple class to manage compliant replies to MCollective::RPC +

+ +
+ + + + + + +
+

Attributes

+ + +
+ + + + +
+ statuscode[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ statusmsg[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ data[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(action, ddl) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/reply.rb, line 7
+ 7:       def initialize(action, ddl)
+ 8:         @data = {}
+ 9:         @statuscode = 0
+10:         @statusmsg = "OK"
+11:         @ddl = ddl
+12:         @action = action
+13: 
+14:         begin
+15:           initialize_data
+16:         rescue Exception => e
+17:           Log.warn("Could not pre-populate reply data from the DDL: %s: %s" % [e.class, e.to_s ])
+18:         end
+19:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + [](key) + click to toggle source + +
+ +
+ +

+Read from the data hash +

+ + + +
+
+    # File lib/mcollective/rpc/reply.rb, line 70
+70:       def [](key)
+71:         @data[key]
+72:       end
+
+ +
+ + +
+ + +
+ + +
+ + []=(key, val) + click to toggle source + +
+ +
+ +

+Write to the data hash +

+ + + +
+
+    # File lib/mcollective/rpc/reply.rb, line 65
+65:       def []=(key, val)
+66:         @data[key] = val
+67:       end
+
+ +
+ + +
+ + +
+ + +
+ + fail(msg, code=1) + click to toggle source + +
+ +
+ +

+Helper to fill in statusmsg and code on failure +

+ + + +
+
+    # File lib/mcollective/rpc/reply.rb, line 36
+36:       def fail(msg, code=1)
+37:         @statusmsg = msg
+38:         @statuscode = code
+39:       end
+
+ +
+ + +
+ + +
+ + +
+ + fail!(msg, code=1) + click to toggle source + +
+ +
+ +

+Helper that fills in statusmsg and code but also raises an appropriate +error +

+ + + +
+
+    # File lib/mcollective/rpc/reply.rb, line 42
+42:       def fail!(msg, code=1)
+43:         @statusmsg = msg
+44:         @statuscode = code
+45: 
+46:         case code
+47:           when 1
+48:             raise RPCAborted, msg
+49: 
+50:           when 2
+51:             raise UnknownRPCAction, msg
+52: 
+53:           when 3
+54:             raise MissingRPCData, msg
+55: 
+56:           when 4
+57:             raise InvalidRPCData, msg
+58: 
+59:           else
+60:             raise UnknownRPCError, msg
+61:         end
+62:       end
+
+ +
+ + +
+ + +
+ + +
+ + fetch(key, default) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/reply.rb, line 74
+74:       def fetch(key, default)
+75:         @data.fetch(key, default)
+76:       end
+
+ +
+ + +
+ + +
+ + +
+ + initialize_data() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/reply.rb, line 21
+21:       def initialize_data
+22:         unless @ddl.actions.include?(@action)
+23:           raise "No action '%s' defined for agent '%s' in the DDL" % [@action, @ddl.pluginname]
+24:         end
+25: 
+26:         interface = @ddl.action_interface(@action)
+27: 
+28:         interface[:output].keys.each do |output|
+29:           # must deep clone this data to avoid accidental updates of the DDL in cases where the
+30:           # default is for example a string and someone does << on it
+31:           @data[output] = Marshal.load(Marshal.dump(interface[:output][output].fetch(:default, nil)))
+32:         end
+33:       end
+
+ +
+ + +
+ + +
+ + +
+ + to_hash() + click to toggle source + +
+ +
+ +

+Returns a compliant Hash of the reply that should be sent over the +middleware +

+ + + +
+
+    # File lib/mcollective/rpc/reply.rb, line 80
+80:       def to_hash
+81:         return {:statuscode => @statuscode,
+82:                 :statusmsg => @statusmsg,
+83:                 :data => @data}
+84:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/RPC/Request.html b/doc/MCollective/RPC/Request.html new file mode 100644 index 0000000..0f5d1ab --- /dev/null +++ b/doc/MCollective/RPC/Request.html @@ -0,0 +1,811 @@ + + + + + + + Class: MCollective::RPC::Request + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::RPC::Request

+ +
+

+Simple class to manage compliant requests for MCollective::RPC agents +

+ +
+ + + + + + +
+

Attributes

+ + +
+ + + + +
+ time[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ action[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ data[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ sender[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ agent[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ uniqid[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ caller[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ ddl[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(msg, ddl) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/request.rb, line 7
+ 7:       def initialize(msg, ddl)
+ 8:         @time = msg[:msgtime]
+ 9:         @action = msg[:body][:action]
+10:         @data = msg[:body][:data]
+11:         @sender = msg[:senderid]
+12:         @agent = msg[:body][:agent]
+13:         @uniqid = msg[:requestid]
+14:         @caller = msg[:callerid] || "unknown"
+15:         @ddl = ddl
+16:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + [](key) + click to toggle source + +
+ +
+ +

+If data is a hash, gives easy access to its members, else returns nil +

+ + + +
+
+    # File lib/mcollective/rpc/request.rb, line 34
+34:       def [](key)
+35:         return nil unless @data.is_a?(Hash)
+36:         return @data[key]
+37:       end
+
+ +
+ + +
+ + +
+ + +
+ + fetch(key, default) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/request.rb, line 39
+39:       def fetch(key, default)
+40:         return nil unless @data.is_a?(Hash)
+41:         return @data.fetch(key, default)
+42:       end
+
+ +
+ + +
+ + +
+ + +
+ + include?(key) + click to toggle source + +
+ +
+ +

+If data is a hash, quick helper to get access to it’s include? method +else returns false +

+ + + +
+
+    # File lib/mcollective/rpc/request.rb, line 20
+20:       def include?(key)
+21:         return false unless @data.is_a?(Hash)
+22:         return @data.include?(key)
+23:       end
+
+ +
+ + +
+ + +
+ + +
+ + should_respond?() + click to toggle source + +
+ +
+ +

+If no :process_results is specified always respond else respond based on +the supplied property +

+ + + +
+
+    # File lib/mcollective/rpc/request.rb, line 27
+27:       def should_respond?
+28:         return @data[:process_results] if @data.include?(:process_results)
+29: 
+30:         return true
+31:       end
+
+ +
+ + +
+ + +
+ + +
+ + to_hash() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/request.rb, line 44
+44:       def to_hash
+45:         return {:agent => @agent,
+46:                 :action => @action,
+47:                 :data => @data}
+48:       end
+
+ +
+ + +
+ + +
+ + +
+ + to_json() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/request.rb, line 55
+55:       def to_json
+56:         to_hash.merge!({:sender   => @sender,
+57:                         :callerid => @callerid,
+58:                         :uniqid   => @uniqid}).to_json
+59:       end
+
+ +
+ + +
+ + +
+ + +
+ + validate!() + click to toggle source + +
+ +
+ +

+Validate the request against the DDL +

+ + + +
+
+    # File lib/mcollective/rpc/request.rb, line 51
+51:       def validate!
+52:         @ddl.validate_rpc_request(@action, @data)
+53:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/RPC/Result.html b/doc/MCollective/RPC/Result.html new file mode 100644 index 0000000..9fc3581 --- /dev/null +++ b/doc/MCollective/RPC/Result.html @@ -0,0 +1,649 @@ + + + + + + + Class: MCollective::RPC::Result + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+

Included Modules

+ +
+ +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::RPC::Result

+ +
+

+Simple class to manage compliant results from MCollective::RPC agents +

+

+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 DDL +

+ +
+ + + + + + +
+

Attributes

+ + +
+ + +
+ agent[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ action[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ results[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(agent, action, result={}) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/result.rb, line 13
+13:       def initialize(agent, action, result={})
+14:         @agent = agent
+15:         @action = action
+16:         @results = result
+17:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + [](idx) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/result.rb, line 19
+19:       def [](idx)
+20:         @results[idx]
+21:       end
+
+ +
+ + +
+ + +
+ + +
+ + []=(idx, item) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/result.rb, line 23
+23:       def []=(idx, item)
+24:         @results[idx] = item
+25:       end
+
+ +
+ + +
+ + +
+ + +
+ + each() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/result.rb, line 31
+31:       def each
+32:         @results.each_pair {|k,v| yield(k,v) }
+33:       end
+
+ +
+ + +
+ + +
+ + +
+ + fetch(key, default) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/result.rb, line 27
+27:       def fetch(key, default)
+28:         @results.fetch(key, default)
+29:       end
+
+ +
+ + +
+ + +
+ + +
+ + to_json(*a) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/rpc/result.rb, line 35
+35:       def to_json(*a)
+36:         {:agent => @agent,
+37:          :action => @action,
+38:          :sender => @results[:sender],
+39:          :statuscode => @results[:statuscode],
+40:          :statusmsg => @results[:statusmsg],
+41:          :data => @results[:data]}.to_json(*a)
+42:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/classes/MCollective/RPC/Stats.html b/doc/MCollective/RPC/Stats.html similarity index 50% rename from doc/classes/MCollective/RPC/Stats.html rename to doc/MCollective/RPC/Stats.html index 8f4522d..50b77ae 100644 --- a/doc/classes/MCollective/RPC/Stats.html +++ b/doc/MCollective/RPC/Stats.html @@ -1,290 +1,749 @@ - - - + + - Class: MCollective::RPC::Stats - - - - - - - - - - -
- - - - - - - - - + - - - - -
ClassMCollective::RPC::Stats
In: - - lib/mcollective/rpc/stats.rb - -
-
Parent: - Object -
-
- + Class: MCollective::RPC::Stats -
+ + + + + - -
- -
-

+ + + +

+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::RPC::Stats

+ +
+

Class to wrap all the stats and to keep track of some timings

-
- - -
- -
-

Methods

- -
- []   - client_stats=   - discovered_agents   - fail   - finish_request   - new   - no_response_report   - node_responded   - ok   - report   - reset   - text_for_aggregates   - time_block_execution   - time_discovery   - to_hash   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
aggregate_failures [RW] 
aggregate_summary [RW] 
blocktime [RW] 
ddl [RW] 
discovered [RW] 
discovered_nodes [RW] 
discoverytime [RW] 
failcount [RW] 
noresponsefrom [RW] 
noresponsefrom [RW] 
okcount [RW] 
requestid [RW] 
responses [RW] 
responsesfrom [RW] 
starttime [RW] 
totaltime [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
+
+ + + + + + +
+

Attributes

+ + +
+ + + + +
+ noresponsefrom[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ starttime[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ discoverytime[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ blocktime[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ responses[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ totaltime[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ discovered[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ discovered_nodes[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ okcount[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ failcount[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ noresponsefrom[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ responsesfrom[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ requestid[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ aggregate_summary[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ ddl[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ aggregate_failures[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File lib/mcollective/rpc/stats.rb, line 9
  9:       def initialize
 10:         reset
-11:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

+11: end +

+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + [](key) + click to toggle source + +
+ +
+ +

Fake hash access to keep things backward compatible

-

[Source]

-
+ + + +
     # File lib/mcollective/rpc/stats.rb, line 51
 51:       def [](key)
 52:         to_hash[key]
 53:       rescue
 54:         nil
-55:       end
-
-
-
-
- -
- - - - -
-

+55: end +

+ +
+ + +
+ + +
+ + +
+ + client_stats=(stats) + click to toggle source + +
+ +
+ +

Re-initializes the object with stats from the basic client

-

[Source]

-
+ + + +
     # File lib/mcollective/rpc/stats.rb, line 72
 72:       def client_stats=(stats)
@@ -295,83 +754,109 @@ Re-initializes the object with stats from the basic client
 77:         @totaltime = stats[:totaltime]
 78:         @requestid = stats[:requestid]
 79:         @discoverytime = stats[:discoverytime] if @discoverytime == 0
-80:       end
-
-
-
-
- -
- - - - -
-

-Update discovered and discovered_nodes based on discovery results +80: end +

+ +
+ + +
+ + +
+ + +
+ + discovered_agents(agents) + click to toggle source + +
+ +
+ +

+Update discovered and discovered_nodes based on discovery +results

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/stats.rb, line 110
 110:       def discovered_agents(agents)
 111:         @discovered_nodes = agents
 112:         @discovered = agents.size
-113:       end
-
-
-
-
- -
- - - - -
-

+113: end +

+ +
+ + +
+ + +
+ + +
+ + fail() + click to toggle source + +
+ +
+ +

increment the count of failed hosts

-

[Source]

-
+ + + +
     # File lib/mcollective/rpc/stats.rb, line 65
 65:       def fail
 66:         @failcount += 1
 67:       rescue
 68:         @failcount = 1
-69:       end
-
-
-
-
- -
- - - - -
-

+69: end +

+ +
+ + +
+ + +
+ + +
+ + finish_request() + click to toggle source + +
+ +
+ +

Helper to calculate total time etc

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/stats.rb, line 116
 116:       def finish_request
@@ -384,28 +869,36 @@ Helper to calculate total time etc
 123:       rescue
 124:         @totaltime = 0
 125:         @noresponsefrom = []
-126:       end
-
-
-
-
- -
- - - - -
-

+126: end +

+ +
+ + +
+ + +
+ + +
+ + no_response_report() + click to toggle source + +
+ +
+ +

Returns a blob of text indicating what nodes did not respond

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/stats.rb, line 237
 237:       def no_response_report
@@ -424,85 +917,109 @@ Returns a blob of text indicating what nodes did not respond
 250:         end
 251: 
 252:         result_text.string
-253:       end
-
-
-
-
- -
- - - - -
-

+253: end +

+ +
+ + +
+ + +
+ + +
+ + node_responded(node) + click to toggle source + +
+ +
+ +

Helper to keep track of who we received responses from

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/stats.rb, line 129
 129:       def node_responded(node)
 130:         @responsesfrom << node
 131:       rescue
 132:         @responsesfrom = [node]
-133:       end
-
-
-
-
- -
- - - - -
-

-increment the count of ok hosts +133: end +

+ +
+ + +
+ + +
+ + +
+ + ok() + click to toggle source + +
+ +
+ +

+increment the count of ok hosts

-

[Source]

-
+ + + +
     # File lib/mcollective/rpc/stats.rb, line 58
 58:       def ok
 59:         @okcount += 1
 60:       rescue
 61:         @okcount = 1
-62:       end
-
-
-
-
- - + + +
+ + +
+ + +
+ + report(caption = "rpc stats", summarize = true, verbose = false) + click to toggle source + +
+ +
+ +

Returns a blob of text representing the request status based on the stats contained in this class

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/stats.rb, line 187
 187:       def report(caption = "rpc stats", summarize = true, verbose = false)
@@ -552,28 +1069,36 @@ contained in this class
 231:         end
 232: 
 233:         result_text.join("\n")
-234:       end
-
-
-
-
- -
- - - - -
-

+234: end +

+ +
+ + +
+ + +
+ + +
+ + reset() + click to toggle source + +
+ +
+ +

Resets stats, if discovery time is set we keep it as it was

-

[Source]

-
+ + + +
     # File lib/mcollective/rpc/stats.rb, line 14
 14:       def reset
@@ -592,25 +1117,34 @@ Resets stats, if discovery time is set we keep it as it was
 27:         @requestid = nil
 28:         @aggregate_summary = []
 29:         @aggregate_failures = []
-30:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+30: end +
+ +
+ + +
+ + +
+ + +
+ + text_for_aggregates() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/rpc/stats.rb, line 135
 135:       def text_for_aggregates
@@ -661,28 +1195,36 @@ Resets stats, if discovery time is set we keep it as it was
 180:         end
 181: 
 182:         result.string
-183:       end
-
-
-
-
- -
- - - - -
-

+183: end +

+ +
+ + +
+ + +
+ + +
+ + time_block_execution(action) + click to toggle source + +
+ +
+ +

helper to time block execution time

-

[Source]

-
+ + + +
      # File lib/mcollective/rpc/stats.rb, line 96
  96:       def time_block_execution(action)
@@ -695,28 +1237,36 @@ helper to time block execution time
 103:         end
 104:       rescue
 105:         @blocktime = 0
-106:       end
-
-
-
-
- -
- - - - -
-

+106: end +

+ +
+ + +
+ + +
+ + +
+ + time_discovery(action) + click to toggle source + +
+ +
+ +

Utility to time discovery from :start to :end

-

[Source]

-
+ + + +
     # File lib/mcollective/rpc/stats.rb, line 83
 83:       def time_discovery(action)
@@ -729,28 +1279,36 @@ Utility to time discovery from :start to :end
 90:         end
 91:       rescue
 92:         @discoverytime = 0
-93:       end
-
-
-
-
- -
- - - - -
-

+93: end +

+ +
+ + +
+ + +
+ + +
+ + to_hash() + click to toggle source + +
+ +
+ +

returns a hash of our stats

-

[Source]

-
+ + + +
     # File lib/mcollective/rpc/stats.rb, line 33
 33:       def to_hash
@@ -768,22 +1326,33 @@ returns a hash of our stats
 45:          :failcount         => @failcount,
 46:          :aggregate_summary => @aggregate_summary,
 47:          :aggregate_failures => @aggregate_failures}
-48:       end
-
-
-
-
+48: end +
+ +
+ +
-
+ +
+ +
-
+
+ +

Disabled; run with --debug to generate this.

+ +
- +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
- \ No newline at end of file + + diff --git a/doc/MCollective/RPCAborted.html b/doc/MCollective/RPCAborted.html new file mode 100644 index 0000000..432d1ce --- /dev/null +++ b/doc/MCollective/RPCAborted.html @@ -0,0 +1,348 @@ + + + + + + + Class: MCollective::RPCAborted + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::RPCAborted

+ +
+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/RPCError.html b/doc/MCollective/RPCError.html new file mode 100644 index 0000000..99f3f9b --- /dev/null +++ b/doc/MCollective/RPCError.html @@ -0,0 +1,348 @@ + + + + + + + Class: MCollective::RPCError + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::RPCError

+ +
+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Registration.html b/doc/MCollective/Registration.html new file mode 100644 index 0000000..7a5e801 --- /dev/null +++ b/doc/MCollective/Registration.html @@ -0,0 +1,371 @@ + + + + + + + Module: MCollective::Registration + + + + + + + + + + + +
+ + +
+ + + + + + +
+

Namespace

+ +
+ + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Registration

+ +
+

+Registration is implimented using a module +structure and installations can configure which module they want to use. +

+

+We provide a simple one that just sends back the list of current known +agents in MCollective::Registration::Agentlist, you can create your own: +

+

+Create a module in plugins/mcollective/registration/.rb +

+

+You can inherit from MCollective::Registration::Base in which +case you just need to supply a body method, whatever this method +returns will be send to the middleware connection for an agent called +registration +

+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Registration/Base.html b/doc/MCollective/Registration/Base.html new file mode 100644 index 0000000..81d4ff1 --- /dev/null +++ b/doc/MCollective/Registration/Base.html @@ -0,0 +1,655 @@ + + + + + + + Class: MCollective::Registration::Base + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Registration::Base

+ +
+

+This is a base class that other registration plugins can use to handle +regular announcements to the mcollective +

+

+The configuration file determines how often registration messages gets sent +using the registerinterval option, the plugin runs in the +background in a thread. +

+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + inherited(klass) + click to toggle source + +
+ +
+ +

+Register plugins that inherits base +

+ + + +
+
+    # File lib/mcollective/registration/base.rb, line 11
+11:       def self.inherited(klass)
+12:         PluginManager << {:type => "registration_plugin", :class => klass.to_s}
+13:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + config() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/registration/base.rb, line 36
+36:       def config
+37:         Config.instance
+38:       end
+
+ +
+ + +
+ + +
+ + +
+ + interval() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/registration/base.rb, line 59
+59:       def interval
+60:         config.registerinterval
+61:       end
+
+ +
+ + +
+ + +
+ + +
+ + msg_filter() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/registration/base.rb, line 40
+40:       def msg_filter
+41:         filter = Util.empty_filter
+42:         filter["agent"] << "registration"
+43:         filter
+44:       end
+
+ +
+ + +
+ + +
+ + +
+ + publish(message) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/registration/base.rb, line 63
+63:       def publish(message)
+64:         unless message
+65:           Log.debug("Skipping registration due to nil body")
+66:         else
+67:           req = Message.new(message, nil, {:type => :request, :agent => "registration", :collective => target_collective, :filter => msg_filter})
+68:           req.encode!
+69: 
+70:           Log.debug("Sending registration #{req.requestid} to collective #{req.collective}")
+71: 
+72:           req.publish
+73:         end
+74:       end
+
+ +
+ + +
+ + +
+ + +
+ + run(connection) + click to toggle source + +
+ +
+ +

+Creates a background thread that periodically send a registration notice. +

+

+The actual registration notices comes from the ‘body’ method of +the registration plugins. +

+ + + +
+
+    # File lib/mcollective/registration/base.rb, line 19
+19:       def run(connection)
+20:         return false if interval == 0
+21: 
+22:         Thread.new do
+23:           loop do
+24:             begin
+25:               publish(body)
+26: 
+27:               sleep interval
+28:             rescue Exception => e
+29:               Log.error("Sending registration message failed: #{e}")
+30:               sleep interval
+31:             end
+32:           end
+33:         end
+34:       end
+
+ +
+ + +
+ + +
+ + +
+ + target_collective() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/registration/base.rb, line 46
+46:       def target_collective
+47:         main_collective = config.main_collective
+48: 
+49:         collective = config.registration_collective || main_collective
+50: 
+51:         unless config.collectives.include?(collective)
+52:           Log.warn("Sending registration to #{main_collective}: #{collective} is not a valid collective")
+53:           collective = main_collective
+54:         end
+55: 
+56:         return collective
+57:       end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Runner.html b/doc/MCollective/Runner.html new file mode 100644 index 0000000..05c0d96 --- /dev/null +++ b/doc/MCollective/Runner.html @@ -0,0 +1,702 @@ + + + + + + + Class: MCollective::Runner + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+

Included Modules

+ +
+ +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Runner

+ +
+

+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 +

+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(configfile) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/runner.rb, line 8
+ 8:     def initialize(configfile)
+ 9:       @config = Config.instance
+10:       @config.loadconfig(configfile) unless @config.configured
+11:       @config.mode = :server
+12: 
+13:       @stats = PluginManager["global_stats"]
+14: 
+15:       @security = PluginManager["security_plugin"]
+16:       @security.initiated_by = :node
+17: 
+18:       @connection = PluginManager["connector_plugin"]
+19:       @connection.connect
+20: 
+21:       @agents = Agents.new
+22: 
+23:       unless Util.windows?
+24:         Signal.trap("USR1") do
+25:           log_code(:PLMC2, "Reloading all agents after receiving USR1 signal", :info)
+26:           @agents.loadagents
+27:         end
+28: 
+29:         Signal.trap("USR2") do
+30:           log_code(:PLMC3, "Cycling logging level due to USR2 signal", :info)
+31: 
+32:           Log.cycle_level
+33:         end
+34:       else
+35:         Util.setup_windows_sleeper
+36:       end
+37:     end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + run() + click to toggle source + +
+ +
+ +

+Starts the main loop, before calling this you should initialize the MCollective::Config singleton. +

+ + + +
+
+    # File lib/mcollective/runner.rb, line 40
+40:     def run
+41:       Data.load_data_sources
+42: 
+43:       Util.subscribe(Util.make_subscriptions("mcollective", :broadcast))
+44:       Util.subscribe(Util.make_subscriptions("mcollective", :directed)) if @config.direct_addressing
+45: 
+46:       # Start the registration plugin if interval isn't 0
+47:       begin
+48:         PluginManager["registration_plugin"].run(@connection) unless @config.registerinterval == 0
+49:       rescue Exception => e
+50:         logexception(:PLMC4, "Failed to start registration plugin: %{error}", :error, e)
+51:       end
+52: 
+53:       loop do
+54:         begin
+55:           request = receive
+56: 
+57:           unless request.agent == "mcollective"
+58:             agentmsg(request)
+59:           else
+60:             log_code(:PLMC5, "Received a control message, possibly via 'mco controller' but this has been deprecated", :error)
+61:           end
+62:         rescue SignalException => e
+63:           logexception(:PLMC7, "Exiting after signal: %{error}", :warn, e)
+64:           @connection.disconnect
+65:           raise
+66: 
+67:         rescue MsgTTLExpired => e
+68:           logexception(:PLMC9, "Expired Message: %{error}", :warn, e)
+69: 
+70:         rescue NotTargettedAtUs => e
+71:           log_code(:PLMC6, "Message does not pass filters, ignoring", :debug)
+72: 
+73:         rescue Exception => e
+74:           logexception(:PLMC10, "Failed to handle message: %{error}", :warn, e, true)
+75:         end
+76:       end
+77:     end
+
+ +
+ + +
+ + +
+ +
+

Private Instance Methods

+ + +
+ + +
+ + agentmsg(request) + click to toggle source + +
+ +
+ +

+Deals with messages directed to agents +

+ + + +
+
+    # File lib/mcollective/runner.rb, line 81
+81:     def agentmsg(request)
+82:       log_code(:PLMC8, "Handling message for agent '%{agent}' on collective '%{collective} with requestid '%{requestid}'", :debug, :agent => request.agent, :collective => request.collective, :requestid => request.requestid)
+83: 
+84:       @agents.dispatch(request, @connection) do |reply_message|
+85:         reply(reply_message, request) if reply_message
+86:       end
+87:     end
+
+ +
+ + +
+ + +
+ + +
+ + controlmsg(request) + click to toggle source + +
+ +
+ +

+Deals with messages sent to our control topic +

+ + + +
+
+     # File lib/mcollective/runner.rb, line 90
+ 90:     def controlmsg(request)
+ 91:       Log.debug("Handling message for mcollectived controller")
+ 92: 
+ 93:       begin
+ 94:         case request.payload[:body]
+ 95:         when /^stats$/
+ 96:           reply(@stats.to_hash, request)
+ 97: 
+ 98:         when /^reload_agent (.+)$/
+ 99:           reply("reloaded #{$1} agent", request) if @agents.loadagent($1)
+100: 
+101:         when /^reload_agents$/
+102: 
+103:           reply("reloaded all agents", request) if @agents.loadagents
+104: 
+105:         else
+106:           Log.error("Received an unknown message to the controller")
+107: 
+108:         end
+109:       rescue Exception => e
+110:         Log.error("Failed to handle control message: #{e}")
+111:       end
+112:     end
+
+ +
+ + +
+ + +
+ + +
+ + receive() + click to toggle source + +
+ +
+ +

+Receive a message from the connection handler +

+ + + +
+
+     # File lib/mcollective/runner.rb, line 115
+115:     def receive
+116:       request = @connection.receive
+117:       request.type = :request
+118: 
+119:       @stats.received
+120: 
+121:       request.decode!
+122:       request.validate
+123: 
+124:       request
+125:     end
+
+ +
+ + +
+ + +
+ + +
+ + reply(msg, request) + click to toggle source + +
+ +
+ +

+Sends a reply to a specific target topic +

+ + + +
+
+     # File lib/mcollective/runner.rb, line 128
+128:     def reply(msg, request)
+129:       msg = Message.new(msg, nil, :request => request)
+130:       msg.encode!
+131:       msg.publish
+132: 
+133:       @stats.sent
+134:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/RunnerStats.html b/doc/MCollective/RunnerStats.html new file mode 100644 index 0000000..e2fc660 --- /dev/null +++ b/doc/MCollective/RunnerStats.html @@ -0,0 +1,734 @@ + + + + + + + Class: MCollective::RunnerStats + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::RunnerStats

+ +
+

+Class to store stats about the mcollectived, it should live in the PluginManager so that agents etc can get hold +of it and return the stats to callers +

+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + new() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/runnerstats.rb, line 5
+ 5:     def initialize
+ 6:       @starttime = Time.now.to_i
+ 7:       @validated = 0
+ 8:       @unvalidated = 0
+ 9:       @filtered = 0
+10:       @passed = 0
+11:       @total = 0
+12:       @replies = 0
+13:       @ttlexpired = 0
+14: 
+15:       @mutex = Mutex.new
+16:     end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + filtered() + click to toggle source + +
+ +
+ +

+Records a message that didnt pass the filters +

+ + + +
+
+    # File lib/mcollective/runnerstats.rb, line 31
+31:     def filtered
+32:       Log.debug("Incrementing filtered stat")
+33:       @filtered += 1
+34:     end
+
+ +
+ + +
+ + +
+ + +
+ + passed() + click to toggle source + +
+ +
+ +

+Records a message that passed the filters +

+ + + +
+
+    # File lib/mcollective/runnerstats.rb, line 25
+25:     def passed
+26:       Log.debug("Incrementing passed stat")
+27:       @passed += 1
+28:     end
+
+ +
+ + +
+ + +
+ + +
+ + received() + click to toggle source + +
+ +
+ +

+Records receipt of a message +

+ + + +
+
+    # File lib/mcollective/runnerstats.rb, line 48
+48:     def received
+49:       Log.debug("Incrementing total stat")
+50:       @total += 1
+51:     end
+
+ +
+ + +
+ + +
+ + +
+ + sent() + click to toggle source + +
+ +
+ +

+Records sending a message +

+ + + +
+
+    # File lib/mcollective/runnerstats.rb, line 54
+54:     def sent
+55:       @mutex.synchronize do
+56:         Log.debug("Incrementing replies stat")
+57:         @replies += 1
+58:       end
+59:     end
+
+ +
+ + +
+ + +
+ + +
+ + to_hash() + click to toggle source + +
+ +
+ +

+Returns a hash with all stats +

+ + + +
+
+    # File lib/mcollective/runnerstats.rb, line 62
+62:     def to_hash
+63:       stats = {:validated => @validated,
+64:         :unvalidated => @unvalidated,
+65:         :passed => @passed,
+66:         :filtered => @filtered,
+67:         :starttime => @starttime,
+68:         :total => @total,
+69:         :ttlexpired => @ttlexpired,
+70:         :replies => @replies}
+71: 
+72:       reply = {:stats => stats,
+73:         :threads => [],
+74:         :pid => Process.pid,
+75:         :times => {} }
+76: 
+77:       ::Process.times.each_pair{|k,v|
+78:         k = k.to_sym
+79:         reply[:times][k] = v
+80:       }
+81: 
+82:       Thread.list.each do |t|
+83:         reply[:threads] << "#{t.inspect}"
+84:       end
+85: 
+86:       reply[:agents] = Agents.agentlist
+87:       reply
+88:     end
+
+ +
+ + +
+ + +
+ + +
+ + ttlexpired() + click to toggle source + +
+ +
+ +

+Records a message that failed TTL checks +

+ + + +
+
+    # File lib/mcollective/runnerstats.rb, line 19
+19:     def ttlexpired
+20:       Log.debug("Incrementing ttl expired stat")
+21:       @ttlexpired += 1
+22:     end
+
+ +
+ + +
+ + +
+ + +
+ + unvalidated() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/runnerstats.rb, line 42
+42:     def unvalidated
+43:       Log.debug("Incrementing unvalidated stat")
+44:       @unvalidated += 1
+45:     end
+
+ +
+ + +
+ + +
+ + +
+ + validated() + click to toggle source + +
+ +
+ +

+Records a message that validated ok +

+ + + +
+
+    # File lib/mcollective/runnerstats.rb, line 37
+37:     def validated
+38:       Log.debug("Incrementing validated stat")
+39:       @validated += 1
+40:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/classes/MCollective/SSL.html b/doc/MCollective/SSL.html similarity index 53% rename from doc/classes/MCollective/SSL.html rename to doc/MCollective/SSL.html index 678945d..9dccae2 100644 --- a/doc/classes/MCollective/SSL.html +++ b/doc/MCollective/SSL.html @@ -1,85 +1,371 @@ - - - + + - Class: MCollective::SSL - - - - - - - - - - -
- - - - - - - - - + - - - - -
ClassMCollective::SSL
In: - - lib/mcollective/ssl.rb - -
-
Parent: - Object -
-
- + Class: MCollective::SSL -
+ + + + + - -
- -
-

+ + + +

+
+
+

In Files

+ +
+ + +
+ + + +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::SSL

+ +
+

A class that assists in encrypting and decrypting data using a combination of RSA and AES

@@ -106,7 +392,7 @@ This will result in a hash of data like:

The key and data will all be base 64 encoded already by default you can pass a 2nd parameter as false to encrypt_with_private and counterparts that will +href="SSL.html#M000206">encrypt_with_private and counterparts that will prevent the base 64 encoding

@@ -118,162 +404,186 @@ There are matching methods for using a public key to encrypt data to be decrypted using a private key

-
- - -
- - - -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - -
private_key_file [R] 
public_key_file [R] 
ssl_cipher [R] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
+
+ + + + + + +
+

Attributes

+ + +
+ + +
+ public_key_file[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ private_key_file[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ ssl_cipher[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + base64_decode(string) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/ssl.rb, line 195
 195:     def self.base64_decode(string)
 196:       Base64.decode64(string)
-197:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
+197: end +
+ +
+ + +
+ + +
+ + +
+ + base64_encode(string) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/ssl.rb, line 186
 186:     def self.base64_encode(string)
 187:       Base64.encode64(string)
-188:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
+188: end +
+ +
+ + +
+ + +
+ + +
+ + md5(string) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/ssl.rb, line 203
 203:     def self.md5(string)
 204:       Digest::MD5.hexdigest(string)
-205:     end
-
-
-
-
- - + + +
+ + +
+ + new(pubkey=nil, privkey=nil, passphrase=nil, cipher=nil) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File lib/mcollective/ssl.rb, line 37
 37:     def initialize(pubkey=nil, privkey=nil, passphrase=nil, cipher=nil)
@@ -288,23 +598,29 @@ decrypted using a private key
 46:       @ssl_cipher = cipher if cipher
 47: 
 48:       raise "The supplied cipher '#{@ssl_cipher}' is not supported" unless OpenSSL::Cipher.ciphers.include?(@ssl_cipher)
-49:     end
-
-
-
-
- -
- - - - -
-

+49: end +

+ +
+ + +
+ + +
+ + +
+ + uuid(string=nil) + click to toggle source + +
+ +
+ +

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 @@ -315,9 +631,11 @@ Code used with permission from:

    https://github.com/kwilczynski/puppet-functions/blob/master/lib/puppet/parser/functions/uuid.rb
 
-

[Source]

-
+ + + +
      # File lib/mcollective/ssl.rb, line 213
 213:     def self.uuid(string=nil)
@@ -345,30 +663,42 @@ Code used with permission from:
 235:       end
 236: 
 237:       bytes.join('-')
-238:     end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

+238: end +

+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + aes_decrypt(key, crypt_string) + click to toggle source + +
+ +
+ +

decrypts a string given key, iv and data

-

[Source]

-
+ + + +
      # File lib/mcollective/ssl.rb, line 158
 158:     def aes_decrypt(key, crypt_string)
@@ -378,28 +708,36 @@ decrypts a string given key, iv and data
 162:       cipher.key = key
 163:       cipher.pkcs5_keyivgen(key)
 164:       decrypted_data = cipher.update(crypt_string) + cipher.final
-165:     end
-
-
-
-
- -
- - - - -
-

+165: end +

+ +
+ + +
+ + +
+ + +
+ + aes_encrypt(plain_string) + click to toggle source + +
+ +
+ +

encrypts a string, returns a hash of key, iv and data

-

[Source]

-
+ + + +
      # File lib/mcollective/ssl.rb, line 144
 144:     def aes_encrypt(plain_string)
@@ -413,80 +751,104 @@ encrypts a string, returns a hash of key, iv and data
 152:       encrypted_data = cipher.update(plain_string) + cipher.final
 153: 
 154:       {:key => key, :data => encrypted_data}
-155:     end
-
-
-
-
- -
- - - - -
-

+155: end +

+ +
+ + +
+ + +
+ + +
+ + base64_decode(string) + click to toggle source + +
+ +
+ +

base 64 decode a string

-

[Source]

-
+ + + +
      # File lib/mcollective/ssl.rb, line 191
 191:     def base64_decode(string)
 192:       SSL.base64_decode(string)
-193:     end
-
-
-
-
- -
- - - - -
-

+193: end +

+ +
+ + +
+ + +
+ + +
+ + base64_encode(string) + click to toggle source + +
+ +
+ +

base 64 encode a string

-

[Source]

-
+ + + +
      # File lib/mcollective/ssl.rb, line 182
 182:     def base64_encode(string)
 183:       SSL.base64_encode(string)
-184:     end
-
-
-
-
- -
- - - - -
-

+184: end +

+ +
+ + +
+ + +
+ + +
+ + decrypt_with_private(crypted, base64=true) + click to toggle source + +
+ +
+ +

Decrypts data, expects a hash as create with crypt_with_public

-

[Source]

-
+ + + +
     # File lib/mcollective/ssl.rb, line 88
 88:     def decrypt_with_private(crypted, base64=true)
@@ -500,28 +862,36 @@ Decrypts data, expects a hash as create with crypt_with_public
 96:         key = rsa_decrypt_with_private(crypted[:key])
 97:         aes_decrypt(key, crypted[:data])
 98:       end
-99:     end
-
-
-
-
- - + + +
+ + +
+ + +
+ + decrypt_with_public(crypted, base64=true) + click to toggle source + +
+ +
+ +

Decrypts data, expects a hash as create with crypt_with_private

-

[Source]

-
+ + + +
      # File lib/mcollective/ssl.rb, line 102
 102:     def decrypt_with_public(crypted, base64=true)
@@ -535,31 +905,39 @@ Decrypts data, expects a hash as create with crypt_with_private
 110:         key = rsa_decrypt_with_public(crypted[:key])
 111:         aes_decrypt(key, crypted[:data])
 112:       end
-113:     end
-
-
-
-
- - + + +
+ + +
+ + +
+ + encrypt_with_private(plain_text, base64=true) + click to toggle source + +
+ +
+ +

Encrypts supplied data using AES and then encrypts using RSA the key and IV

Return a hash with everything optionally base 64 encoded

-

[Source]

-
+ + + +
     # File lib/mcollective/ssl.rb, line 73
 73:     def encrypt_with_private(plain_text, base64=true)
@@ -574,31 +952,39 @@ Return a hash with everything optionally base 64 encoded
 82:       end
 83: 
 84:       {:key => key, :data => data}
-85:     end
-
-
-
-
- - + + +
+ + +
+ + +
+ + encrypt_with_public(plain_text, base64=true) + click to toggle source + +
+ +
+ +

Encrypts supplied data using AES and then encrypts using RSA the key and IV

Return a hash with everything optionally base 64 encoded

-

[Source]

-
+ + + +
     # File lib/mcollective/ssl.rb, line 55
 55:     def encrypt_with_public(plain_text, base64=true)
@@ -613,52 +999,69 @@ Return a hash with everything optionally base 64 encoded
 64:       end
 65: 
 66:       {:key => key, :data => data}
-67:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
+67: end +
+ +
+ + +
+ + +
+ + +
+ + md5(string) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/ssl.rb, line 199
 199:     def md5(string)
 200:       SSL.md5(string)
-201:     end
-
-
-
-
- -
- - - - -
-

+201: end +

+ +
+ + +
+ + +
+ + +
+ + read_key(type, key=nil, passphrase=nil) + click to toggle source + +
+ +
+ +

Reads either a :public or :private key from disk, uses an optional passphrase to read the private key

-

[Source]

-
+ + + +
      # File lib/mcollective/ssl.rb, line 242
 242:     def read_key(type, key=nil, passphrase=nil)
@@ -696,191 +1099,250 @@ passphrase to read the private key
 274:       else
 275:         raise "Can only load :public or :private keys"
 276:       end
-277:     end
-
-
-
-
- -
- - - - -
-

+277: end +

+ +
+ + +
+ + +
+ + +
+ + rsa_decrypt_with_private(crypt_string) + click to toggle source + +
+ +
+ +

Use the private key to RSA decrypt data

-

[Source]

-
+ + + +
      # File lib/mcollective/ssl.rb, line 123
 123:     def rsa_decrypt_with_private(crypt_string)
 124:       raise "No private key set" unless @private_key
 125: 
 126:       @private_key.private_decrypt(crypt_string)
-127:     end
-
-
-
-
- -
- - - - -
-

+127: end +

+ +
+ + +
+ + +
+ + +
+ + rsa_decrypt_with_public(crypt_string) + click to toggle source + +
+ +
+ +

Use the public key to RSA decrypt data

-

[Source]

-
+ + + +
      # File lib/mcollective/ssl.rb, line 137
 137:     def rsa_decrypt_with_public(crypt_string)
 138:       raise "No public key set" unless @public_key
 139: 
 140:       @public_key.public_decrypt(crypt_string)
-141:     end
-
-
-
-
- -
- - - - -
-

+141: end +

+ +
+ + +
+ + +
+ + +
+ + rsa_encrypt_with_private(plain_string) + click to toggle source + +
+ +
+ +

Use the private key to RSA encrypt data

-

[Source]

-
+ + + +
      # File lib/mcollective/ssl.rb, line 130
 130:     def rsa_encrypt_with_private(plain_string)
 131:       raise "No private key set" unless @private_key
 132: 
 133:       @private_key.private_encrypt(plain_string)
-134:     end
-
-
-
-
- -
- - - - -
-

+134: end +

+ +
+ + +
+ + +
+ + +
+ + rsa_encrypt_with_public(plain_string) + click to toggle source + +
+ +
+ +

Use the public key to RSA encrypt data

-

[Source]

-
+ + + +
      # File lib/mcollective/ssl.rb, line 116
 116:     def rsa_encrypt_with_public(plain_string)
 117:       raise "No public key set" unless @public_key
 118: 
 119:       @public_key.public_encrypt(plain_string)
-120:     end
-
-
-
-
- -
- - - - -
-

+120: end +

+ +
+ + +
+ + +
+ + +
+ + sign(string, base64=false) + click to toggle source + +
+ +
+ +

Signs a string using the private key

-

[Source]

-
+ + + +
      # File lib/mcollective/ssl.rb, line 168
 168:     def sign(string, base64=false)
 169:       sig = @private_key.sign(OpenSSL::Digest::SHA1.new, string)
 170: 
 171:       base64 ? base64_encode(sig) : sig
-172:     end
-
-
-
-
- - + + +
+ + +
+ + +
+ + verify_signature(signature, string, base64=false) + click to toggle source + +
+ +
+ +

Using the public key verifies that a string was signed using the private key

-

[Source]

-
+ + + +
      # File lib/mcollective/ssl.rb, line 175
 175:     def verify_signature(signature, string, base64=false)
 176:       signature = base64_decode(signature) if base64
 177: 
 178:       @public_key.verify(OpenSSL::Digest::SHA1.new, signature, string)
-179:     end
-
-
-
-
+179: end +
+ +
+ +
-
+ +
+ +
-
+
+ +

Disabled; run with --debug to generate this.

+ +
- +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
- \ No newline at end of file + + diff --git a/doc/MCollective/Security.html b/doc/MCollective/Security.html new file mode 100644 index 0000000..bf8e7c6 --- /dev/null +++ b/doc/MCollective/Security.html @@ -0,0 +1,401 @@ + + + + + + + Module: MCollective::Security + + + + + + + + + + + +
+
+ + + +
+ +
+ + + + + + +
+

Namespace

+ +
+ + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Security

+ +
+

+Security is implimented using a module +structure and installations can configure which module they want to use. +

+

+Security modules deal with various aspects of +authentication and authorization: +

+
    +
  • Determines if a filter excludes this host from dealing with a request + +
  • +
  • Serialization and Deserialization of messages + +
  • +
  • Validation of messages against keys, certificates or whatever the class +choose to impliment + +
  • +
  • Encoding and Decoding of messages + +
  • +
+

+To impliment a new security class using SSL for +example you would inherit from the base class and only impliment: +

+
    +
  • decodemsg + +
  • +
  • encodereply + +
  • +
  • encoderequest + +
  • +
  • validrequest? + +
  • +
+

+Each of these methods should increment various stats counters, see the +default MCollective::Security::Psk module for examples of this +

+

+Filtering can be extended by providing a new validate_filter? method. +

+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/classes/MCollective/Security/Base.html b/doc/MCollective/Security/Base.html similarity index 53% rename from doc/classes/MCollective/Security/Base.html rename to doc/MCollective/Security/Base.html index 52886e9..bf29ff4 100644 --- a/doc/classes/MCollective/Security/Base.html +++ b/doc/MCollective/Security/Base.html @@ -1,85 +1,353 @@ - - - + + - Class: MCollective::Security::Base - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Security::Base
In: - - lib/mcollective/security/base.rb - -
-
Parent: - Object -
-
- + -
+ Class: MCollective::Security::Base + + + + + -
- -
-

+ + + +

+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Security::Base

+ +
+

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. @@ -89,25 +357,22 @@ To create your own security plugin you should provide a plugin that inherits from this and provides the following methods:

-decodemsg - Decodes a message that was -received from the middleware encodereply - -Encodes a reply message to a previous request message encoderequest - Encodes a new request message validrequest? - Validates a request received -from the middleware +decodemsg - Decodes a message that was received from the middleware +encodereply - Encodes a reply message to a previous request message +encoderequest - Encodes a new request message validrequest? - Validates a +request received from the middleware

Optionally if you are identifying users by some other means like -certificate name you can provide your own callerid method that can provide the rest of -the system with an id, and you would see this id being usable in SimpleRPC -authorization methods +certificate name you can provide your own callerid method that can provide +the rest of the system with an id, and you would see this id being usable +in SimpleRPC authorization methods

-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. +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.

Specifics of each of these are a bit fluid and the interfaces for this is @@ -117,164 +382,190 @@ to see how security works is by looking at the provided MCollective::Security::PSK plugin.

-
- - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - -
initiated_by [RW] 
stats [R] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

+

+ + + + + + +
+

Attributes

+ + +
+ + +
+ stats[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+ initiated_by[RW] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + inherited(klass) + click to toggle source + +
+ +
+ +

Register plugins that inherits base

-

[Source]

-
+ + + +
     # File lib/mcollective/security/base.rb, line 32
 32:       def self.inherited(klass)
 33:         PluginManager << {:type => "security_plugin", :class => klass.to_s}
-34:       end
-
-
-
-
- -
- - - - -
-

-Initializes configuration and logging as well as prepare a zero‘d +34: end +

+ +
+ + +
+ + +
+ + +
+ + new() + click to toggle source + +
+ +
+ +

+Initializes configuration and logging as well as prepare a zero’d hash of stats various security methods and filter validators should increment stats, see MCollective::Security::Psk for a sample

-

[Source]

-
+ + + +
     # File lib/mcollective/security/base.rb, line 38
 38:       def initialize
 39:         @config = Config.instance
 40:         @log = Log
 41:         @stats = PluginManager["global_stats"]
-42:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

+42: end +

+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + callerid() + click to toggle source + +
+ +
+ +

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.

-

[Source]

-
+ + + +
      # File lib/mcollective/security/base.rb, line 219
 219:       def callerid
 220:         "uid=#{Process.uid}"
-221:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
+221: end +
+ +
+ + +
+ + +
+ + +
+ + create_reply(reqid, agent, body) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/security/base.rb, line 167
 167:       def create_reply(reqid, agent, body)
@@ -285,25 +576,34 @@ id, security plugins can provide their own means of doing ids.
 172:          :senderagent => agent,
 173:          :msgtime => Time.now.utc.to_i,
 174:          :body => body}
-175:       end
-
-
-
-
- - + + +
+ + +
+ + create_request(reqid, filter, msg, initiated_by, target_agent, target_collective, ttl=60) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/security/base.rb, line 177
 177:       def create_request(reqid, filter, msg, initiated_by, target_agent, target_collective, ttl=60)
@@ -318,104 +618,134 @@ id, security plugins can provide their own means of doing ids.
 186:          :callerid => callerid,
 187:          :ttl => ttl,
 188:          :msgtime => Time.now.utc.to_i}
-189:       end
-
-
-
-
- -
- - - - -
-

+189: end +

+ +
+ + +
+ + +
+ + +
+ + decodemsg(msg) + click to toggle source + +
+ +
+ +

Security providers should provide this, see MCollective::Security::Psk

-

[Source]

-
+ + + +
      # File lib/mcollective/security/base.rb, line 239
 239:       def decodemsg(msg)
 240:         Log.error("decodemsg is not implemented in #{self.class}")
-241:       end
-
-
-
-
- - + + +
+ + +
+ + +
+ + encodereply(sender, msg, requestcallerid=nil) + click to toggle source + +
+ +
+ +

Security providers should provide this, see MCollective::Security::Psk

-

[Source]

-
+ + + +
      # File lib/mcollective/security/base.rb, line 234
 234:       def encodereply(sender, msg, requestcallerid=nil)
 235:         Log.error("encodereply is not implemented in #{self.class}")
-236:       end
-
-
-
-
- -
- - - - -
-

+236: end +

+ +
+ + +
+ + +
+ + +
+ + encoderequest(sender, msg, filter={}) + click to toggle source + +
+ +
+ +

Security providers should provide this, see MCollective::Security::Psk

-

[Source]

-
+ + + +
      # File lib/mcollective/security/base.rb, line 229
 229:       def encoderequest(sender, msg, filter={})
 230:         Log.error("encoderequest is not implemented in #{self.class}")
-231:       end
-
-
-
-
- -
- - - - -
-

+231: end +

+ +
+ + +
+ + +
+ + +
+ + should_process_msg?(msg, msgid) + click to toggle source + +
+ +
+ +

Give a MC::Message instance and a message id this will figure out if you the incoming message id matches the one the Message object is expecting and raise if its not @@ -424,9 +754,11 @@ href="../Message.html">Message object is expecting and raise if its not 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

-

[Source]

-
+ + + +
      # File lib/mcollective/security/base.rb, line 196
 196:       def should_process_msg?(msg, msgid)
@@ -439,55 +771,68 @@ work of decrypting etc messages that would only later on be ignored
 203:         end
 204: 
 205:         true
-206:       end
-
-
-
-
- -
- - - - -
-

-Validates a callerid. We do not want to -allow things like \ and / in callerids since other plugins make assumptions -that these are safe strings. +206: end +

+ +
+ + +
+ + +
+ + +
+ + valid_callerid?(id) + click to toggle source + +
+ +
+ +

+Validates a callerid. We do not want to allow things like \ and / in +callerids since other plugins make assumptions that these are safe strings.

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

-

[Source]

-
+ + + +
      # File lib/mcollective/security/base.rb, line 213
 213:       def valid_callerid?(id)
 214:         !!id.match(/^[\w]+=[\w\.\-]+$/)
-215:       end
-
-
-
-
- -
- - - - -
-

+215: end +

+ +
+ + +
+ + +
+ + +
+ + validate_filter?(filter) + click to toggle source + +
+ +
+ +

Takes a Hash with a filter in it and validates it against host information.

@@ -512,11 +857,13 @@ agent with a supplied name

-TODO: Support REGEX and/or multiple filter keys to be AND‘d +TODO: Support REGEX and/or multiple filter keys to be AND’d

-

[Source]

-
+ + + +
      # File lib/mcollective/security/base.rb, line 55
  55:       def validate_filter?(filter)
@@ -629,49 +976,68 @@ TODO: Support REGEX and/or multiple filter keys to be AND‘d
 162: 
 163:           return false
 164:         end
-165:       end
-
-
-
-
- -
- - - - -
-

+165: end +

+ +
+ + +
+ + +
+ + +
+ + validrequest?(req) + click to toggle source + +
+ +
+ +

Security providers should provide this, see MCollective::Security::Psk

-

[Source]

-
+ + + +
      # File lib/mcollective/security/base.rb, line 224
 224:       def validrequest?(req)
 225:         Log.error("validrequest? is not implemented in #{self.class}")
-226:       end
-
-
-
-
+226: end +
+ +
+ +
-
+ +
+ +
-
+
+ +

Disabled; run with --debug to generate this.

+ +
- +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
- \ No newline at end of file + + diff --git a/doc/MCollective/SecurityValidationFailed.html b/doc/MCollective/SecurityValidationFailed.html new file mode 100644 index 0000000..13c8799 --- /dev/null +++ b/doc/MCollective/SecurityValidationFailed.html @@ -0,0 +1,348 @@ + + + + + + + Class: MCollective::SecurityValidationFailed + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::SecurityValidationFailed

+ +
+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Shell.html b/doc/MCollective/Shell.html new file mode 100644 index 0000000..c5cfb9c --- /dev/null +++ b/doc/MCollective/Shell.html @@ -0,0 +1,678 @@ + + + + + + + Class: MCollective::Shell + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Shell

+ +
+

+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. +

+
+  s = Shell.new("date", opts)
+  s.runcommand
+  puts s.stdout
+  puts s.stderr
+  puts s.status.exitstatus
+
+

+Options hash can have: +

+
+  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 <<
+  stderr      - a variable that will receive stdin, must support <<
+  environment - the shell environment, defaults to include LC_ALL=C
+                set to nil to clear the environment even of LC_ALL
+  timeout     - a timeout in seconds after which the subprocess is killed,
+                the special value :on_thread_exit kills the subprocess
+                when the invoking thread (typically the agent) has ended
+
+ +
+ + + + + + +
+

Attributes

+ + +
+ + +
+ environment[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ command[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ status[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ stdout[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ stderr[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ stdin[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ cwd[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ timeout[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + new(command, options={}) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/shell.rb, line 27
+27:     def initialize(command, options={})
+28:       @environment = {"LC_ALL" => "C"}
+29:       @command = command
+30:       @status = nil
+31:       @stdout = ""
+32:       @stderr = ""
+33:       @stdin = nil
+34:       @cwd = Dir.tmpdir
+35:       @timeout = nil
+36: 
+37:       options.each do |opt, val|
+38:         case opt.to_s
+39:           when "stdout"
+40:             raise "stdout should support <<" unless val.respond_to?("<<")
+41:             @stdout = val
+42: 
+43:           when "stderr"
+44:             raise "stderr should support <<" unless val.respond_to?("<<")
+45:             @stderr = val
+46: 
+47:           when "stdin"
+48:             raise "stdin should be a String" unless val.is_a?(String)
+49:             @stdin = val
+50: 
+51:           when "cwd"
+52:             raise "Directory #{val} does not exist" unless File.directory?(val)
+53:             @cwd = val
+54: 
+55:           when "environment"
+56:             if val.nil?
+57:               @environment = {}
+58:             else
+59:               @environment.merge!(val.dup)
+60:             end
+61:           when "timeout"
+62:             raise "timeout should be a positive integer or the symbol :on_thread_exit symbol" unless val.eql?(:on_thread_exit) || ( val.is_a?(Fixnum) && val>0 )
+63:             @timeout = val
+64:         end
+65:       end
+66:     end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + runcommand() + click to toggle source + +
+ +
+ +

+Actually does the systemu call passing in the correct environment, stdout +and stderr +

+ + + +
+
+     # File lib/mcollective/shell.rb, line 69
+ 69:     def runcommand
+ 70:       opts = {"env"    => @environment,
+ 71:               "stdout" => @stdout,
+ 72:               "stderr" => @stderr,
+ 73:               "cwd"    => @cwd}
+ 74: 
+ 75:       opts["stdin"] = @stdin if @stdin
+ 76: 
+ 77: 
+ 78:       thread = Thread.current
+ 79:       # Start a double fork and exec with systemu which implies a guard thread.
+ 80:       # If a valid timeout is configured the guard thread will terminate the
+ 81:       # executing process and reap the pid.
+ 82:       # If no timeout is specified the process will run to completion with the
+ 83:       # guard thread reaping the pid on completion.
+ 84:       @status = systemu(@command, opts) do |cid|
+ 85:         begin
+ 86:           if timeout.is_a?(Fixnum)
+ 87:             # wait for the specified timeout
+ 88:             sleep timeout
+ 89:           else
+ 90:             # sleep while the agent thread is still alive
+ 91:             while(thread.alive?)
+ 92:               sleep 0.1
+ 93:             end
+ 94:           end
+ 95: 
+ 96:           # if the process is still running
+ 97:           if (Process.kill(0, cid))
+ 98:             # and a timeout was specified
+ 99:             if timeout
+100:               if Util.windows?
+101:                 Process.kill('KILL', cid)
+102:               else
+103:                 # Kill the process
+104:                 Process.kill('TERM', cid)
+105:                 sleep 2
+106:                 Process.kill('KILL', cid) if (Process.kill(0, cid))
+107:               end
+108:             end
+109:             # only wait if the parent thread is dead
+110:             Process.waitpid(cid) unless thread.alive?
+111:           end
+112:         rescue SystemExit
+113:         rescue Errno::ESRCH
+114:         rescue Errno::ECHILD
+115:           Log.warn("Could not reap process '#{cid}'.")
+116:         rescue Exception => e
+117:           Log.info("Unexpected exception received while waiting for child process: #{e.class}: #{e}")
+118:         end
+119:       end
+120:       @status.thread.kill
+121:       @status
+122:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/Translatable.html b/doc/MCollective/Translatable.html new file mode 100644 index 0000000..8914e33 --- /dev/null +++ b/doc/MCollective/Translatable.html @@ -0,0 +1,495 @@ + + + + + + + Module: MCollective::Translatable + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Translatable

+ +
+ +
+ + + + + + + + + +
+

Public Instance Methods

+ + +
+ + +
+ + log_code(msgid, default, level, args={}) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/translatable.rb, line 7
+ 7:     def log_code(msgid, default, level, args={})
+ 8:       msg = "%s: %s" % [msgid, Util.t(msgid, {:default => default}.merge(args))]
+ 9: 
+10:       Log.log(level, msg, File.basename(caller[1]))
+11:     end
+
+ +
+ + +
+ + +
+ + +
+ + logexception(msgid, default, level, e, backtrace=false) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/translatable.rb, line 20
+20:     def logexception(msgid, default, level, e, backtrace=false)
+21:       Log.logexception(msgid, level, e, backtrace)
+22:     end
+
+ +
+ + +
+ + +
+ + +
+ + raise_code(msgid, default, level, args={}) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/translatable.rb, line 13
+13:     def raise_code(msgid, default, level, args={})
+14:       exception = CodedError.new(msgid, default, level, args)
+15:       exception.set_backtrace caller
+16: 
+17:       raise exception
+18:     end
+
+ +
+ + +
+ + +
+ + +
+ + t(msgid, default, args={}) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+   # File lib/mcollective/translatable.rb, line 3
+3:     def t(msgid, default, args={})
+4:       Util.t(msgid, {:default => default}.merge(args))
+5:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/UnixDaemon.html b/doc/MCollective/UnixDaemon.html new file mode 100644 index 0000000..a72a7f1 --- /dev/null +++ b/doc/MCollective/UnixDaemon.html @@ -0,0 +1,456 @@ + + + + + + + Class: MCollective::UnixDaemon + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::UnixDaemon

+ +
+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + daemonize() + click to toggle source + +
+ +
+ +

+Daemonize the current process +

+ + + +
+
+    # File lib/mcollective/unix_daemon.rb, line 4
+ 4:     def self.daemonize
+ 5:       fork do
+ 6:         Process.setsid
+ 7:         exit if fork
+ 8:         Dir.chdir('/tmp')
+ 9:         STDIN.reopen('/dev/null')
+10:         STDOUT.reopen('/dev/null', 'a')
+11:         STDERR.reopen('/dev/null', 'a')
+12: 
+13:         yield
+14:       end
+15:     end
+
+ +
+ + +
+ + +
+ + +
+ + daemonize_runner(pid=nil) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/unix_daemon.rb, line 17
+17:     def self.daemonize_runner(pid=nil)
+18:       raise "The Unix Daemonizer can not be used on the Windows Platform" if Util.windows?
+19: 
+20:       UnixDaemon.daemonize do
+21:         if pid
+22:           begin
+23:             File.open(pid, 'w') {|f| f.write(Process.pid) }
+24:           rescue Exception => e
+25:           end
+26:         end
+27: 
+28:         begin
+29:           runner = Runner.new(nil)
+30:           runner.run
+31:         ensure
+32:           File.unlink(pid) if pid && File.exist?(pid)
+33:         end
+34:       end
+35:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/UnknownRPCAction.html b/doc/MCollective/UnknownRPCAction.html new file mode 100644 index 0000000..75a79d9 --- /dev/null +++ b/doc/MCollective/UnknownRPCAction.html @@ -0,0 +1,348 @@ + + + + + + + Class: MCollective::UnknownRPCAction + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::UnknownRPCAction

+ +
+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/UnknownRPCError.html b/doc/MCollective/UnknownRPCError.html new file mode 100644 index 0000000..35e6919 --- /dev/null +++ b/doc/MCollective/UnknownRPCError.html @@ -0,0 +1,348 @@ + + + + + + + Class: MCollective::UnknownRPCError + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::UnknownRPCError

+ +
+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/classes/MCollective/Util.html b/doc/MCollective/Util.html similarity index 65% rename from doc/classes/MCollective/Util.html rename to doc/MCollective/Util.html index a7a7018..64584ee 100644 --- a/doc/classes/MCollective/Util.html +++ b/doc/MCollective/Util.html @@ -1,159 +1,421 @@ - - - + + - Module: MCollective::Util - - - - - - - - - - -
- - - - - - - - - + -
ModuleMCollective::Util
In: - - lib/mcollective/util.rb - -
-
-
- + Module: MCollective::Util -
+ + + + + - -
- -
-

+ + + +

+
+
+

In Files

+ +
+ + +
+ + + +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Util

+ +
+

Some basic utility helper methods useful to clients, agents, runner etc.

-
- - -
- -
-

Methods

+
- -
+ + -
+ + + + +
+

Public Class Methods

- + +
+ -
+
+ + absolute_path?(path, separator=File::SEPARATOR, alt_separator=File::ALT_SEPARATOR) + click to toggle source + +
- - - - - - - - -
-

Public Class methods

- -
- - - - -
-

-we should really use Pathname#absolute? but it‘s not in all the ruby +

+ +

+we should really use Pathname#absolute? but it’s not in all the ruby versions we support and it comes down to roughly this

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 464
 464:     def self.absolute_path?(path, separator=File::SEPARATOR, alt_separator=File::ALT_SEPARATOR)
@@ -164,23 +426,29 @@ versions we support and it comes down to roughly this
 469:       end
 470: 
 471:       !!path.match(path_matcher)
-472:     end
-
-
-
-
- - + + +
+ + +
+ + +
+ + align_text(text, console_cols = nil, preamble = 5) + click to toggle source + +
+ +
+ +

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 @@ -191,9 +459,11 @@ 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.

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 310
 310:     def self.align_text(text, console_cols = nil, preamble = 5)
@@ -276,29 +546,37 @@ by default.
 387:       end
 388: 
 389:       text.join("\n")
-390:     end
-
-
-
-
- -
- - - - -
-

-Return color codes, if the config color= -option is false just return a empty string +390: end +

+ +
+ + +
+ + +
+ + +
+ + color(code) + click to toggle source + +
+ +
+ +

+Return color codes, if the config color= option is false just return a +empty string

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 270
 270:     def self.color(code)
@@ -316,54 +594,70 @@ option is false just return a empty string
 282:       else
 283:         return ""
 284:       end
-285:     end
-
-
-
-
- -
- - - - -
-

-Helper to return a string in specific color +285: end +

+ +
+ + +
+ + +
+ + +
+ + colorize(code, msg) + click to toggle source + +
+ +
+ +

+Helper to return a string in specific color

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 288
 288:     def self.colorize(code, msg)
 289:       "%s%s%s" % [ color(code), msg, color(:reset) ]
-290:     end
-
-
-
-
- -
- - - - -
-

+290: end +

+ +
+ + +
+ + +
+ + +
+ + command_in_path?(command) + click to toggle source + +
+ +
+ +

Checks in PATH returns true if the command is found

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 417
 417:     def self.command_in_path?(command)
@@ -372,29 +666,37 @@ Checks in PATH returns true if the command is found
 420:       end
 421: 
 422:       found.include?(true)
-423:     end
-
-
-
-
- -
- - - - -
-

+423: end +

+ +
+ + +
+ + +
+ + +
+ + config_file_for_user() + click to toggle source + +
+ +
+ +

Picks a config file defaults to ~/.mcollective else /etc/mcollective/client.cfg

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 148
 148:     def self.config_file_for_user
@@ -420,28 +722,36 @@ Picks a config file defaults to ~/.mcollective else
 168:       end
 169: 
 170:       return config
-171:     end
-
-
-
-
- -
- - - - -
-

+171: end +

+ +
+ + +
+ + +
+ + +
+ + default_options() + click to toggle source + +
+ +
+ +

Creates a standard options hash

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 174
 174:     def self.default_options
@@ -453,28 +763,36 @@ Creates a standard options hash
 180:        :discovery_method  => nil,
 181:        :discovery_options => Config.instance.default_discovery_options,
 182:        :filter            => empty_filter}
-183:     end
-
-
-
-
- -
- - - - -
-

+183: end +

+ +
+ + +
+ + +
+ + +
+ + empty_filter() + click to toggle source + +
+ +
+ +

Creates an empty filter

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 132
 132:     def self.empty_filter
@@ -483,87 +801,111 @@ Creates an empty filter
 135:        "agent"    => [],
 136:        "identity" => [],
 137:        "compound" => []}
-138:     end
-
-
-
-
- -
- - - - -
-

+138: end +

+ +
+ + +
+ + +
+ + +
+ + empty_filter?(filter) + click to toggle source + +
+ +
+ +

Checks if the passed in filter is an empty one

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 127
 127:     def self.empty_filter?(filter)
 128:       filter == empty_filter || filter == {}
-129:     end
-
-
-
-
- -
- - - - -
-

+129: end +

+ +
+ + +
+ + +
+ + +
+ + get_fact(fact) + click to toggle source + +
+ +
+ +

Gets the value of a specific fact, mostly just a duplicate of MCollective::Facts.get_fact but it kind of +href="Facts.html#M000483">MCollective::Facts.get_fact but it kind of goes with the other classes here

-

[Source]

-
+ + + +
     # File lib/mcollective/util.rb, line 63
 63:     def self.get_fact(fact)
 64:       Facts.get_fact(fact)
-65:     end
-
-
-
-
- -
- - - - -
-

+65: end +

+ +
+ + +
+ + +
+ + +
+ + has_agent?(agent) + click to toggle source + +
+ +
+ +

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 and will +If the passed name starts with a / it’s assumed to be regex and will use regex to match

-

[Source]

-
+ + + +
     # File lib/mcollective/util.rb, line 10
 10:     def self.has_agent?(agent)
@@ -580,34 +922,42 @@ use regex to match
 21:       end
 22: 
 23:       false
-24:     end
-
-
-
-
- -
- - - - -
-

+24: end +

+ +
+ + +
+ + +
+ + +
+ + has_cf_class?(klass) + click to toggle source + +
+ +
+ +

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.

-If the passed name starts with a / it‘s assumed to be regex and will +If the passed name starts with a / it’s assumed to be regex and will use regex to match

-

[Source]

-
+ + + +
     # File lib/mcollective/util.rb, line 40
 40:     def self.has_cf_class?(klass)
@@ -629,32 +979,40 @@ use regex to match
 56:       end
 57: 
 58:       false
-59:     end
-
-
-
-
- -
- - - - -
-

+59: end +

+ +
+ + +
+ + +
+ + +
+ + has_fact?(fact, value, operator) + click to toggle source + +
+ +
+ +

Compares fact == value,

-If the passed value starts with a / it‘s assumed to be regex and will +If the passed value starts with a / it’s assumed to be regex and will use regex to match

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 71
  71:     def self.has_fact?(fact, value, operator)
@@ -694,32 +1052,40 @@ use regex to match
 105:       end
 106: 
 107:       false
-108:     end
-
-
-
-
- -
- - - - -
-

+108: end +

+ +
+ + +
+ + +
+ + +
+ + has_identity?(identity) + click to toggle source + +
+ +
+ +

Checks if the configured identity matches the one supplied

-If the passed name starts with a / it‘s assumed to be regex and will +If the passed name starts with a / it’s assumed to be regex and will use regex to match

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 114
 114:     def self.has_identity?(identity)
@@ -732,52 +1098,69 @@ use regex to match
 121:       end
 122: 
 123:       false
-124:     end
-
-
-
-
- -
- - - - -
-

+124: end +

+ +
+ + +
+ + +
+ + +
+ + loadclass(klass) + click to toggle source + +
+ +
+ +

Wrapper around PluginManager.loadclass +href="PluginManager.html#M000084">PluginManager.loadclass

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 224
 224:     def self.loadclass(klass)
 225:       PluginManager.loadclass(klass)
-226:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
+226: end +
+ +
+ + +
+ + +
+ + +
+ + make_subscriptions(agent, type, collective=nil) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/util.rb, line 185
 185:     def self.make_subscriptions(agent, type, collective=nil)
@@ -794,51 +1177,68 @@ href="PluginManager.html#M000034">PluginManager.loadclass
 196: 
 197:         [{:agent => agent, :type => type, :collective => collective}]
 198:       end
-199:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
+199: end +
+ +
+ + +
+ + +
+ + +
+ + mcollective_version() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/util.rb, line 298
 298:     def self.mcollective_version
 299:       MCollective::VERSION
-300:     end
-
-
-
-
- -
- - - - -
-

+300: end +

+ +
+ + +
+ + +
+ + +
+ + parse_fact_string(fact) + click to toggle source + +
+ +
+ +

Parse a fact filter string like foo=bar into the tuple hash thats needed

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 229
 229:     def self.parse_fact_string(fact)
@@ -855,88 +1255,112 @@ Parse a fact filter string like foo=bar into the tuple hash thats needed
 240:       else
 241:         raise "Could not parse fact #{fact} it does not appear to be in a valid format"
 242:       end
-243:     end
-
-
-
-
- -
- - - - -
-

+243: end +

+ +
+ + +
+ + +
+ + +
+ + ruby_version() + click to toggle source + +
+ +
+ +

Returns the current ruby version as per RUBY_VERSION, mostly doing this here to aid testing

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 294
 294:     def self.ruby_version
 295:       RUBY_VERSION
-296:     end
-
-
-
-
- -
- - - - -
-

-On windows ^c can‘t 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 +296: end +

+ +
+ + +
+ + +
+ + +
+ + setup_windows_sleeper() + click to toggle source + +
+ +
+ +

+On windows ^c can’t 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

-

[Source]

-
+ + + +
     # File lib/mcollective/util.rb, line 30
 30:     def self.setup_windows_sleeper
 31:       Thread.new { loop { sleep 1 } } if Util.windows?
-32:     end
-
-
-
-
- -
- - - - -
-

-Escapes a string so it‘s safe to use in system() or backticks +32: end +

+ +
+ + +
+ + +
+ + +
+ + shellescape(str) + click to toggle source + +
+ +
+ +

+Escapes a string so it’s safe to use in system() or backticks

-Taken from Shellwords#shellescape since it‘s only in a few ruby +Taken from Shellwords#shellescape since it’s only in a few ruby versions

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 248
 248:     def self.shellescape(str)
@@ -953,30 +1377,37 @@ versions
 259:       str.gsub!(/\n/, "'\n'")
 260: 
 261:       return str
-262:     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 +262: end +

+ +
+ + +
+ + +
+ + +
+ + str_to_bool(val) + click to toggle source + +
+ +
+ +

+Converts a string into a boolean value Strings matching 1,y,yes,true or t +will return TrueClass Any other value will return FalseClass

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 477
 477:     def self.str_to_bool(val)
@@ -988,29 +1419,36 @@ return FalseClass
 483:       else
 484:         raise_code(:PLMC42, "Cannot convert string value '%{value}' into a boolean.", :error, :value => clean_val)
 485:       end
-486:     end
-
-
-
-
- -
- - - - -
-

-Helper to subscribe to a topic on multiple -collectives or just one +486: end +

+ +
+ + +
+ + +
+ + +
+ + subscribe(targets) + click to toggle source + +
+ +
+ +

+Helper to subscribe to a topic on multiple collectives or just one

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 202
 202:     def self.subscribe(targets)
@@ -1021,28 +1459,36 @@ collectives or just one
 207:       targets.each do |target|
 208:         connection.subscribe(target[:agent], target[:type], target[:collective])
 209:       end
-210:     end
-
-
-
-
- -
- - - - -
-

+210: end +

+ +
+ + +
+ + +
+ + +
+ + t(msgid, args={}) + click to toggle source + +
+ +
+ +

Looks up and interprolate the hash values into a i18n string

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 489
 489:     def self.t(msgid, args={})
@@ -1051,28 +1497,36 @@ Looks up and interprolate the hash values into a i18n string
 492:       else
 493:         I18n.t(msgid, args)
 494:       end
-495:     end
-
-
-
-
- -
- - - - -
-

+495: end +

+ +
+ + +
+ + +
+ + +
+ + templatepath(template_file) + click to toggle source + +
+ +
+ +

Looks up the template directory and returns its full path

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 498
 498:     def self.templatepath(template_file)
@@ -1082,32 +1536,40 @@ Looks up the template directory and returns its full path
 502: 
 503:       template_path = File.join("/etc/mcollective", template_file)
 504:       return template_path
-505:     end
-
-
-
-
- - + + +
+ + +
+ + +
+ + terminal_dimensions(stdout = STDOUT, environment = ENV) + click to toggle source + +
+ +
+ +

Figures out the columns and lines of the current tty

-Returns [0, 0] if it can‘t figure it -out or if you‘re not running on a tty +Returns [0, 0] if it can’t figure it out or if you’re not +running on a tty

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 396
 396:     def self.terminal_dimensions(stdout = STDOUT, environment = ENV)
@@ -1128,29 +1590,36 @@ out or if you‘re not running on a tty
 411:       end
 412:     rescue
 413:       [0, 0]
-414:     end
-
-
-
-
- -
- - - - -
-

-Helper to unsubscribe to a topic on -multiple collectives or just one +414: end +

+ +
+ + +
+ + +
+ + +
+ + unsubscribe(targets) + click to toggle source + +
+ +
+ +

+Helper to unsubscribe to a topic on multiple collectives or just one

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 213
 213:     def self.unsubscribe(targets)
@@ -1161,34 +1630,42 @@ multiple collectives or just one
 218:       targets.each do |target|
 219:         connection.unsubscribe(target[:agent], target[:type], target[:collective])
 220:       end
-221:     end
-
-
-
-
- -
- - - - -
-

+221: end +

+ +
+ + +
+ + +
+ + +
+ + versioncmp(version_a, version_b) + click to toggle source + +
+ +
+ +

compare two software versions as commonly found in package versions.

-returns 0 if a == b returns -1 if a < b returns 1 if a > b +returns 0 if a == b returns -1 if a < b returns 1 if a > b

Code originally from Puppet

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 433
 433:     def self.versioncmp(version_a, version_b)
@@ -1218,72 +1695,100 @@ Code originally from Puppet
 457:       end
 458: 
 459:       version_a <=> version_b;
-460:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
+460: end +
+ +
+ + +
+ + +
+ + +
+ + windows?() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File lib/mcollective/util.rb, line 264
 264:     def self.windows?
 265:       !!(RbConfig::CONFIG['host_os'] =~ /mswin|win32|dos|mingw|cygwin/i)
-266:     end
-
-
-
-
- -
- - - - -
-

+266: end +

+ +
+ + +
+ + +
+ + +
+ + windows_prefix() + click to toggle source + +
+ +
+ +

Returns the PuppetLabs mcollective path for windows

-

[Source]

-
+ + + +
      # File lib/mcollective/util.rb, line 141
 141:     def self.windows_prefix
 142:       require 'win32/dir'
 143:       prefix = File.join(Dir::COMMON_APPDATA, "PuppetLabs", "mcollective")
-144:     end
-
-
-
-
+144: end +
+ +
+ +
-
+ +
+ +
-
+
+ +

Disabled; run with --debug to generate this.

+ +
- +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
- \ No newline at end of file + + diff --git a/doc/MCollective/Validator.html b/doc/MCollective/Validator.html new file mode 100644 index 0000000..86ed868 --- /dev/null +++ b/doc/MCollective/Validator.html @@ -0,0 +1,646 @@ + + + + + + + Module: MCollective::Validator + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Validator

+ +
+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + [](klass) + click to toggle source + +
+ +
+ +

+Returns and instance of the Plugin class from which objects can be created. +Valid plugin names are +

+
+  :valplugin
+  "valplugin"
+  "ValpluginValidator"
+
+ + + +
+
+    # File lib/mcollective/validator.rb, line 18
+18:     def self.[](klass)
+19:       if klass.is_a?(Symbol)
+20:         klass = validator_class(klass)
+21:       elsif !(klass.match(/.*Validator$/))
+22:         klass = validator_class(klass)
+23:       end
+24: 
+25:       const_get(klass)
+26:     end
+
+ +
+ + +
+ + +
+ + +
+ + has_validator?(validator) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/validator.rb, line 37
+37:     def self.has_validator?(validator)
+38:       const_defined?(validator_class(validator))
+39:     end
+
+ +
+ + +
+ + +
+ + +
+ + load_validators() + click to toggle source + +
+ +
+ +

+Loads the validator plugins. Validators will only be loaded every 5 minutes +

+ + + +
+
+    # File lib/mcollective/validator.rb, line 6
+ 6:     def self.load_validators
+ 7:       if load_validators?
+ 8:         @last_load = Time.now.to_i
+ 9:         PluginManager.find_and_load("validator")
+10:       end
+11:     end
+
+ +
+ + +
+ + +
+ + +
+ + load_validators?() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/validator.rb, line 45
+45:     def self.load_validators?
+46:       return true if @last_load.nil?
+47: 
+48:       (@last_load - Time.now.to_i) > 300
+49:     end
+
+ +
+ + +
+ + +
+ + +
+ + method_missing(method, *args, &block) + click to toggle source + +
+ +
+ +

+Allows validation plugins to be called like module methods : Validator.validate() +

+ + + +
+
+    # File lib/mcollective/validator.rb, line 29
+29:     def self.method_missing(method, *args, &block)
+30:       if has_validator?(method)
+31:         validator = Validator[method].validate(*args)
+32:       else
+33:         raise ValidatorError, "Unknown validator: '#{method}'."
+34:       end
+35:     end
+
+ +
+ + +
+ + +
+ + +
+ + validate(validator, validation) + click to toggle source + +
+ +
+ +

+Generic validate method that will call the correct validator plugin based +on the type of the validation parameter +

+ + + +
+
+    # File lib/mcollective/validator.rb, line 53
+53:     def self.validate(validator, validation)
+54:       Validator.load_validators
+55: 
+56:       begin
+57:         if [:integer, :boolean, :float, :number, :string].include?(validation)
+58:           Validator.typecheck(validator, validation)
+59: 
+60:         else
+61:           case validation
+62:             when Regexp,String
+63:               Validator.regex(validator, validation)
+64: 
+65:             when Symbol
+66:               Validator.send(validation, validator)
+67: 
+68:             when Array
+69:               Validator.array(validator, validation)
+70: 
+71:             when Class
+72:               Validator.typecheck(validator, validation)
+73:           end
+74:         end
+75:       rescue => e
+76:         raise ValidatorError, e.to_s
+77:       end
+78:     end
+
+ +
+ + +
+ + +
+ + +
+ + validator_class(validator) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/validator.rb, line 41
+41:     def self.validator_class(validator)
+42:       "#{validator.to_s.capitalize}Validator"
+43:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/ValidatorError.html b/doc/MCollective/ValidatorError.html new file mode 100644 index 0000000..fa83750 --- /dev/null +++ b/doc/MCollective/ValidatorError.html @@ -0,0 +1,348 @@ + + + + + + + Class: MCollective::ValidatorError + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::ValidatorError

+ +
+ +
+ + + + + + + + + + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/MCollective/WindowsDaemon.html b/doc/MCollective/WindowsDaemon.html new file mode 100644 index 0000000..f550766 --- /dev/null +++ b/doc/MCollective/WindowsDaemon.html @@ -0,0 +1,476 @@ + + + + + + + Class: MCollective::WindowsDaemon + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::WindowsDaemon

+ +
+ +
+ + + + + + + + + +
+

Public Class Methods

+ + +
+ + +
+ + daemonize_runner(pid=nil) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/windows_daemon.rb, line 5
+ 5:     def self.daemonize_runner(pid=nil)
+ 6:       raise "Writing pid files are not supported on the Windows Platform" if pid
+ 7:       raise "The Windows Daemonizer should only be used on the Windows Platform" unless Util.windows?
+ 8: 
+ 9:       WindowsDaemon.mainloop
+10:     end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + service_main() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/windows_daemon.rb, line 12
+12:     def service_main
+13:       Log.debug("Starting Windows Service Daemon")
+14: 
+15:       while running?
+16:         Runner.new(nil).run
+17:       end
+18:     end
+
+ +
+ + +
+ + +
+ + +
+ + service_stop() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/windows_daemon.rb, line 20
+20:     def service_stop
+21:       Log.info("Windows service stopping")
+22:     end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/files/install_rb.html b/doc/Object.html similarity index 59% rename from doc/files/install_rb.html rename to doc/Object.html index 4dc8875..b75708f 100644 --- a/doc/files/install_rb.html +++ b/doc/Object.html @@ -1,195 +1,417 @@ - - - + + - File: install.rb - - - - - - - - - - -
-

install.rb

- - - - - - - - - -
Path:install.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - -
-

Required files

- -
- rbconfig   - find   - fileutils   - tempfile   - optparse   - ostruct   - rdoc/rdoc   -
-
- -
- -
-

Methods

- -
- build_rdoc   - check_prereqs   - do_bins   - do_configs   - do_libs   - glob   - install_binfile   - prepare_installation   -
-
+ -
+ Class: Object + - -
-

Included Modules

+ + + + -
- FileUtils -
-
- -
- - -
-

Constants

- -
- - - - - - - - - - - -
PREREQS=%w{rubygems stomp}
InstallOptions=OpenStruct.new
-
-
- - - - - - - -
-

Public Instance methods

- -
- - - - -
-

+ + + +

+
+
+

In Files

+
+
    + +
+
+
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + + + + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

Object

+ +
+ +
+ + + + + + + + + +
+

Public Instance Methods

+ + +
+ + +
+ + build_rdoc(files) + click to toggle source + +
+ +
+ +

Build the rdoc documentation.

-

[Source]

-
+ + + +
-     # File install.rb, line 246
-246: def build_rdoc(files)
-247:   return unless $haverdoc
-248:   begin
-249:     r = RDoc::RDoc.new
-250:     r.document(["--main", "MCollective", "--line-numbers"] + files)
-251:   rescue RDoc::RDocError => e
-252:     $stderr.puts e.message
-253:   rescue Exception => e
-254:     $stderr.puts "Couldn't build RDoc documentation\n#{e.message}"
-255:   end
-256: end
-
-
-
-
- -
- - - - -
-

[Source]

-
+ # File install.rb, line 248 +248: def build_rdoc(files) +249: return unless $haverdoc +250: begin +251: r = RDoc::RDoc.new +252: r.document(["--main", "MCollective", "--line-numbers"] + files) +253: rescue RDoc::RDocError => e +254: $stderr.puts e.message +255: rescue Exception => e +256: $stderr.puts "Couldn't build RDoc documentation\n#{e.message}" +257: end +258: end +
+ +
+ + +
+ + +
+ + +
+ + check_prereqs() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File install.rb, line 65
 65: def check_prereqs
@@ -201,25 +423,34 @@ Build the rdoc documentation.
 71:       exit(-1)
 72:     end
 73:   end
-74: end
-
-
-
-
- -
- - - - -
-

[Source]

-
+74: end +
+ +
+ + +
+ + +
+ + +
+ + do_bins(bins, target, strip = 's?bin/') + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File install.rb, line 86
 86: def do_bins(bins, target, strip = 's?bin/')
@@ -228,25 +459,34 @@ Build the rdoc documentation.
 89:     obf = bf.gsub(/#{strip}/, '')
 90:     install_binfile(bf, obf, target)
 91:   end
-92: end
-
-
-
-
- -
- - - - -
-

[Source]

-
+92: end +
+ +
+ + +
+ + +
+ + +
+ + do_configs(configs, target, strip = 'etc/') + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File install.rb, line 76
 76: def do_configs(configs, target, strip = 'etc/')
@@ -257,25 +497,34 @@ Build the rdoc documentation.
 81:     makedirs(oc, {:mode => 0755, :verbose => true})
 82:     install(cf, ocf, {:mode => 0644, :preserve => true, :verbose => true})
 83:   end
-84: end
-
-
-
-
- -
- - - - -
-

[Source]

-
+84: end +
+ +
+ + +
+ + +
+ + +
+ + do_libs(libs, target, strip = 'lib/') + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
      # File install.rb, line 94
  94: def do_libs(libs, target, strip = 'lib/')
@@ -289,25 +538,34 @@ Build the rdoc documentation.
 102:       install(lf, olf, {:mode => 0644, :preserve => true, :verbose => true})
 103:     end
 104:   end
-105: end
-
-
-
-
- -
- - - - -
-

[Source]

-
+105: end +
+ +
+ + +
+ + +
+ + +
+ + glob(list) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
     # File install.rb, line 57
 57: def glob(list)
@@ -316,74 +574,90 @@ Build the rdoc documentation.
 60:   g.compact!
 61:   g.uniq!
 62:   g
-63: end
-
-
-
-
- -
- - - - -
-

+63: end +

+ +
+ + +
+ + +
+ + +
+ + install_binfile(from, op_file, target) + click to toggle source + +
+ +
+ +

Install file(s) from ./bin to RbConfig::CONFIG[‘bindir’]. Patch it on the way to insert a #! line; on a Unix install, the command is named as expected

-

[Source]

-
+ + + +
-     # File install.rb, line 261
-261: def install_binfile(from, op_file, target)
-262:   tmp_file = Tempfile.new('mcollective-binfile')
-263: 
-264:   if InstallOptions.ruby
-265:     ruby = InstallOptions.ruby
-266:   else
-267:     ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
-268:   end
-269: 
-270:   File.open(from) do |ip|
-271:     File.open(tmp_file.path, "w") do |op|
-272:       op.puts "#!#{ruby}"
-273:       contents = ip.readlines
-274:       contents.shift if contents[0] =~ /^#!/
-275:       op.write contents.join
-276:     end
-277:   end
-278: 
-279:   install(tmp_file.path, File.join(target, op_file), :mode => 0755, :preserve => true, :verbose => true)
-280:   tmp_file.unlink
-281: end
-
-
-
-
- -
- - - - -
-

+ # File install.rb, line 263 +263: def install_binfile(from, op_file, target) +264: tmp_file = Tempfile.new('mcollective-binfile') +265: +266: if InstallOptions.ruby +267: ruby = InstallOptions.ruby +268: else +269: ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name']) +270: end +271: +272: File.open(from) do |ip| +273: File.open(tmp_file.path, "w") do |op| +274: op.puts "#!#{ruby}" +275: contents = ip.readlines +276: contents.shift if contents[0] =~ /^#!/ +277: op.write contents.join +278: end +279: end +280: +281: install(tmp_file.path, File.join(target, op_file), :mode => 0755, :preserve => true, :verbose => true) +282: tmp_file.unlink +283: end +

+ +
+ + +
+ + +
+ + +
+ + prepare_installation() + click to toggle source + +
+ +
+ +

Prepare the file installation.

-

[Source]

-
+ + + +
      # File install.rb, line 110
 110: def prepare_installation
@@ -502,37 +776,50 @@ Prepare the file installation.
 223:     destdir = ''
 224:   end
 225: 
-226:   configdir = File.join(destdir, configdir)
-227:   bindir = File.join(destdir, bindir)
-228:   sitelibdir = File.join(destdir, sitelibdir)
-229: 
-230:   makedirs(configdir) if InstallOptions.configs
-231:   makedirs(bindir)
-232:   makedirs(sbindir)
-233:   makedirs(sitelibdir)
-234:   makedirs(plugindir)
-235: 
-236:   InstallOptions.sitelibdir = sitelibdir
-237:   InstallOptions.configdir = configdir
-238:   InstallOptions.bindir  = bindir
-239:   InstallOptions.sbindir  = sbindir
-240:   InstallOptions.plugindir  = plugindir
-241: end
-
-
-
-
- - -
- - -
- - - +226: configdir = File.join(destdir, configdir) +227: bindir = File.join(destdir, bindir) +228: sbindir = File.join(destdir, sbindir) +229: sitelibdir = File.join(destdir, sitelibdir) +230: plugindir = File.join(destdir, plugindir) +231: +232: makedirs(configdir) if InstallOptions.configs +233: makedirs(bindir) +234: makedirs(sbindir) +235: makedirs(sitelibdir) +236: makedirs(plugindir) +237: +238: InstallOptions.sitelibdir = sitelibdir +239: InstallOptions.configdir = configdir +240: InstallOptions.bindir = bindir +241: InstallOptions.sbindir = sbindir +242: InstallOptions.plugindir = plugindir +243: end +
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
- \ No newline at end of file + + diff --git a/doc/README.html b/doc/README.html new file mode 100644 index 0000000..2f1d83b --- /dev/null +++ b/doc/README.html @@ -0,0 +1,300 @@ + + + + + + + + File: README [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

+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 marionette-collective.org/ +

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/Rakefile.html b/doc/Rakefile.html new file mode 100644 index 0000000..c7c43ef --- /dev/null +++ b/doc/Rakefile.html @@ -0,0 +1,503 @@ + + + + + + + + File: Rakefile [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

+RAKE_ROOT = File.expand_path(File.dirname(FILE)) +

+

+# Allow override of RELEASE using BUILD_NUMBER ENV[“RELEASE”] = +ENV[“BUILD_NUMBER“] if ENV[“BUILD_NUMBER“] +

+

+begin +

+
+  load File.join(RAKE_ROOT, 'ext', 'packaging.rake')
+
+

+rescue LoadError end +

+

+def announce(msg=’’) +

+
+  STDERR.puts "================"
+  STDERR.puts msg
+  STDERR.puts "================"
+
+

+end +

+

+def safe_system *args +

+
+  raise RuntimeError, "Failed: #{args.join(' ')}" unless system(*args)
+
+

+end +

+

+def load_tools +

+
+  unless File.directory?(File.join(RAKE_ROOT, 'ext', 'packaging'))
+    Rake::Task["package:bootstrap"].invoke
+    begin
+      load File.join(RAKE_ROOT, 'ext', 'packaging.rake')
+    rescue LoadError
+      STDERR.puts "Could not load packaging tools. exiting"
+      exit 1
+    end
+  end
+
+

+end +

+

+def move_artifacts +

+
+  mv("pkg", "build")
+
+

+end +

+

+desc “Cleanup” task :clean do +

+
+  rm_rf "build"
+  rm_rf "doc"
+
+

+end +

+

+desc “Create the .debs” task :deb => :clean do +

+
+  load_tools
+  announce("Building debian packages for #{@build.project}-#{@build.version}-#{@build.release}")
+  Rake::Task["package:deb"].invoke
+
+  if ENV['SIGNED'] == '1'
+    deb_flag = "-k#{ENV['SIGNWITH']}" if ENV['SIGNWITH']
+    safe_system %{/usr/bin/debsign #{deb_flag} pkg/deb/*.changes}
+  end
+  move_artifacts
+
+

+end +

+

+desc “Build documentation” task :doc => :clean do +

+
+  load_tools
+  Rake::Task["package:doc"].invoke
+
+

+end +

+

+desc “Build a gem” task :gem => :clean do +

+
+  load_tools
+  Rake::Task["gem"].reenable
+  Rake::Task["package:gem"].invoke
+
+

+end +

+

+desc “Create a tarball for this release” task :package => +:clean do +

+
+  load_tools
+  announce "Creating #{@build.project}-#{@build.version}.tar.gz"
+  Rake::Task["package:tar"].invoke
+  move_artifacts
+
+

+end +

+

+desc “Creates a RPM” task :rpm => :clean do +

+
+  load_tools
+  announce("Building RPM for #{@build.project}-#{@build.version}-#{@build.release}")
+  Rake::Task["package:rpm"].invoke
+  Rake::Task["package:srpm"].invoke
+  if ENV['SIGNED'] == '1'
+    safe_system %{/usr/bin/rpm --sign pkg/**/*.rpm}
+  end
+  move_artifacts
+
+

+end +

+

+desc “Run spec tests” task :test do +

+
+  sh "cd spec && rake"
+
+

+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 “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 +

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/String.html b/doc/String.html new file mode 100644 index 0000000..8b23e0d --- /dev/null +++ b/doc/String.html @@ -0,0 +1,435 @@ + + + + + + + Class: String + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

String

+ +
+

+start_with? was introduced in 1.8.7, we need to support 1.8.5 and 1.8.6 +

+ +
+ + + + + + + + + +
+

Public Instance Methods

+ + +
+ + +
+ + bytes(&block) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/monkey_patches.rb, line 63
+63:   def bytes(&block)
+64:     # This should not be necessary, really ...
+65:     require 'enumerator'
+66:     return to_enum(:each_byte) unless block_given?
+67:     each_byte(&block)
+68:   end
+
+ +
+ + +
+ + +
+ + +
+ + start_with?(str) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+   # File lib/mcollective/monkey_patches.rb, line 4
+4:   def start_with?(str)
+5:     return self[0 .. (str.length-1)] == str
+6:   end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/Symbol.html b/doc/Symbol.html new file mode 100644 index 0000000..8c0695f --- /dev/null +++ b/doc/Symbol.html @@ -0,0 +1,409 @@ + + + + + + + Class: Symbol + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+

Included Modules

+ +
+ +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

Symbol

+ +
+

+Make arrays of Symbols sortable +

+ +
+ + + + + + + + + +
+

Public Instance Methods

+ + +
+ + +
+ + <=>(other) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/monkey_patches.rb, line 13
+13:   def <=>(other)
+14:     self.to_s <=> other.to_s
+15:   end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + + diff --git a/doc/bin/mc-call-agent.html b/doc/bin/mc-call-agent.html new file mode 100644 index 0000000..5e79d33 --- /dev/null +++ b/doc/bin/mc-call-agent.html @@ -0,0 +1,56 @@ + + + + + + + + File: mc-call-agent [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
  • mcollective
  • + +
  • pp
  • + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/bin/mco.html b/doc/bin/mco.html new file mode 100644 index 0000000..1757cc8 --- /dev/null +++ b/doc/bin/mco.html @@ -0,0 +1,54 @@ + + + + + + + + File: mco [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
  • mcollective
  • + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/bin/mcollectived.html b/doc/bin/mcollectived.html new file mode 100644 index 0000000..e93673d --- /dev/null +++ b/doc/bin/mcollectived.html @@ -0,0 +1,60 @@ + + + + + + + + File: mcollectived [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
  • mcollective
  • + +
  • getoptlong
  • + +
  • mcollective/windows_daemon
  • + +
  • mcollective/unix_daemon
  • + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/classes/Array.html b/doc/classes/Array.html deleted file mode 100644 index 4cdc19f..0000000 --- a/doc/classes/Array.html +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - Class: Array - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassArray
In: - - lib/mcollective/monkey_patches.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-a method # that walks an array in groups, pass a block to call the block on -each sub array -

- -
- - -
- -
-

Methods

- -
- in_groups_of   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/monkey_patches.rb, line 29
-29:   def in_groups_of(chunk_size, padded_with=nil, &block)
-30:     arr = self.clone
-31: 
-32:     # how many to add
-33:     padding = chunk_size - (arr.size % chunk_size)
-34: 
-35:     # pad at the end
-36:     arr.concat([padded_with] * padding) unless padding == chunk_size
-37: 
-38:     # how many chunks we'll make
-39:     count = arr.size / chunk_size
-40: 
-41:     # make that many arrays
-42:     result = []
-43:     count.times {|s| result <<  arr[s * chunk_size, chunk_size]}
-44: 
-45:     if block_given?
-46:       result.each_with_index do |a, i|
-47:         case block.arity
-48:           when 1
-49:             yield(a)
-50:           when 2
-51:             yield(a, (i == result.size - 1))
-52:           else
-53:             raise "Expected 1 or 2 arguments, got #{block.arity}"
-54:         end
-55:       end
-56:     else
-57:       result
-58:     end
-59:   end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/Dir.html b/doc/classes/Dir.html deleted file mode 100644 index eed0ecf..0000000 --- a/doc/classes/Dir.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - Class: Dir - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassDir
In: - - lib/mcollective/monkey_patches.rb - -
-
Parent: - Object -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- mktmpdir   - tmpdir   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/monkey_patches.rb, line 72
- 72:   def self.mktmpdir(prefix_suffix=nil, tmpdir=nil)
- 73:     case prefix_suffix
- 74:     when nil
- 75:       prefix = "d"
- 76:       suffix = ""
- 77:     when String
- 78:       prefix = prefix_suffix
- 79:       suffix = ""
- 80:     when Array
- 81:       prefix = prefix_suffix[0]
- 82:       suffix = prefix_suffix[1]
- 83:     else
- 84:       raise ArgumentError, "unexpected prefix_suffix: #{prefix_suffix.inspect}"
- 85:     end
- 86:     tmpdir ||= Dir.tmpdir
- 87:     t = Time.now.strftime("%Y%m%d")
- 88:     n = nil
- 89:     begin
- 90:       path = "#{tmpdir}/#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
- 91:       path << "-#{n}" if n
- 92:       path << suffix
- 93:       Dir.mkdir(path, 0700)
- 94:     rescue Errno::EEXIST
- 95:       n ||= 0
- 96:       n += 1
- 97:       retry
- 98:     end
- 99: 
-100:     if block_given?
-101:       begin
-102:         yield path
-103:       ensure
-104:         FileUtils.remove_entry_secure path
-105:       end
-106:     else
-107:       path
-108:     end
-109:   end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/monkey_patches.rb, line 111
-111:   def self.tmpdir
-112:     tmp = '.'
-113:     for dir in [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], '/tmp']
-114:       if dir and stat = File.stat(dir) and stat.directory? and stat.writable?
-115:         tmp = dir
-116:         break
-117:       end rescue nil
-118:     end
-119:     File.expand_path(tmp)
-120:   end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective.html b/doc/classes/MCollective.html deleted file mode 100644 index 72b7df5..0000000 --- a/doc/classes/MCollective.html +++ /dev/null @@ -1,504 +0,0 @@ - - - - - - Module: MCollective - - - - - - - - - - -
- - - - - - - - - - -
ModuleMCollective
In: - - lib/mcollective.rb - -
- - lib/mcollective/application.rb - -
- - lib/mcollective/optionparser.rb - -
- - lib/mcollective/pluginpackager.rb - -
- - lib/mcollective/matcher/scanner.rb - -
- - lib/mcollective/matcher/parser.rb - -
- - lib/mcollective/message.rb - -
- - lib/mcollective/matcher.rb - -
- - lib/mcollective/runner.rb - -
- - lib/mcollective/pluginmanager.rb - -
- - lib/mcollective/security.rb - -
- - lib/mcollective/connector.rb - -
- - lib/mcollective/pluginpackager/standard_definition.rb - -
- - lib/mcollective/pluginpackager/agent_definition.rb - -
- - lib/mcollective/applications.rb - -
- - lib/mcollective/logger.rb - -
- - lib/mcollective/agents.rb - -
- - lib/mcollective/config.rb - -
- - lib/mcollective/log.rb - -
- - lib/mcollective/agent.rb - -
- - lib/mcollective/aggregate.rb - -
- - lib/mcollective/discovery.rb - -
- - lib/mcollective/registration/base.rb - -
- - lib/mcollective/registration.rb - -
- - lib/mcollective/logger/console_logger.rb - -
- - lib/mcollective/logger/base.rb - -
- - lib/mcollective/logger/syslog_logger.rb - -
- - lib/mcollective/logger/file_logger.rb - -
- - lib/mcollective/data/base.rb - -
- - lib/mcollective/data/result.rb - -
- - lib/mcollective/ssl.rb - -
- - lib/mcollective/runnerstats.rb - -
- - lib/mcollective/translatable.rb - -
- - lib/mcollective/generators/base.rb - -
- - lib/mcollective/generators/data_generator.rb - -
- - lib/mcollective/generators/agent_generator.rb - -
- - lib/mcollective/aggregate/base.rb - -
- - lib/mcollective/aggregate/result/base.rb - -
- - lib/mcollective/aggregate/result/collection_result.rb - -
- - lib/mcollective/aggregate/result/numeric_result.rb - -
- - lib/mcollective/aggregate/result.rb - -
- - lib/mcollective/facts/base.rb - -
- - lib/mcollective/ddl/discoveryddl.rb - -
- - lib/mcollective/ddl/agentddl.rb - -
- - lib/mcollective/ddl/validatorddl.rb - -
- - lib/mcollective/ddl/base.rb - -
- - lib/mcollective/ddl/dataddl.rb - -
- - lib/mcollective/util.rb - -
- - lib/mcollective/connector/base.rb - -
- - lib/mcollective/rpc.rb - -
- - lib/mcollective/validator.rb - -
- - lib/mcollective/cache.rb - -
- - lib/mcollective/unix_daemon.rb - -
- - lib/mcollective/windows_daemon.rb - -
- - lib/mcollective/security/base.rb - -
- - lib/mcollective/shell.rb - -
- - lib/mcollective/ddl.rb - -
- - lib/mcollective/rpc/actionrunner.rb - -
- - lib/mcollective/rpc/reply.rb - -
- - lib/mcollective/rpc/progress.rb - -
- - lib/mcollective/rpc/agent.rb - -
- - lib/mcollective/rpc/request.rb - -
- - lib/mcollective/rpc/audit.rb - -
- - lib/mcollective/rpc/stats.rb - -
- - lib/mcollective/rpc/result.rb - -
- - lib/mcollective/rpc/client.rb - -
- - lib/mcollective/rpc/helpers.rb - -
- - lib/mcollective/facts.rb - -
- - lib/mcollective/data.rb - -
- - lib/mcollective/client.rb - -
- - lib/mcollective/exception.rb - -
- - lib/mcollective/generators.rb - -
-
-
- - -
- - - -
- -
-

The Marionette Collective

-

-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. -

-

-For an overview of the idea behind this and what it enables please see: -

-
-  http://www.devco.net/archives/2009/10/18/middleware_for_systems_administration.php
-
- -
- - -
- -
-

Methods

- -
- version   -
-
- -
- - - - -
- - - -
-

Constants

- -
- - - - - - -
VERSION="@DEVELOPMENT_VERSION@"
-
-
- - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective.rb, line 65
-65:   def self.version
-66:     VERSION
-67:   end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Agent.html b/doc/classes/MCollective/Agent.html deleted file mode 100644 index 8e794cd..0000000 --- a/doc/classes/MCollective/Agent.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - Module: MCollective::Agent - - - - - - - - - - -
- - - - - - - - - - -
ModuleMCollective::Agent
In: - - lib/mcollective/agent.rb - -
-
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Agents.html b/doc/classes/MCollective/Agents.html deleted file mode 100644 index 82db7b4..0000000 --- a/doc/classes/MCollective/Agents.html +++ /dev/null @@ -1,493 +0,0 @@ - - - - - - Class: MCollective::Agents - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Agents
In: - - lib/mcollective/agents.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-A collection of agents, loads them, reloads them and dispatches messages to -them. It uses the PluginManager to store, -load and manage instances of plugins. -

- -
- - -
- -
-

Methods

- -
- activate_agent?   - agentlist   - class_for_agent   - clear!   - dispatch   - findagentfile   - include?   - loadagent   - loadagents   - new   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

-Get a list of agents that we have -

-

[Source]

-
-
-     # File lib/mcollective/agents.rb, line 145
-145:     def self.agentlist
-146:       @@agents.keys
-147:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/agents.rb, line 5
- 5:     def initialize(agents = {})
- 6:       @config = Config.instance
- 7:       raise ("Configuration has not been loaded, can't load agents") unless @config.configured
- 8: 
- 9:       @@agents = agents
-10: 
-11:       loadagents
-12:     end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Checks if a plugin should be activated by calling activate? on it if it -responds to that method else always activate it -

-

[Source]

-
-
-    # File lib/mcollective/agents.rb, line 85
-85:     def activate_agent?(agent)
-86:       klass = Kernel.const_get("MCollective").const_get("Agent").const_get(agent.capitalize)
-87: 
-88:       if klass.respond_to?("activate?")
-89:         return klass.activate?
-90:       else
-91:         Log.debug("#{klass} does not have an activate? method, activating as default")
-92:         return true
-93:       end
-94:     rescue Exception => e
-95:       Log.warn("Agent activation check for #{agent} failed: #{e.class}: #{e}")
-96:       return false
-97:     end
-
-
-
-
- -
- - - - -
-

-Builds a class name string given a Agent name -

-

[Source]

-
-
-    # File lib/mcollective/agents.rb, line 78
-78:     def class_for_agent(agent)
-79:       "MCollective::Agent::#{agent.capitalize}"
-80:     end
-
-
-
-
- -
- - - - -
-

-Deletes all agents -

-

[Source]

-
-
-    # File lib/mcollective/agents.rb, line 15
-15:     def clear!
-16:       @@agents.each_key do |agent|
-17:         PluginManager.delete "#{agent}_agent"
-18:         Util.unsubscribe(Util.make_subscriptions(agent, :broadcast))
-19:       end
-20: 
-21:       @@agents = {}
-22:     end
-
-
-
-
- -
- - - - -
-

-Dispatches a message to an agent, accepts a block that will get run if -there are any replies to process from the agent -

-

[Source]

-
-
-     # File lib/mcollective/agents.rb, line 118
-118:     def dispatch(request, connection)
-119:       Log.debug("Dispatching a message to agent #{request.agent}")
-120: 
-121:       Thread.new do
-122:         begin
-123:           agent = PluginManager["#{request.agent}_agent"]
-124: 
-125:           Timeout::timeout(agent.timeout) do
-126:             replies = agent.handlemsg(request.payload, connection)
-127: 
-128:             # Agents can decide if they wish to reply or not,
-129:             # returning nil will mean nothing goes back to the
-130:             # requestor
-131:             unless replies == nil
-132:               yield(replies)
-133:             end
-134:           end
-135:         rescue Timeout::Error => e
-136:           Log.warn("Timeout while handling message for #{request.agent}")
-137:         rescue Exception => e
-138:           Log.error("Execution of #{request.agent} failed: #{e}")
-139:           Log.error(e.backtrace.join("\n\t\t"))
-140:         end
-141:       end
-142:     end
-
-
-
-
- -
- - - - -
-

-searches the libdirs for agents -

-

[Source]

-
-
-     # File lib/mcollective/agents.rb, line 100
-100:     def findagentfile(agentname)
-101:       @config.libdir.each do |libdir|
-102:         agentfile = File.join([libdir, "mcollective", "agent", "#{agentname}.rb"])
-103:         if File.exist?(agentfile)
-104:           Log.debug("Found #{agentname} at #{agentfile}")
-105:           return agentfile
-106:         end
-107:       end
-108:       return false
-109:     end
-
-
-
-
- -
- - - - -
-

-Determines if we have an agent with a certain name -

-

[Source]

-
-
-     # File lib/mcollective/agents.rb, line 112
-112:     def include?(agentname)
-113:       PluginManager.include?("#{agentname}_agent")
-114:     end
-
-
-
-
- -
- - - - -
-

-Loads a specified agent from disk if available -

-

[Source]

-
-
-    # File lib/mcollective/agents.rb, line 42
-42:     def loadagent(agentname)
-43:       agentfile = findagentfile(agentname)
-44:       return false unless agentfile
-45:       classname = class_for_agent(agentname)
-46: 
-47:       PluginManager.delete("#{agentname}_agent")
-48: 
-49:       begin
-50:         single_instance = ["registration", "discovery"].include?(agentname)
-51: 
-52:         PluginManager.loadclass(classname)
-53: 
-54:         if activate_agent?(agentname)
-55:           PluginManager << {:type => "#{agentname}_agent", :class => classname, :single_instance => single_instance}
-56: 
-57:           # Attempt to instantiate the agent once so any validation and hooks get run
-58:           # this does a basic sanity check on the agent as a whole, if this fails it
-59:           # will be removed from the plugin list
-60:           PluginManager["#{agentname}_agent"]
-61: 
-62:           Util.subscribe(Util.make_subscriptions(agentname, :broadcast)) unless @@agents.include?(agentname)
-63: 
-64:           @@agents[agentname] = {:file => agentfile}
-65:           return true
-66:         else
-67:           Log.debug("Not activating agent #{agentname} due to agent policy in activate? method")
-68:           return false
-69:         end
-70:       rescue Exception => e
-71:         Log.error("Loading agent #{agentname} failed: #{e}")
-72:         PluginManager.delete("#{agentname}_agent")
-73:         return false
-74:       end
-75:     end
-
-
-
-
- -
- - - - -
-

-Loads all agents from disk -

-

[Source]

-
-
-    # File lib/mcollective/agents.rb, line 25
-25:     def loadagents
-26:       Log.debug("Reloading all agents from disk")
-27: 
-28:       clear!
-29: 
-30:       @config.libdir.each do |libdir|
-31:         agentdir = "#{libdir}/mcollective/agent"
-32:         next unless File.directory?(agentdir)
-33: 
-34:         Dir.new(agentdir).grep(/\.rb$/).each do |agent|
-35:           agentname = File.basename(agent, ".rb")
-36:           loadagent(agentname) unless PluginManager.include?("#{agentname}_agent")
-37:         end
-38:       end
-39:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Aggregate.html b/doc/classes/MCollective/Aggregate.html deleted file mode 100644 index ca31632..0000000 --- a/doc/classes/MCollective/Aggregate.html +++ /dev/null @@ -1,390 +0,0 @@ - - - - - - Class: MCollective::Aggregate - - - - - - - - - - - - - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - - -
- -
-

Classes and Modules

- - Module MCollective::Aggregate::Result
-Class MCollective::Aggregate::Base
- -
- - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - -
action [RW] 
ddl [RW] 
failed [RW] 
functions [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/aggregate.rb, line 8
- 8:     def initialize(ddl)
- 9:       @functions = []
-10:       @ddl = ddl
-11:       @action = ddl[:action]
-12:       @failed = []
-13: 
-14:       create_functions
-15:     end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Call all the appropriate functions with the reply data received from RPC::Client -

-

[Source]

-
-
-    # File lib/mcollective/aggregate.rb, line 45
-45:     def call_functions(reply)
-46:       @functions.each do |function|
-47:         Log.debug("Calling aggregate function #{function} for result")
-48:         begin
-49:           function.process_result(reply[:data][function.output_name], reply)
-50:         rescue Exception => e
-51:           Log.error("Could not process aggregate function for '#{function.output_name}'. #{e.to_s}")
-52:           @failed << {:name => function.output_name, :type => :process_result}
-53:           @functions.delete(function)
-54:         end
-55:       end
-56:     end
-
-
-
-
- -
- - - - -
-

-Check if the function param is defined as an output for the action in the -ddl -

-

[Source]

-
-
-    # File lib/mcollective/aggregate.rb, line 40
-40:     def contains_output?(output)
-41:       @ddl[:output].keys.include?(output)
-42:     end
-
-
-
-
- -
- - - - -
-

-Creates instances of the Aggregate functions -and stores them in the function array. All aggregate call and summarize method calls operate on these -function as a batch. -

-

[Source]

-
-
-    # File lib/mcollective/aggregate.rb, line 19
-19:     def create_functions
-20:       @ddl[:aggregate].each_with_index do |agg, i|
-21:         output = agg[:args][0]
-22: 
-23:         if contains_output?(output)
-24:           arguments = agg[:args][1]
-25:           format = (arguments.delete(:format) if arguments) || nil
-26:           begin
-27:             @functions << load_function(agg[:function]).new(output, arguments, format, @action)
-28:           rescue Exception => e
-29:             Log.error("Cannot create aggregate function '#{output}'. #{e.to_s}")
-30:             @failed << {:name => output, :type => :startup}
-31:           end
-32:         else
-33:           Log.error("Cannot create aggregate function '#{output}'. '#{output}' has not been specified as a valid ddl output.")
-34:           @failed << {:name => output, :type => :create}
-35:         end
-36:       end
-37:     end
-
-
-
-
- -
- - - - -
-

-Loads function from disk for use -

-

[Source]

-
-
-    # File lib/mcollective/aggregate.rb, line 76
-76:     def load_function(function_name)
-77:       function_name = function_name.to_s.capitalize
-78: 
-79:       PluginManager.loadclass("MCollective::Aggregate::#{function_name}") unless Aggregate.const_defined?(function_name)
-80:       Aggregate.const_get(function_name)
-81:     rescue Exception
-82:       raise "Aggregate function file '#{function_name.downcase}.rb' cannot be loaded"
-83:     end
-
-
-
-
- -
- - - - -
-

-Finalizes the function returning a result object -

-

[Source]

-
-
-    # File lib/mcollective/aggregate.rb, line 59
-59:     def summarize
-60:       summary = @functions.map do |function|
-61:         begin
-62:           function.summarize
-63:         rescue Exception => e
-64:           Log.error("Could not summarize aggregate result for '#{function.output_name}'. #{e.to_s}")
-65:           @failed << {:name => function.output_name, :type => :summarize}
-66:           nil
-67:         end
-68:       end
-69: 
-70:       summary.reject{|x| x.nil?}.sort do |x,y|
-71:         x.result[:output] <=> y.result[:output]
-72:       end
-73:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Aggregate/Base.html b/doc/classes/MCollective/Aggregate/Base.html deleted file mode 100644 index dec3501..0000000 --- a/doc/classes/MCollective/Aggregate/Base.html +++ /dev/null @@ -1,251 +0,0 @@ - - - - - - Class: MCollective::Aggregate::Base - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Aggregate::Base
In: - - lib/mcollective/aggregate/base.rb - -
-
Parent: - Object -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   - result_class   - summarize   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
action [RW] 
aggregate_format [RW] 
arguments [RW] 
name [RW] 
output_name [RW] 
result [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/aggregate/base.rb, line 6
- 6:       def initialize(output_name, arguments, aggregate_format, action)
- 7:         @name = self.class.to_s
- 8:         @output_name = output_name
- 9: 
-10:         # Any additional arguments passed in the ddl after the output field will
-11:         # be stored in the arguments array which can be used in the function
-12:         @arguments = arguments
-13:         @aggregate_format = aggregate_format
-14:         @action = action
-15:         @result = {:value => nil, :type => nil, :output => output_name}
-16: 
-17:         startup_hook
-18:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/aggregate/base.rb, line 35
-35:       def result_class(type)
-36:         Result.const_get("#{type.to_s.capitalize}Result")
-37:       end
-
-
-
-
- -
- - - - -
-

-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 -

-

[Source]

-
-
-    # File lib/mcollective/aggregate/base.rb, line 29
-29:       def summarize
-30:         raise "Result type is not set while trying to summarize aggregate function results" unless @result[:type]
-31: 
-32:         result_class(@result[:type]).new(@result, @aggregate_format, @action)
-33:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Aggregate/Result.html b/doc/classes/MCollective/Aggregate/Result.html deleted file mode 100644 index 0ab933a..0000000 --- a/doc/classes/MCollective/Aggregate/Result.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - Module: MCollective::Aggregate::Result - - - - - - - - - - - - - -
- - - -
- - - -
- - -
- - - - - - - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Aggregate/Result/Base.html b/doc/classes/MCollective/Aggregate/Result/Base.html deleted file mode 100644 index fa2bcda..0000000 --- a/doc/classes/MCollective/Aggregate/Result/Base.html +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - Class: MCollective::Aggregate::Result::Base - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Aggregate::Result::Base
In: - - lib/mcollective/aggregate/result/base.rb - -
-
Parent: - Object -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   - result_type   - to_s   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - -
action [RW] 
aggregate_format [RW] 
result [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/aggregate/result/base.rb, line 7
- 7:         def initialize(result, aggregate_format, action)
- 8:           raise "No aggregate_format defined in ddl or aggregate function" unless aggregate_format
- 9: 
-10:           @result = result
-11:           @aggregate_format = aggregate_format
-12:           @action = action
-13:         end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/aggregate/result/base.rb, line 19
-19:         def result_type
-20:           @result[:type]
-21:         end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/aggregate/result/base.rb, line 15
-15:         def to_s
-16:           raise "'to_s' method not implemented for result class '#{self.class}'"
-17:         end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Aggregate/Result/CollectionResult.html b/doc/classes/MCollective/Aggregate/Result/CollectionResult.html deleted file mode 100644 index 6436817..0000000 --- a/doc/classes/MCollective/Aggregate/Result/CollectionResult.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - Class: MCollective::Aggregate::Result::CollectionResult - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Aggregate::Result::CollectionResult
In: - - lib/mcollective/aggregate/result/collection_result.rb - -
-
Parent: - - Base - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- to_s   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/aggregate/result/collection_result.rb, line 5
- 5:         def to_s
- 6:           return "" if @result[:value].keys.include?(nil)
- 7: 
- 8:           result = StringIO.new
- 9: 
-10:           @result[:value].sort{|x,y| x[1] <=> y[1]}.reverse.each do |value|
-11:             result.puts @aggregate_format % [value[0], value[1]]
-12:           end
-13: 
-14:           result.string.chomp
-15:         end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Aggregate/Result/NumericResult.html b/doc/classes/MCollective/Aggregate/Result/NumericResult.html deleted file mode 100644 index 448005d..0000000 --- a/doc/classes/MCollective/Aggregate/Result/NumericResult.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Class: MCollective::Aggregate::Result::NumericResult - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Aggregate::Result::NumericResult
In: - - lib/mcollective/aggregate/result/numeric_result.rb - -
-
Parent: - - Base - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- to_s   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-   # File lib/mcollective/aggregate/result/numeric_result.rb, line 5
-5:         def to_s
-6:           return "" if @result[:value].nil?
-7: 
-8:           return @aggregate_format % @result[:value]
-9:         end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Applications.html b/doc/classes/MCollective/Applications.html deleted file mode 100644 index 09f0299..0000000 --- a/doc/classes/MCollective/Applications.html +++ /dev/null @@ -1,381 +0,0 @@ - - - - - - Class: MCollective::Applications - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Applications
In: - - lib/mcollective/applications.rb - -
-
Parent: - Object -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- []   - filter_extra_options   - list   - load_application   - load_config   - run   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-   # File lib/mcollective/applications.rb, line 3
-3:     def self.[](appname)
-4:       load_application(appname)
-5:       PluginManager["#{appname}_application"]
-6:     end
-
-
-
-
- -
- - - - -
-

-Filters a string of opts out using Shellwords keeping only things related -to —config and -c -

-

[Source]

-
-
-    # File lib/mcollective/applications.rb, line 49
-49:     def self.filter_extra_options(opts)
-50:       res = ""
-51:       words = Shellwords.shellwords(opts)
-52:       words.each_with_index do |word,idx|
-53:         if word == "-c"
-54:           return "--config=#{words[idx + 1]}"
-55:         elsif word == "--config"
-56:           return "--config=#{words[idx + 1]}"
-57:         elsif word =~ /\-c=/
-58:           return word
-59:         elsif word =~ /\-\-config=/
-60:           return word
-61:         end
-62:       end
-63: 
-64:       return ""
-65:     end
-
-
-
-
- -
- - - - -
-

-Returns an array of applications found in the lib dirs -

-

[Source]

-
-
-    # File lib/mcollective/applications.rb, line 36
-36:     def self.list
-37:       load_config
-38: 
-39:       PluginManager.find("application")
-40:     rescue SystemExit
-41:       exit 1
-42:     rescue Exception => e
-43:       STDERR.puts "Failed to generate application list: #{e.class}: #{e}"
-44:       exit 1
-45:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/applications.rb, line 26
-26:     def self.load_application(appname)
-27:       return if PluginManager.include?("#{appname}_application")
-28: 
-29:       load_config
-30: 
-31:       PluginManager.loadclass "MCollective::Application::#{appname.capitalize}"
-32:       PluginManager << {:type => "#{appname}_application", :class => "MCollective::Application::#{appname.capitalize}"}
-33:     end
-
-
-
-
- -
- - - - -
-

-We need to know the config file in order to know the libdir so that we can -find applications. -

-

-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. -

-

-We‘re parsing and filtering MCOLLECTIVE_EXTRA_OPTS removing all but -config related options and parsing the options looking just for the config -file. -

-

-We‘re handling failures gracefully and finally restoring the ARG and -MCOLLECTIVE_EXTRA_OPTS to the state they were before we started parsing. -

-

-This is mostly a hack, when we‘re redoing how config works this stuff -should be made less sucky -

-

[Source]

-
-
-     # File lib/mcollective/applications.rb, line 84
- 84:     def self.load_config
- 85:       return if Config.instance.configured
- 86: 
- 87:       original_argv = ARGV.clone
- 88:       original_extra_opts = ENV["MCOLLECTIVE_EXTRA_OPTS"].clone rescue nil
- 89:       configfile = nil
- 90: 
- 91:       parser = OptionParser.new
- 92:       parser.on("--config CONFIG", "-c", "Config file") do |f|
- 93:         configfile = f
- 94:       end
- 95: 
- 96:       parser.program_name = $0
- 97: 
- 98:       parser.on("--help")
- 99: 
-100:       # avoid option parsers own internal version handling that sux
-101:       parser.on("-v", "--verbose")
-102: 
-103:       if original_extra_opts
-104:         begin
-105:           # optparse will parse the whole ENV in one go and refuse
-106:           # to play along with the retry trick I do below so in
-107:           # order to handle unknown options properly I parse out
-108:           # only -c and --config deleting everything else and
-109:           # then restore the environment variable later when I
-110:           # am done with it
-111:           ENV["MCOLLECTIVE_EXTRA_OPTS"] = filter_extra_options(ENV["MCOLLECTIVE_EXTRA_OPTS"].clone)
-112:           parser.environment("MCOLLECTIVE_EXTRA_OPTS")
-113:         rescue Exception => e
-114:           Log.error("Failed to parse MCOLLECTIVE_EXTRA_OPTS: #{e}")
-115:         end
-116: 
-117:         ENV["MCOLLECTIVE_EXTRA_OPTS"] = original_extra_opts.clone
-118:       end
-119: 
-120:       begin
-121:         parser.parse!
-122:       rescue OptionParser::InvalidOption => e
-123:         retry
-124:       end
-125: 
-126:       ARGV.clear
-127:       original_argv.each {|a| ARGV << a}
-128: 
-129:       configfile = Util.config_file_for_user unless configfile
-130: 
-131:       Config.instance.loadconfig(configfile)
-132:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/applications.rb, line 8
- 8:     def self.run(appname)
- 9:       load_config
-10: 
-11:       begin
-12:         load_application(appname)
-13:       rescue Exception => e
-14:         e.backtrace.first << Util.colorize(:red, "  <----")
-15:         STDERR.puts "Application '#{appname}' failed to load:"
-16:         STDERR.puts
-17:         STDERR.puts Util.colorize(:red, "   #{e} (#{e.class})")
-18:         STDERR.puts
-19:         STDERR.puts "       %s" % [e.backtrace.join("\n       ")]
-20:         exit 1
-21:       end
-22: 
-23:       PluginManager["#{appname}_application"].run
-24:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Cache.html b/doc/classes/MCollective/Cache.html deleted file mode 100644 index f3880fe..0000000 --- a/doc/classes/MCollective/Cache.html +++ /dev/null @@ -1,438 +0,0 @@ - - - - - - Module: MCollective::Cache - - - - - - - - - - -
- - - - - - - - - - -
ModuleMCollective::Cache
In: - - lib/mcollective/cache.rb - -
-
-
- - -
- - - -
- -
-

-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. -

-

-This cache is setup 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 Agent or -something. -

-
-   # sets up a new cache, noop if it already exist
-   Cache.setup(:ddl, 600)
-   => true
-
-   # writes an item to the :ddl cache, this item will
-   # be valid on the cache for 600 seconds
-   Cache.write(:ddl, :something, "value")
-   => "value"
-
-   # reads from the cache, read failures due to non existing
-   # data or expired data will raise an exception
-   Cache.read(:ddl, :something)
-   => "value"
-
-   # time left till expiry, raises if nothing is found
-   Cache.ttl(:ddl, :something)
-   => 500
-
-   # forcibly evict something from the cache
-   Cache.invalidate!(:ddl, :something)
-   => "value"
-
-   # deletes an entire named cache and its mutexes
-   Cache.delete!(:ddl)
-   => true
-
-   # you can also just use this cache as a global mutex store
-   Cache.setup(:mylock)
-
-   Cache.synchronize(:mylock) do
-     do_something()
-   end
-
- -
- - -
- -
-

Methods

- -
- check_cache!   - delete!   - has_cache?   - invalidate!   - read   - setup   - synchronize   - ttl   - write   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/cache.rb, line 70
-70:     def self.check_cache!(cache_name)
-71:       raise_code(:PLMC13, "Could not find a cache called '%{cache_name}'", :debug, :cache_name => cache_name) unless has_cache?(cache_name)
-72:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/cache.rb, line 80
-80:     def self.delete!(cache_name)
-81:       check_cache!(cache_name)
-82: 
-83:       @locks_mutex.synchronize do
-84:         @cache_locks.delete(cache_name)
-85:         @cache.delete(cache_name)
-86:       end
-87: 
-88:       true
-89:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/cache.rb, line 74
-74:     def self.has_cache?(cache_name)
-75:       @locks_mutex.synchronize do
-76:         @cache.include?(cache_name)
-77:       end
-78:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/cache.rb, line 139
-139:     def self.invalidate!(cache_name, key)
-140:       check_cache!(cache_name)
-141: 
-142:       @cache_locks[cache_name].synchronize do
-143:         return false unless @cache[cache_name].include?(key)
-144: 
-145:         @cache[cache_name].delete(key)
-146:       end
-147:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/cache.rb, line 103
-103:     def self.read(cache_name, key)
-104:       check_cache!(cache_name)
-105: 
-106:       unless ttl(cache_name, key) > 0
-107:         raise_code(:PLMC11, "Cache expired on '%{cache_name}' key '%{item}'", :debug, :cache_name => cache_name, :item => key)
-108:       end
-109: 
-110:       log_code(:PLMC12, "Cache hit on '%{cache_name}' key '%{item}'", :debug, :cache_name => cache_name, :item => key)
-111: 
-112:       @cache_locks[cache_name].synchronize do
-113:         @cache[cache_name][key][:value]
-114:       end
-115:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/cache.rb, line 56
-56:     def self.setup(cache_name, ttl=300)
-57:       @locks_mutex.synchronize do
-58:         break if @cache_locks.include?(cache_name)
-59: 
-60:         @cache_locks[cache_name] = Mutex.new
-61: 
-62:         @cache_locks[cache_name].synchronize do
-63:           @cache[cache_name] = {:max_age => Float(ttl)}
-64:         end
-65:       end
-66: 
-67:       true
-68:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/cache.rb, line 129
-129:     def self.synchronize(cache_name)
-130:       check_cache!(cache_name)
-131: 
-132:       raise_code(:PLMC14, "No block supplied to synchronize on cache '%{cache_name}'", :debug, :cache_name => cache_name) unless block_given?
-133: 
-134:       @cache_locks[cache_name].synchronize do
-135:         yield
-136:       end
-137:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/cache.rb, line 117
-117:     def self.ttl(cache_name, key)
-118:       check_cache!(cache_name)
-119: 
-120:       @cache_locks[cache_name].synchronize do
-121:         unless @cache[cache_name].include?(key)
-122:           raise_code(:PLMC15, "No item called '%{item}' for cache '%{cache_name}'", :debug, :cache_name => cache_name, :item => key)
-123:         end
-124: 
-125:         @cache[cache_name][:max_age] - (Time.now - @cache[cache_name][key][:cache_create_time])
-126:       end
-127:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/cache.rb, line 91
- 91:     def self.write(cache_name, key, value)
- 92:       check_cache!(cache_name)
- 93: 
- 94:       @cache_locks[cache_name].synchronize do
- 95:         @cache[cache_name][key] ||= {}
- 96:         @cache[cache_name][key][:cache_create_time] = Time.now
- 97:         @cache[cache_name][key][:value] = value
- 98:       end
- 99: 
-100:       value
-101:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/CodedError.html b/doc/classes/MCollective/CodedError.html deleted file mode 100644 index ef96da6..0000000 --- a/doc/classes/MCollective/CodedError.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - Class: MCollective::CodedError - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::CodedError
In: - - lib/mcollective/exception.rb - -
-
Parent: - RuntimeError -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- log   - new   - set_backtrace   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - -
args [R] 
code [R] 
default [R] 
log_level [R] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/exception.rb, line 5
- 5:     def initialize(msgid, default, level=:debug, args={})
- 6:       @code = msgid
- 7:       @log_level = level
- 8:       @args = args
- 9:       @default = default
-10: 
-11:       msg = Util.t(@code, {:default => default}.merge(@args))
-12: 
-13:       super(msg)
-14:     end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/exception.rb, line 21
-21:     def log(level, log_backtrace=false)
-22:       Log.logexception(@code, level, self, log_backtrace)
-23:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/exception.rb, line 16
-16:     def set_backtrace(trace)
-17:       super
-18:       log(@log_level)
-19:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Config.html b/doc/classes/MCollective/Config.html deleted file mode 100644 index 72df346..0000000 --- a/doc/classes/MCollective/Config.html +++ /dev/null @@ -1,612 +0,0 @@ - - - - - - Class: MCollective::Config - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Config
In: - - lib/mcollective/config.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-A pretty sucky config class, ripe for refactoring/improving -

- -
- - -
- -
-

Methods

- - -
- -
- - - -
-

Included Modules

- -
- Singleton -
-
- -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
classesfile [R] 
collectives [R] 
color [R] 
configdir [R] 
configfile [R] 
configured [R] 
connector [R] 
daemonize [R] 
daemonize [R] 
default_discovery_method [R] 
default_discovery_options [R] 
direct_addressing [R] 
direct_addressing_threshold [R] 
fact_cache_time [R] 
factsource [R] 
identity [R] 
keeplogs [R] 
libdir [R] 
logfacility [R] 
logfile [R] 
logger_type [R] 
loglevel [R] 
main_collective [R] 
max_log_size [R] 
mode [RW] 
pluginconf [R] 
publish_timeout [R] 
registerinterval [R] 
registration [R] 
registration_collective [R] 
rpcaudit [R] 
rpcauditprovider [R] 
rpcauthorization [R] 
rpcauthprovider [R] 
rpclimitmethod [R] 
securityprovider [R] 
ssl_cipher [R] 
threaded [R] 
ttl [R] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/config.rb, line 20
-20:     def initialize
-21:       @configured = false
-22:     end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/config.rb, line 24
- 24:     def loadconfig(configfile)
- 25:       set_config_defaults(configfile)
- 26: 
- 27:       if File.exists?(configfile)
- 28:         File.readlines(configfile).each do |line|
- 29: 
- 30:           # strip blank spaces, tabs etc off the end of all lines
- 31:           line.gsub!(/\s*$/, "")
- 32: 
- 33:           unless line =~ /^#|^$/
- 34:             if (line =~ /(.+?)\s*=\s*(.+)/)
- 35:               key = $1.strip
- 36:               val = $2
- 37: 
- 38:               case key
- 39:                 when "registration"
- 40:                   @registration = val.capitalize
- 41:                 when "registration_collective"
- 42:                   @registration_collective = val
- 43:                 when "registerinterval"
- 44:                   @registerinterval = val.to_i
- 45:                 when "collectives"
- 46:                   @collectives = val.split(",").map {|c| c.strip}
- 47:                 when "main_collective"
- 48:                   @main_collective = val
- 49:                 when "logfile"
- 50:                   @logfile = val
- 51:                 when "keeplogs"
- 52:                   @keeplogs = val.to_i
- 53:                 when "max_log_size"
- 54:                   @max_log_size = val.to_i
- 55:                 when "loglevel"
- 56:                   @loglevel = val
- 57:                 when "logfacility"
- 58:                   @logfacility = val
- 59:                 when "libdir"
- 60:                   paths = val.split(File::PATH_SEPARATOR)
- 61:                   paths.each do |path|
- 62:                     raise("libdir paths should be absolute paths but '%s' is relative" % path) unless Util.absolute_path?(path)
- 63: 
- 64:                     @libdir << path
- 65:                     unless $LOAD_PATH.include?(path)
- 66:                       $LOAD_PATH << path
- 67:                     end
- 68:                   end
- 69:                 when "identity"
- 70:                   @identity = val
- 71:                 when "direct_addressing"
- 72:                   @direct_addressing = Util.str_to_bool(val)
- 73:                 when "direct_addressing_threshold"
- 74:                   @direct_addressing_threshold = val.to_i
- 75:                 when "color"
- 76:                   @color = Util.str_to_bool(val)
- 77:                 when "daemonize"
- 78:                   @daemonize = Util.str_to_bool(val)
- 79:                 when "securityprovider"
- 80:                   @securityprovider = val.capitalize
- 81:                 when "factsource"
- 82:                   @factsource = val.capitalize
- 83:                 when "connector"
- 84:                   @connector = val.capitalize
- 85:                 when "classesfile"
- 86:                   @classesfile = val
- 87:                 when /^plugin.(.+)$/
- 88:                   @pluginconf[$1] = val
- 89:                 when "publish_timeout"
- 90:                   @publish_timeout = val.to_i
- 91:                 when "rpcaudit"
- 92:                   @rpcaudit = Util.str_to_bool(val)
- 93:                 when "rpcauditprovider"
- 94:                   @rpcauditprovider = val.capitalize
- 95:                 when "rpcauthorization"
- 96:                   @rpcauthorization = Util.str_to_bool(val)
- 97:                 when "rpcauthprovider"
- 98:                   @rpcauthprovider = val.capitalize
- 99:                 when "rpclimitmethod"
-100:                   @rpclimitmethod = val.to_sym
-101:                 when "logger_type"
-102:                   @logger_type = val
-103:                 when "fact_cache_time"
-104:                   @fact_cache_time = val.to_i
-105:                 when "ssl_cipher"
-106:                   @ssl_cipher = val
-107:                 when "threaded"
-108:                   @threaded = Util.str_to_bool(val)
-109:                 when "ttl"
-110:                   @ttl = val.to_i
-111:                 when "default_discovery_options"
-112:                   @default_discovery_options << val
-113:                 when "default_discovery_method"
-114:                   @default_discovery_method = val
-115:                 else
-116:                   raise("Unknown config parameter '#{key}'")
-117:               end
-118:             end
-119:           end
-120:         end
-121: 
-122:         raise('The %s config file does not specify a libdir setting, cannot continue' % configfile) if @libdir.empty?
-123: 
-124:         I18n.load_path = Dir[File.expand_path(File.join(File.dirname(__FILE__), "locales", "*.yml"))]
-125:         I18n.locale = :en
-126: 
-127:         read_plugin_config_dir("#{@configdir}/plugin.d")
-128: 
-129:         raise 'Identities can only match /\w\.\-/' unless @identity.match(/^[\w\.\-]+$/)
-130: 
-131:         @configured = true
-132: 
-133:         @libdir.each {|dir| Log.warn("Cannot find libdir: #{dir}") unless File.directory?(dir)}
-134: 
-135:         if @logger_type == "syslog"
-136:           raise "The sylog logger is not usable on the Windows platform" if Util.windows?
-137:         end
-138: 
-139:         PluginManager.loadclass("Mcollective::Facts::#{@factsource}_facts")
-140:         PluginManager.loadclass("Mcollective::Connector::#{@connector}")
-141:         PluginManager.loadclass("Mcollective::Security::#{@securityprovider}")
-142:         PluginManager.loadclass("Mcollective::Registration::#{@registration}")
-143:         PluginManager.loadclass("Mcollective::Audit::#{@rpcauditprovider}") if @rpcaudit
-144:         PluginManager << {:type => "global_stats", :class => RunnerStats.new}
-145: 
-146:         Log.logmsg(:PLMC1, "The Marionette Collective version %{version} started by %{name} using config file %{config}", :info, :version => MCollective::VERSION, :name => $0, :config => configfile)
-147:       else
-148:         raise("Cannot find config file '#{configfile}'")
-149:       end
-150:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/config.rb, line 192
-192:     def read_plugin_config_dir(dir)
-193:       return unless File.directory?(dir)
-194: 
-195:       Dir.new(dir).each do |pluginconfigfile|
-196:         next unless pluginconfigfile =~ /^([\w]+).cfg$/
-197: 
-198:         plugin = $1
-199:         File.open("#{dir}/#{pluginconfigfile}", "r").each do |line|
-200:           # strip blank lines
-201:           line.gsub!(/\s*$/, "")
-202:           next if line =~ /^#|^$/
-203:           if (line =~ /(.+?)\s*=\s*(.+)/)
-204:             key = $1.strip
-205:             val = $2
-206:             @pluginconf["#{plugin}.#{key}"] = val
-207:           end
-208:         end
-209:       end
-210:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/config.rb, line 152
-152:     def set_config_defaults(configfile)
-153:       @stomp = Hash.new
-154:       @subscribe = Array.new
-155:       @pluginconf = Hash.new
-156:       @connector = "activemq"
-157:       @securityprovider = "Psk"
-158:       @factsource = "Yaml"
-159:       @identity = Socket.gethostname
-160:       @registration = "Agentlist"
-161:       @registerinterval = 0
-162:       @registration_collective = nil
-163:       @classesfile = "/var/lib/puppet/state/classes.txt"
-164:       @rpcaudit = false
-165:       @rpcauditprovider = ""
-166:       @rpcauthorization = false
-167:       @rpcauthprovider = ""
-168:       @configdir = File.dirname(configfile)
-169:       @color = !Util.windows?
-170:       @configfile = configfile
-171:       @logger_type = "file"
-172:       @keeplogs = 5
-173:       @max_log_size = 2097152
-174:       @rpclimitmethod = :first
-175:       @libdir = Array.new
-176:       @fact_cache_time = 300
-177:       @loglevel = "info"
-178:       @logfacility = "user"
-179:       @collectives = ["mcollective"]
-180:       @main_collective = @collectives.first
-181:       @ssl_cipher = "aes-256-cbc"
-182:       @direct_addressing = true
-183:       @direct_addressing_threshold = 10
-184:       @default_discovery_method = "mc"
-185:       @default_discovery_options = []
-186:       @ttl = 60
-187:       @mode = :client
-188:       @publish_timeout = 2
-189:       @threaded = false
-190:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Connector.html b/doc/classes/MCollective/Connector.html deleted file mode 100644 index b644e9d..0000000 --- a/doc/classes/MCollective/Connector.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - Module: MCollective::Connector - - - - - - - - - - -
- - - - - - - - - - -
ModuleMCollective::Connector
In: - - lib/mcollective/connector.rb - -
- - lib/mcollective/connector/base.rb - -
-
-
- - -
- - - -
- -
-

-Connector plugins handle the communications -with the middleware, you can provide your own to speak to something other -than Stomp, your plugins must inherit from MCollective::Connector::Base and should -provide the following methods: -

-

-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 -

-
-                was received.  It should get data from all subscribed channels/topics.  Individual messages
-                should be returned as MCollective::Request objects with the payload provided
-
-

-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 -

-

-These methods are all that‘s needed for a new connector protocol and -should hopefully be simple enough to not have tied us to Stomp. -

- -
- - -
- - -
- - - - -
- -
-

Classes and Modules

- - Class MCollective::Connector::Base
- -
- - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Connector/Base.html b/doc/classes/MCollective/Connector/Base.html deleted file mode 100644 index c29115f..0000000 --- a/doc/classes/MCollective/Connector/Base.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - Class: MCollective::Connector::Base - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Connector::Base
In: - - lib/mcollective/connector/base.rb - -
-
Parent: - Object -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- inherited   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/connector/base.rb, line 19
-19:       def self.inherited(klass)
-20:         PluginManager << {:type => "connector_plugin", :class => klass.to_s}
-21:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/DDL.html b/doc/classes/MCollective/DDL.html deleted file mode 100644 index b8d36f6..0000000 --- a/doc/classes/MCollective/DDL.html +++ /dev/null @@ -1,387 +0,0 @@ - - - - - - Module: MCollective::DDL - - - - - - - - - - - - - -
- - - -
- -
-

-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 -

-

-DDL files are used for input validation, -constructing outputs, producing online help, informing the various display -routines and so forth. -

-

-A sample DDL for an agent be seen below, you‘d -put this in your agent dir as <agent name>.ddl -

-
-   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://mcollective-plugins.googlecode.com/",
-            :timeout     => 60
-
-   action "status", :description => "Gets the status of a service" do
-      display :always
-
-      input :service,
-            :prompt      => "Service Name",
-            :description => "The service to get the status for",
-            :type        => :string,
-            :validation  => '^[a-zA-Z\-_\d]+$',
-            :optional    => true,
-            :maxlength   => 30
-
-      output :status,
-             :description => "The status of service",
-             :display_as  => "Service Status"
-  end
-
-

-There are now many types of DDL and ultimately all -pugins should have DDL files. The code is organized -so that any plugin type will magically just work - they will be an instane -of Base which has metadata and a few common -cases. -

-

-For plugin types that require more specific behaviors they can just add a -class here that inherits from Base and add -their specific behavior. -

-

-Base defines a specific behavior for input, -output and metadata which we‘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 AgentDDL class for an -example where agents want a :required argument to be always set. -

- -
- - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/ddl.rb, line 71
-71:     def self.load_and_cache(*args)
-72:       Cache.setup(:ddl, 300)
-73: 
-74:       plugin = args.first
-75:       args.size > 1 ? type = args[1].to_s : type = "agent"
-76:       path = "%s/%s" % [type, plugin]
-77: 
-78:       begin
-79:         ddl = Cache.read(:ddl, path)
-80:       rescue
-81:         begin
-82:           klass = DDL.const_get("%sDDL" % type.capitalize)
-83:         rescue NameError
-84:           klass = Base
-85:         end
-86: 
-87:         ddl = Cache.write(:ddl, path, klass.new(*args))
-88:       end
-89: 
-90:       return ddl
-91:     end
-
-
-
-
- -
- - - - -
-

-There used to be only one big nasty DDL class with a -bunch of mashed together behaviors. It‘s been around for ages and we -would rather not ask all the users to change their DDL.new calls to some other factory method that -would have this exact same behavior. -

-

-So we override the behavior of new which is -a hugely sucky thing to do but ultimately it‘s what would be least -disrupting to code out there today. We did though change DDL to a module to make it possibly a little less -suprising, possibly. -

-

[Source]

-
-
-    # File lib/mcollective/ddl.rb, line 67
-67:     def self.new(*args, &blk)
-68:       load_and_cache(*args)
-69:     end
-
-
-
-
- -
- - - - -
-

-As we‘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 "true"/"yes" or -"false"/"no" turn them into the matching boolean -

-

[Source]

-
-
-     # File lib/mcollective/ddl.rb, line 98
- 98:     def self.string_to_boolean(val)
- 99:       return true if ["true", "t", "yes", "y", "1"].include?(val.downcase)
-100:       return false if ["false", "f", "no", "n", "0"].include?(val.downcase)
-101: 
-102:       raise_code(:PLMC17, "%{value} does not look like a boolean argument", :debug, :value => val)
-103:     end
-
-
-
-
- -
- - - - -
-

-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 -

-

[Source]

-
-
-     # File lib/mcollective/ddl.rb, line 108
-108:     def self.string_to_number(val)
-109:       return val.to_f if val =~ /^\d+\.\d+$/
-110:       return val.to_i if val =~ /^\d+$/
-111: 
-112:       raise_code(:PLMC16, "%{value} does not look like a numeric value", :debug, :value => val)
-113:     end
-
-
-
-
- -
- - - - -
-

-Various DDL implementations will validate and raise -on error, this is a utility method to correctly setup a DDLValidationError exceptions and raise -them -

-

[Source]

-
-
-     # File lib/mcollective/ddl.rb, line 117
-117:     def self.validation_fail!(code, default, level, args={})
-118:       exception = DDLValidationError.new(code, default, level, args)
-119:       exception.set_backtrace caller
-120: 
-121:       raise exception
-122:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/DDL/AgentDDL.html b/doc/classes/MCollective/DDL/AgentDDL.html deleted file mode 100644 index f2bd1ef..0000000 --- a/doc/classes/MCollective/DDL/AgentDDL.html +++ /dev/null @@ -1,627 +0,0 @@ - - - - - - Class: MCollective::DDL::AgentDDL - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::DDL::AgentDDL
In: - - lib/mcollective/ddl/agentddl.rb - -
-
Parent: - - Base - -
-
- - -
- - - -
- -
-

-A DDL class specific to agent plugins. -

-

-A full DDL can be seen below with all the -possible bells and whistles present. -

-

-metadata :name => "Utilities and Helpers for SimpleRPC Agents", -

-
-            :description => "General helpful actions that expose stats and internals to SimpleRPC clients",
-            :author      => "R.I.Pienaar <rip@devco.net>",
-            :license     => "Apache License, Version 2.0",
-            :version     => "1.0",
-            :url         => "http://marionette-collective.org/",
-            :timeout     => 10
-
-

-action "get_fact", -:description => "Retrieve a single fact from the fact store" -do -

-
-     display :always
-
-     input :fact,
-           :prompt      => "The name of the fact",
-           :description => "The fact to retrieve",
-           :type        => :string,
-           :validation  => '^[\w\-\.]+$',
-           :optional    => false,
-           :maxlength   => 40,
-           :default     => "fqdn"
-
-     output :fact,
-            :description => "The name of the fact being returned",
-            :display_as  => "Fact"
-
-     output :value,
-            :description => "The value of the fact",
-            :display_as  => "Value",
-            :default     => ""
-
-    summarize do
-        aggregate summary(:value)
-    end
-
-

-end -

- -
- - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/ddl/agentddl.rb, line 41
-41:       def initialize(plugin, plugintype=:agent, loadddl=true)
-42:         @process_aggregate_functions = nil
-43: 
-44:         super
-45:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Creates the definition for an action, -you can nest input definitions inside -the action to attach inputs and -validation to the actions -

-
-   action "status", :description => "Restarts a Service" do
-      display :always
-
-      input  "service",
-             :prompt      => "Service Action",
-             :description => "The action to perform",
-             :type        => :list,
-             :optional    => true,
-             :list        => ["start", "stop", "restart", "status"]
-
-      output "status",
-             :description => "The status of the service after the action"
-
-   end
-
-

[Source]

-
-
-     # File lib/mcollective/ddl/agentddl.rb, line 112
-112:       def action(name, input, &block)
-113:         raise "Action needs a :description property" unless input.include?(:description)
-114: 
-115:         unless @entities.include?(name)
-116:           @entities[name] = {}
-117:           @entities[name][:action] = name
-118:           @entities[name][:input] = {}
-119:           @entities[name][:output] = {}
-120:           @entities[name][:display] = :failed
-121:           @entities[name][:description] = input[:description]
-122:         end
-123: 
-124:         # if a block is passed it might be creating input methods, call it
-125:         # we set @current_entity so the input block can know what its talking
-126:         # to, this is probably an epic hack, need to improve.
-127:         @current_entity = name
-128:         block.call if block_given?
-129:         @current_entity = nil
-130:       end
-
-
-
-
- -
- - - - -
-

-Returns the interface for a specific action -

-

[Source]

-
-
-     # File lib/mcollective/ddl/agentddl.rb, line 198
-198:       def action_interface(name)
-199:         @entities[name] || {}
-200:       end
-
-
-
-
- -
- - - - -
-

-Returns an array of actions this agent -support -

-

[Source]

-
-
-     # File lib/mcollective/ddl/agentddl.rb, line 203
-203:       def actions
-204:         @entities.keys
-205:       end
-
-
-
-
- -
- - - - -
-

-Sets the aggregate array for the given -action -

-

[Source]

-
-
-    # File lib/mcollective/ddl/agentddl.rb, line 70
-70:       def aggregate(function, format = {:format => nil})
-71:         DDL.validation_fail!(:PLMC28, "Formats supplied to aggregation functions should be a hash", :error) unless format.is_a?(Hash)
-72:         DDL.validation_fail!(:PLMC27, "Formats supplied to aggregation functions must have a :format key", :error) unless format.keys.include?(:format)
-73:         DDL.validation_fail!(:PLMC26, "Functions supplied to aggregate should be a hash", :error) unless function.is_a?(Hash)
-74: 
-75:         unless (function.keys.include?(:args)) && function[:args]
-76:           DDL.validation_fail!(:PLMC25, "aggregate method for action '%{action}' missing a function parameter", :error, :action => entities[@current_entity][:action])
-77:         end
-78: 
-79:         entities[@current_entity][:aggregate] ||= []
-80:         entities[@current_entity][:aggregate] << (format[:format].nil? ? function : function.merge(format))
-81:       end
-
-
-
-
- -
- - - - -
-

-Sets the display preference to either -:ok, :failed, :flatten or :always operates on action level -

-

[Source]

-
-
-    # File lib/mcollective/ddl/agentddl.rb, line 85
-85:       def display(pref)
-86:         # defaults to old behavior, complain if its supplied and invalid
-87:         unless [:ok, :failed, :flatten, :always].include?(pref)
-88:           raise "Display preference #{pref} is not valid, should be :ok, :failed, :flatten or :always"
-89:         end
-90: 
-91:         action = @current_entity
-92:         @entities[action][:display] = pref
-93:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/ddl/agentddl.rb, line 47
-47:       def input(argument, properties)
-48:         raise "Input needs a :optional property" unless properties.include?(:optional)
-49: 
-50:         super
-51:       end
-
-
-
-
- -
- - - - -
-

-Checks if a method name matches a aggregate plugin. This is used by method -missing so that we dont greedily assume that every method_missing call in an agent ddl has -hit a aggregate function. -

-

[Source]

-
-
-     # File lib/mcollective/ddl/agentddl.rb, line 146
-146:       def is_function?(method_name)
-147:         PluginManager.find("aggregate").include?(method_name.to_s)
-148:       end
-
-
-
-
- -
- - - - -
-

-If the method name matches a # aggregate 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 summarize block -

-

[Source]

-
-
-     # File lib/mcollective/ddl/agentddl.rb, line 135
-135:       def method_missing(name, *args, &block)
-136:         unless @process_aggregate_functions || is_function?(name)
-137:           raise NoMethodError, "undefined local variable or method `#{name}'", caller
-138:         end
-139: 
-140:         return {:function => name, :args => args}
-141:       end
-
-
-
-
- -
- - - - -
-

-For a given action and arguments look -up the DDL interface to that action and if any arguments in the DDL have a :default value assign that to any input that does not have an argument in -the input arguments -

-

-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 input -validation -

-

[Source]

-
-
-     # File lib/mcollective/ddl/agentddl.rb, line 159
-159:       def set_default_input_arguments(action, arguments)
-160:         input = action_interface(action)[:input]
-161: 
-162:         return unless input
-163: 
-164:         input.keys.each do |key|
-165:           if !arguments.include?(key) && !input[key][:default].nil? && !input[key][:optional]
-166:             Log.debug("Setting default value for input '%s' to '%s'" % [key, input[key][:default]])
-167:             arguments[key] = input[key][:default]
-168:           end
-169:         end
-170:       end
-
-
-
-
- -
- - - - -
-

-Calls the summarize block defined in -the ddl. Block will not be called if the ddl is getting processed on the -server side. This means that aggregate -plugins only have to be present on the client side. -

-

-The @process_aggregate_functions variable is used by the method_missing block to determine if it -should kick in, this way we very tightly control where we activate the method_missing behavior turning it into a -noop otherwise to maximise the chance of providing good user feedback -

-

[Source]

-
-
-    # File lib/mcollective/ddl/agentddl.rb, line 61
-61:       def summarize(&block)
-62:         unless @config.mode == :server
-63:           @process_aggregate_functions = true
-64:           block.call
-65:           @process_aggregate_functions = nil
-66:         end
-67:       end
-
-
-
-
- -
- - - - -
-

-Helper to use the DDL to figure out if the remote -call to an agent should be allowed based on action name and inputs. -

-

[Source]

-
-
-     # File lib/mcollective/ddl/agentddl.rb, line 174
-174:       def validate_rpc_request(action, arguments)
-175:         # is the action known?
-176:         unless actions.include?(action)
-177:           DDL.validation_fail!(:PLMC29, "Attempted to call action %{action} for %{plugin} but it's not declared in the DDL", :debug, :action => action, :plugin => @pluginname)
-178:         end
-179: 
-180:         input = action_interface(action)[:input] || {}
-181: 
-182:         input.keys.each do |key|
-183:           unless input[key][:optional]
-184:             unless arguments.keys.include?(key)
-185:               DDL.validation_fail!(:PLMC30, "Action '%{action}' needs a '%{key}' argument", :debug, :action => action, :key => key)
-186:             end
-187:           end
-188: 
-189:           if arguments.keys.include?(key)
-190:             validate_input_argument(input, key, arguments[key])
-191:           end
-192:         end
-193: 
-194:         true
-195:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/DDL/DataDDL.html b/doc/classes/MCollective/DDL/DataDDL.html deleted file mode 100644 index 0d21aa3..0000000 --- a/doc/classes/MCollective/DDL/DataDDL.html +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - Class: MCollective::DDL::DataDDL - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::DDL::DataDDL
In: - - lib/mcollective/ddl/dataddl.rb - -
-
Parent: - - Base - -
-
- - -
- - - -
- -
-

-A DDL file for the data query plugins. -

-

-Query plugins can today take only one input by convention in the DDL that is called :query, otherwise the input is identical to the standard input. -

-

-metadata :name => "Agent", -

-
-            :description => "Meta data about installed MColletive Agents",
-            :author      => "R.I.Pienaar <rip@devco.net>",
-            :license     => "ASL 2.0",
-            :version     => "1.0",
-            :url         => "http://marionette-collective.org/",
-            :timeout     => 1
-
-

-dataquery :description => "Agent Meta Data" -do -

-
-    input :query,
-          :prompt => "Agent Name",
-          :description => "Valid agent name",
-          :type => :string,
-          :validation => /^[\w\_]+$/,
-          :maxlength => 20
-
-    [:license, :timeout, :description, :url, :version, :author].each do |item|
-      output item,
-             :description => "Agent #{item}",
-             :display_as => item.to_s.capitalize
-    end
-
-

-end -

- -
- - -
- -
-

Methods

- -
- dataquery   - dataquery_interface   - input   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/ddl/dataddl.rb, line 31
-31:       def dataquery(input, &block)
-32:         raise "Data queries need a :description" unless input.include?(:description)
-33:         raise "Data queries can only have one definition" if @entities[:data]
-34: 
-35:         @entities[:data]  = {:description => input[:description],
-36:                              :input => {},
-37:                              :output => {}}
-38: 
-39:         @current_entity = :data
-40:         block.call if block_given?
-41:         @current_entity = nil
-42:       end
-
-
-
-
- -
- - - - -
-

-Returns the interface for the data query -

-

[Source]

-
-
-    # File lib/mcollective/ddl/dataddl.rb, line 51
-51:       def dataquery_interface
-52:         @entities[:data] || {}
-53:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/ddl/dataddl.rb, line 44
-44:       def input(argument, properties)
-45:         raise "The only valid input name for a data query is 'query'" if argument != :query
-46: 
-47:         super
-48:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/DDL/DiscoveryDDL.html b/doc/classes/MCollective/DDL/DiscoveryDDL.html deleted file mode 100644 index fab1db6..0000000 --- a/doc/classes/MCollective/DDL/DiscoveryDDL.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - Class: MCollective::DDL::DiscoveryDDL - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::DDL::DiscoveryDDL
In: - - lib/mcollective/ddl/discoveryddl.rb - -
-
Parent: - - Base - -
-
- - -
- - - -
- -
-

-DDL for discovery plugins, a full example can -be seen below -

-

-metadata :name => "mc", -

-
-            :description => "MCollective Broadcast based discovery",
-            :author      => "R.I.Pienaar <rip@devco.net>",
-            :license     => "ASL 2.0",
-            :version     => "0.1",
-            :url         => "http://marionette-collective.org/",
-            :timeout     => 2
-
-

-discovery do -

-
-    capabilities [:classes, :facts, :identity, :agents, :compound]
-
-

-end -

- -
- - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

-records valid capabilities for discovery plugins -

-

[Source]

-
-
-    # File lib/mcollective/ddl/discoveryddl.rb, line 22
-22:       def capabilities(*caps)
-23:         caps = [caps].flatten
-24: 
-25:         raise "Discovery plugin capabilities can't be empty" if caps.empty?
-26: 
-27:         caps.each do |cap|
-28:           if [:classes, :facts, :identity, :agents, :compound].include?(cap)
-29:             @entities[:discovery][:capabilities] << cap
-30:           else
-31:             raise "%s is not a valid capability, valid capabilities are :classes, :facts, :identity, :agents and :compound" % cap
-32:           end
-33:         end
-34:       end
-
-
-
-
- -
- - - - -
-

-Creates the definition for new discovery plugins -

-
-   discovery do
-      capabilities [:classes, :facts, :identity, :agents, :compound]
-   end
-
-

[Source]

-
-
-    # File lib/mcollective/ddl/discoveryddl.rb, line 41
-41:       def discovery(&block)
-42:         raise "Discovery plugins can only have one definition" if @entities[:discovery]
-43: 
-44:         @entities[:discovery] = {:capabilities => []}
-45: 
-46:         @current_entity = :discovery
-47:         block.call if block_given?
-48:         @current_entity = nil
-49:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/ddl/discoveryddl.rb, line 17
-17:       def discovery_interface
-18:         @entities[:discovery]
-19:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/DDL/ValidatorDDL.html b/doc/classes/MCollective/DDL/ValidatorDDL.html deleted file mode 100644 index f151eb6..0000000 --- a/doc/classes/MCollective/DDL/ValidatorDDL.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - Class: MCollective::DDL::ValidatorDDL - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::DDL::ValidatorDDL
In: - - lib/mcollective/ddl/validatorddl.rb - -
-
Parent: - - Base - -
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/DDLValidationError.html b/doc/classes/MCollective/DDLValidationError.html deleted file mode 100644 index 90d4452..0000000 --- a/doc/classes/MCollective/DDLValidationError.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - Class: MCollective::DDLValidationError - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::DDLValidationError
In: - - lib/mcollective/exception.rb - -
-
Parent: - - CodedError - -
-
- - -
- - - -
- -
-

-Exceptions for the RPC system -

- -
- - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Data.html b/doc/classes/MCollective/Data.html deleted file mode 100644 index aa7eae9..0000000 --- a/doc/classes/MCollective/Data.html +++ /dev/null @@ -1,381 +0,0 @@ - - - - - - Module: MCollective::Data - - - - - - - - - - - - - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - - -
- -
-

Classes and Modules

- - Class MCollective::Data::Base
-Class MCollective::Data::Result
- -
- - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/data.rb, line 26
-26:     def self.[](plugin)
-27:       PluginManager[pluginname(plugin)]
-28:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/data.rb, line 37
-37:     def self.ddl(plugin)
-38:       DDL.new(pluginname(plugin), :data)
-39:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/data.rb, line 62
-62:     def self.ddl_has_output?(ddl, output)
-63:       ddl.entities[:data][:output].include?(output.to_sym) rescue false
-64:     end
-
-
-
-
- -
- - - - -
-

-For an input where the DDL requests a boolean or -some number this will convert the input to the right type where possible -else just returns the origin input unedited -

-

-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 DDL validation will fail and the user will get an -error, no need to be too defensive here -

-

[Source]

-
-
-    # File lib/mcollective/data.rb, line 74
-74:     def self.ddl_transform_input(ddl, input)
-75:       begin
-76:         type = ddl.entities[:data][:input][:query][:type]
-77: 
-78:         case type
-79:           when :boolean
-80:             return DDL.string_to_boolean(input)
-81: 
-82:           when :number, :integer, :float
-83:             return DDL.string_to_number(input)
-84:         end
-85:       rescue
-86:       end
-87: 
-88:       return input
-89:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/data.rb, line 41
-41:     def self.ddl_validate(ddl, argument)
-42:       name = ddl.meta[:name]
-43:       query = ddl.entities[:data]
-44: 
-45:       DDL.validation_fail!(:PLMC31, "No dataquery has been defined in the DDL for data plugin '%{plugin}'", :error, :plugin => name)  unless query
-46: 
-47:       input = query.fetch(:input, {})
-48:       output = query.fetch(:output, {})
-49: 
-50:       DDL.validation_fail!(:PLMC32, "No output has been defined in the DDL for data plugin %{plugin}", :error, :plugin => name) if output.keys.empty?
-51: 
-52:       if input[:query]
-53:         return true if argument.nil? && input[:query][:optional]
-54: 
-55:         ddl.validate_input_argument(input, :query, argument)
-56:       else
-57:         DDL.validation_fail!(:PLMC33, "No data plugin argument was declared in the '%{plugin}' DDL but an input was supplied", :error, :plugin => name) if argument
-58:         return true
-59:       end
-60:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/data.rb, line 6
- 6:     def self.load_data_sources
- 7:       PluginManager.find_and_load("data")
- 8: 
- 9:       PluginManager.grep(/_data$/).each do |plugin|
-10:         begin
-11:           unless PluginManager[plugin].class.activate?
-12:             Log.debug("Disabling data plugin %s due to plugin activation policy" % plugin)
-13:             PluginManager.delete(plugin)
-14:           end
-15:         rescue Exception => e
-16:           Log.debug("Disabling data plugin %s due to exception #{e.class}: #{e}" % plugin)
-17:           PluginManager.delete(plugin)
-18:         end
-19:       end
-20:     end
-
-
-
-
- -
- - - - -
-

-Data.package("httpd").architecture -

-

[Source]

-
-
-    # File lib/mcollective/data.rb, line 31
-31:     def self.method_missing(method, *args)
-32:       super unless PluginManager.include?(pluginname(method))
-33: 
-34:       PluginManager[pluginname(method)].lookup(args.first)
-35:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/data.rb, line 22
-22:     def self.pluginname(plugin)
-23:       plugin.to_s =~ /_data$/i ? plugin.to_s.downcase : "%s_data" % plugin.to_s.downcase
-24:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Data/Base.html b/doc/classes/MCollective/Data/Base.html deleted file mode 100644 index 5bd7476..0000000 --- a/doc/classes/MCollective/Data/Base.html +++ /dev/null @@ -1,383 +0,0 @@ - - - - - - Class: MCollective::Data::Base - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Data::Base
In: - - lib/mcollective/data/base.rb - -
-
Parent: - Object -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- activate?   - activate_when   - ddl_validate   - inherited   - lookup   - new   - query   - startup_hook   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - -
ddl [R] 
name [R] 
result [R] 
timeout [R] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

-Always be active unless a specific block is given with activate_when -

-

[Source]

-
-
-    # File lib/mcollective/data/base.rb, line 60
-60:       def self.activate?
-61:         return true
-62:       end
-
-
-
-
- -
- - - - -
-

-activate_when do -

-
-   file.exist?("/usr/bin/puppet")
-
-

-end -

-

[Source]

-
-
-    # File lib/mcollective/data/base.rb, line 53
-53:       def self.activate_when(&block)
-54:         (class << self; self; end).instance_eval do
-55:           define_method("activate?", &block)
-56:         end
-57:       end
-
-
-
-
- -
- - - - -
-

-Register plugins that inherits base -

-

[Source]

-
-
-    # File lib/mcollective/data/base.rb, line 7
- 7:       def self.inherited(klass)
- 8:         type = klass.to_s.split("::").last.downcase
- 9: 
-10:         PluginManager << {:type => type, :class => klass.to_s, :single_instance => false}
-11:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/data/base.rb, line 13
-13:       def initialize
-14:         @name = self.class.to_s.split("::").last.downcase
-15:         @ddl = DDL.new(@name, :data)
-16:         @result = Result.new(@ddl.dataquery_interface[:output])
-17:         @timeout = @ddl.meta[:timeout] || 1
-18: 
-19:         startup_hook
-20:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/data/base.rb, line 42
-42:       def self.query(&block)
-43:         self.module_eval { define_method("query_data", &block) }
-44:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/data/base.rb, line 46
-46:       def ddl_validate(what)
-47:         Data.ddl_validate(@ddl, what)
-48:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/data/base.rb, line 22
-22:       def lookup(what)
-23:         ddl_validate(what)
-24: 
-25:         Log.debug("Doing data query %s for '%s'" % [ @name, what ])
-26: 
-27:         Timeout::timeout(@timeout) do
-28:           query_data(what)
-29:         end
-30: 
-31:         @result
-32:       rescue Timeout::Error
-33:         # Timeout::Error is a inherited from Interrupt which seems a really
-34:         # strange choice, making it an equivelant of ^C and such.  Catch it
-35:         # and raise something less critical that will not the runner to just
-36:         # give up the ghost
-37:         msg = "Data plugin %s timed out on query '%s'" % [@name, what]
-38:         Log.error(msg)
-39:         raise MsgTTLExpired, msg
-40:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/data/base.rb, line 64
-64:       def startup_hook;end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Data/Result.html b/doc/classes/MCollective/Data/Result.html deleted file mode 100644 index 56cf4fc..0000000 --- a/doc/classes/MCollective/Data/Result.html +++ /dev/null @@ -1,278 +0,0 @@ - - - - - - Class: MCollective::Data::Result - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Data::Result
In: - - lib/mcollective/data/result.rb - -
-
Parent: - Object -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- []   - []=   - include?   - keys   - method_missing   - new   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/data/result.rb, line 9
- 9:       def initialize(outputs)
-10:         @data = {}
-11: 
-12:         outputs.keys.each do |output|
-13:           @data[output] = Marshal.load(Marshal.dump(outputs[output].fetch(:default, nil)))
-14:         end
-15:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/data/result.rb, line 21
-21:       def [](key)
-22:         @data[key.to_sym]
-23:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/data/result.rb, line 25
-25:       def []=(key, val)
-26:         raise "Can only store String, Integer, Float or Boolean data but got #{val.class} for key #{key}" unless [String, Fixnum, Bignum, Float, TrueClass, FalseClass].include?(val.class)
-27: 
-28:         @data[key.to_sym] = val
-29:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/data/result.rb, line 17
-17:       def include?(key)
-18:         @data.include?(key.to_sym)
-19:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/data/result.rb, line 31
-31:       def keys
-32:         @data.keys
-33:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/data/result.rb, line 35
-35:       def method_missing(method, *args)
-36:         key = method.to_sym
-37: 
-38:         raise NoMethodError, "undefined local variable or method `%s'" % key unless include?(key)
-39: 
-40:         @data[key]
-41:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Discovery.html b/doc/classes/MCollective/Discovery.html deleted file mode 100644 index bd1690c..0000000 --- a/doc/classes/MCollective/Discovery.html +++ /dev/null @@ -1,512 +0,0 @@ - - - - - - Class: MCollective::Discovery - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Discovery
In: - - lib/mcollective/discovery.rb - -
-
Parent: - Object -
-
- - -
- - - -
- - - -
- - - -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-   # File lib/mcollective/discovery.rb, line 3
-3:     def initialize(client)
-4:       @known_methods = find_known_methods
-5:       @default_method = Config.instance.default_discovery_method
-6:       @client = client
-7:     end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Agent 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 -

-

[Source]

-
-
-    # File lib/mcollective/discovery.rb, line 62
-62:     def check_capabilities(filter)
-63:       capabilities = ddl.discovery_interface[:capabilities]
-64: 
-65:       unless capabilities.include?(:classes)
-66:         raise "Cannot use class filters while using the '%s' discovery method" % discovery_method unless filter["cf_class"].empty?
-67:       end
-68: 
-69:       unless capabilities.include?(:facts)
-70:         raise "Cannot use fact filters while using the '%s' discovery method" % discovery_method unless filter["fact"].empty?
-71:       end
-72: 
-73:       unless capabilities.include?(:identity)
-74:         raise "Cannot use identity filters while using the '%s' discovery method" % discovery_method unless filter["identity"].empty?
-75:       end
-76: 
-77:       unless capabilities.include?(:compound)
-78:         raise "Cannot use compound filters while using the '%s' discovery method" % discovery_method unless filter["compound"].empty?
-79:       end
-80:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/discovery.rb, line 47
-47:     def ddl
-48:       @ddl ||= DDL.new(discovery_method, :discovery)
-49: 
-50:       # if the discovery method got changed we might have an old DDL cached
-51:       # this will detect that and reread the correct DDL from disk
-52:       unless @ddl.meta[:name] == discovery_method
-53:         @ddl = DDL.new(discovery_method, :discovery)
-54:       end
-55: 
-56:       return @ddl
-57:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/discovery.rb, line 127
-127:     def discover(filter, timeout, limit)
-128:       raise "Limit has to be an integer" unless limit.is_a?(Fixnum)
-129: 
-130:       force_discovery_method_by_filter(filter)
-131: 
-132:       check_capabilities(filter)
-133: 
-134:       discovered = discovery_class.discover(filter, discovery_timeout(timeout, filter), limit, @client)
-135: 
-136:       if limit > 0
-137:         return discovered[0,limit]
-138:       else
-139:         return discovered
-140:       end
-141:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/discovery.rb, line 39
-39:     def discovery_class
-40:       method = discovery_method.capitalize
-41: 
-42:       PluginManager.loadclass("MCollective::Discovery::#{method}") unless self.class.const_defined?(method)
-43: 
-44:       self.class.const_get(method)
-45:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/discovery.rb, line 21
-21:     def discovery_method
-22:       method = "mc"
-23: 
-24:       if @client.options[:discovery_method]
-25:         method = @client.options[:discovery_method]
-26:       else
-27:         method = @default_method
-28:       end
-29: 
-30:       raise "Unknown discovery method %s" % method unless has_method?(method)
-31: 
-32:       unless method == "mc"
-33:         raise "Custom discovery methods require direct addressing mode" unless Config.instance.direct_addressing
-34:       end
-35: 
-36:       return method
-37:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/discovery.rb, line 117
-117:     def discovery_timeout(timeout, filter)
-118:       timeout = ddl.meta[:timeout] unless timeout
-119: 
-120:       unless (filter["compound"] && filter["compound"].empty?)
-121:         timeout + timeout_for_compound_filter(filter["compound"])
-122:       else
-123:         timeout
-124:       end
-125:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/discovery.rb, line 9
- 9:     def find_known_methods
-10:       PluginManager.find("discovery")
-11:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/discovery.rb, line 17
-17:     def force_direct_mode?
-18:       discovery_method != "mc"
-19:     end
-
-
-
-
- -
- - - - -
-

-checks if compound filters are used and then forces the ‘mc’ -discovery plugin -

-

[Source]

-
-
-    # File lib/mcollective/discovery.rb, line 83
-83:     def force_discovery_method_by_filter(filter)
-84:       unless discovery_method == "mc"
-85:         unless filter["compound"].empty?
-86:           Log.info "Switching to mc discovery method because compound filters are used"
-87:           @client.options[:discovery_method] = "mc"
-88: 
-89:           return true
-90:         end
-91:       end
-92: 
-93:       return false
-94:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/discovery.rb, line 13
-13:     def has_method?(method)
-14:       @known_methods.include?(method)
-15:     end
-
-
-
-
- -
- - - - -
-

-if a compound filter is specified and it has any function then we read the -DDL for each of those plugins and sum up the timeout -declared in the DDL -

-

[Source]

-
-
-     # File lib/mcollective/discovery.rb, line 99
- 99:     def timeout_for_compound_filter(compound_filter)
-100:       return 0 if compound_filter.nil? || compound_filter.empty?
-101: 
-102:       timeout = 0
-103: 
-104:       compound_filter.each do |filter|
-105:         filter.each do |statement|
-106:           if statement["fstatement"]
-107:             pluginname = Data.pluginname(statement["fstatement"]["name"])
-108:             ddl = DDL.new(pluginname, :data)
-109:             timeout += ddl.meta[:timeout]
-110:           end
-111:         end
-112:       end
-113: 
-114:       timeout
-115:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Facts.html b/doc/classes/MCollective/Facts.html deleted file mode 100644 index 5171a69..0000000 --- a/doc/classes/MCollective/Facts.html +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - Module: MCollective::Facts - - - - - - - - - - -
- - - - - - - - - - -
ModuleMCollective::Facts
In: - - lib/mcollective/facts/base.rb - -
- - lib/mcollective/facts.rb - -
-
-
- - -
- - - -
- -
-

-This is a class that gives access to the configured fact provider such as -MCollectives::Facts::Facter that uses Reductive Labs facter -

-

-The actual provider is pluggable and configurable using the -‘factsource’ configuration option. -

-

-To develop a new factsource simply create a class under MCollective::Facts:: and provide the following -classes: -

-
-  self.get_fact(fact)
-  self.has_fact?(fact)
-
-

-You can also just inherit from MCollective::Facts::Base and provide just the -

-
-  self.get_facts
-
-

-method that should return a hash of facts. -

- -
- - -
- -
-

Methods

- -
- []   - get_fact   - has_fact?   -
-
- -
- - - - -
- -
-

Classes and Modules

- - Class MCollective::Facts::Base
- -
- - - - - - - - -
-

Public Class methods

- -
- - - - -
-

-Get the value of a fact -

-

[Source]

-
-
-    # File lib/mcollective/facts.rb, line 35
-35:     def self.[](fact)
-36:       PluginManager["facts_plugin"].get_fact(fact)
-37:     end
-
-
-
-
- -
- - - - -
-

-Get the value of a fact -

-

[Source]

-
-
-    # File lib/mcollective/facts.rb, line 30
-30:     def self.get_fact(fact)
-31:       PluginManager["facts_plugin"].get_fact(fact)
-32:     end
-
-
-
-
- -
- - - - -
-

-True if we know of a specific fact else false -

-

[Source]

-
-
-    # File lib/mcollective/facts.rb, line 25
-25:     def self.has_fact?(fact, value)
-26:       PluginManager["facts_plugin"].get_fact(fact) == value ? true : false
-27:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Facts/Base.html b/doc/classes/MCollective/Facts/Base.html deleted file mode 100644 index b7998e9..0000000 --- a/doc/classes/MCollective/Facts/Base.html +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - Class: MCollective::Facts::Base - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Facts::Base
In: - - lib/mcollective/facts/base.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-A base class for fact providers, to make a new fully functional fact provider inherit -from this and simply provide a self.get_facts method that returns a hash -like: -

-
- {"foo" => "bar",
-  "bar" => "baz"}
-
- -
- - -
- -
-

Methods

- -
- force_reload?   - get_fact   - get_facts   - has_fact?   - inherited   - new   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

-Registers new fact sources into the plugin -manager -

-

[Source]

-
-
-    # File lib/mcollective/facts/base.rb, line 17
-17:       def self.inherited(klass)
-18:         PluginManager << {:type => "facts_plugin", :class => klass.to_s}
-19:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/facts/base.rb, line 10
-10:       def initialize
-11:         @facts = {}
-12:         @last_good_facts = {}
-13:         @last_facts_load = 0
-14:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Plugins can override this to provide forced fact invalidation -

-

[Source]

-
-
-    # File lib/mcollective/facts/base.rb, line 81
-81:       def force_reload?
-82:         false
-83:       end
-
-
-
-
- -
- - - - -
-

-Returns the value of a single fact -

-

[Source]

-
-
-    # File lib/mcollective/facts/base.rb, line 22
-22:       def get_fact(fact=nil)
-23:         config = Config.instance
-24: 
-25:         cache_time = config.fact_cache_time || 300
-26: 
-27:         Thread.exclusive do
-28:           begin
-29:             if (Time.now.to_i - @last_facts_load > cache_time.to_i ) || force_reload?
-30:               Log.debug("Resetting facter cache, now: #{Time.now.to_i} last-known-good: #{@last_facts_load}")
-31: 
-32:               tfacts = load_facts_from_source
-33: 
-34:               # Force reset to last known good state on empty facts
-35:               raise "Got empty facts" if tfacts.empty?
-36: 
-37:               @facts.clear
-38: 
-39:               tfacts.each_pair do |key,value|
-40:                 @facts[key.to_s] = value.to_s
-41:               end
-42: 
-43:               @last_good_facts = @facts.clone
-44:               @last_facts_load = Time.now.to_i
-45:             else
-46:               Log.debug("Using cached facts now: #{Time.now.to_i} last-known-good: #{@last_facts_load}")
-47:             end
-48:           rescue Exception => e
-49:             Log.error("Failed to load facts: #{e.class}: #{e}")
-50: 
-51:             # Avoid loops where failing fact loads cause huge CPU
-52:             # loops, this way it only retries once every cache_time
-53:             # seconds
-54:             @last_facts_load = Time.now.to_i
-55: 
-56:             # Revert to last known good state
-57:             @facts = @last_good_facts.clone
-58:           end
-59:         end
-60: 
-61: 
-62:         # If you do not supply a specific fact all facts will be returned
-63:         if fact.nil?
-64:           return @facts
-65:         else
-66:           @facts.include?(fact) ? @facts[fact] : nil
-67:         end
-68:       end
-
-
-
-
- -
- - - - -
-

-Returns all facts -

-

[Source]

-
-
-    # File lib/mcollective/facts/base.rb, line 71
-71:       def get_facts
-72:         get_fact(nil)
-73:       end
-
-
-
-
- -
- - - - -
-

-Returns true if we know about a specific fact, false otherwise -

-

[Source]

-
-
-    # File lib/mcollective/facts/base.rb, line 76
-76:       def has_fact?(fact)
-77:         get_fact(nil).include?(fact)
-78:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Generators.html b/doc/classes/MCollective/Generators.html deleted file mode 100644 index 7e68a34..0000000 --- a/doc/classes/MCollective/Generators.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - Module: MCollective::Generators - - - - - - - - - - - - - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Generators/AgentGenerator.html b/doc/classes/MCollective/Generators/AgentGenerator.html deleted file mode 100644 index caf5c1a..0000000 --- a/doc/classes/MCollective/Generators/AgentGenerator.html +++ /dev/null @@ -1,267 +0,0 @@ - - - - - - Class: MCollective::Generators::AgentGenerator - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Generators::AgentGenerator
In: - - lib/mcollective/generators/agent_generator.rb - -
-
Parent: - - Base - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- action_help   - create_ddl   - create_plugin_content   - new   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - -
content [RW] 
ddl [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/generators/agent_generator.rb, line 7
- 7:       def initialize(plugin_name, actions = [],  name = nil, description = nil, author = nil ,
- 8:                      license = nil, version = nil, url = nil, timeout = nil)
- 9: 
-10:         super(name, description, author, license, version, url, timeout)
-11:         @plugin_name = plugin_name
-12:         @actions = actions || []
-13:         @ddl = create_ddl
-14:         @mod_name = "Agent"
-15:         @pclass = "RPC::Agent"
-16:         @content = create_plugin_content
-17:         @plugin = create_plugin_string
-18:         write_plugins
-19:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/generators/agent_generator.rb, line 45
-45:       def action_help
-46:         action_snippet = File.read(File.join(File.dirname(__FILE__), "templates", "action_snippet.erb"))
-47:         ERB.new(action_snippet).result
-48:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/generators/agent_generator.rb, line 21
-21:       def create_ddl
-22:         action_text = ""
-23:         @actions.each_with_index do |action, i|
-24:           action_text += "action \"#{action}\", :description => \"%ACTIONDESCRIPTION%\" do\n"
-25:           action_text += action_help if i == 0
-26:           action_text += "end\n"
-27:           action_text += "\n" unless @actions.size == (i + 1)
-28:         end
-29:         # Use inherited method to create metadata part of the ddl
-30:         create_metadata_string + action_text
-31:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/generators/agent_generator.rb, line 33
-33:       def create_plugin_content
-34:         content_text = ""
-35: 
-36:         # Add actions to agent file
-37:         @actions.each_with_index do |action, i|
-38:           content_text +=  "%6s%s" % [" ", "action \"#{action}\" do\n"]
-39:           content_text +=  "%6s%s" % [" ", "end\n"]
-40:           content_text += "\n" unless @actions.size == (i + 1)
-41:         end
-42:         content_text
-43:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Generators/Base.html b/doc/classes/MCollective/Generators/Base.html deleted file mode 100644 index de6cecd..0000000 --- a/doc/classes/MCollective/Generators/Base.html +++ /dev/null @@ -1,267 +0,0 @@ - - - - - - Class: MCollective::Generators::Base - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Generators::Base
In: - - lib/mcollective/generators/base.rb - -
-
Parent: - Object -
-
- - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - -
meta [RW] 
mod_name [RW] 
plugin_name [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/generators/base.rb, line 5
- 5:       def initialize(name, description, author, license, version, url, timeout)
- 6:         @meta = {:name => name,
- 7:                  :description => description,
- 8:                  :author => author,
- 9:                  :license => license,
-10:                  :version => version,
-11:                  :url => url,
-12:                  :timeout => timeout}
-13:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/generators/base.rb, line 15
-15:       def create_metadata_string
-16:         ddl_template = File.read(File.join(File.dirname(__FILE__), "templates", "ddl.erb"))
-17:         ERB.new(ddl_template, nil, "-").result(binding)
-18:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/generators/base.rb, line 20
-20:       def create_plugin_string
-21:         plugin_template = File.read(File.join(File.dirname(__FILE__), "templates", "plugin.erb"))
-22:         ERB.new(plugin_template, nil, "-").result(binding)
-23:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/generators/base.rb, line 25
-25:       def write_plugins
-26:         begin
-27:           Dir.mkdir @plugin_name
-28:           dirname = File.join(@plugin_name, @mod_name.downcase)
-29:           Dir.mkdir dirname
-30:           puts "Created plugin directory : #{@plugin_name}"
-31: 
-32:           File.open(File.join(dirname, "#{@plugin_name}.ddl"), "w"){|f| f.puts @ddl}
-33:           puts "Created DDL file : #{File.join(dirname, "#{@plugin_name}.ddl")}"
-34: 
-35:           File.open(File.join(dirname, "#{@plugin_name}.rb"), "w"){|f| f.puts @plugin}
-36:           puts "Created #{@mod_name} file : #{File.join(dirname, "#{@plugin_name}.rb")}"
-37:         rescue Errno::EEXIST
-38:           raise "cannot generate '#{@plugin_name}' : plugin directory already exists."
-39:         rescue Exception => e
-40:           FileUtils.rm_rf(@plugin_name) if File.directory?(@plugin_name)
-41:           raise "cannot generate plugin - #{e}"
-42:         end
-43:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Generators/DataGenerator.html b/doc/classes/MCollective/Generators/DataGenerator.html deleted file mode 100644 index 16bd9df..0000000 --- a/doc/classes/MCollective/Generators/DataGenerator.html +++ /dev/null @@ -1,247 +0,0 @@ - - - - - - Class: MCollective::Generators::DataGenerator - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Generators::DataGenerator
In: - - lib/mcollective/generators/data_generator.rb - -
-
Parent: - - Base - -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- create_ddl   - create_plugin_content   - new   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - -
content [RW] 
ddl [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/generators/data_generator.rb, line 7
- 7:       def initialize(plugin_name, outputs = [],  name = nil, description = nil, author = nil ,
- 8:                      license = nil, version = nil, url = nil, timeout = nil)
- 9: 
-10:         super(name, description, author, license, version, url, timeout)
-11:         @mod_name = "Data"
-12:         @pclass = "Base"
-13:         @plugin_name = plugin_name
-14:         @outputs = outputs
-15:         @ddl = create_ddl
-16:         @content = create_plugin_content
-17:         @plugin = create_plugin_string
-18:         write_plugins
-19:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/generators/data_generator.rb, line 21
-21:       def create_ddl
-22:         query_text = "dataquery :description => \"Query information\" do\n"
-23:         query_text += ERB.new(File.read(File.join(File.dirname(__FILE__), "templates", "data_input_snippet.erb"))).result
-24: 
-25:         @outputs.each_with_index do |output,i|
-26:           query_text += "%2s%s" % [" ", "output :#{output},\n"]
-27:           query_text += "%9s%s" % [" ", ":description => \"%DESCRIPTION%\",\n"]
-28:           query_text += "%9s%s" % [" ", ":display_as => \"%DESCRIPTION%\"\n"]
-29:           query_text += "\n" unless @outputs.size == (i + 1)
-30:         end
-31: 
-32:         query_text += "end"
-33: 
-34:         # Use inherited method to create metadata part of the ddl
-35:         create_metadata_string + query_text
-36:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/generators/data_generator.rb, line 38
-38:       def create_plugin_content
-39:         content_text = "%6s%s" % [" ", "query do |what|\n"]
-40: 
-41:         @outputs.each do |output|
-42:            content_text += "%8s%s" % [" ", "result[:#{output}] = nil\n"]
-43:         end
-44:         content_text += "%6s%s" % [" ", "end\n"]
-45: 
-46:         # Add actions to agent file
-47:         content_text
-48:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/InvalidRPCData.html b/doc/classes/MCollective/InvalidRPCData.html deleted file mode 100644 index 4e1c329..0000000 --- a/doc/classes/MCollective/InvalidRPCData.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - Class: MCollective::InvalidRPCData - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::InvalidRPCData
In: - - lib/mcollective/exception.rb - -
-
Parent: - - RPCError - -
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Log.html b/doc/classes/MCollective/Log.html deleted file mode 100644 index 4d9c85a..0000000 --- a/doc/classes/MCollective/Log.html +++ /dev/null @@ -1,738 +0,0 @@ - - - - - - Class: MCollective::Log - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Log
In: - - lib/mcollective/log.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-A simple class that allows logging at various levels. -

- -
- - -
- -
-

Methods

- -
- check_level   - config_and_check_level   - configure   - cycle_level   - debug   - error   - execution_stack   - fatal   - from   - info   - instance   - log   - logexception   - logger   - logmsg   - message_for   - set_logger   - unconfigure   - valid_level?   - warn   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - -
VALID_LEVELS=[:error, :fatal, :debug, :warn, :info]
-
-
- - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/log.rb, line 55
-55:       def check_level(level)
-56:         raise "Unknown log level" unless valid_level?(level)
-57:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/log.rb, line 49
-49:       def config_and_check_level(level)
-50:         configure unless @configured
-51:         check_level(level)
-52:         @logger.should_log?(level)
-53:       end
-
-
-
-
- -
- - - - -
-

-configures the logger 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 log method will keep attempting to configure the logger till we eventually get a logging -preference from the config module -

-

[Source]

-
-
-     # File lib/mcollective/log.rb, line 130
-130:       def configure(logger=nil)
-131:         unless logger
-132:           logger_type = "console"
-133: 
-134:           config = Config.instance
-135: 
-136:           if config.configured
-137:             logger_type = config.logger_type
-138:             @configured = true
-139:           end
-140: 
-141:           require "mcollective/logger/%s_logger" % logger_type.downcase
-142: 
-143:           logger_class = MCollective::Logger.const_get("%s_logger" % logger_type.capitalize)
-144: 
-145:           set_logger(logger_class.new)
-146:         else
-147:           set_logger(logger)
-148:           @configured = true
-149:         end
-150: 
-151: 
-152:         @logger.start
-153:       rescue Exception => e
-154:         @configured = false
-155:         STDERR.puts "Could not start logger: #{e.class} #{e}"
-156:       end
-
-
-
-
- -
- - - - -
-

-increments the active log level -

-

[Source]

-
-
-    # File lib/mcollective/log.rb, line 45
-45:       def cycle_level
-46:         @logger.cycle_level if @configured
-47:       end
-
-
-
-
- -
- - - - -
-

-Logs at debug level -

-

[Source]

-
-
-    # File lib/mcollective/log.rb, line 25
-25:       def debug(msg)
-26:         log(:debug, msg)
-27:       end
-
-
-
-
- -
- - - - -
-

-Logs at error level -

-

[Source]

-
-
-    # File lib/mcollective/log.rb, line 35
-35:       def error(msg)
-36:         log(:error, msg)
-37:       end
-
-
-
-
- -
- - - - -
-

-this method is here to facilitate testing -

-

[Source]

-
-
-     # File lib/mcollective/log.rb, line 170
-170:       def execution_stack
-171:         caller
-172:       end
-
-
-
-
- -
- - - - -
-

-Logs at fatal level -

-

[Source]

-
-
-    # File lib/mcollective/log.rb, line 30
-30:       def fatal(msg)
-31:         log(:fatal, msg)
-32:       end
-
-
-
-
- -
- - - - -
-

-figures out the filename that called us -

-

[Source]

-
-
-     # File lib/mcollective/log.rb, line 164
-164:       def from
-165:         path, line, method = execution_stack[3].split(/:(\d+)/)
-166:         "%s:%s%s" % [File.basename(path), line, method]
-167:       end
-
-
-
-
- -
- - - - -
-

-Logs at info level -

-

[Source]

-
-
-    # File lib/mcollective/log.rb, line 15
-15:       def info(msg)
-16:         log(:info, msg)
-17:       end
-
-
-
-
- -
- - - - -
-

-handle old code that relied on this class being a singleton -

-

[Source]

-
-
-    # File lib/mcollective/log.rb, line 40
-40:       def instance
-41:         self
-42:       end
-
-
-
-
- -
- - - - -
-

-logs a message at a certain level -

-

[Source]

-
-
-     # File lib/mcollective/log.rb, line 106
-106:       def log(level, msg, origin=nil)
-107:         return unless config_and_check_level(level)
-108: 
-109:         origin = from unless origin
-110: 
-111:         if @logger
-112:           @logger.log(level, origin, msg)
-113:         else
-114:           t = Time.new.strftime("%H:%M:%S")
-115: 
-116:           STDERR.puts "#{t}: #{level}: #{origin}: #{msg}"
-117:         end
-118:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/log.rb, line 67
-67:       def logexception(msgid, level, e, backtrace=false, args={})
-68:         return false unless config_and_check_level(level)
-69: 
-70:         path, line, method = e.backtrace[1].split(/:(\d+)/)
-71:         origin = "%s:%s%s" % [File.basename(path), line, method]
-72: 
-73:         if e.is_a?(CodedError)
-74:           msg = "%s: %s" % [e.code, e.to_s]
-75:         else
-76:           error_string = "%s: %s" % [e.class, e.to_s]
-77:           msg = message_for(msgid, args.merge(:error => error_string))
-78:         end
-79: 
-80:         log(level, msg, origin)
-81: 
-82:         if backtrace
-83:           e.backtrace.each do |line|
-84:             log(level, "%s:          %s" % [msgid, line], origin)
-85:           end
-86:         end
-87:       end
-
-
-
-
- -
- - - - -
-

-Obtain the class name of the currently configured logger -

-

[Source]

-
-
-    # File lib/mcollective/log.rb, line 10
-10:       def logger
-11:         @logger.class
-12:       end
-
-
-
-
- -
- - - - -
-

-Logs a message at a certain level, the message must be a token that will be -looked up from the i18n localization -database -

-

-Messages can interprolate strings from the -args hash, a message with "foo %{bar}" in the localization -database will use args[:bar] for the value there, the interprolation is -handled by the i18n library itself -

-

[Source]

-
-
-     # File lib/mcollective/log.rb, line 97
- 97:       def logmsg(msgid, default, level, args={})
- 98:         return false unless config_and_check_level(level)
- 99: 
-100:         msg = message_for(msgid, {:default => default}.merge(args))
-101: 
-102:         log(level, msg)
-103:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/log.rb, line 63
-63:       def message_for(msgid, args={})
-64:         "%s: %s" % [msgid, Util.t(msgid, args)]
-65:       end
-
-
-
-
- -
- - - - -
-

-sets the logger class to use -

-

[Source]

-
-
-     # File lib/mcollective/log.rb, line 121
-121:       def set_logger(logger)
-122:         @logger = logger
-123:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/log.rb, line 158
-158:       def unconfigure
-159:         @configured = false
-160:         set_logger(nil)
-161:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/log.rb, line 59
-59:       def valid_level?(level)
-60:         VALID_LEVELS.include?(level)
-61:       end
-
-
-
-
- -
- - - - -
-

-Logs at warn level -

-

[Source]

-
-
-    # File lib/mcollective/log.rb, line 20
-20:       def warn(msg)
-21:         log(:warn, msg)
-22:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Logger.html b/doc/classes/MCollective/Logger.html deleted file mode 100644 index de8deae..0000000 --- a/doc/classes/MCollective/Logger.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - Module: MCollective::Logger - - - - - - - - - - - - - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Logger/Base.html b/doc/classes/MCollective/Logger/Base.html deleted file mode 100644 index cb3aa66..0000000 --- a/doc/classes/MCollective/Logger/Base.html +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - Class: MCollective::Logger::Base - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Logger::Base
In: - - lib/mcollective/logger/base.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-A base class for logging providers. -

-

-Logging providers should provide the following: -

-
-   * 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
-
- -
- - -
- -
-

Methods

- -
- cycle_level   - new   - set_level   - should_log?   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - -
active_level [R] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/logger/base.rb, line 14
-14:       def initialize
-15:         @known_levels = [:debug, :info, :warn, :error, :fatal]
-16: 
-17:         # Sanity check the class that impliments the logging
-18:         @known_levels.each do |lvl|
-19:           raise "Logger class did not specify a map for #{lvl}" unless valid_levels.include?(lvl)
-20:         end
-21:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Figures out the next level and sets it -

-

[Source]

-
-
-    # File lib/mcollective/logger/base.rb, line 28
-28:       def cycle_level
-29:         lvl = get_next_level
-30:         set_level(lvl)
-31: 
-32:         log(lvl, "", "Logging level is now #{lvl.to_s.upcase}")
-33:       end
-
-
-
-
- -
- - - - -
-

-Sets a new level and record it in -@active_level -

-

[Source]

-
-
-    # File lib/mcollective/logger/base.rb, line 36
-36:       def set_level(level)
-37:         set_logging_level(level)
-38:         @active_level = level.to_sym
-39:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/logger/base.rb, line 23
-23:       def should_log?(level)
-24:         @known_levels.index(level) >= @known_levels.index(@active_level)
-25:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Logger/Console_logger.html b/doc/classes/MCollective/Logger/Console_logger.html deleted file mode 100644 index 78fdc89..0000000 --- a/doc/classes/MCollective/Logger/Console_logger.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - - - Class: MCollective::Logger::Console_logger - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Logger::Console_logger
In: - - lib/mcollective/logger/console_logger.rb - -
-
Parent: - - Base - -
-
- - -
- - - -
- -
-

-Implements a syslog based logger using the standard ruby syslog class -

- -
- - -
- -
-

Methods

- -
- color   - colorize   - log   - set_logging_level   - start   - valid_levels   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

-Set some colors for various logging levels, will honor the color configuration option and -return nothing if its configured not to -

-

[Source]

-
-
-    # File lib/mcollective/logger/console_logger.rb, line 37
-37:       def color(level)
-38:         colorize = Config.instance.color
-39: 
-40:         colors = {:error => Util.color(:red),
-41:                   :fatal => Util.color(:red),
-42:                   :warn  => Util.color(:yellow),
-43:                   :info  => Util.color(:green),
-44:                   :reset => Util.color(:reset)}
-45: 
-46:         if colorize
-47:           return colors[level] || ""
-48:         else
-49:           return ""
-50:         end
-51:       end
-
-
-
-
- -
- - - - -
-

-Helper to return a string in specific color -

-

[Source]

-
-
-    # File lib/mcollective/logger/console_logger.rb, line 54
-54:       def colorize(level, msg)
-55:         "%s%s%s" % [ color(level), msg, color(:reset) ]
-56:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/logger/console_logger.rb, line 24
-24:       def log(level, from, msg, normal_output=STDERR, last_resort_output=STDERR)
-25:         time = Time.new.strftime("%Y/%m/%d %H:%M:%S")
-26: 
-27:         normal_output.puts("%s %s: %s %s" % [colorize(level, level), time, from, msg])
-28:       rescue
-29:         # if this fails we probably cant show the user output at all,
-30:         # STDERR it as last resort
-31:         last_resort_output.puts("#{level}: #{msg}")
-32:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/logger/console_logger.rb, line 12
-12:       def set_logging_level(level)
-13:         # nothing to do here, we ignore high levels when we log
-14:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/logger/console_logger.rb, line 5
- 5:       def start
- 6:         set_level(:info)
- 7: 
- 8:         config = Config.instance
- 9:         set_level(config.loglevel.to_sym) if config.configured
-10:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/logger/console_logger.rb, line 16
-16:       def valid_levels
-17:         {:info  => :info,
-18:          :warn  => :warning,
-19:          :debug => :debug,
-20:          :fatal => :crit,
-21:          :error => :err}
-22:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Logger/File_logger.html b/doc/classes/MCollective/Logger/File_logger.html deleted file mode 100644 index 93999db..0000000 --- a/doc/classes/MCollective/Logger/File_logger.html +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - Class: MCollective::Logger::File_logger - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Logger::File_logger
In: - - lib/mcollective/logger/file_logger.rb - -
-
Parent: - - Base - -
-
- - -
- - - -
- -
-

-Impliments a file based logger using the standard ruby logger class -

-

-To configure you should set: -

-
-  - config.logfile
-  - config.keeplogs defaults to 2097152
-  - config.max_log_size defaults to 5
-
- -
- - -
- -
-

Methods

- -
- log   - set_logging_level   - start   - valid_levels   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/logger/file_logger.rb, line 37
-37:       def log(level, from, msg)
-38:         @logger.add(map_level(level)) { "#{from} #{msg}" }
-39:       rescue
-40:         # if this fails we probably cant show the user output at all,
-41:         # STDERR it as last resort
-42:         STDERR.puts("#{level}: #{msg}")
-43:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/logger/file_logger.rb, line 22
-22:       def set_logging_level(level)
-23:         @logger.level = map_level(level)
-24:       rescue Exception => e
-25:         @logger.level = ::Logger::DEBUG
-26:         log(:error, "", "Could not set logging to #{level} using debug instead: #{e.class} #{e}")
-27:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/logger/file_logger.rb, line 13
-13:       def start
-14:         config = Config.instance
-15: 
-16:         @logger = ::Logger.new(config.logfile, config.keeplogs, config.max_log_size)
-17:         @logger.formatter = ::Logger::Formatter.new
-18: 
-19:         set_level(config.loglevel.to_sym)
-20:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/logger/file_logger.rb, line 29
-29:       def valid_levels
-30:         {:info  => ::Logger::INFO,
-31:          :warn  => ::Logger::WARN,
-32:          :debug => ::Logger::DEBUG,
-33:          :fatal => ::Logger::FATAL,
-34:          :error => ::Logger::ERROR}
-35:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Logger/Syslog_logger.html b/doc/classes/MCollective/Logger/Syslog_logger.html deleted file mode 100644 index 3a57425..0000000 --- a/doc/classes/MCollective/Logger/Syslog_logger.html +++ /dev/null @@ -1,278 +0,0 @@ - - - - - - Class: MCollective::Logger::Syslog_logger - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Logger::Syslog_logger
In: - - lib/mcollective/logger/syslog_logger.rb - -
-
Parent: - - Base - -
-
- - -
- - - -
- -
-

-Implements a syslog based logger using the standard ruby syslog class -

- -
- - -
- -
-

Methods

- -
- log   - set_logging_level   - start   - syslog_facility   - valid_levels   -
-
- -
- - - -
-

Included Modules

- -
- Syslog::Constants -
-
- -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/logger/syslog_logger.rb, line 42
-42:       def log(level, from, msg)
-43:         Syslog.send(map_level(level), "#{from} #{msg}")
-44:       rescue
-45:         # if this fails we probably cant show the user output at all,
-46:         # STDERR it as last resort
-47:         STDERR.puts("#{level}: #{msg}")
-48:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/logger/syslog_logger.rb, line 30
-30:       def set_logging_level(level)
-31:         # noop
-32:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/logger/syslog_logger.rb, line 9
- 9:       def start
-10:         config = Config.instance
-11: 
-12:         facility = syslog_facility(config.logfacility)
-13:         level = config.loglevel.to_sym
-14: 
-15:         Syslog.close if Syslog.opened?
-16:         Syslog.open(File.basename($0), 3, facility)
-17: 
-18:         set_level(level)
-19:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/logger/syslog_logger.rb, line 21
-21:       def syslog_facility(facility)
-22:         begin
-23:           Syslog.const_get("LOG_#{facility.upcase}")
-24:         rescue NameError => e
-25:           STDERR.puts "Invalid syslog facility #{facility} supplied, reverting to USER"
-26:           Syslog::LOG_USER
-27:         end
-28:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/logger/syslog_logger.rb, line 34
-34:       def valid_levels
-35:         {:info  => :info,
-36:          :warn  => :warning,
-37:          :debug => :debug,
-38:          :fatal => :crit,
-39:          :error => :err}
-40:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Matcher/Scanner.html b/doc/classes/MCollective/Matcher/Scanner.html deleted file mode 100644 index a72088f..0000000 --- a/doc/classes/MCollective/Matcher/Scanner.html +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - Class: MCollective::Matcher::Scanner - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Matcher::Scanner
In: - - lib/mcollective/matcher/scanner.rb - -
-
Parent: - Object -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- get_token   - new   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - -
arguments [RW] 
token_index [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/matcher/scanner.rb, line 6
- 6:       def initialize(arguments)
- 7:         @token_index = 0
- 8:         @arguments = arguments.split("")
- 9:         @seperation_counter = 0
-10:         @white_spaces = 0
-11:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Scans the input string and identifies single language tokens -

-

[Source]

-
-
-    # File lib/mcollective/matcher/scanner.rb, line 14
-14:       def get_token
-15:         if @token_index >= @arguments.size
-16:           return nil
-17:         end
-18: 
-19:         case @arguments[@token_index]
-20:         when "("
-21:           return "(", "("
-22: 
-23:         when ")"
-24:           return ")", ")"
-25: 
-26:         when "n"
-27:           if (@arguments[@token_index + 1] == "o") && (@arguments[@token_index + 2] == "t") && ((@arguments[@token_index + 3] == " ") || (@arguments[@token_index + 3] == "("))
-28:             @token_index += 2
-29:             return "not", "not"
-30:           else
-31:             gen_statement
-32:           end
-33: 
-34:         when "!"
-35:           return "not", "not"
-36: 
-37:         when "a"
-38:           if (@arguments[@token_index + 1] == "n") && (@arguments[@token_index + 2] == "d") && ((@arguments[@token_index + 3] == " ") || (@arguments[@token_index + 3] == "("))
-39:             @token_index += 2
-40:             return "and", "and"
-41:           else
-42:             gen_statement
-43:           end
-44: 
-45:         when "o"
-46:           if (@arguments[@token_index + 1] == "r") && ((@arguments[@token_index + 2] == " ") || (@arguments[@token_index + 2] == "("))
-47:             @token_index += 1
-48:             return "or", "or"
-49:           else
-50:             gen_statement
-51:           end
-52: 
-53:         when " "
-54:           return " ", " "
-55: 
-56:         else
-57:           gen_statement
-58:         end
-59:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Message.html b/doc/classes/MCollective/Message.html deleted file mode 100644 index f8583ae..0000000 --- a/doc/classes/MCollective/Message.html +++ /dev/null @@ -1,728 +0,0 @@ - - - - - - Class: MCollective::Message - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Message
In: - - lib/mcollective/message.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-container for a message, its headers, agent, collective and other meta data -

- -
- - -
- -
-

Methods

- -
- base64?   - base64_decode!   - base64_encode!   - create_reqid   - decode!   - encode!   - expected_msgid=   - new   - publish   - reply_to=   - type=   - validate   - validate_compound_filter   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - -
VALIDTYPES=[:message, :request, :direct_request, :reply]
-
-
- - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
agent [RW] 
collective [RW] 
discovered_hosts [RW] 
expected_msgid [R] 
filter [RW] 
headers [RW] 
message [R] 
msgtime [R] 
options [RW] 
payload [R] 
reply_to [R] 
request [R] 
requestid [RW] 
ttl [RW] 
type [R] 
validated [R] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

-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 -

-

[Source]

-
-
-    # File lib/mcollective/message.rb, line 23
-23:     def initialize(payload, message, options = {})
-24:       options = {:base64 => false,
-25:                  :agent => nil,
-26:                  :headers => {},
-27:                  :type => :message,
-28:                  :request => nil,
-29:                  :filter => Util.empty_filter,
-30:                  :options => {},
-31:                  :ttl => 60,
-32:                  :expected_msgid => nil,
-33:                  :requestid => nil,
-34:                  :collective => nil}.merge(options)
-35: 
-36:       @payload = payload
-37:       @message = message
-38:       @requestid = options[:requestid]
-39:       @discovered_hosts = nil
-40:       @reply_to = nil
-41: 
-42:       @type = options[:type]
-43:       @headers = options[:headers]
-44:       @base64 = options[:base64]
-45:       @filter = options[:filter]
-46:       @expected_msgid = options[:expected_msgid]
-47:       @options = options[:options]
-48: 
-49:       @ttl = @options[:ttl] || Config.instance.ttl
-50:       @msgtime = 0
-51: 
-52:       @validated = false
-53: 
-54:       if options[:request]
-55:         @request = options[:request]
-56:         @agent = request.agent
-57:         @collective = request.collective
-58:         @type = :reply
-59:       else
-60:         @agent = options[:agent]
-61:         @collective = options[:collective]
-62:       end
-63: 
-64:       base64_decode!
-65:     end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/message.rb, line 129
-129:     def base64?
-130:       @base64
-131:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/message.rb, line 115
-115:     def base64_decode!
-116:       return unless @base64
-117: 
-118:       @payload = SSL.base64_decode(@payload)
-119:       @base64 = false
-120:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/message.rb, line 122
-122:     def base64_encode!
-123:       return if @base64
-124: 
-125:       @payload = SSL.base64_encode(@payload)
-126:       @base64 = true
-127:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/message.rb, line 226
-226:     def create_reqid
-227:       # we gsub out the -s so that the format of the id does not
-228:       # change from previous versions, these should just be more
-229:       # unique than previous ones
-230:       SSL.uuid.gsub("-", "")
-231:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/message.rb, line 175
-175:     def decode!
-176:       raise "Cannot decode message type #{type}" unless [:request, :reply].include?(type)
-177: 
-178:       @payload = PluginManager["security_plugin"].decodemsg(self)
-179: 
-180:       if type == :request
-181:         raise 'callerid in request is not valid, surpressing reply to potentially forged request' unless PluginManager["security_plugin"].valid_callerid?(payload[:callerid])
-182:       end
-183: 
-184:       [:collective, :agent, :filter, :requestid, :ttl, :msgtime].each do |prop|
-185:         instance_variable_set("@#{prop}", payload[prop]) if payload.include?(prop)
-186:       end
-187:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/message.rb, line 133
-133:     def encode!
-134:       case type
-135:         when :reply
-136:           raise "Cannot encode a reply message if no request has been associated with it" unless request
-137:           raise 'callerid in original request is not valid, surpressing reply to potentially forged request' unless PluginManager["security_plugin"].valid_callerid?(request.payload[:callerid])
-138: 
-139:           @requestid = request.payload[:requestid]
-140:           @payload = PluginManager["security_plugin"].encodereply(agent, payload, requestid, request.payload[:callerid])
-141:         when :request, :direct_request
-142:           validate_compound_filter(@filter["compound"]) unless @filter["compound"].empty?
-143: 
-144:           @requestid = create_reqid unless @requestid
-145:           @payload = PluginManager["security_plugin"].encoderequest(Config.instance.identity, payload, requestid, filter, agent, collective, ttl)
-146:         else
-147:           raise "Cannot encode #{type} messages"
-148:       end
-149:     end
-
-
-
-
- -
- - - - -
-

-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. -

-

[Source]

-
-
-     # File lib/mcollective/message.rb, line 110
-110:     def expected_msgid=(msgid)
-111:       raise "Can only store the expected msgid for reply messages" unless @type == :reply
-112:       @expected_msgid = msgid
-113:     end
-
-
-
-
- -
- - - - -
-

-publish a reply message by creating a -target name and sending it -

-

[Source]

-
-
-     # File lib/mcollective/message.rb, line 213
-213:     def publish
-214:       # If we've been specificaly told about hosts that were discovered
-215:       # use that information to do P2P calls if appropriate else just
-216:       # send it as is.
-217:       config = Config.instance
-218:       if @discovered_hosts && config.direct_addressing && (@discovered_hosts.size <= config.direct_addressing_threshold)
-219:         self.type = :direct_request
-220:         Log.debug("Handling #{requestid} as a direct request")
-221:       end
-222: 
-223:       PluginManager['connector_plugin'].publish(self)
-224:     end
-
-
-
-
- -
- - - - -
-

-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 -

-

[Source]

-
-
-     # File lib/mcollective/message.rb, line 99
- 99:     def reply_to=(target)
-100:       raise "Custom reply targets can only be set on requests" unless [:request, :direct_request].include?(@type)
-101: 
-102:       @reply_to = target
-103:     end
-
-
-
-
- -
- - - - -
-

-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. -

-

-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. -

-

[Source]

-
-
-    # File lib/mcollective/message.rb, line 76
-76:     def type=(type)
-77:       raise "Unknown message type #{type}" unless VALIDTYPES.include?(type)
-78: 
-79:       if type == :direct_request
-80:         raise "Direct requests is not enabled using the direct_addressing config option" unless Config.instance.direct_addressing
-81: 
-82:         unless @discovered_hosts && !@discovered_hosts.empty?
-83:           raise "Can only set type to :direct_request if discovered_hosts have been set"
-84:         end
-85: 
-86:         # clear out the filter, custom discovery sources might interpret the filters
-87:         # different than the remote mcollectived and in directed mode really the only
-88:         # filter that matters is the agent filter
-89:         @filter = Util.empty_filter
-90:         @filter["agent"] << @agent
-91:       end
-92: 
-93:       @type = type
-94:     end
-
-
-
-
- -
- - - - -
-

-Perform validation against the message by checking filters and ttl -

-

[Source]

-
-
-     # File lib/mcollective/message.rb, line 190
-190:     def validate
-191:       raise "Can only validate request messages" unless type == :request
-192: 
-193:       msg_age = Time.now.utc.to_i - msgtime
-194: 
-195:       if msg_age > ttl
-196:         cid = ""
-197:         cid += payload[:callerid] + "@" if payload.include?(:callerid)
-198:         cid += payload[:senderid]
-199: 
-200:         if msg_age > ttl
-201:           PluginManager["global_stats"].ttlexpired
-202: 
-203:           raise(MsgTTLExpired, "message #{requestid} from #{cid} created at #{msgtime} is #{msg_age} seconds old, TTL is #{ttl}")
-204:         end
-205:       end
-206: 
-207:       raise(NotTargettedAtUs, "Received message is not targetted to us") unless PluginManager["security_plugin"].validate_filter?(payload[:filter])
-208: 
-209:       @validated = true
-210:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/message.rb, line 151
-151:     def validate_compound_filter(compound_filter)
-152:       compound_filter.each do |filter|
-153:         filter.each do |statement|
-154:           if statement["fstatement"]
-155:             functionname = statement["fstatement"]["name"]
-156:             pluginname = Data.pluginname(functionname)
-157:             value = statement["fstatement"]["value"]
-158: 
-159:             ddl = DDL.new(pluginname, :data)
-160: 
-161:             # parses numbers and booleans entered as strings into proper
-162:             # types of data so that DDL validation will pass
-163:             statement["fstatement"]["params"] = Data.ddl_transform_input(ddl, statement["fstatement"]["params"])
-164: 
-165:             Data.ddl_validate(ddl, statement["fstatement"]["params"])
-166: 
-167:             unless value && Data.ddl_has_output?(ddl, value)
-168:               DDL.validation_fail!(:PLMC41, "Data plugin '%{functionname}()' does not return a '%{value}' value", :error, {:functionname => functionname, :value => value})
-169:             end
-170:           end
-171:         end
-172:       end
-173:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/MissingRPCData.html b/doc/classes/MCollective/MissingRPCData.html deleted file mode 100644 index 8181974..0000000 --- a/doc/classes/MCollective/MissingRPCData.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - Class: MCollective::MissingRPCData - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::MissingRPCData
In: - - lib/mcollective/exception.rb - -
-
Parent: - - RPCError - -
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/MsgDoesNotMatchRequestID.html b/doc/classes/MCollective/MsgDoesNotMatchRequestID.html deleted file mode 100644 index 7d57933..0000000 --- a/doc/classes/MCollective/MsgDoesNotMatchRequestID.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Class: MCollective::MsgDoesNotMatchRequestID - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::MsgDoesNotMatchRequestID
In: - - lib/mcollective/exception.rb - -
-
Parent: - RuntimeError -
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/MsgTTLExpired.html b/doc/classes/MCollective/MsgTTLExpired.html deleted file mode 100644 index 182a9a7..0000000 --- a/doc/classes/MCollective/MsgTTLExpired.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Class: MCollective::MsgTTLExpired - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::MsgTTLExpired
In: - - lib/mcollective/exception.rb - -
-
Parent: - RuntimeError -
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/NotTargettedAtUs.html b/doc/classes/MCollective/NotTargettedAtUs.html deleted file mode 100644 index 7ca3d44..0000000 --- a/doc/classes/MCollective/NotTargettedAtUs.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Class: MCollective::NotTargettedAtUs - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::NotTargettedAtUs
In: - - lib/mcollective/exception.rb - -
-
Parent: - RuntimeError -
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/PluginManager.html b/doc/classes/MCollective/PluginManager.html deleted file mode 100644 index 0e2d714..0000000 --- a/doc/classes/MCollective/PluginManager.html +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - Module: MCollective::PluginManager - - - - - - - - - - -
- - - - - - - - - - -
ModuleMCollective::PluginManager
In: - - lib/mcollective/pluginmanager.rb - -
-
-
- - -
- - - -
- -
-

-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. -

- -
- - -
- -
-

Methods

- -
- <<   - []   - clear   - create_instance   - delete   - find   - find_and_load   - grep   - include?   - loadclass   - pluginlist   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

-Adds a plugin to the list of plugins, we expect a hash like: -

-
-   {:type => "base",
-    :class => foo.new}
-
-

-or like: -

-
-   {:type => "base",
-    :class => "Foo::Bar"}
-
-

-In the event that we already have a class with the given type an exception -will be raised. -

-

-If the :class passed is a String 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. -

-

-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 [] -

-

-By default all plugin instances are cached and returned later so -there‘s always a single instance. You can pass :single_instance => -false when calling this to instruct it to always return a new instance when -a copy is requested. This only works with sending a String for :class. -

-

[Source]

-
-
-    # File lib/mcollective/pluginmanager.rb, line 30
-30:     def self.<<(plugin)
-31:       plugin[:single_instance] = true unless plugin.include?(:single_instance)
-32: 
-33:       type = plugin[:type]
-34:       klass = plugin[:class]
-35:       single = plugin[:single_instance]
-36: 
-37:       raise("Plugin #{type} already loaded") if @plugins.include?(type)
-38: 
-39: 
-40:       # If we get a string then store 'nil' as the instance, signalling that we'll
-41:       # create the class later on demand.
-42:       if klass.is_a?(String)
-43:         @plugins[type] = {:loadtime => Time.now, :class => klass, :instance => nil, :single => single}
-44:         Log.debug("Registering plugin #{type} with class #{klass} single_instance: #{single}")
-45:       else
-46:         @plugins[type] = {:loadtime => Time.now, :class => klass.class, :instance => klass, :single => true}
-47:         Log.debug("Registering plugin #{type} with class #{klass.class} single_instance: true")
-48:       end
-49:     end
-
-
-
-
- -
- - - - -
-

-Gets a plugin by type -

-

[Source]

-
-
-    # File lib/mcollective/pluginmanager.rb, line 72
-72:     def self.[](plugin)
-73:       raise("No plugin #{plugin} defined") unless @plugins.include?(plugin)
-74: 
-75:       klass = @plugins[plugin][:class]
-76: 
-77:       if @plugins[plugin][:single]
-78:         # Create an instance of the class if one hasn't been done before
-79:         if @plugins[plugin][:instance] == nil
-80:           Log.debug("Returning new plugin #{plugin} with class #{klass}")
-81:           @plugins[plugin][:instance] = create_instance(klass)
-82:         else
-83:           Log.debug("Returning cached plugin #{plugin} with class #{klass}")
-84:         end
-85: 
-86:         @plugins[plugin][:instance]
-87:       else
-88:         Log.debug("Returning new plugin #{plugin} with class #{klass}")
-89:         create_instance(klass)
-90:       end
-91:     end
-
-
-
-
- -
- - - - -
-

-deletes all registered plugins -

-

[Source]

-
-
-    # File lib/mcollective/pluginmanager.rb, line 67
-67:     def self.clear
-68:       @plugins.clear
-69:     end
-
-
-
-
- -
- - - - -
-

-use eval to create an instance of a class -

-

[Source]

-
-
-     # File lib/mcollective/pluginmanager.rb, line 94
- 94:     def self.create_instance(klass)
- 95:       begin
- 96:         eval("#{klass}.new")
- 97:       rescue Exception => e
- 98:         raise("Could not create instance of plugin #{klass}: #{e}")
- 99:       end
-100:     end
-
-
-
-
- -
- - - - -
-

-Removes a plugim the list -

-

[Source]

-
-
-    # File lib/mcollective/pluginmanager.rb, line 52
-52:     def self.delete(plugin)
-53:       @plugins.delete(plugin) if @plugins.include?(plugin)
-54:     end
-
-
-
-
- -
- - - - -
-

-Finds plugins in all configured libdirs -

-
-  find("agent")
-
-

-will return an array of just agent names, for example: -

-
-  ["puppetd", "package"]
-
-

-Can also be used to find files of -other extensions: -

-
-  find("agent", "ddl")
-
-

-Will return the same list but only of files with extension .ddl in the -agent subdirectory -

-

[Source]

-
-
-     # File lib/mcollective/pluginmanager.rb, line 116
-116:     def self.find(type, extension="rb")
-117:       extension = ".#{extension}" unless extension.match(/^\./)
-118: 
-119:       plugins = []
-120: 
-121:       Config.instance.libdir.each do |libdir|
-122:         plugdir = File.join([libdir, "mcollective", type.to_s])
-123:         next unless File.directory?(plugdir)
-124: 
-125:         Dir.new(plugdir).grep(/#{extension}$/).map do |plugin|
-126:           plugins << File.basename(plugin, extension)
-127:         end
-128:       end
-129: 
-130:       plugins.sort.uniq
-131:     end
-
-
-
-
- -
- - - - -
-

-Finds and loads from disk all plugins from all libdirs that match certain -criteria. -

-
-   find_and_load("pluginpackager")
-
-

-Will find all .rb files in the -libdir/mcollective/pluginpackager/ directory in all libdirs and load them -from disk. -

-

-You can influence what plugins get loaded using a block notation: -

-
-   find_and_load("pluginpackager") do |plugin|
-      plugin.match(/puppet/)
-   end
-
-

-This will load only plugins matching /puppet/ -

-

[Source]

-
-
-     # File lib/mcollective/pluginmanager.rb, line 148
-148:     def self.find_and_load(type, extension="rb")
-149:       extension = ".#{extension}" unless extension.match(/^\./)
-150: 
-151:       klasses = find(type, extension).map do |plugin|
-152:         if block_given?
-153:           next unless yield(plugin)
-154:         end
-155: 
-156:         "%s::%s::%s" % [ "MCollective", type.capitalize, plugin.capitalize ]
-157:       end.compact
-158: 
-159:       klasses.sort.uniq.each {|klass| loadclass(klass, true)}
-160:     end
-
-
-
-
- -
- - - - -
-

-Grep‘s over the plugin list and returns the list found -

-

[Source]

-
-
-     # File lib/mcollective/pluginmanager.rb, line 176
-176:     def self.grep(regex)
-177:       @plugins.keys.grep(regex)
-178:     end
-
-
-
-
- -
- - - - -
-

-Finds out if we have a plugin with the given name -

-

[Source]

-
-
-    # File lib/mcollective/pluginmanager.rb, line 57
-57:     def self.include?(plugin)
-58:       @plugins.include?(plugin)
-59:     end
-
-
-
-
- -
- - - - -
-

-Loads a class from file by doing some simple search/replace on class names -and then doing a require. -

-

[Source]

-
-
-     # File lib/mcollective/pluginmanager.rb, line 164
-164:     def self.loadclass(klass, squash_failures=false)
-165:       fname = klass.gsub("::", "/").downcase + ".rb"
-166: 
-167:       Log.debug("Loading #{klass} from #{fname}")
-168: 
-169:       load fname
-170:     rescue Exception => e
-171:       Log.error("Failed to load #{klass}: #{e}")
-172:       raise unless squash_failures
-173:     end
-
-
-
-
- -
- - - - -
-

-Provides a list of plugins we know about -

-

[Source]

-
-
-    # File lib/mcollective/pluginmanager.rb, line 62
-62:     def self.pluginlist
-63:       @plugins.keys.sort
-64:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/PluginPackager.html b/doc/classes/MCollective/PluginPackager.html deleted file mode 100644 index 6b5a6c2..0000000 --- a/doc/classes/MCollective/PluginPackager.html +++ /dev/null @@ -1,383 +0,0 @@ - - - - - - Module: MCollective::PluginPackager - - - - - - - - - - - - - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/pluginpackager.rb, line 12
-12:     def self.[](klass)
-13:       const_get("#{klass}")
-14:     end
-
-
-
-
- -
- - - - -
-

-Checks if a directory is present and not empty -

-

[Source]

-
-
-    # File lib/mcollective/pluginpackager.rb, line 31
-31:     def self.check_dir_present(path)
-32:       (File.directory?(path) && !Dir.glob(File.join(path, "*")).empty?)
-33:     end
-
-
-
-
- -
- - - - -
-

-Checks if a build tool is present on the system -

-

[Source]

-
-
-    # File lib/mcollective/pluginpackager.rb, line 54
-54:     def self.command_available?(build_tool)
-55:       ENV["PATH"].split(File::PATH_SEPARATOR).each do |path|
-56:         builder = File.join(path, build_tool)
-57:         if File.exists?(builder)
-58:           return true
-59:         end
-60:       end
-61:       false
-62:     end
-
-
-
-
- -
- - - - -
-

-Quietly calls a block if verbose parameter is false -

-

[Source]

-
-
-    # File lib/mcollective/pluginpackager.rb, line 36
-36:     def self.execute_verbosely(verbose, &block)
-37:       unless verbose
-38:         old_stdout = $stdout.clone
-39:         $stdout.reopen(File.new("/dev/null", "w"))
-40:         begin
-41:           block.call
-42:         rescue Exception => e
-43:           $stdout.reopen old_stdout
-44:           raise e
-45:         ensure
-46:           $stdout.reopen old_stdout
-47:         end
-48:       else
-49:         block.call
-50:       end
-51:     end
-
-
-
-
- -
- - - - -
-

-Filter out platform specific dependencies Given a list of dependencies -named - debian::foo redhat::bar PluginPackager.filter_dependencies(‘debian’, -dependencies) will return foo. -

-

[Source]

-
-
-    # File lib/mcollective/pluginpackager.rb, line 74
-74:     def self.filter_dependencies(prefix, dependencies)
-75:       dependencies.map do |dependency|
-76:         if dependency[:name] =~ /^(\w+)::(\w+)/
-77:           if prefix == $1
-78:             dependency[:name] = $2
-79:             dependency
-80:           else
-81:             nil
-82:           end
-83:         else
-84:           dependency
-85:         end
-86:       end.reject{ |dependency| dependency == nil }
-87:     end
-
-
-
-
- -
- - - - -
-

-Fetch and return metadata from plugin DDL -

-

[Source]

-
-
-    # File lib/mcollective/pluginpackager.rb, line 17
-17:     def self.get_metadata(path, type)
-18:       ddl = DDL.new("package", type.to_sym, false)
-19: 
-20:       begin
-21:         ddl_file = File.read(Dir.glob(File.join(path, type, "*.ddl")).first)
-22:       rescue Exception
-23:         raise "failed to load ddl file in plugin directory : #{File.join(path, type)}"
-24:       end
-25:       ddl.instance_eval ddl_file
-26: 
-27:       return ddl.meta, ddl.requirements[:mcollective]
-28:     end
-
-
-
-
- -
- - - - -
-

-Package implementation plugins -

-

[Source]

-
-
-    # File lib/mcollective/pluginpackager.rb, line 8
- 8:     def self.load_packagers
- 9:       PluginManager.find_and_load("pluginpackager")
-10:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/pluginpackager.rb, line 64
-64:     def self.safe_system(*args)
-65:       raise(RuntimeError, "Failed: #{args.join(' ')}") unless system *args
-66:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/PluginPackager/AgentDefinition.html b/doc/classes/MCollective/PluginPackager/AgentDefinition.html deleted file mode 100644 index 4b89ce6..0000000 --- a/doc/classes/MCollective/PluginPackager/AgentDefinition.html +++ /dev/null @@ -1,394 +0,0 @@ - - - - - - Class: MCollective::PluginPackager::AgentDefinition - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::PluginPackager::AgentDefinition
In: - - lib/mcollective/pluginpackager/agent_definition.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-MCollective Agent Plugin package -

- -
- - -
- -
-

Methods

- -
- agent   - client   - common   - identify_packages   - new   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
dependencies [RW] 
mcname [RW] 
mcversion [RW] 
metadata [RW] 
packagedata [RW] 
path [RW] 
plugintype [RW] 
postinstall [RW] 
preinstall [RW] 
revision [RW] 
target_path [RW] 
vendor [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/pluginpackager/agent_definition.rb, line 8
- 8:       def initialize(configuration, mcdependency, plugintype)
- 9:         @plugintype = plugintype
-10:         @path = configuration[:target]
-11:         @packagedata = {}
-12:         @revision = configuration[:revision] || 1
-13:         @preinstall = configuration[:preinstall]
-14:         @postinstall = configuration[:postinstall]
-15:         @vendor = configuration[:vendor] || "Puppet Labs"
-16:         @dependencies = configuration[:dependency] || []
-17:         @target_path = File.expand_path(@path)
-18:         @metadata, mcversion = PluginPackager.get_metadata(@path, "agent")
-19:         @mcname = mcdependency[:mcname] ||  "mcollective"
-20:         @mcversion = mcdependency[:mcversion] || mcversion
-21:         @metadata[:version] = (configuration[:version] || @metadata[:version])
-22:         @dependencies << {:name => "#{@mcname}-common", :version => @mcversion}
-23:         @metadata[:name] = (configuration[:pluginname] || @metadata[:name]).downcase.gsub(/\s+|_/, "-")
-24:         identify_packages
-25:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Obtain Agent package files and dependencies. -

-

[Source]

-
-
-    # File lib/mcollective/pluginpackager/agent_definition.rb, line 38
-38:       def agent
-39:         agent = {:files => [],
-40:                  :dependencies => @dependencies.clone,
-41:                  :description => "Agent plugin for #{@metadata[:name]}"}
-42: 
-43:         agentdir = File.join(@path, "agent")
-44: 
-45:         if PluginPackager.check_dir_present agentdir
-46:           ddls = Dir.glob(File.join(agentdir, "*.ddl"))
-47:           agent[:files] = (Dir.glob(File.join(agentdir, "*")) - ddls)
-48:         else
-49:           return nil
-50:         end
-51:         agent[:plugindependency] = {:name => "#{@mcname}-#{@metadata[:name]}-common", :version => @metadata[:version], :revision => @revision}
-52:         agent
-53:       end
-
-
-
-
- -
- - - - -
-

-Obtain client package files and -dependencies. -

-

[Source]

-
-
-    # File lib/mcollective/pluginpackager/agent_definition.rb, line 56
-56:       def client
-57:         client = {:files => [],
-58:                   :dependencies => @dependencies.clone,
-59:                   :description => "Client plugin for #{@metadata[:name]}"}
-60: 
-61:         clientdir = File.join(@path, "application")
-62:         aggregatedir = File.join(@path, "aggregate")
-63: 
-64:         client[:files] += Dir.glob(File.join(clientdir, "*")) if PluginPackager.check_dir_present clientdir
-65:         client[:files] += Dir.glob(File.join(aggregatedir, "*")) if PluginPackager.check_dir_present aggregatedir
-66:         client[:plugindependency] = {:name => "#{@mcname}-#{@metadata[:name]}-common", :version => @metadata[:version], :revision => @revision}
-67:         client[:files].empty? ? nil : client
-68:       end
-
-
-
-
- -
- - - - -
-

-Obtain common package files and -dependencies. -

-

[Source]

-
-
-    # File lib/mcollective/pluginpackager/agent_definition.rb, line 71
-71:       def common
-72:         common = {:files =>[],
-73:                   :dependencies => @dependencies.clone,
-74:                   :description => "Common libraries for #{@metadata[:name]}"}
-75: 
-76:         datadir = File.join(@path, "data", "**")
-77:         utildir = File.join(@path, "util", "**", "**")
-78:         ddldir = File.join(@path, "agent", "*.ddl")
-79:         validatordir = File.join(@path, "validator", "**")
-80: 
-81:         [datadir, utildir, validatordir, ddldir].each do |directory|
-82:           common[:files] += Dir.glob(directory)
-83:         end
-84: 
-85:         # We fail if there is no ddl file present
-86:         if common[:files].grep(/^.*\.ddl$/).empty?
-87:           raise "cannot create package - No ddl file found in #{File.join(@path, "agent")}"
-88:         end
-89: 
-90:         common[:files].empty? ? nil : common
-91:       end
-
-
-
-
- -
- - - - -
-

-Identify present packages and populate packagedata hash. -

-

[Source]

-
-
-    # File lib/mcollective/pluginpackager/agent_definition.rb, line 28
-28:       def identify_packages
-29:         common_package = common
-30:         @packagedata[:common] = common_package if common_package
-31:         agent_package = agent
-32:         @packagedata[:agent] = agent_package if agent_package
-33:         client_package = client
-34:         @packagedata[:client] = client_package if client_package
-35:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/PluginPackager/StandardDefinition.html b/doc/classes/MCollective/PluginPackager/StandardDefinition.html deleted file mode 100644 index d190b63..0000000 --- a/doc/classes/MCollective/PluginPackager/StandardDefinition.html +++ /dev/null @@ -1,340 +0,0 @@ - - - - - - Class: MCollective::PluginPackager::StandardDefinition - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::PluginPackager::StandardDefinition
In: - - lib/mcollective/pluginpackager/standard_definition.rb - -
-
Parent: - Object -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- common   - identify_packages   - new   - plugin   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
dependencies [RW] 
mcname [RW] 
mcversion [RW] 
metadata [RW] 
packagedata [RW] 
path [RW] 
plugintype [RW] 
postinstall [RW] 
preinstall [RW] 
revision [RW] 
target_path [RW] 
vendor [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/pluginpackager/standard_definition.rb, line 7
- 7:       def initialize(configuration, mcdependency, plugintype)
- 8:         @plugintype = plugintype
- 9:         @path = configuration[:target]
-10:         @packagedata = {}
-11:         @revision = configuration[:revision] || 1
-12:         @preinstall = configuration[:preinstall]
-13:         @postinstall = configuration[:postinstall]
-14:         @vendor = configuration[:vendor] || "Puppet Labs"
-15:         @dependencies = configuration[:dependency] || []
-16:         @target_path = File.expand_path(@path)
-17:         @metadata, mcversion = PluginPackager.get_metadata(@path, @plugintype)
-18:         @mcname = mcdependency[:mcname] || "mcollective"
-19:         @mcversion = mcdependency[:mcversion] || mcversion
-20:         @dependencies << {:name => "#{mcname}-common", :version => @mcversion}
-21:         @metadata[:name] = (configuration[:pluginname] || @metadata[:name]).downcase.gsub(/\s+|_/, "-")
-22:         @metadata[:version] = (configuration[:version] || @metadata[:version])
-23:         identify_packages
-24:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Obtain list of common files -

-

[Source]

-
-
-    # File lib/mcollective/pluginpackager/standard_definition.rb, line 54
-54:       def common
-55:         common = {:files => [],
-56:                   :dependencies => @dependencies.clone,
-57:                   :description => "Common libraries for #{@name} connector plugin"}
-58: 
-59:         commondir = File.join(@path, "util")
-60:         if PluginPackager.check_dir_present commondir
-61:           common[:files] = Dir.glob(File.join(commondir, "*"))
-62:           return common
-63:         else
-64:           return nil
-65:         end
-66:       end
-
-
-
-
- -
- - - - -
-

-Identify present packages and populate the packagedata hash -

-

[Source]

-
-
-    # File lib/mcollective/pluginpackager/standard_definition.rb, line 27
-27:       def identify_packages
-28:         common_package = common
-29:         @packagedata[:common] = common_package if common_package
-30:         plugin_package = plugin
-31:         @packagedata[@plugintype.to_sym] = plugin_package if plugin_package
-32:       end
-
-
-
-
- -
- - - - -
-

-Obtain standard plugin files -and dependencies -

-

[Source]

-
-
-    # File lib/mcollective/pluginpackager/standard_definition.rb, line 35
-35:       def plugin
-36:         plugindata = {:files => [],
-37:                       :dependencies => @dependencies.clone,
-38:                       :description => "#{@name} #{@plugintype} plugin for the Marionette Collective."}
-39: 
-40:         plugindir = File.join(@path, @plugintype.to_s)
-41:         if PluginPackager.check_dir_present plugindir
-42:           plugindata[:files] = Dir.glob(File.join(plugindir, "*"))
-43:         else
-44:           return nil
-45:         end
-46: 
-47:         plugindata[:plugindependency] = {:name => "#{@mcname}-#{@metadata[:name]}-common",
-48:                                       :version => @metadata[:version],
-49:                                       :revision => @revision} if @packagedata[:common]
-50:         plugindata
-51:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/RPC.html b/doc/classes/MCollective/RPC.html deleted file mode 100644 index 23c2f74..0000000 --- a/doc/classes/MCollective/RPC.html +++ /dev/null @@ -1,539 +0,0 @@ - - - - - - Module: MCollective::RPC - - - - - - - - - - - - - -
- - - -
- -
-

-Toolset to create a standard interface of client and agent using an RPC metaphor, standard compliant agents will make it -easier to create generic clients like web interfaces etc -

- -
- - -
- -
-

Methods

- -
- const_missing   - discovered   - empty_filter?   - printrpc   - printrpcstats   - rpcclient   - rpcoptions   - stats   -
-
- -
- - - - -
- - - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/rpc.rb, line 175
-175:     def self.const_missing(const_name)
-176:       super unless const_name == :DDL
-177: 
-178:       Log.warn("MCollective::RPC::DDL is deprecatd, please use MCollective::DDL instead")
-179:       MCollective::DDL
-180:     end
-
-
-
-
- -
- - - - -
-

-means for other classes to drop discovered -hosts into this module its a bit hacky but needed so that the mixin methods -like printrpcstats can easily get access to -it without users having to pass it around in params. -

-

[Source]

-
-
-     # File lib/mcollective/rpc.rb, line 107
-107:     def self.discovered(discovered)
-108:       @@discovered = discovered
-109:     end
-
-
-
-
- -
- - - - -
-

-means for other classes to drop stats into -this module its a bit hacky but needed so that the mixin methods like printrpcstats can easily get access to it -without users having to pass it around in params. -

-

[Source]

-
-
-     # File lib/mcollective/rpc.rb, line 99
- 99:     def self.stats(stats)
-100:       @@stats = stats
-101:     end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Wrapper for MCollective::Util.empty_filter? -to make clients less fugly to write - ticket 18 -

-

[Source]

-
-
-     # File lib/mcollective/rpc.rb, line 167
-167:     def empty_filter?(options)
-168:       if options.include?(:filter)
-169:         Util.empty_filter?(options[:filter])
-170:       else
-171:         Util.empty_filter?(options)
-172:       end
-173:     end
-
-
-
-
- -
- - - - -
-

-Prints the result of an RPC call. -

-

-In the default quiet mode - no flattening or verbose - only results that -produce an error will be printed -

-

-To get details of each result run with the -v command line option. -

-

[Source]

-
-
-     # File lib/mcollective/rpc.rb, line 146
-146:     def printrpc(result, flags = {})
-147:       verbose = @options[:verbose] rescue verbose = false
-148:       verbose = flags[:verbose] || verbose
-149:       flatten = flags[:flatten] || false
-150:       format = @options[:output_format]
-151:       forced_mode = @options[:force_display_mode] || false
-152: 
-153:       result_text =  Helpers.rpcresults(result, {:verbose => verbose, :flatten => flatten, :format => format, :force_display_mode => forced_mode})
-154: 
-155:       if result.is_a?(Array) && format == :console
-156:         puts "\n%s\n" % [ result_text ]
-157:       else
-158:         # when we get just one result to print dont pad them all with
-159:         # blank spaces etc, just print the individual result with no
-160:         # padding
-161:         puts result_text unless result_text == ""
-162:       end
-163:     end
-
-
-
-
- -
- - - - -
-

-Prints stats, requires stats to be saved from elsewhere using the MCollective::RPC.stats method. -

-

-If you‘ve passed -v on the command line a detailed stat block will be -printed, else just a one liner. -

-

-You can pass flags into it: -

-
-  printrpcstats :caption => "Foo", :summarize => true
-
-

-This will use "Foo" as the caption to the stats in verbose mode and print out any -aggregate summary information if present -

-

[Source]

-
-
-     # File lib/mcollective/rpc.rb, line 123
-123:     def printrpcstats(flags={})
-124:       return unless @options[:output_format] == :console
-125: 
-126:       flags = {:summarize => false, :caption => "rpc stats"}.merge(flags)
-127: 
-128:       verbose = @options[:verbose] rescue verbose = false
-129: 
-130:       begin
-131:         stats = @@stats
-132:       rescue
-133:         puts("no stats to display")
-134:         return
-135:       end
-136: 
-137:       puts stats.report(flags[:caption], flags[:summarize], verbose)
-138:     end
-
-
-
-
- -
- - - - -
-

-Wrapper to create clients, supposed to be used as a mixin: -

-

-include MCollective::RPC -

-

-exim = rpcclient("exim") printrpc exim.mailq -

-

-or -

-

-rpcclient("exim") do |exim| -

-
-   printrpc exim.mailq
-
-

-end -

-

-It will take a few flags: -

-
-   :configfile => "etc/client.cfg"
-   :options => options
-   :exit_on_failure => true
-
-

-Options would be a build up options hash from the Optionparser you can use the rpcoptions helper to create this -

-

-:exit_on_failure is true by default, and causes the application to exit if -there is a failure constructing the RPC client. Set -this flag to false to cause an Exception to be raised instead. -

-

[Source]

-
-
-    # File lib/mcollective/rpc.rb, line 60
-60:     def rpcclient(agent, flags = {})
-61:       configfile = flags[:configfile] || "/etc/mcollective/client.cfg"
-62:       options = flags[:options] || nil
-63: 
-64:       if flags.key?(:exit_on_failure)
-65:         exit_on_failure = flags[:exit_on_failure]
-66:       else
-67:         # We exit on failure by default for CLI-friendliness
-68:         exit_on_failure = true
-69:       end
-70: 
-71:       begin
-72:         if options
-73:           rpc = Client.new(agent, :configfile => options[:config], :options => options)
-74:           @options = rpc.options
-75:         else
-76:           rpc = Client.new(agent, :configfile => configfile)
-77:           @options = rpc.options
-78:         end
-79:       rescue Exception => e
-80:         if exit_on_failure
-81:           puts("Could not create RPC client: #{e}")
-82:           exit!
-83:         else
-84:           raise e
-85:         end
-86:       end
-87: 
-88:       if block_given?
-89:         yield(rpc)
-90:       else
-91:         return rpc
-92:       end
-93:     end
-
-
-
-
- -
- - - - -
-

-Creates a standard options hash, pass in a block to add extra headings etc -see Optionparser -

-

[Source]

-
-
-    # File lib/mcollective/rpc.rb, line 21
-21:     def rpcoptions
-22:       oparser = MCollective::Optionparser.new({:verbose => false, :progress_bar => true}, "filter")
-23: 
-24:       options = oparser.parse do |parser, options|
-25:         if block_given?
-26:           yield(parser, options)
-27:         end
-28: 
-29:         Helpers.add_simplerpc_options(parser, options)
-30:       end
-31: 
-32:       return options
-33:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/RPC/ActionRunner.html b/doc/classes/MCollective/RPC/ActionRunner.html deleted file mode 100644 index 79686b9..0000000 --- a/doc/classes/MCollective/RPC/ActionRunner.html +++ /dev/null @@ -1,534 +0,0 @@ - - - - - - Class: MCollective::RPC::ActionRunner - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::RPC::ActionRunner
In: - - lib/mcollective/rpc/actionrunner.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-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 -

-

-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. -

-

-any STDERR gets logged at error level and any STDOUT gets logged at info -level. -

-

-It will interpret the exit code from the application the same way RPC::Reply#fail! and fail handles their codes -creating a consistent interface, the message part of the fail message will -come from STDERR -

-

-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 -

-

-It uses the MCollective::Shell wrapper to call -the external application -

- -
- - -
- -
-

Methods

- -
- canrun?   - load_json_results   - load_results   - new   - path_to_command   - run   - save_json_request   - saverequest   - shell   - tempfile   - to_s   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
action [R] 
agent [R] 
command [R] 
format [R] 
request [R] 
stderr [R] 
stdout [R] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/actionrunner.rb, line 26
-26:       def initialize(command, request, format=:json)
-27:         @agent = request.agent
-28:         @action = request.action
-29:         @format = format
-30:         @request = request
-31:         @command = path_to_command(command)
-32:         @stdout = ""
-33:         @stderr = ""
-34:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/rpc/actionrunner.rb, line 117
-117:       def canrun?(command)
-118:         File.executable?(command)
-119:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/actionrunner.rb, line 91
-91:       def load_json_results(file)
-92:         return {} unless File.readable?(file)
-93: 
-94:         JSON.load(File.read(file)) || {}
-95:       rescue JSON::ParserError
-96:         {}
-97:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/actionrunner.rb, line 73
-73:       def load_results(file)
-74:         Log.debug("Attempting to load results in #{format} format from #{file}")
-75: 
-76:         data = {}
-77: 
-78:         if respond_to?("load_#{format}_results")
-79:           tempdata = send("load_#{format}_results", file)
-80: 
-81:           tempdata.each_pair do |k,v|
-82:             data[k.to_sym] = v
-83:           end
-84:         end
-85: 
-86:         data
-87:       rescue Exception => e
-88:         {}
-89:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/rpc/actionrunner.rb, line 129
-129:       def path_to_command(command)
-130:         unless command[0,1] == File::SEPARATOR
-131:           Config.instance.libdir.each do |libdir|
-132:             command_file = File.join(libdir, "agent", agent, command)
-133: 
-134:             return command_file if File.exist?(command_file)
-135:           end
-136:         end
-137: 
-138:         return command
-139:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/actionrunner.rb, line 36
-36:       def run
-37:         unless canrun?(command)
-38:           Log.warn("Cannot run #{to_s}")
-39:           raise RPCAborted, "Cannot execute #{to_s}"
-40:         end
-41: 
-42:         Log.debug("Running #{to_s}")
-43: 
-44:         request_file = saverequest(request)
-45:         reply_file = tempfile("reply")
-46:         reply_file.close
-47: 
-48:         runner = shell(command, request_file.path, reply_file.path)
-49: 
-50:         runner.runcommand
-51: 
-52:         Log.debug("#{command} exited with #{runner.status.exitstatus}")
-53: 
-54:         stderr.each_line {|l| Log.error("#{to_s}: #{l.chomp}")} unless stderr.empty?
-55:         stdout.each_line {|l| Log.info("#{to_s}: #{l.chomp}")} unless stdout.empty?
-56: 
-57:         {:exitstatus => runner.status.exitstatus,
-58:          :stdout     => runner.stdout,
-59:          :stderr     => runner.stderr,
-60:          :data       => load_results(reply_file.path)}
-61:       ensure
-62:         request_file.close! if request_file.respond_to?("close!")
-63:         reply_file.close! if reply_file.respond_to?("close")
-64:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/rpc/actionrunner.rb, line 113
-113:       def save_json_request(req)
-114:         req.to_json
-115:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/rpc/actionrunner.rb, line 99
- 99:       def saverequest(req)
-100:         Log.debug("Attempting to save request in #{format} format")
-101: 
-102:         if respond_to?("save_#{format}_request")
-103:           data = send("save_#{format}_request", req)
-104: 
-105:           request_file = tempfile("request")
-106:           request_file.puts data
-107:           request_file.close
-108:         end
-109: 
-110:         request_file
-111:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/actionrunner.rb, line 66
-66:       def shell(command, infile, outfile)
-67:         env = {"MCOLLECTIVE_REQUEST_FILE" => infile,
-68:                "MCOLLECTIVE_REPLY_FILE"   => outfile}
-69: 
-70:         Shell.new("#{command} #{infile} #{outfile}", :cwd => Dir.tmpdir, :stdout => stdout, :stderr => stderr, :environment => env)
-71:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/rpc/actionrunner.rb, line 125
-125:       def tempfile(prefix)
-126:         Tempfile.new("mcollective_#{prefix}", Dir.tmpdir)
-127:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/rpc/actionrunner.rb, line 121
-121:       def to_s
-122:         "%s#%s command: %s" % [ agent, action, command ]
-123:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/RPC/Agent.html b/doc/classes/MCollective/RPC/Agent.html deleted file mode 100644 index 4050b22..0000000 --- a/doc/classes/MCollective/RPC/Agent.html +++ /dev/null @@ -1,462 +0,0 @@ - - - - - - Class: MCollective::RPC::Agent - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::RPC::Agent
In: - - lib/mcollective/rpc/agent.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-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. -

-

-See marionette-collective.org/simplerpc/agents.html -

-

-It only really makes sense to use this with a Simple RPC client on the other end, basic usage would be: -

-
-   module MCollective
-     module Agent
-       class Helloworld<RPC::Agent
-         action "hello" do
-           reply[:msg] = "Hello #{request[:name]}"
-         end
-
-         action "foo" do
-           implemented_by "/some/script.sh"
-         end
-       end
-     end
-   end
-
-

-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. -

-

-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. -

-

-We also currently have the validation code in here, this will be moved to -plugins soon. -

- -
- - -
- -
-

Methods

- -
- actions   - activate?   - handlemsg   - load_ddl   - new   -
-
- -
- - - -
-

Included Modules

- - -
- -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
agent_name [RW] 
config [R] 
ddl [R] 
logger [R] 
meta [R] 
reply [RW] 
request [RW] 
timeout [R] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

-Returns an array of actions this agent -support -

-

[Source]

-
-
-     # File lib/mcollective/rpc/agent.rb, line 157
-157:       def self.actions
-158:         public_instance_methods.sort.grep(/_action$/).map do |method|
-159:           $1 if method =~ /(.+)_action$/
-160:         end
-161:       end
-
-
-
-
- -
- - - - -
-

-By default RPC Agents support a toggle in the configuration that -can enable and disable them based on the agent name -

-

-Example an agent called Foo can have: -

-

-plugin.foo.activate_agent = false -

-

-and this will prevent the agent from loading on this particular machine. -

-

-Agents can use the activate_when helper to -override this for example: -

-

-activate_when do -

-
-   File.exist?("/usr/bin/puppet")
-
-

-end -

-

[Source]

-
-
-     # File lib/mcollective/rpc/agent.rb, line 142
-142:       def self.activate?
-143:         agent_name = self.to_s.split("::").last.downcase
-144: 
-145:         log_code(:PLMC37, "Starting default activation checks for the '%{agent}' agent", :debug, :agent => agent_name)
-146: 
-147:         should_activate = Util.str_to_bool(Config.instance.pluginconf.fetch("#{agent_name}.activate_agent", true))
-148: 
-149:         unless should_activate
-150:           log_code(:PLMC38, "Found plugin configuration '%{agent}.activate_agent' with value '%{should_activate}'", :debug, :agent => agent_name, :should_activate => should_activate)
-151:         end
-152: 
-153:         return should_activate
-154:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/agent.rb, line 40
-40:       def initialize
-41:         @agent_name = self.class.to_s.split("::").last.downcase
-42: 
-43:         load_ddl
-44: 
-45:         @logger = Log.instance
-46:         @config = Config.instance
-47: 
-48:         # if we have a global authorization provider enable it
-49:         # plugins can still override it per plugin
-50:         self.class.authorized_by(@config.rpcauthprovider) if @config.rpcauthorization
-51: 
-52:         startup_hook
-53:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-     # File lib/mcollective/rpc/agent.rb, line 64
- 64:       def handlemsg(msg, connection)
- 65:         @request = RPC::Request.new(msg, @ddl)
- 66:         @reply = RPC::Reply.new(@request.action, @ddl)
- 67: 
- 68:         begin
- 69:           # Incoming requests need to be validated against the DDL thus reusing
- 70:           # all the work users put into creating DDLs and creating a consistent
- 71:           # quality of input validation everywhere with the a simple once off
- 72:           # investment of writing a DDL
- 73:           @request.validate!
- 74: 
- 75:           # Calls the authorization plugin if any is defined
- 76:           # if this raises an exception we wil just skip processing this
- 77:           # message
- 78:           authorization_hook(@request) if respond_to?("authorization_hook")
- 79: 
- 80:           # Audits the request, currently continues processing the message
- 81:           # we should make this a configurable so that an audit failure means
- 82:           # a message wont be processed by this node depending on config
- 83:           audit_request(@request, connection)
- 84: 
- 85:           before_processing_hook(msg, connection)
- 86: 
- 87:           if respond_to?("#{@request.action}_action")
- 88:             send("#{@request.action}_action")
- 89:           else
- 90:             log_code(:PLMC36, "Unknown action '%{action}' for agent '%{agent}'", :warn, :action => @request.action, :agent => @request.agent)
- 91:             raise UnknownRPCAction, "Unknown action '#{@request.action}' for agent '#{@request.agent}'"
- 92:           end
- 93:         rescue RPCAborted => e
- 94:           @reply.fail e.to_s, 1
- 95: 
- 96:         rescue UnknownRPCAction => e
- 97:           @reply.fail e.to_s, 2
- 98: 
- 99:         rescue MissingRPCData => e
-100:           @reply.fail e.to_s, 3
-101: 
-102:         rescue InvalidRPCData, DDLValidationError => e
-103:           @reply.fail e.to_s, 4
-104: 
-105:         rescue UnknownRPCError => e
-106:           Log.error("%s#%s failed: %s: %s" % [@agent_name, @request.action, e.class, e.to_s])
-107:           Log.error(e.backtrace.join("\n\t"))
-108:           @reply.fail e.to_s, 5
-109: 
-110:         rescue Exception => e
-111:           Log.error("%s#%s failed: %s: %s" % [@agent_name, @request.action, e.class, e.to_s])
-112:           Log.error(e.backtrace.join("\n\t"))
-113:           @reply.fail e.to_s, 5
-114: 
-115:         end
-116: 
-117:         after_processing_hook
-118: 
-119:         if @request.should_respond?
-120:           return @reply.to_hash
-121:         else
-122:           log_code(:PLMC35, "Client did not request a response, surpressing reply", :debug)
-123:           return nil
-124:         end
-125:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/agent.rb, line 55
-55:       def load_ddl
-56:         @ddl = DDL.new(@agent_name, :agent)
-57:         @meta = @ddl.meta
-58:         @timeout = @meta[:timeout] || 10
-59: 
-60:       rescue Exception => e
-61:         DDL.validation_fail!(:PLMC24, "Failed to load DDL for the '%{agent}' agent, DDLs are required: %{error_class}: %{error}", :error, :agent => @agent_name, :error_class => e.class, :error => e.to_s)
-62:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/RPC/Audit.html b/doc/classes/MCollective/RPC/Audit.html deleted file mode 100644 index c3878f7..0000000 --- a/doc/classes/MCollective/RPC/Audit.html +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - Class: MCollective::RPC::Audit - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::RPC::Audit
In: - - lib/mcollective/rpc/audit.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-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 -

-

-We provide a simple one that logs to a logfile in the class -MCollective::Audit::Logfile you can create your own: -

-

-Create a class in plugins/mcollective/audit/<yourplugin>.rb -

-

-You must inherit from MCollective::RPC::Audit -which will take care of registering you with the plugin system. -

-

-Your plugin must provide audit_request(request, connection) the -request parameter will be an instance of MCollective::RPC::Request -

-

-To enable auditing you should set: -

-

-rpcaudit = 1 rpcauditprovider = Logfile -

-

-in the config file this will enable logging using the -MCollective::Audit::Logile class -

-

-The Audit class acts as a base for audit plugins -and takes care of registering them with the plugin manager -

- -
- - -
- -
-

Methods

- -
- audit_request   - inherited   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/audit.rb, line 29
-29:       def self.inherited(klass)
-30:         PluginManager << {:type => "rpcaudit_plugin", :class => klass.to_s}
-31:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/audit.rb, line 33
-33:       def audit_request(request, connection)
-34:         @log.error("audit_request is not implimented in #{this.class}")
-35:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/RPC/Progress.html b/doc/classes/MCollective/RPC/Progress.html deleted file mode 100644 index 12910d0..0000000 --- a/doc/classes/MCollective/RPC/Progress.html +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - Class: MCollective::RPC::Progress - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::RPC::Progress
In: - - lib/mcollective/rpc/progress.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-Class that shows a progress bar, currently only supports a twirling -progress bar. -

-

-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 = Progress.new 100.times {|i| print -p.twirl(i+1, 100) + "\r"};puts -

-
- * [ ==================================================> ] 100 / 100
-
- -
- - -
- -
-

Methods

- -
- new   - twirl   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/progress.rb, line 15
-15:       def initialize(size=nil)
-16:         @twirl = ['|', '/', '-', "\\", '|', '/', '-', "\\"]
-17:         @twirldex = 0
-18: 
-19:         if size
-20:           @size = size
-21:         else
-22:           cols = Util.terminal_dimensions[0] - 22
-23: 
-24:           # Defaults back to old behavior if it
-25:           # couldn't figure out the size or if
-26:           # its more than 60 wide
-27:           if cols <= 0
-28:             @size = 0
-29:           elsif cols > 60
-30:             @size = 60
-31:           else
-32:             @size = cols
-33:           end
-34:         end
-35:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/progress.rb, line 37
-37:       def twirl(current, total)
-38:         # if the size is negative there is just not enough
-39:         # space on the terminal, return a simpler version
-40:         return "\r#{current} / #{total}" if @size == 0
-41: 
-42:         if current == total
-43:           txt = "\r %s [ " % Util.colorize(:green, "*")
-44:         else
-45:           txt = "\r %s [ " % Util.colorize(:red, @twirl[@twirldex])
-46:         end
-47: 
-48:         dashes = ((current.to_f / total) * @size).round
-49: 
-50:         dashes.times { txt << "=" }
-51:         txt << ">"
-52: 
-53:         (@size - dashes).times { txt << " " }
-54: 
-55:         txt << " ] #{current} / #{total}"
-56: 
-57:         @twirldex == 7 ? @twirldex = 0 : @twirldex += 1
-58: 
-59:         return txt
-60:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/RPC/Reply.html b/doc/classes/MCollective/RPC/Reply.html deleted file mode 100644 index 6361f7e..0000000 --- a/doc/classes/MCollective/RPC/Reply.html +++ /dev/null @@ -1,404 +0,0 @@ - - - - - - Class: MCollective::RPC::Reply - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::RPC::Reply
In: - - lib/mcollective/rpc/reply.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-Simple class to manage compliant replies to MCollective::RPC -

- -
- - -
- -
-

Methods

- -
- []   - []=   - fail   - fail!   - fetch   - initialize_data   - new   - to_hash   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - -
data [RW] 
statuscode [RW] 
statusmsg [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/reply.rb, line 7
- 7:       def initialize(action, ddl)
- 8:         @data = {}
- 9:         @statuscode = 0
-10:         @statusmsg = "OK"
-11:         @ddl = ddl
-12:         @action = action
-13: 
-14:         begin
-15:           initialize_data
-16:         rescue Exception => e
-17:           Log.warn("Could not pre-populate reply data from the DDL: %s: %s" % [e.class, e.to_s ])
-18:         end
-19:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Read from the data hash -

-

[Source]

-
-
-    # File lib/mcollective/rpc/reply.rb, line 70
-70:       def [](key)
-71:         @data[key]
-72:       end
-
-
-
-
- -
- - - - -
-

-Write to the data hash -

-

[Source]

-
-
-    # File lib/mcollective/rpc/reply.rb, line 65
-65:       def []=(key, val)
-66:         @data[key] = val
-67:       end
-
-
-
-
- -
- - - - -
-

-Helper to fill in statusmsg and code on failure -

-

[Source]

-
-
-    # File lib/mcollective/rpc/reply.rb, line 36
-36:       def fail(msg, code=1)
-37:         @statusmsg = msg
-38:         @statuscode = code
-39:       end
-
-
-
-
- -
- - - - -
-

-Helper that fills in statusmsg and code but also raises an appropriate -error -

-

[Source]

-
-
-    # File lib/mcollective/rpc/reply.rb, line 42
-42:       def fail!(msg, code=1)
-43:         @statusmsg = msg
-44:         @statuscode = code
-45: 
-46:         case code
-47:           when 1
-48:             raise RPCAborted, msg
-49: 
-50:           when 2
-51:             raise UnknownRPCAction, msg
-52: 
-53:           when 3
-54:             raise MissingRPCData, msg
-55: 
-56:           when 4
-57:             raise InvalidRPCData, msg
-58: 
-59:           else
-60:             raise UnknownRPCError, msg
-61:         end
-62:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/reply.rb, line 74
-74:       def fetch(key, default)
-75:         @data.fetch(key, default)
-76:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/reply.rb, line 21
-21:       def initialize_data
-22:         unless @ddl.actions.include?(@action)
-23:           raise "No action '%s' defined for agent '%s' in the DDL" % [@action, @ddl.pluginname]
-24:         end
-25: 
-26:         interface = @ddl.action_interface(@action)
-27: 
-28:         interface[:output].keys.each do |output|
-29:           # must deep clone this data to avoid accidental updates of the DDL in cases where the
-30:           # default is for example a string and someone does << on it
-31:           @data[output] = Marshal.load(Marshal.dump(interface[:output][output].fetch(:default, nil)))
-32:         end
-33:       end
-
-
-
-
- -
- - - - -
-

-Returns a compliant Hash of the reply that should be sent over the -middleware -

-

[Source]

-
-
-    # File lib/mcollective/rpc/reply.rb, line 80
-80:       def to_hash
-81:         return {:statuscode => @statuscode,
-82:                 :statusmsg => @statusmsg,
-83:                 :data => @data}
-84:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/RPC/Request.html b/doc/classes/MCollective/RPC/Request.html deleted file mode 100644 index e182884..0000000 --- a/doc/classes/MCollective/RPC/Request.html +++ /dev/null @@ -1,401 +0,0 @@ - - - - - - Class: MCollective::RPC::Request - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::RPC::Request
In: - - lib/mcollective/rpc/request.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-Simple class to manage compliant requests for MCollective::RPC agents -

- -
- - -
- -
-

Methods

- -
- []   - fetch   - include?   - new   - should_respond?   - to_hash   - to_json   - validate!   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
action [RW] 
agent [RW] 
caller [RW] 
data [RW] 
ddl [RW] 
sender [RW] 
time [RW] 
uniqid [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/request.rb, line 7
- 7:       def initialize(msg, ddl)
- 8:         @time = msg[:msgtime]
- 9:         @action = msg[:body][:action]
-10:         @data = msg[:body][:data]
-11:         @sender = msg[:senderid]
-12:         @agent = msg[:body][:agent]
-13:         @uniqid = msg[:requestid]
-14:         @caller = msg[:callerid] || "unknown"
-15:         @ddl = ddl
-16:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-If data is a hash, gives easy access to its members, else returns nil -

-

[Source]

-
-
-    # File lib/mcollective/rpc/request.rb, line 34
-34:       def [](key)
-35:         return nil unless @data.is_a?(Hash)
-36:         return @data[key]
-37:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/request.rb, line 39
-39:       def fetch(key, default)
-40:         return nil unless @data.is_a?(Hash)
-41:         return @data.fetch(key, default)
-42:       end
-
-
-
-
- -
- - - - -
-

-If data is a hash, quick helper to get access to it‘s include? method else returns false -

-

[Source]

-
-
-    # File lib/mcollective/rpc/request.rb, line 20
-20:       def include?(key)
-21:         return false unless @data.is_a?(Hash)
-22:         return @data.include?(key)
-23:       end
-
-
-
-
- -
- - - - -
-

-If no :process_results is specified always respond else respond based on -the supplied property -

-

[Source]

-
-
-    # File lib/mcollective/rpc/request.rb, line 27
-27:       def should_respond?
-28:         return @data[:process_results] if @data.include?(:process_results)
-29: 
-30:         return true
-31:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/request.rb, line 44
-44:       def to_hash
-45:         return {:agent => @agent,
-46:                 :action => @action,
-47:                 :data => @data}
-48:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/request.rb, line 55
-55:       def to_json
-56:         to_hash.merge!({:sender   => @sender,
-57:                         :callerid => @callerid,
-58:                         :uniqid   => @uniqid}).to_json
-59:       end
-
-
-
-
- -
- - - - -
-

-Validate the request against the DDL -

-

[Source]

-
-
-    # File lib/mcollective/rpc/request.rb, line 51
-51:       def validate!
-52:         @ddl.validate_rpc_request(@action, @data)
-53:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/RPC/Result.html b/doc/classes/MCollective/RPC/Result.html deleted file mode 100644 index 225f3c8..0000000 --- a/doc/classes/MCollective/RPC/Result.html +++ /dev/null @@ -1,317 +0,0 @@ - - - - - - Class: MCollective::RPC::Result - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::RPC::Result
In: - - lib/mcollective/rpc/result.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-Simple class to manage compliant results from MCollective::RPC agents -

-

-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 DDL -

- -
- - -
- -
-

Methods

- -
- []   - []=   - each   - fetch   - new   - to_json   -
-
- -
- - - -
-

Included Modules

- -
- Enumerable -
-
- -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - -
action [R] 
agent [R] 
results [R] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/result.rb, line 13
-13:       def initialize(agent, action, result={})
-14:         @agent = agent
-15:         @action = action
-16:         @results = result
-17:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/result.rb, line 19
-19:       def [](idx)
-20:         @results[idx]
-21:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/result.rb, line 23
-23:       def []=(idx, item)
-24:         @results[idx] = item
-25:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/result.rb, line 31
-31:       def each
-32:         @results.each_pair {|k,v| yield(k,v) }
-33:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/result.rb, line 27
-27:       def fetch(key, default)
-28:         @results.fetch(key, default)
-29:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/rpc/result.rb, line 35
-35:       def to_json(*a)
-36:         {:agent => @agent,
-37:          :action => @action,
-38:          :sender => @results[:sender],
-39:          :statuscode => @results[:statuscode],
-40:          :statusmsg => @results[:statusmsg],
-41:          :data => @results[:data]}.to_json(*a)
-42:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/RPCAborted.html b/doc/classes/MCollective/RPCAborted.html deleted file mode 100644 index f101f38..0000000 --- a/doc/classes/MCollective/RPCAborted.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - Class: MCollective::RPCAborted - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::RPCAborted
In: - - lib/mcollective/exception.rb - -
-
Parent: - - RPCError - -
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/RPCError.html b/doc/classes/MCollective/RPCError.html deleted file mode 100644 index e62de8c..0000000 --- a/doc/classes/MCollective/RPCError.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Class: MCollective::RPCError - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::RPCError
In: - - lib/mcollective/exception.rb - -
-
Parent: - StandardError -
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Registration.html b/doc/classes/MCollective/Registration.html deleted file mode 100644 index 6b4292b..0000000 --- a/doc/classes/MCollective/Registration.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - Module: MCollective::Registration - - - - - - - - - - -
- - - - - - - - - - -
ModuleMCollective::Registration
In: - - lib/mcollective/registration/base.rb - -
- - lib/mcollective/registration.rb - -
-
-
- - -
- - - -
- -
-

-Registration is implimented using a module -structure and installations can configure which module they want to use. -

-

-We provide a simple one that just sends back the list of current known -agents in MCollective::Registration::Agentlist, you can create your own: -

-

-Create a module in plugins/mcollective/registration/<yourplugin>.rb -

-

-You can inherit from MCollective::Registration::Base in which -case you just need to supply a body method, whatever this method -returns will be send to the middleware connection for an agent called -registration -

- -
- - -
- - -
- - - - -
- -
-

Classes and Modules

- - Class MCollective::Registration::Base
- -
- - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Registration/Base.html b/doc/classes/MCollective/Registration/Base.html deleted file mode 100644 index 1f000d8..0000000 --- a/doc/classes/MCollective/Registration/Base.html +++ /dev/null @@ -1,347 +0,0 @@ - - - - - - Class: MCollective::Registration::Base - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Registration::Base
In: - - lib/mcollective/registration/base.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-This is a base class that other registration plugins can use to handle -regular announcements to the mcollective -

-

-The configuration file determines how often registration messages gets sent -using the registerinterval option, the plugin runs in the -background in a thread. -

- -
- - -
- -
-

Methods

- -
- config   - inherited   - interval   - msg_filter   - publish   - run   - target_collective   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

-Register plugins that inherits base -

-

[Source]

-
-
-    # File lib/mcollective/registration/base.rb, line 11
-11:       def self.inherited(klass)
-12:         PluginManager << {:type => "registration_plugin", :class => klass.to_s}
-13:       end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/registration/base.rb, line 36
-36:       def config
-37:         Config.instance
-38:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/registration/base.rb, line 59
-59:       def interval
-60:         config.registerinterval
-61:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/registration/base.rb, line 40
-40:       def msg_filter
-41:         filter = Util.empty_filter
-42:         filter["agent"] << "registration"
-43:         filter
-44:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/registration/base.rb, line 63
-63:       def publish(message)
-64:         unless message
-65:           Log.debug("Skipping registration due to nil body")
-66:         else
-67:           req = Message.new(message, nil, {:type => :request, :agent => "registration", :collective => target_collective, :filter => msg_filter})
-68:           req.encode!
-69: 
-70:           Log.debug("Sending registration #{req.requestid} to collective #{req.collective}")
-71: 
-72:           req.publish
-73:         end
-74:       end
-
-
-
-
- -
- - - - -
-

-Creates a background thread that periodically send a registration notice. -

-

-The actual registration notices comes from the ‘body’ method of -the registration plugins. -

-

[Source]

-
-
-    # File lib/mcollective/registration/base.rb, line 19
-19:       def run(connection)
-20:         return false if interval == 0
-21: 
-22:         Thread.new do
-23:           loop do
-24:             begin
-25:               publish(body)
-26: 
-27:               sleep interval
-28:             rescue Exception => e
-29:               Log.error("Sending registration message failed: #{e}")
-30:               sleep interval
-31:             end
-32:           end
-33:         end
-34:       end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/registration/base.rb, line 46
-46:       def target_collective
-47:         main_collective = config.main_collective
-48: 
-49:         collective = config.registration_collective || main_collective
-50: 
-51:         unless config.collectives.include?(collective)
-52:           Log.warn("Sending registration to #{main_collective}: #{collective} is not a valid collective")
-53:           collective = main_collective
-54:         end
-55: 
-56:         return collective
-57:       end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Runner.html b/doc/classes/MCollective/Runner.html deleted file mode 100644 index 62f7e8f..0000000 --- a/doc/classes/MCollective/Runner.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - Class: MCollective::Runner - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Runner
In: - - lib/mcollective/runner.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-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 -

- -
- - -
- -
-

Methods

- -
- new   - run   -
-
- -
- - - -
-

Included Modules

- - -
- -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/runner.rb, line 8
- 8:     def initialize(configfile)
- 9:       @config = Config.instance
-10:       @config.loadconfig(configfile) unless @config.configured
-11:       @config.mode = :server
-12: 
-13:       @stats = PluginManager["global_stats"]
-14: 
-15:       @security = PluginManager["security_plugin"]
-16:       @security.initiated_by = :node
-17: 
-18:       @connection = PluginManager["connector_plugin"]
-19:       @connection.connect
-20: 
-21:       @agents = Agents.new
-22: 
-23:       unless Util.windows?
-24:         Signal.trap("USR1") do
-25:           log_code(:PLMC2, "Reloading all agents after receiving USR1 signal", :info)
-26:           @agents.loadagents
-27:         end
-28: 
-29:         Signal.trap("USR2") do
-30:           log_code(:PLMC3, "Cycling logging level due to USR2 signal", :info)
-31: 
-32:           Log.cycle_level
-33:         end
-34:       else
-35:         Util.setup_windows_sleeper
-36:       end
-37:     end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Starts the main loop, before calling this you should initialize the MCollective::Config singleton. -

-

[Source]

-
-
-    # File lib/mcollective/runner.rb, line 40
-40:     def run
-41:       Data.load_data_sources
-42: 
-43:       Util.subscribe(Util.make_subscriptions("mcollective", :broadcast))
-44:       Util.subscribe(Util.make_subscriptions("mcollective", :directed)) if @config.direct_addressing
-45: 
-46:       # Start the registration plugin if interval isn't 0
-47:       begin
-48:         PluginManager["registration_plugin"].run(@connection) unless @config.registerinterval == 0
-49:       rescue Exception => e
-50:         logexception(:PLMC4, "Failed to start registration plugin: %{error}", :error, e)
-51:       end
-52: 
-53:       loop do
-54:         begin
-55:           request = receive
-56: 
-57:           unless request.agent == "mcollective"
-58:             agentmsg(request)
-59:           else
-60:             log_code(:PLMC5, "Received a control message, possibly via 'mco controller' but this has been deprecated", :error)
-61:           end
-62:         rescue SignalException => e
-63:           logexception(:PLMC7, "Exiting after signal: %{error}", :warn, e)
-64:           @connection.disconnect
-65:           raise
-66: 
-67:         rescue MsgTTLExpired => e
-68:           logexception(:PLMC9, "Expired Message: %{error}", :warn, e)
-69: 
-70:         rescue NotTargettedAtUs => e
-71:           log_code(:PLMC6, "Message does not pass filters, ignoring", :debug)
-72: 
-73:         rescue Exception => e
-74:           logexception(:PLMC10, "Failed to handle message: %{error}", :warn, e, true)
-75:         end
-76:       end
-77:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/RunnerStats.html b/doc/classes/MCollective/RunnerStats.html deleted file mode 100644 index 6c4437b..0000000 --- a/doc/classes/MCollective/RunnerStats.html +++ /dev/null @@ -1,412 +0,0 @@ - - - - - - Class: MCollective::RunnerStats - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::RunnerStats
In: - - lib/mcollective/runnerstats.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-Class to store stats about the mcollectived, it should live in the PluginManager so that agents etc can get hold -of it and return the stats to callers -

- -
- - -
- -
-

Methods

- -
- filtered   - new   - passed   - received   - sent   - to_hash   - ttlexpired   - unvalidated   - validated   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/runnerstats.rb, line 5
- 5:     def initialize
- 6:       @starttime = Time.now.to_i
- 7:       @validated = 0
- 8:       @unvalidated = 0
- 9:       @filtered = 0
-10:       @passed = 0
-11:       @total = 0
-12:       @replies = 0
-13:       @ttlexpired = 0
-14: 
-15:       @mutex = Mutex.new
-16:     end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Records a message that didnt pass the filters -

-

[Source]

-
-
-    # File lib/mcollective/runnerstats.rb, line 31
-31:     def filtered
-32:       Log.debug("Incrementing filtered stat")
-33:       @filtered += 1
-34:     end
-
-
-
-
- -
- - - - -
-

-Records a message that passed the -filters -

-

[Source]

-
-
-    # File lib/mcollective/runnerstats.rb, line 25
-25:     def passed
-26:       Log.debug("Incrementing passed stat")
-27:       @passed += 1
-28:     end
-
-
-
-
- -
- - - - -
-

-Records receipt of a message -

-

[Source]

-
-
-    # File lib/mcollective/runnerstats.rb, line 48
-48:     def received
-49:       Log.debug("Incrementing total stat")
-50:       @total += 1
-51:     end
-
-
-
-
- -
- - - - -
-

-Records sending a message -

-

[Source]

-
-
-    # File lib/mcollective/runnerstats.rb, line 54
-54:     def sent
-55:       @mutex.synchronize do
-56:         Log.debug("Incrementing replies stat")
-57:         @replies += 1
-58:       end
-59:     end
-
-
-
-
- -
- - - - -
-

-Returns a hash with all stats -

-

[Source]

-
-
-    # File lib/mcollective/runnerstats.rb, line 62
-62:     def to_hash
-63:       stats = {:validated => @validated,
-64:         :unvalidated => @unvalidated,
-65:         :passed => @passed,
-66:         :filtered => @filtered,
-67:         :starttime => @starttime,
-68:         :total => @total,
-69:         :ttlexpired => @ttlexpired,
-70:         :replies => @replies}
-71: 
-72:       reply = {:stats => stats,
-73:         :threads => [],
-74:         :pid => Process.pid,
-75:         :times => {} }
-76: 
-77:       ::Process.times.each_pair{|k,v|
-78:         k = k.to_sym
-79:         reply[:times][k] = v
-80:       }
-81: 
-82:       Thread.list.each do |t|
-83:         reply[:threads] << "#{t.inspect}"
-84:       end
-85: 
-86:       reply[:agents] = Agents.agentlist
-87:       reply
-88:     end
-
-
-
-
- -
- - - - -
-

-Records a message that failed TTL checks -

-

[Source]

-
-
-    # File lib/mcollective/runnerstats.rb, line 19
-19:     def ttlexpired
-20:       Log.debug("Incrementing ttl expired stat")
-21:       @ttlexpired += 1
-22:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/runnerstats.rb, line 42
-42:     def unvalidated
-43:       Log.debug("Incrementing unvalidated stat")
-44:       @unvalidated += 1
-45:     end
-
-
-
-
- -
- - - - -
-

-Records a message that validated ok -

-

[Source]

-
-
-    # File lib/mcollective/runnerstats.rb, line 37
-37:     def validated
-38:       Log.debug("Incrementing validated stat")
-39:       @validated += 1
-40:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Security.html b/doc/classes/MCollective/Security.html deleted file mode 100644 index 739dccb..0000000 --- a/doc/classes/MCollective/Security.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - Module: MCollective::Security - - - - - - - - - - -
- - - - - - - - - - -
ModuleMCollective::Security
In: - - lib/mcollective/security.rb - -
- - lib/mcollective/security/base.rb - -
-
-
- - -
- - - -
- -
-

-Security is implimented using a module -structure and installations can configure which module they want to use. -

-

-Security modules deal with various aspects of -authentication and authorization: -

-
    -
  • Determines if a filter excludes this host from dealing with a request - -
  • -
  • Serialization and Deserialization of messages - -
  • -
  • Validation of messages against keys, certificates or whatever the class -choose to impliment - -
  • -
  • Encoding and Decoding of messages - -
  • -
-

-To impliment a new security class using SSL for -example you would inherit from the base class and only impliment: -

-
    -
  • decodemsg - -
  • -
  • encodereply - -
  • -
  • encoderequest - -
  • -
  • validrequest? - -
  • -
-

-Each of these methods should increment various stats counters, see the -default MCollective::Security::Psk module for examples of this -

-

-Filtering can be extended by providing a new validate_filter? method. -

- -
- - -
- - -
- - - - -
- -
-

Classes and Modules

- - Class MCollective::Security::Base
- -
- - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/SecurityValidationFailed.html b/doc/classes/MCollective/SecurityValidationFailed.html deleted file mode 100644 index b42e94b..0000000 --- a/doc/classes/MCollective/SecurityValidationFailed.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Class: MCollective::SecurityValidationFailed - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::SecurityValidationFailed
In: - - lib/mcollective/exception.rb - -
-
Parent: - RuntimeError -
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Shell.html b/doc/classes/MCollective/Shell.html deleted file mode 100644 index 31bc5a3..0000000 --- a/doc/classes/MCollective/Shell.html +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - Class: MCollective::Shell - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::Shell
In: - - lib/mcollective/shell.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-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. -

-
-  s = Shell.new("date", opts)
-  s.runcommand
-  puts s.stdout
-  puts s.stderr
-  puts s.status.exitstatus
-
-

-Options hash can have: -

-
-  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 <<
-  stderr      - a variable that will receive stdin, must support <<
-  environment - the shell environment, defaults to include LC_ALL=C
-                set to nil to clear the environment even of LC_ALL
-
- -
- - -
- -
-

Methods

- -
- new   - runcommand   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
command [R] 
cwd [R] 
environment [R] 
status [R] 
stderr [R] 
stdin [R] 
stdout [R] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/shell.rb, line 24
-24:     def initialize(command, options={})
-25:       @environment = {"LC_ALL" => "C"}
-26:       @command = command
-27:       @status = nil
-28:       @stdout = ""
-29:       @stderr = ""
-30:       @stdin = nil
-31:       @cwd = Dir.tmpdir
-32: 
-33:       options.each do |opt, val|
-34:         case opt.to_s
-35:           when "stdout"
-36:             raise "stdout should support <<" unless val.respond_to?("<<")
-37:             @stdout = val
-38: 
-39:           when "stderr"
-40:             raise "stderr should support <<" unless val.respond_to?("<<")
-41:             @stderr = val
-42: 
-43:           when "stdin"
-44:             raise "stdin should be a String" unless val.is_a?(String)
-45:             @stdin = val
-46: 
-47:           when "cwd"
-48:             raise "Directory #{val} does not exist" unless File.directory?(val)
-49:             @cwd = val
-50: 
-51:           when "environment"
-52:             if val.nil?
-53:               @environment = {}
-54:             else
-55:               @environment.merge!(val.dup)
-56:             end
-57:         end
-58:       end
-59:     end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Actually does the systemu call passing in the correct environment, stdout -and stderr -

-

[Source]

-
-
-    # File lib/mcollective/shell.rb, line 62
-62:     def runcommand
-63:       opts = {"env"    => @environment,
-64:               "stdout" => @stdout,
-65:               "stderr" => @stderr,
-66:               "cwd"    => @cwd}
-67: 
-68:       opts["stdin"] = @stdin if @stdin
-69: 
-70:       # Check if the parent thread is alive. If it should die,
-71:       # and the process spawned by systemu is still alive,
-72:       # fire off a blocking waitpid and wait for the process to
-73:       # finish so that we can avoid zombies.
-74:       thread = Thread.current
-75:       @status = systemu(@command, opts) do |cid|
-76:         begin
-77:           while(thread.alive?)
-78:             sleep 0.1
-79:           end
-80: 
-81:           Process.waitpid(cid) if Process.getpgid(cid)
-82:         rescue SystemExit
-83:         rescue Errno::ESRCH
-84:         rescue Errno::ECHILD
-85:         rescue Exception => e
-86:           Log.info("Unexpected exception received while waiting for child process: #{e.class}: #{e}")
-87:         end
-88:       end
-89:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Translatable.html b/doc/classes/MCollective/Translatable.html deleted file mode 100644 index 732579d..0000000 --- a/doc/classes/MCollective/Translatable.html +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - Module: MCollective::Translatable - - - - - - - - - - -
- - - - - - - - - - -
ModuleMCollective::Translatable
In: - - lib/mcollective/translatable.rb - -
-
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- log_code   - logexception   - raise_code   - t   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/translatable.rb, line 7
- 7:     def log_code(msgid, default, level, args={})
- 8:       msg = "%s: %s" % [msgid, Util.t(msgid, {:default => default}.merge(args))]
- 9: 
-10:       Log.log(level, msg, File.basename(caller[1]))
-11:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/translatable.rb, line 20
-20:     def logexception(msgid, default, level, e, backtrace=false)
-21:       Log.logexception(msgid, level, e, backtrace)
-22:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/translatable.rb, line 13
-13:     def raise_code(msgid, default, level, args={})
-14:       exception = CodedError.new(msgid, default, level, args)
-15:       exception.set_backtrace caller
-16: 
-17:       raise exception
-18:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-   # File lib/mcollective/translatable.rb, line 3
-3:     def t(msgid, default, args={})
-4:       Util.t(msgid, {:default => default}.merge(args))
-5:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/UnixDaemon.html b/doc/classes/MCollective/UnixDaemon.html deleted file mode 100644 index 64f02a5..0000000 --- a/doc/classes/MCollective/UnixDaemon.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - Class: MCollective::UnixDaemon - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::UnixDaemon
In: - - lib/mcollective/unix_daemon.rb - -
-
Parent: - Object -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- daemonize   - daemonize_runner   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

-Daemonize the current process -

-

[Source]

-
-
-    # File lib/mcollective/unix_daemon.rb, line 4
- 4:     def self.daemonize
- 5:       fork do
- 6:         Process.setsid
- 7:         exit if fork
- 8:         Dir.chdir('/tmp')
- 9:         STDIN.reopen('/dev/null')
-10:         STDOUT.reopen('/dev/null', 'a')
-11:         STDERR.reopen('/dev/null', 'a')
-12: 
-13:         yield
-14:       end
-15:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/unix_daemon.rb, line 17
-17:     def self.daemonize_runner(pid=nil)
-18:       raise "The Unix Daemonizer can not be used on the Windows Platform" if Util.windows?
-19: 
-20:       UnixDaemon.daemonize do
-21:         if pid
-22:           begin
-23:             File.open(pid, 'w') {|f| f.write(Process.pid) }
-24:           rescue Exception => e
-25:           end
-26:         end
-27: 
-28:         begin
-29:           runner = Runner.new(nil)
-30:           runner.run
-31:         ensure
-32:           File.unlink(pid) if pid && File.exist?(pid)
-33:         end
-34:       end
-35:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/UnknownRPCAction.html b/doc/classes/MCollective/UnknownRPCAction.html deleted file mode 100644 index 858554c..0000000 --- a/doc/classes/MCollective/UnknownRPCAction.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - Class: MCollective::UnknownRPCAction - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::UnknownRPCAction
In: - - lib/mcollective/exception.rb - -
-
Parent: - - RPCError - -
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/UnknownRPCError.html b/doc/classes/MCollective/UnknownRPCError.html deleted file mode 100644 index 20113c1..0000000 --- a/doc/classes/MCollective/UnknownRPCError.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - Class: MCollective::UnknownRPCError - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::UnknownRPCError
In: - - lib/mcollective/exception.rb - -
-
Parent: - - RPCError - -
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/Validator.html b/doc/classes/MCollective/Validator.html deleted file mode 100644 index 6c4c70a..0000000 --- a/doc/classes/MCollective/Validator.html +++ /dev/null @@ -1,342 +0,0 @@ - - - - - - Module: MCollective::Validator - - - - - - - - - - -
- - - - - - - - - - -
ModuleMCollective::Validator
In: - - lib/mcollective/validator.rb - -
-
-
- - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

-Returns and instance of the Plugin class from which objects can be created. -Valid plugin names are -

-
-  :valplugin
-  "valplugin"
-  "ValpluginValidator"
-
-

[Source]

-
-
-    # File lib/mcollective/validator.rb, line 18
-18:     def self.[](klass)
-19:       if klass.is_a?(Symbol)
-20:         klass = validator_class(klass)
-21:       elsif !(klass.match(/.*Validator$/))
-22:         klass = validator_class(klass)
-23:       end
-24: 
-25:       const_get(klass)
-26:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/validator.rb, line 37
-37:     def self.has_validator?(validator)
-38:       const_defined?(validator_class(validator))
-39:     end
-
-
-
-
- -
- - - - -
-

-Loads the validator plugins. Validators will only be loaded every 5 minutes -

-

[Source]

-
-
-    # File lib/mcollective/validator.rb, line 6
- 6:     def self.load_validators
- 7:       if load_validators?
- 8:         @last_load = Time.now.to_i
- 9:         PluginManager.find_and_load("validator")
-10:       end
-11:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/validator.rb, line 45
-45:     def self.load_validators?
-46:       return true if @last_load.nil?
-47: 
-48:       (@last_load - Time.now.to_i) > 300
-49:     end
-
-
-
-
- -
- - - - -
-

-Allows validation plugins to be called like module methods : Validator.validate() -

-

[Source]

-
-
-    # File lib/mcollective/validator.rb, line 29
-29:     def self.method_missing(method, *args, &block)
-30:       if has_validator?(method)
-31:         validator = Validator[method].validate(*args)
-32:       else
-33:         raise ValidatorError, "Unknown validator: '#{method}'."
-34:       end
-35:     end
-
-
-
-
- -
- - - - -
-

-Generic validate method that will call -the correct validator plugin based on the type of the validation parameter -

-

[Source]

-
-
-    # File lib/mcollective/validator.rb, line 53
-53:     def self.validate(validator, validation)
-54:       Validator.load_validators
-55: 
-56:       begin
-57:         if [:integer, :boolean, :float, :number, :string].include?(validation)
-58:           Validator.typecheck(validator, validation)
-59: 
-60:         else
-61:           case validation
-62:             when Regexp,String
-63:               Validator.regex(validator, validation)
-64: 
-65:             when Symbol
-66:               Validator.send(validation, validator)
-67: 
-68:             when Array
-69:               Validator.array(validator, validation)
-70: 
-71:             when Class
-72:               Validator.typecheck(validator, validation)
-73:           end
-74:         end
-75:       rescue => e
-76:         raise ValidatorError, e.to_s
-77:       end
-78:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/validator.rb, line 41
-41:     def self.validator_class(validator)
-42:       "#{validator.to_s.capitalize}Validator"
-43:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/ValidatorError.html b/doc/classes/MCollective/ValidatorError.html deleted file mode 100644 index 3245935..0000000 --- a/doc/classes/MCollective/ValidatorError.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - Class: MCollective::ValidatorError - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::ValidatorError
In: - - lib/mcollective/exception.rb - -
-
Parent: - RuntimeError -
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/MCollective/WindowsDaemon.html b/doc/classes/MCollective/WindowsDaemon.html deleted file mode 100644 index ef3500b..0000000 --- a/doc/classes/MCollective/WindowsDaemon.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - Class: MCollective::WindowsDaemon - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassMCollective::WindowsDaemon
In: - - lib/mcollective/windows_daemon.rb - -
-
Parent: - Win32::Daemon -
-
- - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/windows_daemon.rb, line 5
- 5:     def self.daemonize_runner(pid=nil)
- 6:       raise "Writing pid files are not supported on the Windows Platform" if pid
- 7:       raise "The Windows Daemonizer should only be used on the Windows Platform" unless Util.windows?
- 8: 
- 9:       WindowsDaemon.mainloop
-10:     end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/windows_daemon.rb, line 12
-12:     def service_main
-13:       Log.debug("Starting Windows Service Daemon")
-14: 
-15:       while running?
-16:         Runner.new(nil).run
-17:       end
-18:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/windows_daemon.rb, line 20
-20:     def service_stop
-21:       Log.info("Windows service stopping")
-22:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/String.html b/doc/classes/String.html deleted file mode 100644 index 65be5bb..0000000 --- a/doc/classes/String.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - Class: String - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassString
In: - - lib/mcollective/monkey_patches.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-start_with? was introduced in 1.8.7, we -need to support 1.8.5 and 1.8.6 -

- -
- - -
- -
-

Methods

- -
- bytes   - start_with?   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/monkey_patches.rb, line 63
-63:   def bytes(&block)
-64:     # This should not be necessary, really ...
-65:     require 'enumerator'
-66:     return to_enum(:each_byte) unless block_given?
-67:     each_byte(&block)
-68:   end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-   # File lib/mcollective/monkey_patches.rb, line 4
-4:   def start_with?(str)
-5:     return self[0 .. (str.length-1)] == str
-6:   end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/classes/Symbol.html b/doc/classes/Symbol.html deleted file mode 100644 index ffaa50a..0000000 --- a/doc/classes/Symbol.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - Class: Symbol - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassSymbol
In: - - lib/mcollective/monkey_patches.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-Make arrays of Symbols sortable -

- -
- - -
- -
-

Methods

- -
- <=>   -
-
- -
- - - -
-

Included Modules

- -
- Comparable -
-
- -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/mcollective/monkey_patches.rb, line 13
-13:   def <=>(other)
-14:     self.to_s <=> other.to_s
-15:   end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/doc/created.rid b/doc/created.rid index d7eade0..62e4d8f 100644 --- a/doc/created.rid +++ b/doc/created.rid @@ -1 +1 @@ -Fri, 08 Nov 2013 12:58:30 +0000 +Fri, 15 Nov 2013 12:53:46 +0000 diff --git a/doc/etc/client_cfg_dist.html b/doc/etc/client_cfg_dist.html new file mode 100644 index 0000000..3a1c759 --- /dev/null +++ b/doc/etc/client_cfg_dist.html @@ -0,0 +1,304 @@ + + + + + + + + File: client.cfg.dist [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

+main_collective = mcollective collectives = mcollective libdir = +/usr/libexec/mcollective logger_type = console loglevel = warn +

+

+# Plugins securityprovider = psk plugin.psk = unset +

+

+connector = activemq plugin.activemq.pool.size = 1 +plugin.activemq.pool.1.host = stomp1 plugin.activemq.pool.1.port = 6163 +plugin.activemq.pool.1.user = mcollective plugin.activemq.pool.1.password = +marionette +

+

+# Facts factsource = yaml plugin.yaml = /etc/mcollective/facts.yaml +

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/etc/data-help_erb.html b/doc/etc/data-help_erb.html new file mode 100644 index 0000000..52597fe --- /dev/null +++ b/doc/etc/data-help_erb.html @@ -0,0 +1,341 @@ + + + + + + + + File: data-help.erb [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

+<%= metastring %> QUERY FUNCTION INPUT: +

+

+% if entities[:data][:input][:query] +

+
+              Description: <%= entities[:data][:input][:query][:description] %>
+                   Prompt: <%= entities[:data][:input][:query][:prompt] %>
+                     Type: <%= entities[:data][:input][:query][:type] %>
+
+

+% if entities[:data][:input][:query][:type] == :string +

+
+               Validation: <%= entities[:data][:input][:query][:validation] %>
+                   Length: <%= entities[:data][:input][:query][:maxlength] %>
+
+

+% elsif entities[:data][:input][:query][:type] == :list +

+
+             Valid Values: <%= entities[:data][:input][:query][:list].join(", ") %>
+
+

+% end % if entities[:data][:input][:query][:default] +

+
+            Default Value: <%= entities[:data][:input][:query][:default] %>
+
+

+% end % else +

+
+    This plugin does not take any input
+
+

+% end +

+

+QUERY FUNCTION OUTPUT: +

+

+% entities[:data][:output].keys.sort.each do |output| +

+
+           <%= output %>:
+              Description: <%= entities[:data][:output][output][:description] %>
+               Display As: <%= entities[:data][:output][output][:display_as] %>
+
+

+% end +

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/etc/discovery-help_erb.html b/doc/etc/discovery-help_erb.html new file mode 100644 index 0000000..0f550dd --- /dev/null +++ b/doc/etc/discovery-help_erb.html @@ -0,0 +1,303 @@ + + + + + + + + File: discovery-help.erb [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

+<%= metastring %> DISCOVERY METHOD CAPABILITIES: % [[“Filter based on +configuration management classes”, :classes], % [“Filter based +on system facts”, :facts], % [“Filter based on mcollective +identity”, :identity], % [“Filter based on mcollective +agents”, :agents], % [“Compound filters combining classes and +facts”, :compound]].each do |cap| % if +entities[:discovery][:capabilities].include?(cap.last) +

+
+      <%= cap.first %>
+
+

+% end % end +

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/etc/facts_yaml_dist.html b/doc/etc/facts_yaml_dist.html new file mode 100644 index 0000000..f8a2e87 --- /dev/null +++ b/doc/etc/facts_yaml_dist.html @@ -0,0 +1,291 @@ + + + + + + + + File: facts.yaml.dist [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

+mcollective: 1 +

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/etc/metadata-help_erb.html b/doc/etc/metadata-help_erb.html new file mode 100644 index 0000000..e7b44c1 --- /dev/null +++ b/doc/etc/metadata-help_erb.html @@ -0,0 +1,313 @@ + + + + + + + + File: metadata-help.erb [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

+<%= meta[:name] %> <%= “=” * meta[:name].size %> +

+

+<%= meta[:description] %> +

+
+      Author: <%= meta[:author] %>
+     Version: <%= meta[:version] %>
+     License: <%= meta[:license] %>
+     Timeout: <%= meta[:timeout] %>
+   Home Page: <%= meta[:url] %>
+
+

+% if requirements[:mcollective] +

+
+   Requires MCollective <%= requirements[:mcollective] %> or newer
+
+

+% end % unless @usage == ““ +

+

+<%= Util.align_text(@usage, nil, 3) if @usage != “” %> % end +

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/etc/msg-help_erb.html b/doc/etc/msg-help_erb.html new file mode 100644 index 0000000..f3ba0e5 --- /dev/null +++ b/doc/etc/msg-help_erb.html @@ -0,0 +1,308 @@ + + + + + + + + File: msg-help.erb [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

+Help for message: <%= msg_code %> +

+

+Example Message: +

+

+<%= Util.align_text(msg_example, nil, 3) %> +

+

+Message Detail: +

+

+<%= Util.align_text(msg_detail, nil, 3) %> +

+

+For more information please see docs.puppetlabs.com/mcollective/messages/<%= +msg_code %>.html +

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/etc/rpc-help_erb.html b/doc/etc/rpc-help_erb.html new file mode 100644 index 0000000..84be996 --- /dev/null +++ b/doc/etc/rpc-help_erb.html @@ -0,0 +1,370 @@ + + + + + + + + File: rpc-help.erb [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

+<%= metastring %> ACTIONS: +

+
==
+
+   <%= entities.keys.sort.join(", ") %>
+
+

+% entities.keys.sort.each do |action| +

+
+   <%= action %> action:
+   <% (action.size + 8).times do %>-<% end %>
+       <%= entities[action][:description] %>
+
+       INPUT:
+
+

+% if entities[action][:input].size > 0 % +entities[action][:input].keys.sort.each do |input| +

+
+           <%= input %>:
+              Description: <%= entities[action][:input][input][:description] %>
+                   Prompt: <%= entities[action][:input][input][:prompt] %>
+                     Type: <%= entities[action][:input][input][:type] %>
+                 Optional: <%= !!entities[action][:input][input][:optional] %>
+
+

+% if entities[action][:input][input][:type] == :string +

+
+               Validation: <%= entities[action][:input][input][:validation] %>
+                   Length: <%= entities[action][:input][input][:maxlength] %>
+
+

+% elsif entities[action][:input][input][:type] == :list +

+
+             Valid Values: <%= entities[action][:input][input][:list].join(", ") %>
+
+

+% end % if entities[action][:input][input][:default] +

+
+            Default Value: <%= entities[action][:input][input][:default] %>
+
+

+% end +

+

+% end % else +

+
+          This action does not have any inputs
+
+

+% end +

+
+       OUTPUT:
+
+

+% entities[action][:output].keys.sort.each do |output| +

+
+           <%= output %>:
+              Description: <%= entities[action][:output][output][:description] %>
+               Display As: <%= entities[action][:output][output][:display_as] %>
+
+

+% if entities[action][:output][output][:default] +

+
+            Default Value: <%= entities[action][:output][output][:default] %>
+
+

+% end +

+

+% end % end +

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/etc/server_cfg_dist.html b/doc/etc/server_cfg_dist.html new file mode 100644 index 0000000..92807b5 --- /dev/null +++ b/doc/etc/server_cfg_dist.html @@ -0,0 +1,305 @@ + + + + + + + + File: server.cfg.dist [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

+main_collective = mcollective collectives = mcollective libdir = +/usr/libexec/mcollective logfile = /var/log/mcollective.log loglevel = info +daemonize = 1 +

+

+# Plugins securityprovider = psk plugin.psk = unset +

+

+connector = activemq plugin.activemq.pool.size = 1 +plugin.activemq.pool.1.host = stomp1 plugin.activemq.pool.1.port = 6163 +plugin.activemq.pool.1.user = mcollective plugin.activemq.pool.1.password = +marionette +

+

+# Facts factsource = yaml plugin.yaml = /etc/mcollective/facts.yaml +

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/etc/ssl/PLACEHOLDER.html b/doc/etc/ssl/PLACEHOLDER.html new file mode 100644 index 0000000..cbc2a37 --- /dev/null +++ b/doc/etc/ssl/PLACEHOLDER.html @@ -0,0 +1,288 @@ + + + + + + + + File: PLACEHOLDER [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/etc/ssl/clients/PLACEHOLDER.html b/doc/etc/ssl/clients/PLACEHOLDER.html new file mode 100644 index 0000000..1ea4094 --- /dev/null +++ b/doc/etc/ssl/clients/PLACEHOLDER.html @@ -0,0 +1,288 @@ + + + + + + + + File: PLACEHOLDER [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/files/lib/mcollective/agent_rb.html b/doc/files/lib/mcollective/agent_rb.html deleted file mode 100644 index cfd6068..0000000 --- a/doc/files/lib/mcollective/agent_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: agent.rb - - - - - - - - - - -
-

agent.rb

- - - - - - - - - -
Path:lib/mcollective/agent.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/agents_rb.html b/doc/files/lib/mcollective/agents_rb.html deleted file mode 100644 index eeb8802..0000000 --- a/doc/files/lib/mcollective/agents_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: agents.rb - - - - - - - - - - -
-

agents.rb

- - - - - - - - - -
Path:lib/mcollective/agents.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 2684dbb..0000000 --- a/doc/files/lib/mcollective/aggregate/base_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: base.rb - - - - - - - - - - -
-

base.rb

- - - - - - - - - -
Path:lib/mcollective/aggregate/base.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 7b47f98..0000000 --- a/doc/files/lib/mcollective/aggregate/result/base_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: base.rb - - - - - - - - - - -
-

base.rb

- - - - - - - - - -
Path:lib/mcollective/aggregate/result/base.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 69684fc..0000000 --- a/doc/files/lib/mcollective/aggregate/result/collection_result_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: collection_result.rb - - - - - - - - - - -
-

collection_result.rb

- - - - - - - - - -
Path:lib/mcollective/aggregate/result/collection_result.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index df9f0e7..0000000 --- a/doc/files/lib/mcollective/aggregate/result/numeric_result_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: numeric_result.rb - - - - - - - - - - -
-

numeric_result.rb

- - - - - - - - - -
Path:lib/mcollective/aggregate/result/numeric_result.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 3621501..0000000 --- a/doc/files/lib/mcollective/aggregate/result_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: result.rb - - - - - - - - - - -
-

result.rb

- - - - - - - - - -
Path:lib/mcollective/aggregate/result.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/aggregate_rb.html b/doc/files/lib/mcollective/aggregate_rb.html deleted file mode 100644 index 729498c..0000000 --- a/doc/files/lib/mcollective/aggregate_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: aggregate.rb - - - - - - - - - - -
-

aggregate.rb

- - - - - - - - - -
Path:lib/mcollective/aggregate.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/application_rb.html b/doc/files/lib/mcollective/application_rb.html deleted file mode 100644 index 517c878..0000000 --- a/doc/files/lib/mcollective/application_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: application.rb - - - - - - - - - - -
-

application.rb

- - - - - - - - - -
Path:lib/mcollective/application.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/applications_rb.html b/doc/files/lib/mcollective/applications_rb.html deleted file mode 100644 index c7f9e4e..0000000 --- a/doc/files/lib/mcollective/applications_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: applications.rb - - - - - - - - - - -
-

applications.rb

- - - - - - - - - -
Path:lib/mcollective/applications.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/cache_rb.html b/doc/files/lib/mcollective/cache_rb.html deleted file mode 100644 index 3ca23b6..0000000 --- a/doc/files/lib/mcollective/cache_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: cache.rb - - - - - - - - - - -
-

cache.rb

- - - - - - - - - -
Path:lib/mcollective/cache.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/client_rb.html b/doc/files/lib/mcollective/client_rb.html deleted file mode 100644 index 7fcd31e..0000000 --- a/doc/files/lib/mcollective/client_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: client.rb - - - - - - - - - - -
-

client.rb

- - - - - - - - - -
Path:lib/mcollective/client.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/config_rb.html b/doc/files/lib/mcollective/config_rb.html deleted file mode 100644 index 8fd13d0..0000000 --- a/doc/files/lib/mcollective/config_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: config.rb - - - - - - - - - - -
-

config.rb

- - - - - - - - - -
Path:lib/mcollective/config.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 165219b..0000000 --- a/doc/files/lib/mcollective/connector/base_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: base.rb - - - - - - - - - - -
-

base.rb

- - - - - - - - - -
Path:lib/mcollective/connector/base.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/connector_rb.html b/doc/files/lib/mcollective/connector_rb.html deleted file mode 100644 index 83b2e61..0000000 --- a/doc/files/lib/mcollective/connector_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: connector.rb - - - - - - - - - - -
-

connector.rb

- - - - - - - - - -
Path:lib/mcollective/connector.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 8642e90..0000000 --- a/doc/files/lib/mcollective/data/base_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: base.rb - - - - - - - - - - -
-

base.rb

- - - - - - - - - -
Path:lib/mcollective/data/base.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index e6e83b8..0000000 --- a/doc/files/lib/mcollective/data/result_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: result.rb - - - - - - - - - - -
-

result.rb

- - - - - - - - - -
Path:lib/mcollective/data/result.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/data_rb.html b/doc/files/lib/mcollective/data_rb.html deleted file mode 100644 index bd5e809..0000000 --- a/doc/files/lib/mcollective/data_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: data.rb - - - - - - - - - - -
-

data.rb

- - - - - - - - - -
Path:lib/mcollective/data.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 6e2597c..0000000 --- a/doc/files/lib/mcollective/ddl/agentddl_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: agentddl.rb - - - - - - - - - - -
-

agentddl.rb

- - - - - - - - - -
Path:lib/mcollective/ddl/agentddl.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index ffe12bb..0000000 --- a/doc/files/lib/mcollective/ddl/base_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: base.rb - - - - - - - - - - -
-

base.rb

- - - - - - - - - -
Path:lib/mcollective/ddl/base.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 2f49a76..0000000 --- a/doc/files/lib/mcollective/ddl/dataddl_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: dataddl.rb - - - - - - - - - - -
-

dataddl.rb

- - - - - - - - - -
Path:lib/mcollective/ddl/dataddl.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index faa3bd9..0000000 --- a/doc/files/lib/mcollective/ddl/discoveryddl_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: discoveryddl.rb - - - - - - - - - - -
-

discoveryddl.rb

- - - - - - - - - -
Path:lib/mcollective/ddl/discoveryddl.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index e912850..0000000 --- a/doc/files/lib/mcollective/ddl/validatorddl_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: validatorddl.rb - - - - - - - - - - -
-

validatorddl.rb

- - - - - - - - - -
Path:lib/mcollective/ddl/validatorddl.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/ddl_rb.html b/doc/files/lib/mcollective/ddl_rb.html deleted file mode 100644 index 0fc4f16..0000000 --- a/doc/files/lib/mcollective/ddl_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: ddl.rb - - - - - - - - - - -
-

ddl.rb

- - - - - - - - - -
Path:lib/mcollective/ddl.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/discovery_rb.html b/doc/files/lib/mcollective/discovery_rb.html deleted file mode 100644 index 1aa8bb5..0000000 --- a/doc/files/lib/mcollective/discovery_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: discovery.rb - - - - - - - - - - -
-

discovery.rb

- - - - - - - - - -
Path:lib/mcollective/discovery.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/exception_rb.html b/doc/files/lib/mcollective/exception_rb.html deleted file mode 100644 index 9c00dcc..0000000 --- a/doc/files/lib/mcollective/exception_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: exception.rb - - - - - - - - - - -
-

exception.rb

- - - - - - - - - -
Path:lib/mcollective/exception.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 3d4f6c0..0000000 --- a/doc/files/lib/mcollective/facts/base_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: base.rb - - - - - - - - - - -
-

base.rb

- - - - - - - - - -
Path:lib/mcollective/facts/base.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/facts_rb.html b/doc/files/lib/mcollective/facts_rb.html deleted file mode 100644 index 0e15fae..0000000 --- a/doc/files/lib/mcollective/facts_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: facts.rb - - - - - - - - - - -
-

facts.rb

- - - - - - - - - -
Path:lib/mcollective/facts.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 53c1de7..0000000 --- a/doc/files/lib/mcollective/generators/agent_generator_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: agent_generator.rb - - - - - - - - - - -
-

agent_generator.rb

- - - - - - - - - -
Path:lib/mcollective/generators/agent_generator.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 8aa9fde..0000000 --- a/doc/files/lib/mcollective/generators/base_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: base.rb - - - - - - - - - - -
-

base.rb

- - - - - - - - - -
Path:lib/mcollective/generators/base.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 898ea37..0000000 --- a/doc/files/lib/mcollective/generators/data_generator_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: data_generator.rb - - - - - - - - - - -
-

data_generator.rb

- - - - - - - - - -
Path:lib/mcollective/generators/data_generator.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/generators_rb.html b/doc/files/lib/mcollective/generators_rb.html deleted file mode 100644 index 6aae7da..0000000 --- a/doc/files/lib/mcollective/generators_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: generators.rb - - - - - - - - - - -
-

generators.rb

- - - - - - - - - -
Path:lib/mcollective/generators.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/log_rb.html b/doc/files/lib/mcollective/log_rb.html deleted file mode 100644 index 9d920da..0000000 --- a/doc/files/lib/mcollective/log_rb.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - File: log.rb - - - - - - - - - - -
-

log.rb

- - - - - - - - - -
Path:lib/mcollective/log.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - -
-

Required files

- -
- mcollective/logger/%s_logger   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 0df66fe..0000000 --- a/doc/files/lib/mcollective/logger/base_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: base.rb - - - - - - - - - - -
-

base.rb

- - - - - - - - - -
Path:lib/mcollective/logger/base.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index a0adb4b..0000000 --- a/doc/files/lib/mcollective/logger/console_logger_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: console_logger.rb - - - - - - - - - - -
-

console_logger.rb

- - - - - - - - - -
Path:lib/mcollective/logger/console_logger.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index afbb235..0000000 --- a/doc/files/lib/mcollective/logger/file_logger_rb.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - File: file_logger.rb - - - - - - - - - - -
-

file_logger.rb

- - - - - - - - - -
Path:lib/mcollective/logger/file_logger.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - -
-

Required files

- -
- logger   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index a23b2f4..0000000 --- a/doc/files/lib/mcollective/logger/syslog_logger_rb.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - File: syslog_logger.rb - - - - - - - - - - -
-

syslog_logger.rb

- - - - - - - - - -
Path:lib/mcollective/logger/syslog_logger.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - -
-

Required files

- -
- syslog   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/logger_rb.html b/doc/files/lib/mcollective/logger_rb.html deleted file mode 100644 index 60c8a56..0000000 --- a/doc/files/lib/mcollective/logger_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: logger.rb - - - - - - - - - - -
-

logger.rb

- - - - - - - - - -
Path:lib/mcollective/logger.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 2dde3e1..0000000 --- a/doc/files/lib/mcollective/matcher/parser_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: parser.rb - - - - - - - - - - -
-

parser.rb

- - - - - - - - - -
Path:lib/mcollective/matcher/parser.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index ac90650..0000000 --- a/doc/files/lib/mcollective/matcher/scanner_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: scanner.rb - - - - - - - - - - -
-

scanner.rb

- - - - - - - - - -
Path:lib/mcollective/matcher/scanner.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/matcher_rb.html b/doc/files/lib/mcollective/matcher_rb.html deleted file mode 100644 index 451f187..0000000 --- a/doc/files/lib/mcollective/matcher_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: matcher.rb - - - - - - - - - - -
-

matcher.rb

- - - - - - - - - -
Path:lib/mcollective/matcher.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/message_rb.html b/doc/files/lib/mcollective/message_rb.html deleted file mode 100644 index 83f4c7d..0000000 --- a/doc/files/lib/mcollective/message_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: message.rb - - - - - - - - - - -
-

message.rb

- - - - - - - - - -
Path:lib/mcollective/message.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 3382b51..0000000 --- a/doc/files/lib/mcollective/monkey_patches_rb.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - File: monkey_patches.rb - - - - - - - - - - -
-

monkey_patches.rb

- - - - - - - - - -
Path:lib/mcollective/monkey_patches.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- -
-

-start_with? was introduced in 1.8.7, we need to support 1.8.5 and 1.8.6 -

- -
- -
-

Required files

- -
- enumerator   -
-
- -
- - -
- - - - -
- - -
-

Constants

- -
- - - - - - -
RbConfig=::Config
-
-
- - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/optionparser_rb.html b/doc/files/lib/mcollective/optionparser_rb.html deleted file mode 100644 index ce9e590..0000000 --- a/doc/files/lib/mcollective/optionparser_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: optionparser.rb - - - - - - - - - - -
-

optionparser.rb

- - - - - - - - - -
Path:lib/mcollective/optionparser.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/pluginmanager_rb.html b/doc/files/lib/mcollective/pluginmanager_rb.html deleted file mode 100644 index 502329c..0000000 --- a/doc/files/lib/mcollective/pluginmanager_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: pluginmanager.rb - - - - - - - - - - -
-

pluginmanager.rb

- - - - - - - - - -
Path:lib/mcollective/pluginmanager.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index de663f6..0000000 --- a/doc/files/lib/mcollective/pluginpackager/agent_definition_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: agent_definition.rb - - - - - - - - - - -
-

agent_definition.rb

- - - - - - - - - -
Path:lib/mcollective/pluginpackager/agent_definition.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 6d5e762..0000000 --- a/doc/files/lib/mcollective/pluginpackager/standard_definition_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: standard_definition.rb - - - - - - - - - - -
-

standard_definition.rb

- - - - - - - - - -
Path:lib/mcollective/pluginpackager/standard_definition.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/pluginpackager_rb.html b/doc/files/lib/mcollective/pluginpackager_rb.html deleted file mode 100644 index c4781c2..0000000 --- a/doc/files/lib/mcollective/pluginpackager_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: pluginpackager.rb - - - - - - - - - - -
-

pluginpackager.rb

- - - - - - - - - -
Path:lib/mcollective/pluginpackager.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 845076d..0000000 --- a/doc/files/lib/mcollective/registration/base_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: base.rb - - - - - - - - - - -
-

base.rb

- - - - - - - - - -
Path:lib/mcollective/registration/base.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/registration_rb.html b/doc/files/lib/mcollective/registration_rb.html deleted file mode 100644 index 667223e..0000000 --- a/doc/files/lib/mcollective/registration_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: registration.rb - - - - - - - - - - -
-

registration.rb

- - - - - - - - - -
Path:lib/mcollective/registration.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index e5bcaba..0000000 --- a/doc/files/lib/mcollective/rpc/actionrunner_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: actionrunner.rb - - - - - - - - - - -
-

actionrunner.rb

- - - - - - - - - -
Path:lib/mcollective/rpc/actionrunner.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index aa8ddcd..0000000 --- a/doc/files/lib/mcollective/rpc/agent_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: agent.rb - - - - - - - - - - -
-

agent.rb

- - - - - - - - - -
Path:lib/mcollective/rpc/agent.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index f0609b1..0000000 --- a/doc/files/lib/mcollective/rpc/audit_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: audit.rb - - - - - - - - - - -
-

audit.rb

- - - - - - - - - -
Path:lib/mcollective/rpc/audit.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index dfd5325..0000000 --- a/doc/files/lib/mcollective/rpc/client_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: client.rb - - - - - - - - - - -
-

client.rb

- - - - - - - - - -
Path:lib/mcollective/rpc/client.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index edb1a0f..0000000 --- a/doc/files/lib/mcollective/rpc/helpers_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: helpers.rb - - - - - - - - - - -
-

helpers.rb

- - - - - - - - - -
Path:lib/mcollective/rpc/helpers.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 3c94309..0000000 --- a/doc/files/lib/mcollective/rpc/progress_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: progress.rb - - - - - - - - - - -
-

progress.rb

- - - - - - - - - -
Path:lib/mcollective/rpc/progress.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 87f9716..0000000 --- a/doc/files/lib/mcollective/rpc/reply_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: reply.rb - - - - - - - - - - -
-

reply.rb

- - - - - - - - - -
Path:lib/mcollective/rpc/reply.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 87e39eb..0000000 --- a/doc/files/lib/mcollective/rpc/request_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: request.rb - - - - - - - - - - -
-

request.rb

- - - - - - - - - -
Path:lib/mcollective/rpc/request.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 3514b48..0000000 --- a/doc/files/lib/mcollective/rpc/result_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: result.rb - - - - - - - - - - -
-

result.rb

- - - - - - - - - -
Path:lib/mcollective/rpc/result.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index dcde181..0000000 --- a/doc/files/lib/mcollective/rpc/stats_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: stats.rb - - - - - - - - - - -
-

stats.rb

- - - - - - - - - -
Path:lib/mcollective/rpc/stats.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/rpc_rb.html b/doc/files/lib/mcollective/rpc_rb.html deleted file mode 100644 index 2e0ee3c..0000000 --- a/doc/files/lib/mcollective/rpc_rb.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - File: rpc.rb - - - - - - - - - - -
-

rpc.rb

- - - - - - - - - -
Path:lib/mcollective/rpc.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - -
-

Required files

- -
- pp   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/runner_rb.html b/doc/files/lib/mcollective/runner_rb.html deleted file mode 100644 index e606906..0000000 --- a/doc/files/lib/mcollective/runner_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: runner.rb - - - - - - - - - - -
-

runner.rb

- - - - - - - - - -
Path:lib/mcollective/runner.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/runnerstats_rb.html b/doc/files/lib/mcollective/runnerstats_rb.html deleted file mode 100644 index 5687dea..0000000 --- a/doc/files/lib/mcollective/runnerstats_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: runnerstats.rb - - - - - - - - - - -
-

runnerstats.rb

- - - - - - - - - -
Path:lib/mcollective/runnerstats.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 5d9f09c..0000000 --- a/doc/files/lib/mcollective/security/base_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: base.rb - - - - - - - - - - -
-

base.rb

- - - - - - - - - -
Path:lib/mcollective/security/base.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/security_rb.html b/doc/files/lib/mcollective/security_rb.html deleted file mode 100644 index 797d733..0000000 --- a/doc/files/lib/mcollective/security_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: security.rb - - - - - - - - - - -
-

security.rb

- - - - - - - - - -
Path:lib/mcollective/security.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/shell_rb.html b/doc/files/lib/mcollective/shell_rb.html deleted file mode 100644 index 8a399ba..0000000 --- a/doc/files/lib/mcollective/shell_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: shell.rb - - - - - - - - - - -
-

shell.rb

- - - - - - - - - -
Path:lib/mcollective/shell.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/ssl_rb.html b/doc/files/lib/mcollective/ssl_rb.html deleted file mode 100644 index eed84f5..0000000 --- a/doc/files/lib/mcollective/ssl_rb.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - File: ssl.rb - - - - - - - - - - -
-

ssl.rb

- - - - - - - - - -
Path:lib/mcollective/ssl.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - -
-

Required files

- -
- openssl   - base64   - digest/sha1   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/translatable_rb.html b/doc/files/lib/mcollective/translatable_rb.html deleted file mode 100644 index 82f7763..0000000 --- a/doc/files/lib/mcollective/translatable_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: translatable.rb - - - - - - - - - - -
-

translatable.rb

- - - - - - - - - -
Path:lib/mcollective/translatable.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 5352119..0000000 --- a/doc/files/lib/mcollective/unix_daemon_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: unix_daemon.rb - - - - - - - - - - -
-

unix_daemon.rb

- - - - - - - - - -
Path:lib/mcollective/unix_daemon.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/util_rb.html b/doc/files/lib/mcollective/util_rb.html deleted file mode 100644 index 2e26369..0000000 --- a/doc/files/lib/mcollective/util_rb.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - File: util.rb - - - - - - - - - - -
-

util.rb

- - - - - - - - - -
Path:lib/mcollective/util.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - -
-

Required files

- -
- win32/dir   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective/validator_rb.html b/doc/files/lib/mcollective/validator_rb.html deleted file mode 100644 index 4edb534..0000000 --- a/doc/files/lib/mcollective/validator_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: validator.rb - - - - - - - - - - -
-

validator.rb

- - - - - - - - - -
Path:lib/mcollective/validator.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ 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 deleted file mode 100644 index 9e96c41..0000000 --- a/doc/files/lib/mcollective/windows_daemon_rb.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - File: windows_daemon.rb - - - - - - - - - - -
-

windows_daemon.rb

- - - - - - - - - -
Path:lib/mcollective/windows_daemon.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - -
-

Required files

- -
- win32/daemon   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/files/lib/mcollective_rb.html b/doc/files/lib/mcollective_rb.html deleted file mode 100644 index 886f060..0000000 --- a/doc/files/lib/mcollective_rb.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - File: mcollective.rb - - - - - - - - - - -
-

mcollective.rb

- - - - - - - - - -
Path:lib/mcollective.rb -
Last Update:Fri Nov 08 12:57:19 +0000 2013
-
- - -
- - - -
- - -
-

Required files

- -
- rubygems   - stomp   - timeout   - digest/md5   - optparse   - singleton   - socket   - erb   - shellwords   - stringio   - rbconfig   - tempfile   - tmpdir   - mcollective/exception   - mcollective/monkey_patches   - mcollective/translatable   - mcollective/cache   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/doc/fr_class_index.html b/doc/fr_class_index.html deleted file mode 100644 index 9aaf78d..0000000 --- a/doc/fr_class_index.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - Classes - - - - - -
-

Classes

-
- Array
- Dir
- MCollective
- MCollective::Agent
- MCollective::Agents
- MCollective::Aggregate
- MCollective::Aggregate::Base
- MCollective::Aggregate::Result
- MCollective::Aggregate::Result::Base
- MCollective::Aggregate::Result::CollectionResult
- MCollective::Aggregate::Result::NumericResult
- MCollective::Application
- MCollective::Applications
- MCollective::Cache
- MCollective::Client
- MCollective::CodedError
- MCollective::Config
- MCollective::Connector
- MCollective::Connector::Base
- MCollective::DDL
- MCollective::DDL::AgentDDL
- MCollective::DDL::Base
- MCollective::DDL::DataDDL
- MCollective::DDL::DiscoveryDDL
- MCollective::DDL::ValidatorDDL
- MCollective::DDLValidationError
- MCollective::Data
- MCollective::Data::Base
- MCollective::Data::Result
- MCollective::Discovery
- MCollective::Facts
- MCollective::Facts::Base
- MCollective::Generators
- MCollective::Generators::AgentGenerator
- MCollective::Generators::Base
- MCollective::Generators::DataGenerator
- MCollective::InvalidRPCData
- MCollective::Log
- MCollective::Logger
- MCollective::Logger::Base
- MCollective::Logger::Console_logger
- MCollective::Logger::File_logger
- MCollective::Logger::Syslog_logger
- MCollective::Matcher
- MCollective::Matcher::Parser
- MCollective::Matcher::Scanner
- MCollective::Message
- MCollective::MissingRPCData
- MCollective::MsgDoesNotMatchRequestID
- MCollective::MsgTTLExpired
- MCollective::NotTargettedAtUs
- MCollective::Optionparser
- MCollective::PluginManager
- MCollective::PluginPackager
- MCollective::PluginPackager::AgentDefinition
- MCollective::PluginPackager::StandardDefinition
- MCollective::RPC
- MCollective::RPC::ActionRunner
- MCollective::RPC::Agent
- MCollective::RPC::Audit
- MCollective::RPC::Client
- MCollective::RPC::Helpers
- MCollective::RPC::Progress
- MCollective::RPC::Reply
- MCollective::RPC::Request
- MCollective::RPC::Result
- MCollective::RPC::Stats
- MCollective::RPCAborted
- MCollective::RPCError
- MCollective::Registration
- MCollective::Registration::Base
- MCollective::Runner
- MCollective::RunnerStats
- MCollective::SSL
- MCollective::Security
- MCollective::Security::Base
- MCollective::SecurityValidationFailed
- MCollective::Shell
- MCollective::Translatable
- MCollective::UnixDaemon
- MCollective::UnknownRPCAction
- MCollective::UnknownRPCError
- MCollective::Util
- MCollective::Validator
- MCollective::ValidatorError
- MCollective::WindowsDaemon
- String
- Symbol
-
-
- - \ No newline at end of file diff --git a/doc/fr_file_index.html b/doc/fr_file_index.html deleted file mode 100644 index d91831c..0000000 --- a/doc/fr_file_index.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - Files - - - - - -
-

Files

-
- install.rb
- lib/mcollective.rb
- lib/mcollective/agent.rb
- lib/mcollective/agents.rb
- lib/mcollective/aggregate.rb
- lib/mcollective/aggregate/base.rb
- lib/mcollective/aggregate/result.rb
- lib/mcollective/aggregate/result/base.rb
- lib/mcollective/aggregate/result/collection_result.rb
- lib/mcollective/aggregate/result/numeric_result.rb
- lib/mcollective/application.rb
- lib/mcollective/applications.rb
- lib/mcollective/cache.rb
- lib/mcollective/client.rb
- lib/mcollective/config.rb
- lib/mcollective/connector.rb
- lib/mcollective/connector/base.rb
- lib/mcollective/data.rb
- lib/mcollective/data/base.rb
- lib/mcollective/data/result.rb
- lib/mcollective/ddl.rb
- lib/mcollective/ddl/agentddl.rb
- lib/mcollective/ddl/base.rb
- lib/mcollective/ddl/dataddl.rb
- lib/mcollective/ddl/discoveryddl.rb
- lib/mcollective/ddl/validatorddl.rb
- lib/mcollective/discovery.rb
- lib/mcollective/exception.rb
- lib/mcollective/facts.rb
- lib/mcollective/facts/base.rb
- lib/mcollective/generators.rb
- lib/mcollective/generators/agent_generator.rb
- lib/mcollective/generators/base.rb
- lib/mcollective/generators/data_generator.rb
- lib/mcollective/log.rb
- lib/mcollective/logger.rb
- lib/mcollective/logger/base.rb
- lib/mcollective/logger/console_logger.rb
- lib/mcollective/logger/file_logger.rb
- lib/mcollective/logger/syslog_logger.rb
- lib/mcollective/matcher.rb
- lib/mcollective/matcher/parser.rb
- lib/mcollective/matcher/scanner.rb
- lib/mcollective/message.rb
- lib/mcollective/monkey_patches.rb
- lib/mcollective/optionparser.rb
- lib/mcollective/pluginmanager.rb
- lib/mcollective/pluginpackager.rb
- lib/mcollective/pluginpackager/agent_definition.rb
- lib/mcollective/pluginpackager/standard_definition.rb
- lib/mcollective/registration.rb
- lib/mcollective/registration/base.rb
- lib/mcollective/rpc.rb
- lib/mcollective/rpc/actionrunner.rb
- lib/mcollective/rpc/agent.rb
- lib/mcollective/rpc/audit.rb
- lib/mcollective/rpc/client.rb
- lib/mcollective/rpc/helpers.rb
- lib/mcollective/rpc/progress.rb
- lib/mcollective/rpc/reply.rb
- lib/mcollective/rpc/request.rb
- lib/mcollective/rpc/result.rb
- lib/mcollective/rpc/stats.rb
- lib/mcollective/runner.rb
- lib/mcollective/runnerstats.rb
- lib/mcollective/security.rb
- lib/mcollective/security/base.rb
- lib/mcollective/shell.rb
- lib/mcollective/ssl.rb
- lib/mcollective/translatable.rb
- lib/mcollective/unix_daemon.rb
- lib/mcollective/util.rb
- lib/mcollective/validator.rb
- lib/mcollective/windows_daemon.rb
-
-
- - \ No newline at end of file diff --git a/doc/fr_method_index.html b/doc/fr_method_index.html deleted file mode 100644 index 190f5b3..0000000 --- a/doc/fr_method_index.html +++ /dev/null @@ -1,523 +0,0 @@ - - - - - - - - Methods - - - - - -
-

Methods

-
- << (MCollective::PluginManager)
- <=> (Symbol)
- [] (MCollective::Facts)
- [] (MCollective::PluginManager)
- [] (MCollective::PluginPackager)
- [] (MCollective::Applications)
- [] (MCollective::RPC::Stats)
- [] (MCollective::RPC::Reply)
- [] (MCollective::RPC::Result)
- [] (MCollective::Data::Result)
- [] (MCollective::Application)
- [] (MCollective::Validator)
- [] (MCollective::Data)
- [] (MCollective::RPC::Request)
- []= (MCollective::RPC::Result)
- []= (MCollective::RPC::Reply)
- []= (MCollective::Data::Result)
- []= (MCollective::Application)
- absolute_path? (MCollective::Util)
- action (MCollective::DDL::AgentDDL)
- action_help (MCollective::Generators::AgentGenerator)
- action_interface (MCollective::DDL::AgentDDL)
- actions (MCollective::DDL::AgentDDL)
- actions (MCollective::RPC::Agent)
- activate? (MCollective::Data::Base)
- activate? (MCollective::RPC::Agent)
- activate_agent? (MCollective::Agents)
- activate_when (MCollective::Data::Base)
- add_common_options (MCollective::Optionparser)
- add_filter_options (MCollective::Optionparser)
- add_required_options (MCollective::Optionparser)
- add_simplerpc_options (MCollective::RPC::Helpers)
- aes_decrypt (MCollective::SSL)
- aes_encrypt (MCollective::SSL)
- agent (MCollective::PluginPackager::AgentDefinition)
- agent_filter (MCollective::RPC::Client)
- agentlist (MCollective::Agents)
- aggregate (MCollective::DDL::AgentDDL)
- aggregate_reply (MCollective::RPC::Client)
- align_text (MCollective::Util)
- application_cli_arguments (MCollective::Application)
- application_description (MCollective::Application)
- application_failure (MCollective::Application)
- application_options (MCollective::Application)
- application_options (MCollective::Application)
- application_parse_options (MCollective::Application)
- application_usage (MCollective::Application)
- audit_request (MCollective::RPC::Audit)
- base64? (MCollective::Message)
- base64_decode (MCollective::SSL)
- base64_decode (MCollective::SSL)
- base64_decode! (MCollective::Message)
- base64_encode (MCollective::SSL)
- base64_encode (MCollective::SSL)
- base64_encode! (MCollective::Message)
- batch_size= (MCollective::RPC::Client)
- batch_sleep_time= (MCollective::RPC::Client)
- build_rdoc (install.rb)
- bytes (String)
- call_agent (MCollective::RPC::Client)
- call_agent_batched (MCollective::RPC::Client)
- call_functions (MCollective::Aggregate)
- callerid (MCollective::Security::Base)
- canrun? (MCollective::RPC::ActionRunner)
- capabilities (MCollective::DDL::DiscoveryDDL)
- check_cache! (MCollective::Cache)
- check_capabilities (MCollective::Discovery)
- check_dir_present (MCollective::PluginPackager)
- check_level (MCollective::Log)
- check_prereqs (install.rb)
- class_filter (MCollective::RPC::Client)
- class_for_agent (MCollective::Agents)
- clear (MCollective::PluginManager)
- clear! (MCollective::Agents)
- client (MCollective::PluginPackager::AgentDefinition)
- client_stats= (MCollective::RPC::Stats)
- clioptions (MCollective::Application)
- collective (MCollective::Client)
- collective= (MCollective::RPC::Client)
- color (MCollective::Util)
- color (MCollective::Logger::Console_logger)
- colorize (MCollective::Logger::Console_logger)
- colorize (MCollective::Util)
- command_available? (MCollective::PluginPackager)
- command_in_path? (MCollective::Util)
- common (MCollective::PluginPackager::AgentDefinition)
- common (MCollective::PluginPackager::StandardDefinition)
- compound_filter (MCollective::RPC::Client)
- config (MCollective::Registration::Base)
- config_and_check_level (MCollective::Log)
- config_file_for_user (MCollective::Util)
- configuration (MCollective::Application)
- configure (MCollective::Log)
- const_missing (MCollective::RPC)
- contains_output? (MCollective::Aggregate)
- create_compound_callstack (MCollective::Matcher)
- create_ddl (MCollective::Generators::DataGenerator)
- create_ddl (MCollective::Generators::AgentGenerator)
- create_function_hash (MCollective::Matcher)
- create_functions (MCollective::Aggregate)
- create_instance (MCollective::PluginManager)
- create_metadata_string (MCollective::Generators::Base)
- create_plugin_content (MCollective::Generators::AgentGenerator)
- create_plugin_content (MCollective::Generators::DataGenerator)
- create_plugin_string (MCollective::Generators::Base)
- create_reply (MCollective::Security::Base)
- create_reqid (MCollective::Message)
- create_request (MCollective::Security::Base)
- createreq (MCollective::Client)
- custom_request (MCollective::RPC::Client)
- cycle_level (MCollective::Logger::Base)
- cycle_level (MCollective::Log)
- daemonize (MCollective::UnixDaemon)
- daemonize_runner (MCollective::WindowsDaemon)
- daemonize_runner (MCollective::UnixDaemon)
- dataquery (MCollective::DDL::DataDDL)
- dataquery_interface (MCollective::DDL::DataDDL)
- ddl (MCollective::Data)
- ddl (MCollective::Discovery)
- ddl_has_output? (MCollective::Data)
- ddl_transform_input (MCollective::Data)
- ddl_validate (MCollective::Data::Base)
- ddl_validate (MCollective::Data)
- debug (MCollective::Log)
- decode! (MCollective::Message)
- decodemsg (MCollective::Security::Base)
- decrypt_with_private (MCollective::SSL)
- decrypt_with_public (MCollective::SSL)
- default_options (MCollective::Util)
- delete (MCollective::PluginManager)
- delete! (MCollective::Cache)
- description (MCollective::Application)
- disconnect (MCollective::Client)
- disconnect (MCollective::Application)
- disconnect (MCollective::RPC::Client)
- discover (MCollective::RPC::Client)
- discover (MCollective::Client)
- discover (MCollective::Discovery)
- discovered (MCollective::RPC)
- discovered_agents (MCollective::RPC::Stats)
- discovered_req (MCollective::Client)
- discovery (MCollective::DDL::DiscoveryDDL)
- discovery_class (MCollective::Discovery)
- discovery_interface (MCollective::DDL::DiscoveryDDL)
- discovery_method (MCollective::Discovery)
- discovery_method= (MCollective::RPC::Client)
- discovery_options= (MCollective::RPC::Client)
- discovery_timeout (MCollective::RPC::Client)
- discovery_timeout (MCollective::Discovery)
- discovery_timeout= (MCollective::RPC::Client)
- dispatch (MCollective::Agents)
- display (MCollective::DDL::AgentDDL)
- display_stats (MCollective::Client)
- do_bins (install.rb)
- do_configs (install.rb)
- do_libs (install.rb)
- each (MCollective::RPC::Result)
- empty_filter (MCollective::Util)
- empty_filter? (MCollective::Util)
- empty_filter? (MCollective::RPC)
- encode! (MCollective::Message)
- encodereply (MCollective::Security::Base)
- encoderequest (MCollective::Security::Base)
- encrypt_with_private (MCollective::SSL)
- encrypt_with_public (MCollective::SSL)
- error (MCollective::Log)
- eval_compound_fstatement (MCollective::Matcher)
- eval_compound_statement (MCollective::Matcher)
- exclude_argument_sections (MCollective::Application)
- execute_function (MCollective::Matcher)
- execute_verbosely (MCollective::PluginPackager)
- execution_stack (MCollective::Log)
- exit_with_paren_errors (MCollective::Matcher::Parser)
- exit_with_parse_errors (MCollective::Matcher::Parser)
- exit_with_token_errors (MCollective::Matcher::Parser)
- expected_msgid= (MCollective::Message)
- extract_hosts_from_array (MCollective::RPC::Helpers)
- extract_hosts_from_json (MCollective::RPC::Helpers)
- fact_filter (MCollective::RPC::Client)
- fail (MCollective::RPC::Reply)
- fail (MCollective::RPC::Stats)
- fail! (MCollective::RPC::Reply)
- fatal (MCollective::Log)
- fetch (MCollective::RPC::Reply)
- fetch (MCollective::RPC::Request)
- fetch (MCollective::RPC::Result)
- filter_dependencies (MCollective::PluginPackager)
- filter_extra_options (MCollective::Applications)
- filtered (MCollective::RunnerStats)
- find (MCollective::PluginManager)
- find_and_load (MCollective::PluginManager)
- find_known_methods (MCollective::Discovery)
- findagentfile (MCollective::Agents)
- findddlfile (MCollective::DDL::Base)
- finish_request (MCollective::RPC::Stats)
- fire_and_forget_request (MCollective::RPC::Client)
- force_direct_mode? (MCollective::Discovery)
- force_discovery_method_by_filter (MCollective::Discovery)
- force_reload? (MCollective::Facts::Base)
- from (MCollective::Log)
- get_fact (MCollective::Facts::Base)
- get_fact (MCollective::Facts)
- get_fact (MCollective::Util)
- get_facts (MCollective::Facts::Base)
- get_metadata (MCollective::PluginPackager)
- get_token (MCollective::Matcher::Scanner)
- glob (install.rb)
- grep (MCollective::PluginManager)
- halt (MCollective::Application)
- halt_code (MCollective::Application)
- handlemsg (MCollective::RPC::Agent)
- has_agent? (MCollective::Util)
- has_cache? (MCollective::Cache)
- has_cf_class? (MCollective::Util)
- has_fact? (MCollective::Facts)
- has_fact? (MCollective::Facts::Base)
- has_fact? (MCollective::Util)
- has_identity? (MCollective::Util)
- has_method? (MCollective::Discovery)
- has_validator? (MCollective::Validator)
- help (MCollective::DDL::Base)
- help (MCollective::RPC::Client)
- help (MCollective::Application)
- identify_packages (MCollective::PluginPackager::StandardDefinition)
- identify_packages (MCollective::PluginPackager::AgentDefinition)
- identity_filter (MCollective::RPC::Client)
- identity_filter_discovery_optimization (MCollective::RPC::Client)
- in_groups_of (Array)
- include? (MCollective::PluginManager)
- include? (MCollective::Agents)
- include? (MCollective::RPC::Request)
- include? (MCollective::Data::Result)
- info (MCollective::Log)
- inherited (MCollective::Connector::Base)
- inherited (MCollective::RPC::Audit)
- inherited (MCollective::Registration::Base)
- inherited (MCollective::Data::Base)
- inherited (MCollective::Facts::Base)
- inherited (MCollective::Security::Base)
- initialize_data (MCollective::RPC::Reply)
- input (MCollective::DDL::AgentDDL)
- input (MCollective::DDL::DataDDL)
- input (MCollective::DDL::Base)
- install_binfile (install.rb)
- instance (MCollective::Log)
- interval (MCollective::Registration::Base)
- intialize_application_options (MCollective::Application)
- invalidate! (MCollective::Cache)
- is_function? (MCollective::DDL::AgentDDL)
- keys (MCollective::Data::Result)
- limit_method= (MCollective::RPC::Client)
- limit_targets= (MCollective::RPC::Client)
- list (MCollective::Applications)
- load_aggregate_functions (MCollective::RPC::Client)
- load_and_cache (MCollective::DDL)
- load_application (MCollective::Applications)
- load_config (MCollective::Applications)
- load_data_sources (MCollective::Data)
- load_ddl (MCollective::RPC::Agent)
- load_function (MCollective::Aggregate)
- load_json_results (MCollective::RPC::ActionRunner)
- load_packagers (MCollective::PluginPackager)
- load_results (MCollective::RPC::ActionRunner)
- load_validators (MCollective::Validator)
- load_validators? (MCollective::Validator)
- loadagent (MCollective::Agents)
- loadagents (MCollective::Agents)
- loadclass (MCollective::PluginManager)
- loadclass (MCollective::Util)
- loadconfig (MCollective::Config)
- loadddlfile (MCollective::DDL::Base)
- log (MCollective::Logger::Console_logger)
- log (MCollective::Logger::File_logger)
- log (MCollective::Log)
- log (MCollective::Logger::Syslog_logger)
- log (MCollective::CodedError)
- log_code (MCollective::Translatable)
- logexception (MCollective::Log)
- logexception (MCollective::Translatable)
- logger (MCollective::Log)
- logmsg (MCollective::Log)
- lookup (MCollective::Data::Base)
- main (MCollective::Application)
- make_subscriptions (MCollective::Util)
- mcollective_version (MCollective::Util)
- md5 (MCollective::SSL)
- md5 (MCollective::SSL)
- message_for (MCollective::Log)
- metadata (MCollective::DDL::Base)
- method_missing (MCollective::Data::Result)
- method_missing (MCollective::Data)
- method_missing (MCollective::Validator)
- method_missing (MCollective::RPC::Client)
- method_missing (MCollective::DDL::AgentDDL)
- mktmpdir (Dir)
- msg_filter (MCollective::Registration::Base)
- new (MCollective::RPC::Stats)
- new (MCollective::RunnerStats)
- new (MCollective::SSL)
- new (MCollective::RPC::Request)
- new (MCollective::Matcher::Parser)
- new (MCollective::Agents)
- new (MCollective::Data::Result)
- new (MCollective::Shell)
- new (MCollective::Data::Base)
- new (MCollective::Aggregate)
- new (MCollective::Matcher::Scanner)
- new (MCollective::Facts::Base)
- new (MCollective::DDL)
- new (MCollective::Aggregate::Base)
- new (MCollective::Config)
- new (MCollective::DDL::Base)
- new (MCollective::Client)
- new (MCollective::Aggregate::Result::Base)
- new (MCollective::RPC::ActionRunner)
- new (MCollective::Generators::AgentGenerator)
- new (MCollective::RPC::Reply)
- new (MCollective::Optionparser)
- new (MCollective::PluginPackager::StandardDefinition)
- new (MCollective::RPC::Client)
- new (MCollective::RPC::Agent)
- new (MCollective::RPC::Progress)
- new (MCollective::Generators::DataGenerator)
- new (MCollective::Logger::Base)
- new (MCollective::Generators::Base)
- new (MCollective::RPC::Result)
- new (MCollective::Discovery)
- new (MCollective::DDL::AgentDDL)
- new (MCollective::CodedError)
- new (MCollective::Runner)
- new (MCollective::Security::Base)
- new (MCollective::Message)
- new (MCollective::PluginPackager::AgentDefinition)
- new_request (MCollective::RPC::Client)
- no_response_report (MCollective::RPC::Stats)
- node_responded (MCollective::RPC::Stats)
- ok (MCollective::RPC::Stats)
- old_rpcresults (MCollective::RPC::Helpers)
- option (MCollective::Application)
- options (MCollective::Application)
- options (MCollective::RPC::Client)
- output (MCollective::DDL::Base)
- parse (MCollective::Optionparser)
- parse (MCollective::Matcher::Parser)
- parse_fact_string (MCollective::Util)
- passed (MCollective::RunnerStats)
- path_to_command (MCollective::RPC::ActionRunner)
- pick_nodes_from_discovered (MCollective::RPC::Client)
- plugin (MCollective::PluginPackager::StandardDefinition)
- pluginlist (MCollective::PluginManager)
- pluginname (MCollective::Data)
- prepare_installation (install.rb)
- printrpc (MCollective::RPC)
- printrpcstats (MCollective::RPC)
- process_results_with_block (MCollective::RPC::Client)
- process_results_without_block (MCollective::RPC::Client)
- publish (MCollective::Message)
- publish (MCollective::Registration::Base)
- query (MCollective::Data::Base)
- raise_code (MCollective::Translatable)
- read (MCollective::Cache)
- read_key (MCollective::SSL)
- read_plugin_config_dir (MCollective::Config)
- receive (MCollective::Client)
- received (MCollective::RunnerStats)
- reply_to= (MCollective::Message)
- report (MCollective::RPC::Stats)
- req (MCollective::Client)
- requires (MCollective::DDL::Base)
- reset (MCollective::RPC::Client)
- reset (MCollective::RPC::Stats)
- reset_filter (MCollective::RPC::Client)
- result_class (MCollective::Aggregate::Base)
- result_type (MCollective::Aggregate::Result::Base)
- rpc_result_from_reply (MCollective::RPC::Client)
- rpcclient (MCollective::Application)
- rpcclient (MCollective::RPC)
- rpcoptions (MCollective::RPC)
- rpcresults (MCollective::RPC::Helpers)
- rsa_decrypt_with_private (MCollective::SSL)
- rsa_decrypt_with_public (MCollective::SSL)
- rsa_encrypt_with_private (MCollective::SSL)
- rsa_encrypt_with_public (MCollective::SSL)
- ruby_version (MCollective::Util)
- run (MCollective::Applications)
- run (MCollective::Application)
- run (MCollective::Registration::Base)
- run (MCollective::RPC::ActionRunner)
- run (MCollective::Runner)
- runcommand (MCollective::Shell)
- safe_system (MCollective::PluginPackager)
- save_json_request (MCollective::RPC::ActionRunner)
- saverequest (MCollective::RPC::ActionRunner)
- sendreq (MCollective::Client)
- sent (MCollective::RunnerStats)
- service_main (MCollective::WindowsDaemon)
- service_stop (MCollective::WindowsDaemon)
- set_backtrace (MCollective::CodedError)
- set_config_defaults (MCollective::Config)
- set_default_input_arguments (MCollective::DDL::AgentDDL)
- set_level (MCollective::Logger::Base)
- set_logger (MCollective::Log)
- set_logging_level (MCollective::Logger::File_logger)
- set_logging_level (MCollective::Logger::Console_logger)
- set_logging_level (MCollective::Logger::Syslog_logger)
- setup (MCollective::Cache)
- setup_windows_sleeper (MCollective::Util)
- shell (MCollective::RPC::ActionRunner)
- shellescape (MCollective::Util)
- should_log? (MCollective::Logger::Base)
- should_process_msg? (MCollective::Security::Base)
- should_respond? (MCollective::RPC::Request)
- sign (MCollective::SSL)
- start (MCollective::Logger::Syslog_logger)
- start (MCollective::Logger::Console_logger)
- start (MCollective::Logger::File_logger)
- start_publisher (MCollective::Client)
- start_receiver (MCollective::Client)
- start_with? (String)
- startup_hook (MCollective::Data::Base)
- stats (MCollective::RPC)
- str_to_bool (MCollective::Util)
- string_to_boolean (MCollective::DDL)
- string_to_number (MCollective::DDL)
- subscribe (MCollective::Util)
- subscribe (MCollective::Client)
- summarize (MCollective::DDL::AgentDDL)
- summarize (MCollective::Aggregate::Base)
- summarize (MCollective::Aggregate)
- synchronize (MCollective::Cache)
- syslog_facility (MCollective::Logger::Syslog_logger)
- t (MCollective::Translatable)
- t (MCollective::Util)
- target_collective (MCollective::Registration::Base)
- tempfile (MCollective::RPC::ActionRunner)
- template_for_plugintype (MCollective::DDL::Base)
- templatepath (MCollective::Util)
- terminal_dimensions (MCollective::Util)
- text_for_aggregates (MCollective::RPC::Stats)
- text_for_flattened_result (MCollective::RPC::Helpers)
- text_for_result (MCollective::RPC::Helpers)
- threaded_req (MCollective::Client)
- time_block_execution (MCollective::RPC::Stats)
- time_discovery (MCollective::RPC::Stats)
- timeout_for_compound_filter (MCollective::Discovery)
- tmpdir (Dir)
- to_hash (MCollective::RPC::Request)
- to_hash (MCollective::RunnerStats)
- to_hash (MCollective::RPC::Reply)
- to_hash (MCollective::RPC::Stats)
- to_json (MCollective::RPC::Result)
- to_json (MCollective::RPC::Request)
- to_s (MCollective::Aggregate::Result::NumericResult)
- to_s (MCollective::RPC::ActionRunner)
- to_s (MCollective::Aggregate::Result::CollectionResult)
- to_s (MCollective::Aggregate::Result::Base)
- ttl (MCollective::Cache)
- ttlexpired (MCollective::RunnerStats)
- twirl (MCollective::RPC::Progress)
- type= (MCollective::Message)
- unconfigure (MCollective::Log)
- unsubscribe (MCollective::Util)
- unsubscribe (MCollective::Client)
- unthreaded_req (MCollective::Client)
- unvalidated (MCollective::RunnerStats)
- update_stat (MCollective::Client)
- usage (MCollective::DDL::Base)
- usage (MCollective::Application)
- uuid (MCollective::SSL)
- valid_callerid? (MCollective::Security::Base)
- valid_level? (MCollective::Log)
- valid_levels (MCollective::Logger::Console_logger)
- valid_levels (MCollective::Logger::Syslog_logger)
- valid_levels (MCollective::Logger::File_logger)
- validate (MCollective::Message)
- validate (MCollective::Validator)
- validate! (MCollective::RPC::Request)
- validate_cli_options (MCollective::Application)
- validate_compound_filter (MCollective::Message)
- validate_filter? (MCollective::Security::Base)
- validate_input_argument (MCollective::DDL::Base)
- validate_option (MCollective::Application)
- validate_request (MCollective::RPC::Client)
- validate_requirements (MCollective::DDL::Base)
- validate_rpc_request (MCollective::DDL::AgentDDL)
- validated (MCollective::RunnerStats)
- validation_fail! (MCollective::DDL)
- validator_class (MCollective::Validator)
- validrequest? (MCollective::Security::Base)
- verify_signature (MCollective::SSL)
- version (MCollective)
- versioncmp (MCollective::Util)
- warn (MCollective::Log)
- windows? (MCollective::Util)
- windows_prefix (MCollective::Util)
- write (MCollective::Cache)
- write_plugins (MCollective::Generators::Base)
-
-
- - \ No newline at end of file diff --git a/doc/images/brick.png b/doc/images/brick.png new file mode 100755 index 0000000000000000000000000000000000000000..7851cf34c946e5667221e3478668503eb1cd733f GIT binary patch literal 452 zcmV;#0XzPQP)Pdwe5?6tW?r-ok|b$oDQj8FV%kZPq;(MWOV8?8;<)(iP}>hNMU> z7fbz%jjlr7h8uuoQ~J6}n}@Y@PdTk=)PxO{%7zmL?dchpZX*~n;I{!C>*(8cU;q(~ zAS%Po_@naEU!xidrBXD?;hN|x^%W|Ij)0y*r5vi|?W&Fub(NqJ@z0o=O&SR3v>A``^efOSo-hEdApp;^Jd;9y!%1UfzX6Bh- z%-mbG|0Na{7Ruai_Y+DEb1s+b!*9k%Q!whMxjtZKA*?o;i1g&jy0@( zaU=-@d-h+o%gal6JRXEXA&L3`d2 z%jIxzZ~*p9O-;EJp_Ds0If38rM<5W8ic~K>FOK&2_p!CLg^i63OioVb6k$)zWHLx3 z5;!|M!}<9+#QSi1dRlbEcxPt^;cysUuU8@%3}RwpLRIGG<|IKnoyP6$Eh3SKw7a*r zSDXP=IYc&YZf;7@?fCe($^l9ORaJ3wbAx0uiC8QqRr$2t-Cfy8%XCI3B%pxJW>XdM zw~zPt_s}#A@pxQ5Ly)4szaMtH9lgE1SXx@b+S(fW`ub$fYPE8J7#bSNDzme*Ub07{ zQKV8SjEs!%0@v5ql8ggm!@$6Rbi^E8vBqpRM-}l+@5OSMrl+TWj*gC^qoV@>u{fQb zov5v?g~?>X@bEC&+uLPaQ&Ypn-y~^mZA}+f(&2EFH8eE%dU|@ENpN*_1-)L6_4Rc* zFuq@`IjX9vp1QiaK9ZojyZhnQURP99d=u;%37VRkpwsD4U0sd3x;hEQB&e^i|3QN0 z=H|Os1fRqaw!?#igLmS4HE!G3*ce(`TF} zlgUq0Q544c8(ae&UR$8ps&snq6^bPY3v3xAmMW74Di$h~GCH6E3TaYs2#6A<7K*gC z777H71_Wa;(dfp+g-drPCSWu)#PInZi72LJ;o?i~$-U=y&UbQ89Dul3%3P+Axkzc* zbH-y;QF=hR{qLItf%ci2_&e5wNo0gnVatG?ul6Zw=o$I9Ljfn*ic3`U?>IfEim3g{ zujU&$-hy6wn;w(xme|zJm;lWJxtTFfM)q0`kX!Vu0+d${$}LCddK1<^htTe-fUYL3 zB`SdNsZD>RgvLj1<^@h6_+cDRK2Brcr2~>%$*5S)hyV33PV^teac3%|4lz@8p4?)5 z?t5o^?q+%^%)Yygo~I^U4VR!bTnWuE35hcWrfCDR3q+sxJ79e7Fg`&)RCqLA^2^y^ z0laVfadW90_Fz8Brm|r47sB^u1VgI>kanj)Z4`zMSfHlm8>CwXa$JVM`$2RrmZB-3 zN10m-!;BvH*Br3V8t`DH7m`jf#2upVDXl{5ff18_pzCPK1Zu$$CKKvd8FGeFf)+K<|x33pc7P&S#3GZT4mEw;nr(Ze*F z3&*?-4U-lm*#tber5 z%S_ceqB`b3ko6r~BbvDwdohTvP(3a(pq{x#T$yQsu#OKwEe}KuH^Mh@nxg_(Nw136 zq#a^3xNBke)In+!?qk3%4wB69{pF`Tzg`07*qoM6N<$ Eg55P&8UO$Q literal 0 HcmV?d00001 diff --git a/doc/images/bullet_black.png b/doc/images/bullet_black.png new file mode 100755 index 0000000000000000000000000000000000000000..57619706d10d9736b1849a83f2c5694fbe09c53b GIT binary patch literal 211 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^zbpD<_bdI{u9mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-$h^>lFz(Kw&{<9vg>5sw~gS5O!4 zr|{HuUFIBKiQyL}eBJ-L{`UVT|6_O~L{G%N{Wbre{kQtZ_0LvEhC#5QQ<|d}62BjvZR2H60wE-$h^mK6y(Kw&{<9vg>(S^W+6Zii9 z|Nhthr~iNb*Z!}6uiN$Dz5neG3a-`baBX8yz1H+_;eX)`ni0%X8XBDc-`=Ph(Uan2 zYsR{H!kvIN--9isvHznRsC#5QQ<|d}62BjvZR2H60wE-$h_H=O!(Kw&{<9vg>(S^W+6Zii9 z|Nhthr~iNb*Z!}6uiN$Dz5neG3a-`baBX8yz4q@v|B?28{s)#N@CGn3@%_y|zAV9T z66e<&B4?b6oF&azg|C(V&1ZbI_D}pL`}(^FT2yXwG1Ph~$Q@h8mJYOz!PC{xWt~$( F699+YQR)By literal 0 HcmV?d00001 diff --git a/doc/images/date.png b/doc/images/date.png new file mode 100755 index 0000000000000000000000000000000000000000..783c83357fdf90a1c7c024358e1d768b5c09c135 GIT binary patch literal 626 zcmV-&0*(ENP)5OC%H;f`~O(q$Q#t2<^v$A>fbmv%e#dKTwK=Ku{5lS|}<-`a#7b zzTCOnnT>at)D}AMFuOZ5&%EqFN(lyumd$2ASF6=;nM~%2?gqc@U=#|4PqkX@EBo-9 z7pD#bO_RUa>*faM`8;MYfVi$JnB-zcBFc6gjl$d!bF98Q!!!(Z1_R~P?e!pt#6CHJ9S&n_n&@=9 z%GP;!@Co4c*at+6vNz7o(6en^Q1%qHrc;1)9IRaz-$@S$Z-qdC^ds3X0NvQH;KS)D z-dh&rW&@X;1cS(45z)J&BVt+tv&GMVJ%!EiW) zLBGZW)#Z+gl-Lih&?>X3SS-S#ujQ;9JRXmIB7X)8`d6ETj)D#Q2+$s|<_b7-B9Xvq zwNfqlEp%y3$uY`h{Y$(Gn5@}sqEsq95lpAkFO5dyBmP6^H-51G4J|rN2Ujt<`2YX_ M07*qoM6N<$fP)IO9T&v~?D!=C@G6X*U1@h2}>2WE%HrrsjTfQsh6N9%SR25A5rkWp0g zzi;-6|3HJE;58sAyX1e@^d7EwiKQLb00%dp|5+t<{|l;G!D3eSuFDma zRCxr2MVY_`ELgLXqo}ssqp5E;*r|opZT~&|!~VN?1^mw`Yxp0VmiIp*r|Ey~#AW|W zTBd;IxVd?%*x1<_!3Ip2yP9Rn!u1aqt=siKx4a3At0%7dKV|u@|9wlg|7x7R;eT!K z{QuFp&Huxb3&AdAW?^~2z`(!^HUQ{cR*=op7H|BYU0VMi3A-|5H&#ol!zs_8lnTUg(&PtE($2Dhdk=&(F^R z|KGZGj(DV`tD_*NsU$2QNCCXqf9n(sfdh~LzJJdCa}5CGoUI+JZJBOCDz({abl~fE zw*5kfzVoR6cNi2r#C!ZEH0O;NW@rIh| zlqsqSSs9s#;sV;-@|>77A1W_O_DV`91Pq4Kz`Z(PaO&pn=GOMkuU$ROkc5GuVd!Y* zcn`UMYkYq7V07o@rsi~>-ziMLT zG+?a49zQWzia{TFcs{FKj#dh}e#z5@`O3omC>ELXboP2cR7WT?J@&ao#fn-I;sJ*F zD;=5p9?%y~V{F{q4^{|Zlt~d?*Ve!iWj&E%8@h^*gN$V29v5mAsN{O(ULD=kFMd^> zzLGLp)CZ#Qm6Q%3+`@kXtfre9GnE->Ai(oKKDoxtH@hRaB&C1e=IHR>I8;havNP_A z5Rq#nPVBdI5VpJ;S&et6>VVp>c?LwQ)tZWlq#H^i>)VP@16GREXU98`irCrvkEecY zkv~S7^T>M0*)Mb{LvE6`M77!t_ZXXI^`uU6W|L`YE-^~uca*s^)=F=9o*rxs>$qx+ zN_$rAd`ahYK2^cpF)HkQ1(Vq|Urh;b~<55D)DL$EUNo=p_A6VQ1A+M~) zfa$>U0O5Rbu4r3$+|O$+gUQaOR@{dPsf3U1Dln%z0(Y0xq^w4=AKW8UMLXPC9RL7* zZ3?i~&mg|kvE%&Q2{D=<{q^E0^^uNwISF-V^g!SN_6Pp zHm8=*qyzo0O&|aW=mQ}BV^c}pv_6$imk>cA#v4GgKI?F@S#sYw42|o9Jp1uLDt+Ls z2-H#~>q=LQWTF;nU7xJYKH2KCI4{O5B$T{{EgN}dE+rE|#F+n@O!gj|u;Xxe?Su03 z2tWqC_4M@)#<@OoQ{pg&@m`>d=YYXNQlKHoj2tjT2nB<`FCZcENCi2SLd5c#Iz{+w= zQMis*31e?RPgP7h#4AOzY&hE#R4n&Ii?x5Yq0)?J7KNcBj@XdX zlWZ;>n^k?`V`54w4oMu!H=JW%u_9}!!vS4^ZMC2#K+@g2!t)G5*y)(xiYlL_px35D zIhY0lK348EIpV!%r-=F;O(7xbv>oQP6>|(>Opp4COU-9M>Q6ub0PdDCFo(En#x&eN zGni{g@pt^Yi&Zk-WUSBg%!GQT&imw!)F&}=v0^+ zPAeQFDhtKVnUuxMHpDJZ^)IYcqn3l$E3tGu>6%O0JW{Qd&uUAT_CJz)Db-2{$Z4Cq zibD~-93PZJRMP~xt4_LEY#WADM=C$k2DOim8}|&T7PflIw)ySUdh%=c{&;)e+r`Hd z>F)2L5sYyl@Pwfv-Z+Q9(~d^Q%E@BrXlV!+zKk$1SUf5lN)jz7MS>v}FnGm>Qbf5( zWmQ8>Y4OMAhWe&Lk?b!b?Oi z7q@cwX@48D4*Plhd-GIrduvP}Ef)tlzfP@U!q&vPH#vyU*UZF+Z1UXs%zV%z6LOs+ zcaVxUJ2&!|`1z(BM}Lk=9HZd_-+C?1s|j(*3pM}K)5P_O^ZvgjpgCOOIH^P=rz zrnafS&0I?@i8t47Fuv>lf^b*BgG?Gr8}Rx=$^MeEIq58C~R;2W5b2+Z6DSOmY&y?jM>PP zmCH(!b;p5a z08~hSk!QD03@!sbLen@urU{Gbn>9K(ikm zl#3h~9C5N=ig9Rs_qtTd=#qk`!ZGs7NvnMZ+uzd@j(?Rvpko)yuH)l~lSKOGS)aBD z7_OmZBdg=SE=0lny&|8m4WGI#J|9BJ}fBGEjmh_+3QFV-yUQn(l{$5#`e$ znfciyaIqFV2bzbhDu?7{<$RLQFC=|ws^?CtX)4I8sO>-(eMb1ar-sUdK)fzgqvMk> zZ^Rh)#8kxW$|S;j1HHPvzPz`!bA(!5h*+9K{Bl4}FHo45&3%yp?rDAP3~x@+ME*8G z&}mIK2Y`4+qxB<9rNt@5hlZ)HG`HKZFPtZ(CdCW@wfOGs!rXe8 z-mBDPnj{HhE4Ayk=DMsy6c5sbcY=`3>S0gZ@AO)^Sd)t$p13pA3PJ#dmLDTD1s}Wz z02ItQF~53Ov+wZ2P`n_U4VAJGo_<)CMpqJ3n-|`KmS8^ z<6NCKAuP(yrPRXiqft#MxAk}%PIb2CItemH*OUB$_E1dAyieI6EigfeNusQvXT~9L zwllbU*O+j+W5Qti)3H?p?*D`9lDN^-b^Q#pv$U8g4>1bxARs=rK5^IfwL5Y4H4Pl{I}`^(PH1gYU{*wqe@3$h1OCneK4J4!&MRe zOI%s;fxPp5H9Bx6x{QqEsK*Hpw`q|yBo$$v_ZDvLxN=kn=g9|eG|t{-cBCa zWSp2ev%7lwBK@tsaE^R7fx&OwUGQ#^arcni@_`qa0+Ih<3e19Mf+3k%g+)@Z0>QL0 z!HU9+@@y$mUhU^$zNMt8xbj1@av;@3!U%#u{N{thykrE-duU`-05?CiI5){L zy%f8$xwgE)K0S*=93sE3FU*{+{yF$b=Jm0O!B_#^eoI(9dVeEu^GYSFGhk6VM2eP; zSzH6(dYAFYJ=IMG-RZ%6^E|!yINDStfqn3^nx(_a*MMt-QOJ6FngYP6Flzi8{}M1u z?#m8_6qlhH0|2mB*E(B$x{iH!qh!(v^CX*om>t8m-!J2T%OyrE@fg!+W!rCupnGfE zR%c(5_C1*?Q|=SfK?@c3?d{0gfIk6Qne%2NAR%5!D1e2lrEA=#=314|^y}mlbdU!h zPIxs%P{lm;bYgjBs1qyXxkN6UD66G>mRl#Xr4z~PvG$je@$TcPPQN{YiFfsV4Ahz{ z;nj44T{SOdcs1301%HU_N_w4#jyn9@;-ar3_x<_h`fhkmBj(Iby8UQuwZ@CP3EK}j zbXm^OyhBqkWQ~AeVy^iVB)4Wh)+=b5--vjbtrvx4823+e>fN%unKd+&T&~@;LSp8#I-|*I=U2LzE0($<|LW%XsA_XQ z3>6@ct56W8`Y2>d{!pjH=F?<22mf_ejVWx&mfsLml615hA!(-FDBnc-jDQv_NKXNy z(=8#eu15MT`JMYUW~~vr%z{`z9S|~|_VAY6Ov4M7#Wa(*O#3EWzRYv@&_zy|0i*@_46?BhYPPEpVGD|(a((4@b>fF)l-3jQvCcv z{o)yqMWo1gDTG1vWp=_AJoP5UPxA^qrdn6*;Qh%^sB8>DcX5d2bXh zu<5X$-n2+RVUy$k%$jmfMxgu4ZWTs$Oy{Q?tryu(5>W>)zs2)w zHL}wWPpTzwL2MM8=lkwHp3#jyMe3%J0Av0)*ixKl2lMvu@{j$n91n^pNe|jd``l0N z0RU<BSv#yWY}G&Kb9IUxK2(l z!4Sz=T3g)J1mqFu!`seMX@O}Bp}gyZ@I7GK*7vWYuax&DJ=8$){{tXS> z7+}lu)M-J126vy;?q&^}iM1!NCf1I@E@@H~O-PIlsM7kknVdsATr@pmBo(C~$G6gS z02;)2O@0&~`#fHDeC1eCZZs;s2N)@A;Z!v}6IRW@+w4GRSlrsuorBjfJ?y*o(0gj> zt+;DN~K1pX*UvM(B(Di$9F6+&eT z#bhNzlMA>q^N?j+@1IqnYvK};_)_77Ts{!elaGqJg{uwb(1mX6u=pkfLJYkfX+`v! zOm>eolNV>Nz$A&W8YqkN#cU|#i6j>Ox+Eu4*8Myq{Eq?u*kn+nT zQ@k8?r`Isov^UI2=T{#K~skC)fRP-aj zcrJyQmQ!u>p5&{_zp7xOM(Q%smb6M%g6o4s^>A8#L41?8Ox^e7CM$W~*3!e8F7P`S zK9!26tqJVBt`?fLxM^Gf`xAacdcbz&)u<6pKM?qA_ms76BOQWg0Le^W#?SMIT$jE7 zyw1!lG*$#k#iqZyl9~L_CjIwBb}$%9+e2Vw!1@$nfpvj1y2o4hJabo7^;(V}>++Tz z{|NtdydBeFpKnv*Vg9BTu3P)+)3J?9`*6t|c{b*k>-L!PvY`#5^i1^XCnxh zky})0T&rp6 zJFwUVv-;Dzt2_z1)}rtpHBQH#<-`N0%%UP1TF^VNx2@~Zh_4nbMMxj7zeHTrB&q)a Dl)1NK literal 0 HcmV?d00001 diff --git a/doc/images/macFFBgHack.png b/doc/images/macFFBgHack.png new file mode 100644 index 0000000000000000000000000000000000000000..c6473b324ee1dae1faaacc0826639833f551116c GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~%1|*NXY)uAIEX7WqAsj$Z!;#Vf4nJ za0`Jjl>Qs8<JF;+Fd5q0wCR k?u=~bH}2*0f`J3~k>FVdQ&MBb@0BAfpf&c&j literal 0 HcmV?d00001 diff --git a/doc/images/package.png b/doc/images/package.png new file mode 100755 index 0000000000000000000000000000000000000000..da3c2a2d74bab159ba0f65d7db601768258afcb2 GIT binary patch literal 853 zcmV-b1FHOqP)5TQ^(M5v$(QKVE?W+9X! z*o}&~6c?_FreF)9NJB7b5Nbn{G0n4+%uJhR9(V5R|NFTpb|HgjefT!tIhLx@DR+N) zV+fHiR5Yt19}k|KnCsND{tH-`IMJ)3AE?OtyZ4>Un|6(d%h#JK`i&a7^xW9>`yBy` zS4SOHeOpC7$?hH5-#7Rswiue_8Ju*2N@$58=a#2OTA3png`w3v->gWif7t%e$ z$NLVS!tFT#8WL|Wa&K~+{%4P2cRfwesYV1_!F=3OaRVHl(>=`%&{x*s30c}#CNE@&;ItrAv!f!)Oy$Q9t$uS=(sD$-J{T*^(8Eez1E-l3}} zPrfHZ1`qsIFe&gipuL8-IZbo2Yg{lFGKs?ZZWcOaOdk*3`5T;$?AjbG1#`B510Er^h2)2r3Y{!8_2Gj=$KzuN5 zaErtW8W_Y2iJJjY)5pmTVJoPJYpanPOEuYHclM^C1F>${hFRpdi8a<2H|Xudf78bm(zwJ9`K%6I?q*Ua~ fW9JvIbn5*B+_J)rUMBs>00000NkvXXu0mjfH&TkY literal 0 HcmV?d00001 diff --git a/doc/images/page_green.png b/doc/images/page_green.png new file mode 100755 index 0000000000000000000000000000000000000000..de8e003f9fb8752c09e7f3655d5d8664b5c62fc3 GIT binary patch literal 621 zcmV-z0+RiSP)QqUjAtB;_Vvt6}AS_5YgM`Uqu`yva+H8^=4U$e4gHb}u zAQ2N{V3A%pO|?Pv?tb6z=jC}SiRa$G^v3q?*6XcYz$p|cq{uLj@#~Fi`J(>5{@&&N zy%T^+;>8cXx%|o77anP?&W1?1A(>-T49z9pyeCl@7YI+Si zKti7=B~``}TImz(G{0PnlQA3P#MAd}sorMjkP!50B7$nAkU^%#nl{Q9lW0@}9fE-> zN(q7tRuiC_T1r|BBtVBTlQ2+70$Rf;eF`Z;lx46Cpu-rEgb)EBKq(b^W8l<^We(`D z43?0=01z<3G6+UUv6`CsWCk6^93!#+<;ws7007{zS3k2k9-zZKFO~(k`>s0y006+1 zgF_jyIhsL-`FMf~JL~C=cV75(CrJ|q;MVO961G=O zm9d)YpJg5g(4i_HKL75eSE}mq$Y}r}hyVdcV~p>6a}oXr80q`oj%+s700000NkvXX Hu0mjfPs|!l literal 0 HcmV?d00001 diff --git a/doc/images/page_white_text.png b/doc/images/page_white_text.png new file mode 100755 index 0000000000000000000000000000000000000000..813f712f726c935f9adf8d2f2dd0d7683791ef11 GIT binary patch literal 342 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^zbpD<_bdI{u9mbgZg z1m~xflqVLYGB~E>C#5QQ<|d}62BjvZR2H60wE-%6;pyTSA|c6o&@eC9QG)Hj&ExYL zO&oVL^)+cM^qd@ApywS>pwx0H@RDN}hq;7mU-SKczYQ-hnrr=;iDAQMZQ+*g=YOM= z!QlMQEn7FbaD->uKAYgo_j9)W&$$zS*W9}m(ey0q$&7l-XEWO0Y(9M=SnhLbwy;d>@~SY$Ku*0xPvIOQeV1x7u_z-2-X>_74(yfh7C znXL|3GZ+d2`3re2hs?MKC#5QQ<|d}62BjvZR2H60wE-$R?&;zfqH(@;q9b3Efq-lM(nr^( z=EYR73-9e)UYMWsXy%?aZsD68Yyv^2$~6QgEcljw%kx>O(f-gQ?@fOOx3A-0+Qw?O zRx~W)kn~Qe2d6f9nMG#g9Q04Mk==M~N!Dglvxk!fgVh#w@ZV$IY1+Xc`d{d2UcaP~ zfWp)_Ivqj}l2SPy^9ZWy6rG9Yx4v67_uA&&9|XA~5-#3)W3%em1peD8RWH^#O%XoM zxMPud%}GTj#~*+7JMxTd!`{^Q+>(D3*|@KV`*G2;{QnANOxu1$r2xIe;OXk;vd$@? F2>@zac~<}c literal 0 HcmV?d00001 diff --git a/doc/images/plugin.png b/doc/images/plugin.png new file mode 100755 index 0000000000000000000000000000000000000000..6187b15aec001b7080b51a5f944f07591f26cc15 GIT binary patch literal 591 zcmV-V0eEcNHZMNv|IbJ-M`( zKwWL~opzjJe^WpCmV9E;(0&ut2;4va_(#>M8)>9$R5viQnf(Nkh~VM$y>J(jqb$cj z+nL1Nm|mV)Gm|9MnHf*7Ja4OEAQz__^LRKOLEwqpiGV^^A*T=#&inGm-62Xs;dnSp zKj&H9T*boh2i)W+(n27l!C)>fq|L%VB1i ziC4p;NwV_}ZjW7$LRW#(_bKF#hp=!IqNO26Z*w2+LEwx{PVnZ&Sn}T;mtzb$;qA*nT@@+ zV5uQ@iXDTPoTbV#FRr~z04|PPh`wXTNoCm9*tG&?e3+fYl>K6+&3|Cc$KOpL`ER+_ dcRl5U#9zn6ZO}GFk7R5;7c zlif>`Q5?tj7Yw@ZCMtTF^Q|ZedeJhM%QPCR*bs8V79p$QTo7e94yQNXRs-{0?hOn_-8n0AMO@u1Ts zNl8QzJs1#rz%RBt?ux>l+amAvh+J!{$lkaqv}+Erb-6j2xp>K4GLQnNB*W`hFg*?P z^AL@~(h~Z+wfcWEXHqV^Tq-#z$7Y#o0;yFxA!00F}F2dX# zjE$iOgT#G4*1TR6kB1Gnn@>$meCh2a>c5YuIvFn-R2W@>4@M*m@-|jiDV?b)bccgA zyPfsMM!rjy>+1O2)5Eg29Z_*2p&qGnmS!OH?vZ(4>QB01d>j%9n4QINxkyT(Dos?I zjaWF$*IQmh`SF-?xU%xMEfjq1=6qY*g&lgG_cXv$BGoIWyfO5 zp>pdV*O+y=&6@N2WWFo(%RtT`Q(H^6zn^a%epE~Kx^mEJ{c8`luC$nc*z9j|4Ms8aJK-la^5T)AZ%#@G{_P{NCN^P z(J0zvSn~SSm(Ur);-M~8^*;61*VRI`T1BN&LAhK;sZ>I-SVW;vfUfJv=ko^ugnc0x zhJodBxe>iyk3%w<%wC8holUJ4(iv>tL{`DQt zPOsyUbO_Cmc&*iHkqbm3ku`|GcC^OhF>jj9W*GkH;^g!iUVpib_h*=@udp4h(P+e*zL_~ZmJjh(y^BxULwq>9zXoYE8sq{#pN~U0C6!8vY)5N2 z9P*}mw}7X$O^qTtJef1ACWvJT9^wt-)Zh0r~j#0bT`f;-zv6 z^Tmw22!%rMcs!TaUX<-8s;X-B`+Xbo+_uWuFa z1yIPc?DTrQ7KvRhmt*TG|L=EYQ=LqFX;=Lp`4}jx6BE-@00000NkvXXu0mjf=s_29 literal 0 HcmV?d00001 diff --git a/doc/images/wrench.png b/doc/images/wrench.png new file mode 100755 index 0000000000000000000000000000000000000000..5c8213fef5ab969f03189d4367e32e597e38bd7f GIT binary patch literal 610 zcmV-o0-gPdP)^jb z4`0v}DG1te)wmeb(>p90leRz?_mO+^JKy=v&2<29Od6?F%9%(c8los#f*@G`-%W&* z$)uBj2i@u-@SgX}gtyWPe6d*|w6h%R? zScK2#Yn%$sum0cy>90DmY*i{1XqpClEtktsRTZ)lCUe z<FogV^*tm>8*AlX za4oiR!&85LrobG57qUHUX#{>Vz(RHpB5|@>9O6N$jqB8>%($0wxE5R3)b>Y~xtCo$ zCgEk&A?_#IxHdN)9tqre^o{ho4{?hmPuf@^@I3-wncaRd%|~O3xbrKY=&TiwPYkJroM{;WUQTuMY8vpg}f4o)2%U3C;eEDoiEh?94d(rV57VIF#8VqzW$HrDC|#U`x@QDbgi zVl)t9GGz&YY#D?gc%>hISA+_EBpnXt#pnC`p6@xw0$8TCbULjhlgVx(kuc)%xbgqq zR5+DNDFRN0!y)7Gm}oT0i39}h4h928qY?Rho^UvPGJ#kuW|-Amtrn`Pmd&+bFo@sp z$LI4IQw7BG?|#2ewOS<<3VjL$0=lMY^m;wqZujv5kx1l%Sl;V&Iy4#$ip3&@LV2!7vhhN=PCz%^9v24`qb(+m4W?!q-&~=?ssf5GfnAmJKV;3bvpDm0(NhahZ=&^sqo6Odj6>)Dq_3p~4~ zvb`d3Mydwjt&Df^hVmLtI2x=U&h9(JVYX-!y~z3zi;1>=LY;o(bL$(Yf$lf)dMf0-u^0HrpTG Wk@)HE*94aU0000m+BBgry{~j2fHLegbHP( zrgXNbr0}2;^nywdjLjZe?uxtrd3D(pZH@fFFc0{BW_~jxoO1w7-VX;6vK@ROA$$R6 zEmo;Ht-Mj|>5jUy{bQ^V5@53LRI8AgLpUm|m+15sqcz@QtVSo|oz7ArM8?pIn+>gN z0b=4_b5O|4A*;Q+vc9Vqr~%3V155*NV~@gTz}KSUiKB-uJzjMZ>5%Q#n24H!V{ zTY(LLAE*NAHZ}C#wnj%Bw5OFIkRhkkAW#kDC3j9Wm0YXRaXlyyp>#mVfYG)eC;@ab zDb=T-BCAY4LI(Z@GOTr2V_A{pRwSmz+8Be>CjAw(=gnbVWAeguvZa93JmL(EDxv1m z0OP4q=fpAK1Mq!C2`OkEn37o;m#wF#(t(8Pu#S?2f#x<~4EO{@fmm`p9veD6RZ_jp z@Au4};q&`XuKEYgIiB4((kgxOs#YdqJw0fY>9^K_agEu5+$#k;w#%I2N>n_?)YIqu z`tq&#_^p?-%K*U0^}|7+9U(&k0?s;=r=uCZ%)H9_edH8wK}gB(nUB1FFk+2Ol%BXV zHoFY`D~2x|2 - + + - - - - The Marionette Collective version 2.3.2 - - - - - - - - - - \ No newline at end of file + + + +

mcollective version 2.3.3

+ + +

This is the API documentation for 'mcollective version 2.3.3'.

+ + + + +

Files

+ + + +

Classes/Modules

+ + +

Methods

+ + +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + diff --git a/doc/install_rb.html b/doc/install_rb.html new file mode 100644 index 0000000..0f2e186 --- /dev/null +++ b/doc/install_rb.html @@ -0,0 +1,66 @@ + + + + + + + + File: install.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
  • rbconfig
  • + +
  • find
  • + +
  • fileutils
  • + +
  • tempfile
  • + +
  • optparse
  • + +
  • ostruct
  • + +
  • rdoc/rdoc
  • + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/js/darkfish.js b/doc/js/darkfish.js new file mode 100644 index 0000000..43528fd --- /dev/null +++ b/doc/js/darkfish.js @@ -0,0 +1,116 @@ +/** + * + * Darkfish Page Functions + * $Id: darkfish.js 53 2009-01-07 02:52:03Z deveiant $ + * + * Author: Michael Granger + * + */ + +/* Provide console simulation for firebug-less environments */ +if (!("console" in window) || !("firebug" in console)) { + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", + "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; + + window.console = {}; + for (var i = 0; i < names.length; ++i) + window.console[names[i]] = function() {}; +}; + + +/** + * Unwrap the first element that matches the given @expr@ from the targets and return them. + */ +$.fn.unwrap = function( expr ) { + return this.each( function() { + $(this).parents( expr ).eq( 0 ).after( this ).remove(); + }); +}; + + +function showSource( e ) { + var target = e.target; + var codeSections = $(target). + parents('.method-detail'). + find('.method-source-code'); + + $(target). + parents('.method-detail'). + find('.method-source-code'). + slideToggle(); +}; + +function hookSourceViews() { + $('.method-description,.method-heading').click( showSource ); +}; + +function toggleDebuggingSection() { + $('.debugging-section').slideToggle(); +}; + +function hookDebuggingToggle() { + $('#debugging-toggle img').click( toggleDebuggingSection ); +}; + +function hookQuickSearch() { + $('.quicksearch-field').each( function() { + var searchElems = $(this).parents('.section').find( 'li' ); + var toggle = $(this).parents('.section').find('h3 .search-toggle'); + // console.debug( "Toggle is: %o", toggle ); + var qsbox = $(this).parents('form').get( 0 ); + + $(this).quicksearch( this, searchElems, { + noSearchResultsIndicator: 'no-class-search-results', + focusOnLoad: false + }); + $(toggle).click( function() { + // console.debug( "Toggling qsbox: %o", qsbox ); + $(qsbox).toggle(); + }); + }); +}; + +function highlightTarget( anchor ) { + console.debug( "Highlighting target '%s'.", anchor ); + + $("a[name=" + anchor + "]").each( function() { + if ( !$(this).parent().parent().hasClass('target-section') ) { + console.debug( "Wrapping the target-section" ); + $('div.method-detail').unwrap( 'div.target-section' ); + $(this).parent().wrap( '
' ); + } else { + console.debug( "Already wrapped." ); + } + }); +}; + +function highlightLocationTarget() { + console.debug( "Location hash: %s", window.location.hash ); + if ( ! window.location.hash || window.location.hash.length == 0 ) return; + + var anchor = window.location.hash.substring(1); + console.debug( "Found anchor: %s; matching %s", anchor, "a[name=" + anchor + "]" ); + + highlightTarget( anchor ); +}; + +function highlightClickTarget( event ) { + console.debug( "Highlighting click target for event %o", event.target ); + try { + var anchor = $(event.target).attr( 'href' ).substring(1); + console.debug( "Found target anchor: %s", anchor ); + highlightTarget( anchor ); + } catch ( err ) { + console.error( "Exception while highlighting: %o", err ); + }; +}; + + +$(document).ready( function() { + hookSourceViews(); + hookDebuggingToggle(); + hookQuickSearch(); + highlightLocationTarget(); + + $('ul.link-list a').bind( "click", highlightClickTarget ); +}); diff --git a/doc/js/jquery.js b/doc/js/jquery.js new file mode 100644 index 0000000..afe9e74 --- /dev/null +++ b/doc/js/jquery.js @@ -0,0 +1,32 @@ +/* + * jQuery 1.2.6 - New Wave Javascript + * + * Copyright (c) 2008 John Resig (jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * $Date: 2008-09-25 09:50:52 -0700 (Thu, 25 Sep 2008) $ + * $Rev: 38 $ + */ +(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else +return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else +return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else +selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else +this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else +return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else +jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else +jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("",""]||!tags.indexOf("",""]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!tags.indexOf("",""]||(!tags.indexOf("",""]||!tags.indexOf("",""]||jQuery.browser.msie&&[1,"div
","
"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf(""&&tags.indexOf("=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else +ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&¬xml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&¬xml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&¬xml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else +while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return im[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else +for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
").append(res.responseText.replace(//g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else +xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else +jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else +for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else +s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else +e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})(); \ No newline at end of file diff --git a/doc/js/quicksearch.js b/doc/js/quicksearch.js new file mode 100644 index 0000000..332772a --- /dev/null +++ b/doc/js/quicksearch.js @@ -0,0 +1,114 @@ +/** + * + * JQuery QuickSearch - Hook up a form field to hide non-matching elements. + * $Id: quicksearch.js 53 2009-01-07 02:52:03Z deveiant $ + * + * Author: Michael Granger + * + */ +jQuery.fn.quicksearch = function( target, searchElems, options ) { + // console.debug( "Quicksearch fn" ); + + var settings = { + delay: 250, + clearButton: false, + highlightMatches: false, + focusOnLoad: false, + noSearchResultsIndicator: null + }; + if ( options ) $.extend( settings, options ); + + return jQuery(this).each( function() { + // console.debug( "Creating a new quicksearch on %o for %o", this, searchElems ); + new jQuery.quicksearch( this, searchElems, settings ); + }); +}; + + +jQuery.quicksearch = function( searchBox, searchElems, settings ) { + var timeout; + var boxdiv = $(searchBox).parents('div').eq(0); + + function init() { + setupKeyEventHandlers(); + focusOnLoad(); + }; + + function setupKeyEventHandlers() { + // console.debug( "Hooking up the 'keypress' event to %o", searchBox ); + $(searchBox). + unbind( 'keyup' ). + keyup( function(e) { return onSearchKey( e.keyCode ); }); + $(searchBox). + unbind( 'keypress' ). + keypress( function(e) { + switch( e.which ) { + // Execute the search on Enter, Tab, or Newline + case 9: + case 13: + case 10: + clearTimeout( timeout ); + e.preventDefault(); + doQuickSearch(); + break; + + // Allow backspace + case 8: + return true; + break; + + // Only allow valid search characters + default: + return validQSChar( e.charCode ); + } + }); + }; + + function focusOnLoad() { + if ( !settings.focusOnLoad ) return false; + $(searchBox).focus(); + }; + + function onSearchKey ( code ) { + clearTimeout( timeout ); + // console.debug( "...scheduling search." ); + timeout = setTimeout( doQuickSearch, settings.delay ); + }; + + function validQSChar( code ) { + var c = String.fromCharCode( code ); + return ( + (c == ':') || + (c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') + ); + }; + + function doQuickSearch() { + var searchText = searchBox.value; + var pat = new RegExp( searchText, "im" ); + var shownCount = 0; + + if ( settings.noSearchResultsIndicator ) { + $('#' + settings.noSearchResultsIndicator).hide(); + } + + // All elements start out hidden + $(searchElems).each( function(index) { + var str = $(this).text(); + + if ( pat.test(str) ) { + shownCount += 1; + $(this).fadeIn(); + } else { + $(this).hide(); + } + }); + + if ( shownCount == 0 && settings.noSearchResultsIndicator ) { + $('#' + settings.noSearchResultsIndicator).slideDown(); + } + }; + + init(); +}; diff --git a/doc/js/thickbox-compressed.js b/doc/js/thickbox-compressed.js new file mode 100644 index 0000000..3a3fdae --- /dev/null +++ b/doc/js/thickbox-compressed.js @@ -0,0 +1,10 @@ +/* + * Thickbox 3 - One Box To Rule Them All. + * By Cody Lindley (http://www.codylindley.com) + * Copyright (c) 2007 cody lindley + * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php +*/ + +var tb_pathToImage = "../images/loadingAnimation.gif"; + +eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$(o).2S(9(){1u(\'a.18, 3n.18, 3i.18\');1w=1p 1t();1w.L=2H});9 1u(b){$(b).s(9(){6 t=X.Q||X.1v||M;6 a=X.u||X.23;6 g=X.1N||P;19(t,a,g);X.2E();H P})}9 19(d,f,g){3m{3(2t o.v.J.2i==="2g"){$("v","11").r({A:"28%",z:"28%"});$("11").r("22","2Z");3(o.1Y("1F")===M){$("v").q("<4 5=\'B\'><4 5=\'8\'>");$("#B").s(G)}}n{3(o.1Y("B")===M){$("v").q("<4 5=\'B\'><4 5=\'8\'>");$("#B").s(G)}}3(1K()){$("#B").1J("2B")}n{$("#B").1J("2z")}3(d===M){d=""}$("v").q("<4 5=\'K\'><1I L=\'"+1w.L+"\' />");$(\'#K\').2y();6 h;3(f.O("?")!==-1){h=f.3l(0,f.O("?"))}n{h=f}6 i=/\\.2s$|\\.2q$|\\.2m$|\\.2l$|\\.2k$/;6 j=h.1C().2h(i);3(j==\'.2s\'||j==\'.2q\'||j==\'.2m\'||j==\'.2l\'||j==\'.2k\'){1D="";1G="";14="";1z="";1x="";R="";1n="";1r=P;3(g){E=$("a[@1N="+g+"]").36();25(D=0;((D&1d;&1d;2T &2R;"}n{1D=E[D].Q;1G=E[D].u;14="<1e 5=\'1U\'>&1d;&1d;&2O; 2N"}}n{1r=1b;1n="1t "+(D+1)+" 2L "+(E.1c)}}}S=1p 1t();S.1g=9(){S.1g=M;6 a=2x();6 x=a[0]-1M;6 y=a[1]-1M;6 b=S.z;6 c=S.A;3(b>x){c=c*(x/b);b=x;3(c>y){b=b*(y/c);c=y}}n 3(c>y){b=b*(y/c);c=y;3(b>x){c=c*(x/b);b=x}}13=b+30;1a=c+2G;$("#8").q("<1I 5=\'2F\' L=\'"+f+"\' z=\'"+b+"\' A=\'"+c+"\' 23=\'"+d+"\'/>"+"<4 5=\'2D\'>"+d+"<4 5=\'2C\'>"+1n+14+R+"<4 5=\'2A\'>1l 1k 1j 1s");$("#Z").s(G);3(!(14==="")){9 12(){3($(o).N("s",12)){$(o).N("s",12)}$("#8").C();$("v").q("<4 5=\'8\'>");19(1D,1G,g);H P}$("#1U").s(12)}3(!(R==="")){9 1i(){$("#8").C();$("v").q("<4 5=\'8\'>");19(1z,1x,g);H P}$("#1X").s(1i)}o.1h=9(e){3(e==M){I=2w.2v}n{I=e.2u}3(I==27){G()}n 3(I==3k){3(!(R=="")){o.1h="";1i()}}n 3(I==3j){3(!(14=="")){o.1h="";12()}}};16();$("#K").C();$("#1L").s(G);$("#8").r({Y:"T"})};S.L=f}n{6 l=f.2r(/^[^\\?]+\\??/,\'\');6 m=2p(l);13=(m[\'z\']*1)+30||3h;1a=(m[\'A\']*1)+3g||3f;W=13-30;V=1a-3e;3(f.O(\'2j\')!=-1){1E=f.1B(\'3d\');$("#15").C();3(m[\'1A\']!="1b"){$("#8").q("<4 5=\'2f\'><4 5=\'1H\'>"+d+"<4 5=\'2e\'>1l 1k 1j 1s ")}n{$("#B").N();$("#8").q(" ")}}n{3($("#8").r("Y")!="T"){3(m[\'1A\']!="1b"){$("#8").q("<4 5=\'2f\'><4 5=\'1H\'>"+d+"<4 5=\'2e\'>1l 1k 1j 1s<4 5=\'F\' J=\'z:"+W+"p;A:"+V+"p\'>")}n{$("#B").N();$("#8").q("<4 5=\'F\' 3c=\'3b\' J=\'z:"+W+"p;A:"+V+"p;\'>")}}n{$("#F")[0].J.z=W+"p";$("#F")[0].J.A=V+"p";$("#F")[0].3a=0;$("#1H").11(d)}}$("#Z").s(G);3(f.O(\'37\')!=-1){$("#F").q($(\'#\'+m[\'26\']).1T());$("#8").24(9(){$(\'#\'+m[\'26\']).q($("#F").1T())});16();$("#K").C();$("#8").r({Y:"T"})}n 3(f.O(\'2j\')!=-1){16();3($.1q.35){$("#K").C();$("#8").r({Y:"T"})}}n{$("#F").34(f+="&1y="+(1p 33().32()),9(){16();$("#K").C();1u("#F a.18");$("#8").r({Y:"T"})})}}3(!m[\'1A\']){o.21=9(e){3(e==M){I=2w.2v}n{I=e.2u}3(I==27){G()}}}}31(e){}}9 1m(){$("#K").C();$("#8").r({Y:"T"})}9 G(){$("#2Y").N("s");$("#Z").N("s");$("#8").2X("2W",9(){$(\'#8,#B,#1F\').2V("24").N().C()});$("#K").C();3(2t o.v.J.2i=="2g"){$("v","11").r({A:"1Z",z:"1Z"});$("11").r("22","")}o.1h="";o.21="";H P}9 16(){$("#8").r({2U:\'-\'+20((13/2),10)+\'p\',z:13+\'p\'});3(!(1V.1q.2Q&&1V.1q.2P<7)){$("#8").r({38:\'-\'+20((1a/2),10)+\'p\'})}}9 2p(a){6 b={};3(!a){H b}6 c=a.1B(/[;&]/);25(6 i=0;i + + + + + + + File: agent.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/agents_rb.html b/doc/lib/mcollective/agents_rb.html new file mode 100644 index 0000000..79f638b --- /dev/null +++ b/doc/lib/mcollective/agents_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: agents.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/aggregate/base_rb.html b/doc/lib/mcollective/aggregate/base_rb.html new file mode 100644 index 0000000..b71475a --- /dev/null +++ b/doc/lib/mcollective/aggregate/base_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: base.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/aggregate/result/base_rb.html b/doc/lib/mcollective/aggregate/result/base_rb.html new file mode 100644 index 0000000..fa2ed93 --- /dev/null +++ b/doc/lib/mcollective/aggregate/result/base_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: base.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/aggregate/result/collection_result_rb.html b/doc/lib/mcollective/aggregate/result/collection_result_rb.html new file mode 100644 index 0000000..97bcea3 --- /dev/null +++ b/doc/lib/mcollective/aggregate/result/collection_result_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: collection_result.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/aggregate/result/numeric_result_rb.html b/doc/lib/mcollective/aggregate/result/numeric_result_rb.html new file mode 100644 index 0000000..0753dde --- /dev/null +++ b/doc/lib/mcollective/aggregate/result/numeric_result_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: numeric_result.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/aggregate/result_rb.html b/doc/lib/mcollective/aggregate/result_rb.html new file mode 100644 index 0000000..a5f140c --- /dev/null +++ b/doc/lib/mcollective/aggregate/result_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: result.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/aggregate_rb.html b/doc/lib/mcollective/aggregate_rb.html new file mode 100644 index 0000000..c7d0f7f --- /dev/null +++ b/doc/lib/mcollective/aggregate_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: aggregate.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/application_rb.html b/doc/lib/mcollective/application_rb.html new file mode 100644 index 0000000..6ff7197 --- /dev/null +++ b/doc/lib/mcollective/application_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: application.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/applications_rb.html b/doc/lib/mcollective/applications_rb.html new file mode 100644 index 0000000..1881f92 --- /dev/null +++ b/doc/lib/mcollective/applications_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: applications.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/cache_rb.html b/doc/lib/mcollective/cache_rb.html new file mode 100644 index 0000000..7b45a5c --- /dev/null +++ b/doc/lib/mcollective/cache_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: cache.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/client_rb.html b/doc/lib/mcollective/client_rb.html new file mode 100644 index 0000000..a1cd141 --- /dev/null +++ b/doc/lib/mcollective/client_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: client.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/config_rb.html b/doc/lib/mcollective/config_rb.html new file mode 100644 index 0000000..b98eecd --- /dev/null +++ b/doc/lib/mcollective/config_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: config.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/connector/base_rb.html b/doc/lib/mcollective/connector/base_rb.html new file mode 100644 index 0000000..b71475a --- /dev/null +++ b/doc/lib/mcollective/connector/base_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: base.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/connector_rb.html b/doc/lib/mcollective/connector_rb.html new file mode 100644 index 0000000..9e815d4 --- /dev/null +++ b/doc/lib/mcollective/connector_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: connector.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/data/base_rb.html b/doc/lib/mcollective/data/base_rb.html new file mode 100644 index 0000000..b71475a --- /dev/null +++ b/doc/lib/mcollective/data/base_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: base.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/data/result_rb.html b/doc/lib/mcollective/data/result_rb.html new file mode 100644 index 0000000..a5f140c --- /dev/null +++ b/doc/lib/mcollective/data/result_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: result.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/data_rb.html b/doc/lib/mcollective/data_rb.html new file mode 100644 index 0000000..2d18869 --- /dev/null +++ b/doc/lib/mcollective/data_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: data.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/ddl/agentddl_rb.html b/doc/lib/mcollective/ddl/agentddl_rb.html new file mode 100644 index 0000000..228f438 --- /dev/null +++ b/doc/lib/mcollective/ddl/agentddl_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: agentddl.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/ddl/base_rb.html b/doc/lib/mcollective/ddl/base_rb.html new file mode 100644 index 0000000..b71475a --- /dev/null +++ b/doc/lib/mcollective/ddl/base_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: base.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/ddl/dataddl_rb.html b/doc/lib/mcollective/ddl/dataddl_rb.html new file mode 100644 index 0000000..2068b78 --- /dev/null +++ b/doc/lib/mcollective/ddl/dataddl_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: dataddl.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/ddl/discoveryddl_rb.html b/doc/lib/mcollective/ddl/discoveryddl_rb.html new file mode 100644 index 0000000..c6e1085 --- /dev/null +++ b/doc/lib/mcollective/ddl/discoveryddl_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: discoveryddl.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/ddl/validatorddl_rb.html b/doc/lib/mcollective/ddl/validatorddl_rb.html new file mode 100644 index 0000000..4d5f4d2 --- /dev/null +++ b/doc/lib/mcollective/ddl/validatorddl_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: validatorddl.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/ddl_rb.html b/doc/lib/mcollective/ddl_rb.html new file mode 100644 index 0000000..b968543 --- /dev/null +++ b/doc/lib/mcollective/ddl_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: ddl.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/discovery_rb.html b/doc/lib/mcollective/discovery_rb.html new file mode 100644 index 0000000..6410c29 --- /dev/null +++ b/doc/lib/mcollective/discovery_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: discovery.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/exception_rb.html b/doc/lib/mcollective/exception_rb.html new file mode 100644 index 0000000..9f6709d --- /dev/null +++ b/doc/lib/mcollective/exception_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: exception.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/facts/base_rb.html b/doc/lib/mcollective/facts/base_rb.html new file mode 100644 index 0000000..b71475a --- /dev/null +++ b/doc/lib/mcollective/facts/base_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: base.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/facts_rb.html b/doc/lib/mcollective/facts_rb.html new file mode 100644 index 0000000..ee9ea1e --- /dev/null +++ b/doc/lib/mcollective/facts_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: facts.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/generators/agent_generator_rb.html b/doc/lib/mcollective/generators/agent_generator_rb.html new file mode 100644 index 0000000..628a575 --- /dev/null +++ b/doc/lib/mcollective/generators/agent_generator_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: agent_generator.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/generators/base_rb.html b/doc/lib/mcollective/generators/base_rb.html new file mode 100644 index 0000000..b71475a --- /dev/null +++ b/doc/lib/mcollective/generators/base_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: base.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/generators/data_generator_rb.html b/doc/lib/mcollective/generators/data_generator_rb.html new file mode 100644 index 0000000..bf28753 --- /dev/null +++ b/doc/lib/mcollective/generators/data_generator_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: data_generator.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/generators/templates/action_snippet_erb.html b/doc/lib/mcollective/generators/templates/action_snippet_erb.html new file mode 100644 index 0000000..0d76a8c --- /dev/null +++ b/doc/lib/mcollective/generators/templates/action_snippet_erb.html @@ -0,0 +1,306 @@ + + + + + + + + File: action_snippet.erb [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

+# 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%"
+
+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/lib/mcollective/generators/templates/data_input_snippet_erb.html b/doc/lib/mcollective/generators/templates/data_input_snippet_erb.html new file mode 100644 index 0000000..63fa55d --- /dev/null +++ b/doc/lib/mcollective/generators/templates/data_input_snippet_erb.html @@ -0,0 +1,298 @@ + + + + + + + + File: data_input_snippet.erb [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

+input :query, +

+
+      :prompt => "%PROMP%",
+      :description => "%DESCRIPTION%",
+      :type => %TYPE%,
+      :validation => %VALIDATION%,
+      :maxlength => %MAXLENGTH%
+
+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/lib/mcollective/generators/templates/ddl_erb.html b/doc/lib/mcollective/generators/templates/ddl_erb.html new file mode 100644 index 0000000..ab43821 --- /dev/null +++ b/doc/lib/mcollective/generators/templates/ddl_erb.html @@ -0,0 +1,300 @@ + + + + + + + + File: ddl.erb [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

+metadata :name => “<%= meta[:name] || “%FULLNANE%” +-%>”, +

+
+         :description => "<%= meta[:description] || "%DESCRIPTION%" -%>",
+         :author => "<%= meta[:author] || "%AUTHOR%" -%>",
+         :license => "<%= meta[:license] || "%LICENSE%" -%>",
+         :version => "<%= meta[:version] || "%VERSION%" -%>",
+         :url => "<%= meta[:url] || "%URL%" -%>",
+         :timeout => <%= meta[:timeout] || "%TIMEOUT%" %>
+
+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/lib/mcollective/generators/templates/plugin_erb.html b/doc/lib/mcollective/generators/templates/plugin_erb.html new file mode 100644 index 0000000..5e42f50 --- /dev/null +++ b/doc/lib/mcollective/generators/templates/plugin_erb.html @@ -0,0 +1,305 @@ + + + + + + + + File: plugin.erb [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

+module MCollective +

+
+  module <%= @mod_name%>
+    class <%= @plugin_name.capitalize -%><<%= @pclass%>
+
+

+<%= @content%> +

+
+    end
+  end
+
+

+end +

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/lib/mcollective/generators_rb.html b/doc/lib/mcollective/generators_rb.html new file mode 100644 index 0000000..de45c71 --- /dev/null +++ b/doc/lib/mcollective/generators_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: generators.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/locales/en_yml.html b/doc/lib/mcollective/locales/en_yml.html new file mode 100644 index 0000000..d2b8b95 --- /dev/null +++ b/doc/lib/mcollective/locales/en_yml.html @@ -0,0 +1,636 @@ + + + + + + + + File: en.yml [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

+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:
+    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:
+    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:
+    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.
+
+        It does not indicate a problem, it's just a debugging aid
+    pattern: "Cache hit on '%{cache_name}' key '%{item}'"
+  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:
+    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:
+    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:
+    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:
+    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:
+    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:
+    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 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:
+    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:
+    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:
+    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:
+    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",
+                      :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
+    pattern: "Cannot determine what entity input '%{input}' belongs to"
+  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:
+    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:
+    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:
+    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:
+    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:
+    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:
+    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:
+    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:
+    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:
+    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:
+    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:
+    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:
+    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:
+    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:
+    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.
+
+        Check your agent code and make sure you have code like:
+
+            action "the_action" do
+                .
+                .
+            end
+    pattern: "Unknown action '%{action}' for agent '%{agent}'"
+  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:
+    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:
+    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:
+    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:
+    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}'"
+  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:
+    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:
+    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:
+    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:
+    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}"
+
+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/lib/mcollective/log_rb.html b/doc/lib/mcollective/log_rb.html new file mode 100644 index 0000000..722e1bc --- /dev/null +++ b/doc/lib/mcollective/log_rb.html @@ -0,0 +1,54 @@ + + + + + + + + File: log.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
  • mcollective/logger/%s_logger
  • + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/logger/base_rb.html b/doc/lib/mcollective/logger/base_rb.html new file mode 100644 index 0000000..b71475a --- /dev/null +++ b/doc/lib/mcollective/logger/base_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: base.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/logger/console_logger_rb.html b/doc/lib/mcollective/logger/console_logger_rb.html new file mode 100644 index 0000000..c64d2c6 --- /dev/null +++ b/doc/lib/mcollective/logger/console_logger_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: console_logger.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/logger/file_logger_rb.html b/doc/lib/mcollective/logger/file_logger_rb.html new file mode 100644 index 0000000..ebafb64 --- /dev/null +++ b/doc/lib/mcollective/logger/file_logger_rb.html @@ -0,0 +1,54 @@ + + + + + + + + File: file_logger.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
  • logger
  • + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/logger/syslog_logger_rb.html b/doc/lib/mcollective/logger/syslog_logger_rb.html new file mode 100644 index 0000000..337ec2b --- /dev/null +++ b/doc/lib/mcollective/logger/syslog_logger_rb.html @@ -0,0 +1,54 @@ + + + + + + + + File: syslog_logger.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
  • syslog
  • + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/logger_rb.html b/doc/lib/mcollective/logger_rb.html new file mode 100644 index 0000000..977e81e --- /dev/null +++ b/doc/lib/mcollective/logger_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: logger.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/matcher/parser_rb.html b/doc/lib/mcollective/matcher/parser_rb.html new file mode 100644 index 0000000..ed8286b --- /dev/null +++ b/doc/lib/mcollective/matcher/parser_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: parser.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/matcher/scanner_rb.html b/doc/lib/mcollective/matcher/scanner_rb.html new file mode 100644 index 0000000..406c071 --- /dev/null +++ b/doc/lib/mcollective/matcher/scanner_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: scanner.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/matcher_rb.html b/doc/lib/mcollective/matcher_rb.html new file mode 100644 index 0000000..fd2be59 --- /dev/null +++ b/doc/lib/mcollective/matcher_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: matcher.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/message_rb.html b/doc/lib/mcollective/message_rb.html new file mode 100644 index 0000000..4629798 --- /dev/null +++ b/doc/lib/mcollective/message_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: message.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/monkey_patches_rb.html b/doc/lib/mcollective/monkey_patches_rb.html new file mode 100644 index 0000000..be874de --- /dev/null +++ b/doc/lib/mcollective/monkey_patches_rb.html @@ -0,0 +1,57 @@ + + + + + + + + File: monkey_patches.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
  • enumerator
  • + +
+
+ + + +
+
+ +
+ +
+

Description

+

+start_with? was introduced in 1.8.7, we need to support 1.8.5 and 1.8.6 +

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/optionparser_rb.html b/doc/lib/mcollective/optionparser_rb.html new file mode 100644 index 0000000..67b928f --- /dev/null +++ b/doc/lib/mcollective/optionparser_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: optionparser.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/pluginmanager_rb.html b/doc/lib/mcollective/pluginmanager_rb.html new file mode 100644 index 0000000..db557b2 --- /dev/null +++ b/doc/lib/mcollective/pluginmanager_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: pluginmanager.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/pluginpackager/agent_definition_rb.html b/doc/lib/mcollective/pluginpackager/agent_definition_rb.html new file mode 100644 index 0000000..5d8b876 --- /dev/null +++ b/doc/lib/mcollective/pluginpackager/agent_definition_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: agent_definition.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/pluginpackager/standard_definition_rb.html b/doc/lib/mcollective/pluginpackager/standard_definition_rb.html new file mode 100644 index 0000000..4811088 --- /dev/null +++ b/doc/lib/mcollective/pluginpackager/standard_definition_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: standard_definition.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/pluginpackager_rb.html b/doc/lib/mcollective/pluginpackager_rb.html new file mode 100644 index 0000000..b23e7b5 --- /dev/null +++ b/doc/lib/mcollective/pluginpackager_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: pluginpackager.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/registration/base_rb.html b/doc/lib/mcollective/registration/base_rb.html new file mode 100644 index 0000000..b71475a --- /dev/null +++ b/doc/lib/mcollective/registration/base_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: base.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/registration_rb.html b/doc/lib/mcollective/registration_rb.html new file mode 100644 index 0000000..d138e58 --- /dev/null +++ b/doc/lib/mcollective/registration_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: registration.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/rpc/actionrunner_rb.html b/doc/lib/mcollective/rpc/actionrunner_rb.html new file mode 100644 index 0000000..78c582d --- /dev/null +++ b/doc/lib/mcollective/rpc/actionrunner_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: actionrunner.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/rpc/agent_rb.html b/doc/lib/mcollective/rpc/agent_rb.html new file mode 100644 index 0000000..c32db86 --- /dev/null +++ b/doc/lib/mcollective/rpc/agent_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: agent.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/rpc/audit_rb.html b/doc/lib/mcollective/rpc/audit_rb.html new file mode 100644 index 0000000..71d7d04 --- /dev/null +++ b/doc/lib/mcollective/rpc/audit_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: audit.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/rpc/client_rb.html b/doc/lib/mcollective/rpc/client_rb.html new file mode 100644 index 0000000..c17a816 --- /dev/null +++ b/doc/lib/mcollective/rpc/client_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: client.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/rpc/helpers_rb.html b/doc/lib/mcollective/rpc/helpers_rb.html new file mode 100644 index 0000000..a9cbd03 --- /dev/null +++ b/doc/lib/mcollective/rpc/helpers_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: helpers.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/rpc/progress_rb.html b/doc/lib/mcollective/rpc/progress_rb.html new file mode 100644 index 0000000..4834f2d --- /dev/null +++ b/doc/lib/mcollective/rpc/progress_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: progress.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/rpc/reply_rb.html b/doc/lib/mcollective/rpc/reply_rb.html new file mode 100644 index 0000000..020f9d2 --- /dev/null +++ b/doc/lib/mcollective/rpc/reply_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: reply.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/rpc/request_rb.html b/doc/lib/mcollective/rpc/request_rb.html new file mode 100644 index 0000000..e62133c --- /dev/null +++ b/doc/lib/mcollective/rpc/request_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: request.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/rpc/result_rb.html b/doc/lib/mcollective/rpc/result_rb.html new file mode 100644 index 0000000..a5f140c --- /dev/null +++ b/doc/lib/mcollective/rpc/result_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: result.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/rpc/stats_rb.html b/doc/lib/mcollective/rpc/stats_rb.html new file mode 100644 index 0000000..f1837e1 --- /dev/null +++ b/doc/lib/mcollective/rpc/stats_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: stats.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/rpc_rb.html b/doc/lib/mcollective/rpc_rb.html new file mode 100644 index 0000000..1ca8410 --- /dev/null +++ b/doc/lib/mcollective/rpc_rb.html @@ -0,0 +1,54 @@ + + + + + + + + File: rpc.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
  • pp
  • + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/runner_rb.html b/doc/lib/mcollective/runner_rb.html new file mode 100644 index 0000000..63ec60c --- /dev/null +++ b/doc/lib/mcollective/runner_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: runner.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/runnerstats_rb.html b/doc/lib/mcollective/runnerstats_rb.html new file mode 100644 index 0000000..33acab4 --- /dev/null +++ b/doc/lib/mcollective/runnerstats_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: runnerstats.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/security/base_rb.html b/doc/lib/mcollective/security/base_rb.html new file mode 100644 index 0000000..b71475a --- /dev/null +++ b/doc/lib/mcollective/security/base_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: base.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/security_rb.html b/doc/lib/mcollective/security_rb.html new file mode 100644 index 0000000..fa491dc --- /dev/null +++ b/doc/lib/mcollective/security_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: security.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/shell_rb.html b/doc/lib/mcollective/shell_rb.html new file mode 100644 index 0000000..08c56c6 --- /dev/null +++ b/doc/lib/mcollective/shell_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: shell.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/ssl_rb.html b/doc/lib/mcollective/ssl_rb.html new file mode 100644 index 0000000..371b04d --- /dev/null +++ b/doc/lib/mcollective/ssl_rb.html @@ -0,0 +1,58 @@ + + + + + + + + File: ssl.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
  • openssl
  • + +
  • base64
  • + +
  • digest/sha1
  • + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/translatable_rb.html b/doc/lib/mcollective/translatable_rb.html new file mode 100644 index 0000000..7160090 --- /dev/null +++ b/doc/lib/mcollective/translatable_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: translatable.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/unix_daemon_rb.html b/doc/lib/mcollective/unix_daemon_rb.html new file mode 100644 index 0000000..8a65cf5 --- /dev/null +++ b/doc/lib/mcollective/unix_daemon_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: unix_daemon.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/util_rb.html b/doc/lib/mcollective/util_rb.html new file mode 100644 index 0000000..df36387 --- /dev/null +++ b/doc/lib/mcollective/util_rb.html @@ -0,0 +1,54 @@ + + + + + + + + File: util.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
  • win32/dir
  • + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/validator_rb.html b/doc/lib/mcollective/validator_rb.html new file mode 100644 index 0000000..4f4ba15 --- /dev/null +++ b/doc/lib/mcollective/validator_rb.html @@ -0,0 +1,52 @@ + + + + + + + + File: validator.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective/windows_daemon_rb.html b/doc/lib/mcollective/windows_daemon_rb.html new file mode 100644 index 0000000..21f2b76 --- /dev/null +++ b/doc/lib/mcollective/windows_daemon_rb.html @@ -0,0 +1,54 @@ + + + + + + + + File: windows_daemon.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
  • win32/daemon
  • + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/lib/mcollective_rb.html b/doc/lib/mcollective_rb.html new file mode 100644 index 0000000..e84f02b --- /dev/null +++ b/doc/lib/mcollective_rb.html @@ -0,0 +1,86 @@ + + + + + + + + File: mcollective.rb [mcollective version 2.3.3] + + + + + + + + + + +
+
+
Last Modified
+
Fri Nov 15 12:17:20 +0000 2013
+ + +
Requires
+
+
    + +
  • rubygems
  • + +
  • stomp
  • + +
  • timeout
  • + +
  • digest/md5
  • + +
  • optparse
  • + +
  • singleton
  • + +
  • socket
  • + +
  • erb
  • + +
  • shellwords
  • + +
  • stringio
  • + +
  • rbconfig
  • + +
  • tempfile
  • + +
  • tmpdir
  • + +
  • mcollective/exception
  • + +
  • mcollective/monkey_patches
  • + +
  • mcollective/translatable
  • + +
  • mcollective/cache
  • + +
+
+ + + +
+
+ +
+ +
+

Description

+ +
+ +
+ + + diff --git a/doc/mcollective_init.html b/doc/mcollective_init.html new file mode 100644 index 0000000..6e3e876 --- /dev/null +++ b/doc/mcollective_init.html @@ -0,0 +1,416 @@ + + + + + + + + File: mcollective.init [mcollective version 2.3.3] + + + + + + + + + + +
+
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

+#!/bin/sh # # mcollective Application Server for STOMP based agents # # +chkconfig: 345 24 76 # # description: mcollective lets you build powerful +Stomp compatible middleware clients in ruby without having to worry too # +much about all the setup and management of a Stomp connection, it also +provides stats, logging and so forth # as a bonus. # ### BEGIN INIT INFO # +Provides: mcollective # Required-Start: $remote_fs # Required-Stop: +$remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # +Short-Description: Start daemon at boot time # Description: Enable service +provided by daemon. ### END INIT INFO +

+

+mcollectived=“/usr/sbin/mcollectived“ +

+

+# Lockfile if [ -d /var/lock/subsys ]; then +

+
+    # RedHat/CentOS/etc who use subsys
+    lock="/var/lock/subsys/mcollective"
+
+

+else +

+
+    # The rest of them
+    lock="/var/lock/mcollective"
+
+

+fi +

+

+# PID directory pidfile=“/var/run/mcollectived.pid“ +

+

+# Source function library. . /lib/lsb/init-functions +

+

+# Check that binary exists if ! [ -f $mcollectived ] then +

+
+    echo "mcollectived binary not found"
+    exit 0
+
+

+fi +

+

+# See how we were called. case “$1” in +

+
+    start)
+        echo -n "Starting mcollective: "
+
+        if [ -f ${lock} ]; then
+            # we were not shut down correctly
+            if [ -s ${pidfile} ]; then
+                kill `cat ${pidfile}` >/dev/null 2>&1
+            fi
+            rm -f ${pidfile}
+
+            rm -f ${lock}
+            sleep 2
+        fi
+
+        rm -f ${pidfile}
+
+        ${mcollectived} --pid=${pidfile} --config="/etc/mcollective/server.cfg"
+        if [ $? = 0 ]; then
+            log_success_msg
+            touch $lock
+            exit 0
+        else
+            log_failure_msg
+            exit 1
+        fi
+        ;;
+    stop)
+        echo -n "Shutting down mcollective: "
+
+        if [ -s ${pidfile} ]; then
+            kill `cat ${pidfile}` >/dev/null 2>&1
+        fi
+        rm -f ${pidfile}
+
+        log_success_msg
+        rm -f $lock
+        ;;
+    restart)
+        $0 stop
+        sleep 2
+        $0 start
+        ;;
+    condrestart)
+        if [ -f $lock ]; then
+            $0 stop
+            # avoid race
+            sleep 2
+            $0 start
+        fi
+        ;;
+    status)
+        if [ -f ${lock} ]; then
+            if [ -s ${pidfile} ]; then
+                if [ -e /proc/`cat ${pidfile}` ]; then
+                    echo "mcollectived (`cat ${pidfile}`) is running"
+                    exit 0
+                else
+                    echo "mcollectived (`cat ${pidfile}`) is NOT running"
+                    exit 1
+                fi
+            fi
+        else
+            echo "mcollectived: service not started"
+            exit 1
+        fi
+        ;;
+    force-reload)
+        echo "not implemented"
+        ;;
+    *)
+        echo "Usage: mcollectived {start|stop|restart|condrestart|status}"
+        exit 1
+        ;;
+
+

+esac exit 0 +

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + diff --git a/doc/rdoc-style.css b/doc/rdoc-style.css deleted file mode 100644 index 44c7b3d..0000000 --- a/doc/rdoc-style.css +++ /dev/null @@ -1,208 +0,0 @@ - -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/doc/rdoc.css b/doc/rdoc.css new file mode 100644 index 0000000..bca0a02 --- /dev/null +++ b/doc/rdoc.css @@ -0,0 +1,696 @@ +/* + * "Darkfish" Rdoc CSS + * $Id: rdoc.css 54 2009-01-27 01:09:48Z deveiant $ + * + * Author: Michael Granger + * + */ + +/* Base Green is: #6C8C22 */ + +*{ padding: 0; margin: 0; } + +body { + background: #efefef; + font: 14px "Helvetica Neue", Helvetica, Tahoma, sans-serif; +} +body.class, body.module, body.file { + margin-left: 40px; +} +body.file-popup { + font-size: 90%; + margin-left: 0; +} + +h1 { + font-size: 300%; + text-shadow: rgba(135,145,135,0.65) 2px 2px 3px; + color: #6C8C22; +} +h2,h3,h4 { margin-top: 1.5em; } + +a { + color: #6C8C22; + text-decoration: none; +} +a:hover { + border-bottom: 1px dotted #6C8C22; +} + +pre { + background: #ddd; + padding: 0.5em 0; +} + + +/* @group Generic Classes */ + +.initially-hidden { + display: none; +} + +.quicksearch-field { + width: 98%; + background: #ddd; + border: 1px solid #aaa; + height: 1.5em; + -webkit-border-radius: 4px; +} +.quicksearch-field:focus { + background: #f1edba; +} + +.missing-docs { + font-size: 120%; + background: white url(images/wrench_orange.png) no-repeat 4px center; + color: #ccc; + line-height: 2em; + border: 1px solid #d00; + opacity: 1; + padding-left: 20px; + text-indent: 24px; + letter-spacing: 3px; + font-weight: bold; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; +} + +.target-section { + border: 2px solid #dcce90; + border-left-width: 8px; + padding: 0 1em; + background: #fff3c2; +} + +/* @end */ + + +/* @group Index Page, Standalone file pages */ +body.indexpage { + margin: 1em 3em; +} +body.indexpage p, +body.indexpage div, +body.file p { + margin: 1em 0; +} + +.indexpage ul, +.file #documentation ul { + line-height: 160%; + list-style: none; +} +.indexpage ul a, +.file #documentation ul a { + font-size: 16px; +} + +.indexpage li, +.file #documentation li { + padding-left: 20px; + background: url(images/bullet_black.png) no-repeat left 4px; +} +.indexpage li.module { + background: url(images/package.png) no-repeat left 4px; +} +.indexpage li.class { + background: url(images/ruby.png) no-repeat left 4px; +} +.indexpage li.file { + background: url(images/page_white_text.png) no-repeat left 4px; +} + +/* @end */ + +/* @group Top-Level Structure */ + +.class #metadata, +.file #metadata, +.module #metadata { + float: left; + width: 260px; +} + +.class #documentation, +.file #documentation, +.module #documentation { + margin: 2em 1em 5em 300px; + min-width: 340px; +} + +.file #metadata { + margin: 0.8em; +} + +#validator-badges { + clear: both; + margin: 1em 1em 2em; +} + +/* @end */ + +/* @group Metadata Section */ +#metadata .section { + background-color: #dedede; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border: 1px solid #aaa; + margin: 0 8px 16px; + font-size: 90%; + overflow: hidden; +} +#metadata h3.section-header { + margin: 0; + padding: 2px 8px; + background: #ccc; + color: #666; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-bottom: 1px solid #aaa; +} +#metadata ul, +#metadata dl, +#metadata p { + padding: 8px; + list-style: none; +} + +#file-metadata ul { + padding-left: 28px; + list-style-image: url(images/page_green.png); +} + +dl.svninfo { + color: #666; + margin: 0; +} +dl.svninfo dt { + font-weight: bold; +} + +ul.link-list li { + white-space: nowrap; +} +ul.link-list .type { + font-size: 8px; + text-transform: uppercase; + color: white; + background: #969696; + padding: 2px 4px; + -webkit-border-radius: 5px; +} + +/* @end */ + + +/* @group Project Metadata Section */ +#project-metadata { + margin-top: 3em; +} + +.file #project-metadata { + margin-top: 0em; +} + +#project-metadata .section { + border: 1px solid #aaa; +} +#project-metadata h3.section-header { + border-bottom: 1px solid #aaa; + position: relative; +} +#project-metadata h3.section-header .search-toggle { + position: absolute; + right: 5px; +} + + +#project-metadata form { + color: #777; + background: #ccc; + padding: 8px 8px 16px; + border-bottom: 1px solid #bbb; +} +#project-metadata fieldset { + border: 0; +} + +#no-class-search-results { + margin: 0 auto 1em; + text-align: center; + font-size: 14px; + font-weight: bold; + color: #aaa; +} + +/* @end */ + + +/* @group Documentation Section */ +#description { + font-size: 100%; + color: #333; +} + +#description p { + margin: 1em 0.4em; +} + +#description ul { + margin-left: 2em; +} +#description ul li { + line-height: 1.4em; +} + +#description dl, +#documentation dl { + margin: 8px 1.5em; + border: 1px solid #ccc; +} +#description dl { + font-size: 14px; +} + +#description dt, +#documentation dt { + padding: 2px 4px; + font-weight: bold; + background: #ddd; +} +#description dd, +#documentation dd { + padding: 2px 12px; +} +#description dd + dt, +#documentation dd + dt { + margin-top: 0.7em; +} + +#documentation .section { + font-size: 90%; +} +#documentation h3.section-header { + margin-top: 2em; + padding: 0.75em 0.5em; + background-color: #dedede; + color: #333; + font-size: 150%; + border: 1px solid #bbb; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; +} + +#constants-list > dl, +#attributes-list > dl { + margin: 1em 0 2em; + border: 0; +} +#constants-list > dl dt, +#attributes-list > dl dt { + padding-left: 0; + font-weight: bold; + font-family: Monaco, "Andale Mono"; + background: inherit; +} +#constants-list > dl dt a, +#attributes-list > dl dt a { + color: inherit; +} +#constants-list > dl dd, +#attributes-list > dl dd { + margin: 0 0 1em 0; + padding: 0; + color: #666; +} + +/* @group Method Details */ + +#documentation .method-source-code { + display: none; +} + +#documentation .method-detail { + margin: 0.5em 0; + padding: 0.5em 0; + cursor: pointer; +} +#documentation .method-detail:hover { + background-color: #f1edba; +} +#documentation .method-alias { + font-style: oblique; +} +#documentation .method-heading { + position: relative; + padding: 2px 4px 0 20px; + font-size: 125%; + font-weight: bold; + color: #333; + background: url(images/brick.png) no-repeat left bottom; +} +#documentation .method-heading a { + color: inherit; +} +#documentation .method-click-advice { + position: absolute; + top: 2px; + right: 5px; + font-size: 10px; + color: #9b9877; + visibility: hidden; + padding-right: 20px; + line-height: 20px; + background: url(images/zoom.png) no-repeat right top; +} +#documentation .method-detail:hover .method-click-advice { + visibility: visible; +} + +#documentation .method-alias .method-heading { + color: #666; + background: url(images/brick_link.png) no-repeat left bottom; +} + +#documentation .method-description, +#documentation .aliases { + margin: 0 20px; + line-height: 1.2em; + color: #666; +} +#documentation .aliases { + padding-top: 4px; + font-style: italic; + cursor: default; +} +#documentation .method-description p { + padding: 0; +} +#documentation .method-description p + p { + margin-bottom: 0.5em; +} + +#documentation .attribute-method-heading { + background: url(images/tag_green.png) no-repeat left bottom; +} +#documentation #attribute-method-details .method-detail:hover { + background-color: transparent; + cursor: default; +} +#documentation .attribute-access-type { + font-size: 60%; + text-transform: uppercase; + vertical-align: super; + padding: 0 2px; +} +/* @end */ + +/* @end */ + + + +/* @group Source Code */ + +a.source-toggle { + font-size: 90%; +} +a.source-toggle img { + +} + +div.method-source-code { + background: #262626; + color: #efefef; + margin: 1em; + padding: 0.5em; + border: 1px dashed #999; + overflow: hidden; +} + +div.method-source-code pre { + background: inherit; + padding: 0; + color: white; + overflow: hidden; +} + +/* @group 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; } + +/* @end */ +/* @end */ + + +/* @group File Popup Contents */ + +.file #metadata, +.file-popup #metadata { +} + +.file-popup dl { + font-size: 80%; + padding: 0.75em; + background-color: #dedede; + color: #333; + border: 1px solid #bbb; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; +} +.file dt { + font-weight: bold; + padding-left: 22px; + line-height: 20px; + background: url(images/page_white_width.png) no-repeat left top; +} +.file dt.modified-date { + background: url(images/date.png) no-repeat left top; +} +.file dt.requires { + background: url(images/plugin.png) no-repeat left top; +} +.file dt.scs-url { + background: url(images/wrench.png) no-repeat left top; +} + +.file dl dd { + margin: 0 0 1em 0; +} +.file #metadata dl dd ul { + list-style: circle; + margin-left: 20px; + padding-top: 0; +} +.file #metadata dl dd ul li { +} + + +.file h2 { + margin-top: 2em; + padding: 0.75em 0.5em; + background-color: #dedede; + color: #333; + font-size: 120%; + border: 1px solid #bbb; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; +} + +/* @end */ + + + + +/* @group ThickBox Styles */ +#TB_window { + font: 12px Arial, Helvetica, sans-serif; + color: #333333; +} + +#TB_secondLine { + font: 10px Arial, Helvetica, sans-serif; + color:#666666; +} + +#TB_window a:link {color: #666666;} +#TB_window a:visited {color: #666666;} +#TB_window a:hover {color: #000;} +#TB_window a:active {color: #666666;} +#TB_window a:focus{color: #666666;} + +#TB_overlay { + position: fixed; + z-index:100; + top: 0px; + left: 0px; + height:100%; + width:100%; +} + +.TB_overlayMacFFBGHack {background: url(images/macFFBgHack.png) repeat;} +.TB_overlayBG { + background-color:#000; + filter:alpha(opacity=75); + -moz-opacity: 0.75; + opacity: 0.75; +} + +* html #TB_overlay { /* ie6 hack */ + position: absolute; + height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); +} + +#TB_window { + position: fixed; + background: #ffffff; + z-index: 102; + color:#000000; + display:none; + border: 4px solid #525252; + text-align:left; + top:50%; + left:50%; +} + +* html #TB_window { /* ie6 hack */ +position: absolute; +margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); +} + +#TB_window img#TB_Image { + display:block; + margin: 15px 0 0 15px; + border-right: 1px solid #ccc; + border-bottom: 1px solid #ccc; + border-top: 1px solid #666; + border-left: 1px solid #666; +} + +#TB_caption{ + height:25px; + padding:7px 30px 10px 25px; + float:left; +} + +#TB_closeWindow{ + height:25px; + padding:11px 25px 10px 0; + float:right; +} + +#TB_closeAjaxWindow{ + padding:7px 10px 5px 0; + margin-bottom:1px; + text-align:right; + float:right; +} + +#TB_ajaxWindowTitle{ + float:left; + padding:7px 0 5px 10px; + margin-bottom:1px; + font-size: 22px; +} + +#TB_title{ + background-color: #6C8C22; + color: #dedede; + height:40px; +} +#TB_title a { + color: white !important; + border-bottom: 1px dotted #dedede; +} + +#TB_ajaxContent{ + clear:both; + padding:2px 15px 15px 15px; + overflow:auto; + text-align:left; + line-height:1.4em; +} + +#TB_ajaxContent.TB_modal{ + padding:15px; +} + +#TB_ajaxContent p{ + padding:5px 0px 5px 0px; +} + +#TB_load{ + position: fixed; + display:none; + height:13px; + width:208px; + z-index:103; + top: 50%; + left: 50%; + margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */ +} + +* html #TB_load { /* ie6 hack */ +position: absolute; +margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); +} + +#TB_HideSelect{ + z-index:99; + position:fixed; + top: 0; + left: 0; + background-color:#fff; + border:none; + filter:alpha(opacity=0); + -moz-opacity: 0; + opacity: 0; + height:100%; + width:100%; +} + +* html #TB_HideSelect { /* ie6 hack */ + position: absolute; + height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); +} + +#TB_iframeContent{ + clear:both; + border:none; + margin-bottom:-1px; + margin-top:1px; + _margin-bottom:1px; +} + +/* @end */ + +/* @group Debugging Section */ + +#debugging-toggle { + text-align: center; +} +#debugging-toggle img { + cursor: pointer; +} + +#rdoc-debugging-section-dump { + display: none; + margin: 0 2em 2em; + background: #ccc; + border: 1px solid #999; +} + + + +/* @end */ diff --git a/ext/Makefile.debian b/ext/Makefile.debian deleted file mode 100644 index dbb3ac7..0000000 --- a/ext/Makefile.debian +++ /dev/null @@ -1,46 +0,0 @@ -#!/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 diff --git a/ext/action_helpers/perl/.gitignore b/ext/action_helpers/perl/.gitignore deleted file mode 100644 index 0b5bd39..0000000 --- a/ext/action_helpers/perl/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -Makefile -blib -pm_to_blib diff --git a/ext/build_defaults.yaml b/ext/build_defaults.yaml new file mode 100644 index 0000000..c9c5b95 --- /dev/null +++ b/ext/build_defaults.yaml @@ -0,0 +1,21 @@ +--- +packaging_url: 'git://github.com/puppetlabs/packaging.git --branch=master' +packaging_repo: 'packaging' +default_cow: 'base-squeeze-i386.cow' +cows: 'base-lucid-i386.cow base-precise-i386.cow base-quantal-i386.cow base-raring-i386.cow base-sid-i386.cow base-squeeze-i386.cow base-stable-i386.cow base-testing-i386.cow base-unstable-i386.cow base-wheezy-i386.cow base-saucy-i386.cow' +pbuild_conf: '/etc/pbuilderrc' +packager: 'puppetlabs' +gpg_name: 'info@puppetlabs.com' +gpg_key: '4BD6EC30' +sign_tar: FALSE +# a space separated list of mock configs +final_mocks: 'pl-el-5-i386 pl-el-6-i386 pl-fedora-18-i386 pl-fedora-19-i386' +yum_host: 'yum.puppetlabs.com' +yum_repo_path: '/opt/repository/yum/' +build_gem: TRUE +build_dmg: FALSE +build_doc: TRUE +build_ips: FALSE +apt_host: 'apt.puppetlabs.com' +apt_repo_url: 'http://apt.puppetlabs.com' +apt_repo_path: '/opt/repository/incoming' diff --git a/ext/debian/changelog b/ext/debian/changelog new file mode 100644 index 0000000..b559546 --- /dev/null +++ b/ext/debian/changelog @@ -0,0 +1,5 @@ +mcollective (2.3.3-1puppetlabs1) unstable sid squeeze wheezy precise; urgency=low + + * Update to version 2.3.3-1puppetlabs1 + + -- Puppet Labs Release Fri, 15 Nov 2013 12:53:51 +0000 diff --git a/ext/debian/control b/ext/debian/control index 3d59c8b..469fe25 100644 --- a/ext/debian/control +++ b/ext/debian/control @@ -2,7 +2,7 @@ Source: mcollective Section: utils Priority: extra Maintainer: Riccardo Setti -Build-Depends: debhelper (>= 7), dpatch, cdbs +Build-Depends: debhelper (>= 7), quilt, cdbs, ruby Standards-Version: 3.8.0 Homepage: http://marionette-collective.org/ @@ -10,14 +10,14 @@ Package: mcollective Architecture: all Depends: ruby (>= 1.8.1), mcollective-common (= ${source:Version}) Description: build server orchestration or parallel job execution systems - The Marionette Collective aka. mcollective is a framework + The Marionette Collective aka. mcollective is a framework to build server orchestration or parallel job execution systems. Package: mcollective-client Architecture: all Depends: ruby (>= 1.8.1), mcollective-common (= ${source:Version}) Description: build server orchestration or parallel job execution systems - The Marionette Collective aka. mcollective is a framework + The Marionette Collective aka. mcollective is a framework to build server orchestration or parallel job execution system Package: mcollective-common @@ -26,7 +26,7 @@ Breaks: mcollective (<< 2.0.0-1), mcollective-client (<< 2.0.0-1) Architecture: all 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 + The Marionette Collective aka. mcollective is a framework to build server orchestration or parallel job execution systems. . Common files for mcollective packages. @@ -35,7 +35,7 @@ Package: mcollective-doc Architecture: all Section: doc Description: Documentation for mcollective - The Marionette Collective aka. mcollective is a framework + The Marionette Collective aka. mcollective is a framework to build server orchestration or parallel job execution systems. . Documentation package. diff --git a/ext/debian/mcollective-common.dirs b/ext/debian/mcollective-common.dirs deleted file mode 100644 index 2b54b99..0000000 --- a/ext/debian/mcollective-common.dirs +++ /dev/null @@ -1 +0,0 @@ -usr/lib/ruby/vendor_ruby diff --git a/ext/debian/mcollective.dirs b/ext/debian/mcollective.dirs new file mode 100644 index 0000000..cfb1fd7 --- /dev/null +++ b/ext/debian/mcollective.dirs @@ -0,0 +1,2 @@ +etc/mcollective/ssl/clients +etc/mcollective/plugin.d diff --git a/ext/debian/mcollective.init b/ext/debian/mcollective.init index f599f4a..c4e822c 100755 --- a/ext/debian/mcollective.init +++ b/ext/debian/mcollective.init @@ -75,6 +75,9 @@ case "$1" in $0 start fi ;; + force-reload) + echo "not implemented" + ;; status) status_of_proc -p ${pidfile} ${mcollectived} ${name} && exit 0 || exit $? ;; diff --git a/ext/debian/mcollective.install b/ext/debian/mcollective.install index 64e7158..f099689 100644 --- a/ext/debian/mcollective.install +++ b/ext/debian/mcollective.install @@ -1,5 +1,3 @@ -usr/sbin/mcollectived usr/sbin -etc/mcollective/facts.yaml etc/mcollective -etc/mcollective/server.cfg etc/mcollective -etc/init.d etc/ -etc/mcollective/ssl +usr/sbin/mcollectived +etc/mcollective/facts.yaml +etc/mcollective/server.cfg diff --git a/ext/debian/patches/00list b/ext/debian/patches/00list deleted file mode 100644 index f356934..0000000 --- a/ext/debian/patches/00list +++ /dev/null @@ -1 +0,0 @@ -pluginsdir.dpatch diff --git a/ext/debian/patches/conffile.dpatch b/ext/debian/patches/conffile.dpatch deleted file mode 100755 index 499ae7c..0000000 --- a/ext/debian/patches/conffile.dpatch +++ /dev/null @@ -1,111 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## conffile.dpatch by -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: fix plugins dir - -@DPATCH@ -diff -urNad mcollective-1.1.4~/etc/client.cfg.dist mcollective-1.1.4/etc/client.cfg.dist ---- mcollective-1.1.4~/etc/client.cfg.dist 2011-04-06 14:13:08.829462165 -0700 -+++ mcollective-1.1.4/etc/client.cfg.dist 2011-04-06 14:12:53.129384114 -0700 -@@ -1,6 +1,6 @@ - main_collective = mcollective - collectives = mcollective --libdir = /usr/libexec/mcollective -+libdir = /usr/share/mcollective/plugins - logger_type = console - loglevel = warn - -diff -urNad mcollective-1.1.4~/etc/server.cfg.dist mcollective-1.1.4/etc/server.cfg.dist ---- mcollective-1.1.4~/etc/server.cfg.dist 2011-04-06 14:12:30.889527230 -0700 -+++ mcollective-1.1.4/etc/server.cfg.dist 2011-04-06 14:12:23.779407065 -0700 -@@ -1,6 +1,6 @@ - main_collective = mcollective - collectives = mcollective --libdir = /usr/libexec/mcollective -+libdir = /usr/share/mcollective/plugins - logfile = /var/log/mcollective.log - loglevel = info - daemonize = 1 - diff --git a/ext/debian/patches/pluginsdir.patch b/ext/debian/patches/pluginsdir.patch new file mode 100755 index 0000000..4fe0318 --- /dev/null +++ b/ext/debian/patches/pluginsdir.patch @@ -0,0 +1,24 @@ +diff --git a/etc/client.cfg.dist b/etc/client.cfg.dist +index 1acffee..5c36486 100644 +--- a/etc/client.cfg.dist ++++ b/etc/client.cfg.dist +@@ -1,6 +1,6 @@ + main_collective = mcollective + collectives = mcollective +-libdir = /usr/libexec/mcollective ++libdir = /usr/share/mcollective/plugins + logger_type = console + loglevel = warn + +diff --git a/etc/server.cfg.dist b/etc/server.cfg.dist +index 2038324..c28a826 100644 +--- a/etc/server.cfg.dist ++++ b/etc/server.cfg.dist +@@ -1,6 +1,6 @@ + main_collective = mcollective + collectives = mcollective +-libdir = /usr/libexec/mcollective ++libdir = /usr/share/mcollective/plugins + logfile = /var/log/mcollective.log + loglevel = info + daemonize = 1 diff --git a/ext/debian/patches/series b/ext/debian/patches/series new file mode 100644 index 0000000..15b17e6 --- /dev/null +++ b/ext/debian/patches/series @@ -0,0 +1 @@ +pluginsdir.patch diff --git a/ext/debian/rules b/ext/debian/rules index 966ff75..70ad4c4 100755 --- a/ext/debian/rules +++ b/ext/debian/rules @@ -1,18 +1,15 @@ #!/usr/bin/make -f -DEB_MAKE_CLEAN_TARGET := -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.debian -C $(DEB_BUILDDIR) +BUILD_ROOT=$(CURDIR)/debian/tmp +RUBY_LIBDIR=$(shell /usr/bin/ruby -rrbconfig -e 'puts RbConfig::CONFIG["vendordir"]') +PLUGINDIR=/usr/share/mcollective/plugins +DOCDIR=$(BUILD_ROOT)/usr/share/doc/mcollective install/mcollective:: - mv $(CURDIR)/debian/tmp/etc/mcollective/server.cfg.dist $(CURDIR)/debian/tmp/etc/mcollective/server.cfg - mv $(CURDIR)/debian/tmp/etc/mcollective/client.cfg.dist $(CURDIR)/debian/tmp/etc/mcollective/client.cfg - mv $(CURDIR)/debian/tmp/etc/mcollective/facts.yaml.dist $(CURDIR)/debian/tmp/etc/mcollective/facts.yaml -# dh_installinit -pmcollective -o + /usr/bin/ruby install.rb --destdir=$(CURDIR)/debian/tmp --no-rdoc --sitelibdir=$(RUBY_LIBDIR) --ruby=/usr/bin/ruby --plugindir=$(PLUGINDIR) + mkdir -p $(DOCDIR) + cp -a doc/* $(DOCDIR) binary-fixup/mcollective:: chmod 640 $(CURDIR)/debian/mcollective/etc/mcollective/server.cfg diff --git a/ext/debian/source/format b/ext/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/ext/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/ext/packaging.rake b/ext/packaging.rake new file mode 100644 index 0000000..3adb340 --- /dev/null +++ b/ext/packaging.rake @@ -0,0 +1,36 @@ +build_defs_file = File.join(RAKE_ROOT, 'ext', 'build_defaults.yaml') +if File.exist?(build_defs_file) + begin + require 'yaml' + @build_defaults ||= YAML.load_file(build_defs_file) + rescue Exception => e + STDERR.puts "Unable to load yaml from #{build_defs_file}:" + raise e + end + @packaging_url = @build_defaults['packaging_url'] + @packaging_repo = @build_defaults['packaging_repo'] + raise "Could not find packaging url in #{build_defs_file}" if @packaging_url.nil? + raise "Could not find packaging repo in #{build_defs_file}" if @packaging_repo.nil? + + namespace :package do + desc "Bootstrap packaging automation, e.g. clone into packaging repo" + task :bootstrap do + if File.exist?(File.join(RAKE_ROOT, "ext", @packaging_repo)) + puts "It looks like you already have ext/#{@packaging_repo}. If you don't like it, blow it away with package:implode." + else + cd File.join(RAKE_ROOT, 'ext') do + %x{git clone #{@packaging_url}} + end + end + end + desc "Remove all cloned packaging automation" + task :implode do + rm_rf File.join(RAKE_ROOT, "ext", @packaging_repo) + end + end +end + +begin + load File.join(RAKE_ROOT, 'ext', 'packaging', 'packaging.rake') +rescue LoadError +end diff --git a/ext/project_data.yaml b/ext/project_data.yaml new file mode 100644 index 0000000..c0f080c --- /dev/null +++ b/ext/project_data.yaml @@ -0,0 +1,45 @@ +--- +project: 'mcollective' +author: 'Puppet Labs' +email: 'info@puppetlabs.com' +homepage: 'https://docs.puppetlabs.com/mcollective/' +summary: 'Application Server for hosting Ruby code on any capable middleware' +description: 'The Marionette Collective, e.g. mcollective, is a framework for building server orchestration or parallel job execution systems.' +version_file: 'lib/mcollective.rb' +update_version_file: true +version_strategy: 'odd_even' +# files and gem_files are space separated lists +files: 'mcollective.init COPYING doc etc lib plugins ext bin install.rb' +# List of packaging related templates to evaluate before the tarball is packed +templates: + - "ext/redhat/mcollective.spec.erb" + - "ext/debian/changelog.erb" +# The gem is only built for the mcollective client +gem_name: 'mcollective-client' +gem_summary: 'Client libraries for the Mcollective Application Server' +gem_description: 'Client libraries for the Mcollective Application Server' +gem_files: 'lib bin' +gem_test_files: 'spec/**/*' +gem_require_path: 'lib' +gem_executables: 'mco' +gem_default_executables: 'mco' +gem_excludes: "bin/mcollectived lib/mcollective/runner.rb lib/mcollective/vendor/json lib/mcollective/vendor/load_json.rb lib/mcollective/vendor/systemu lib/mcollective/vendor/load_systemu.rb lib/mcollective/vendor/i18n lib/mcollective/vendor/load_i18n.rb" +gem_runtime_dependencies: + systemu: + json: + stomp: + i18n: +gem_rdoc_options: + - --line-numbers + - --main + - Mcollective + - --exclude + - mcollective/vendor + - --exclude + - spec + - --exclude + - ext + - --exclude + - website + - --exclude + - plugins diff --git a/ext/redhat/mcollective.service b/ext/redhat/mcollective.service new file mode 100644 index 0000000..6c98dd7 --- /dev/null +++ b/ext/redhat/mcollective.service @@ -0,0 +1,14 @@ +[Unit] +Description=The Marionette Collective +After=network.target + +[Service] +Type=forking +StandardOutput=syslog +StandardError=syslog +ExecStart=/usr/sbin/mcollectived --config=/etc/mcollective/server.cfg --pidfile=/var/run/mcollective.pid +ExecReload=/bin/kill -USR1 $MAINPID +PIDFile=/var/run/mcollective.pid + +[Install] +WantedBy=multi-user.target diff --git a/ext/redhat/mcollective.spec b/ext/redhat/mcollective.spec index bd5d927..af93a46 100644 --- a/ext/redhat/mcollective.spec +++ b/ext/redhat/mcollective.spec @@ -1,32 +1,60 @@ -# 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"]') +# Fedora 17 and later use vendorlibdir instead of sitelibdir (see https://fedoraproject.org/wiki/Packaging:Ruby?rd=Packaging/Ruby#Pure_Ruby_packages) +%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 +%global ruby_libdir %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["vendorlibdir"]') %else -%global ruby_libdir %(ruby -rrbconfig -e "puts RbConfig::CONFIG['sitelibdir']") +%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 -Name: mcollective -Version: %{version} -Release: %{release} -Group: System Environment/Daemons -License: ASL 2.0 -URL: http://puppetlabs.com/mcollective/introduction/ -Source0: http://downloads.puppetlabs.com/mcollective/%{name}-%{version}.tgz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Requires: mcollective-common = %{version}-%{release} -Packager: R.I.Pienaar -BuildArch: noarch +%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 +%global _with_systemd 1 +%else +%global _with_systemd 0 +%endif + +# VERSION is subbed out during rake package:srpm process +%global realversion 2.3.3 +%global rpmversion 2.3.3 + +Summary: Application Server for hosting Ruby code on any capable middleware +Name: mcollective +Version: %{rpmversion} +Release: 1%{?dist} +Group: System Environment/Daemons +License: ASL 2.0 +URL: http://puppetlabs.com/mcollective/introduction/ +Source0: http://downloads.puppetlabs.com/mcollective/%{name}-%{realversion}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: ruby >= 1.8 +Requires: mcollective-common = %{version}-%{release} +Packager: Puppet Labs +BuildArch: noarch + +%if 0%{?_with_systemd} +# Required for %%post, %%preun, %%postun +Requires: systemd +%if 0%{?fedora} >= 18 +BuildRequires: systemd +%else +BuildRequires: systemd-units +%endif +%else +# Required for %%post and %%preun +Requires: chkconfig +# Required for %%preun and %%postun +Requires: initscripts +%endif + +%description +The Marionette Collective: + +Server for the mcollective Application Server %package common -Summary: Common libraries for the mcollective clients and servers -Group: System Environment/Libraries -Requires: ruby >= 1.8 -Requires: rubygems -Requires: rubygem(stomp) +Summary: Common libraries for the mcollective clients and servers +Group: System Environment/Libraries +Requires: ruby >= 1.8 +Requires: rubygems +Requires: rubygem-stomp %description common The Marionette Collective: @@ -34,77 +62,82 @@ The Marionette Collective: Common libraries for the mcollective clients and servers %package client -Summary: Client tools for the mcollective Application Server -Requires: mcollective-common = %{version}-%{release} -Group: Applications/System +Summary: Client tools for the mcollective Application Server +Requires: mcollective-common = %{version}-%{release} +Group: Applications/System %description client The Marionette Collective: Client tools for the mcollective Application Server -%description -The Marionette Collective: - -Server for the mcollective Application Server - %prep -%setup -q +%setup -q -n %{name}-%{realversion} %build %install rm -rf %{buildroot} -%{__install} -d -m0755 %{buildroot}/%{ruby_libdir}/mcollective -%{__install} -d -m0755 %{buildroot}%{_bindir} -%{__install} -d -m0755 %{buildroot}%{_sbindir} + +ruby install.rb --destdir=%{buildroot} --no-rdoc --sitelibdir=%{ruby_libdir} --plugindir=%{_libexecdir}/mcollective + +%if 0%{?_with_systemd} +%{__install} -d -m0755 %{buildroot}%{_unitdir} +%{__install} -m0644 ext/redhat/mcollective.service %{buildroot}%{_unitdir}/mcollective.service +%else %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/init.d -%{__install} -d -m0755 %{buildroot}%{_libexecdir}/mcollective/ -%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/mcollective -%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/mcollective/plugin.d -%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/mcollective/ssl -%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/mcollective/ssl/clients -%{__install} -m0755 bin/mcollectived %{buildroot}%{_sbindir}/mcollectived -%{__install} -m0640 etc/server.cfg.dist %{buildroot}%{_sysconfdir}/mcollective/server.cfg -%{__install} -m0644 etc/client.cfg.dist %{buildroot}%{_sysconfdir}/mcollective/client.cfg -%{__install} -m0444 etc/facts.yaml.dist %{buildroot}%{_sysconfdir}/mcollective/facts.yaml -%{__install} -m0444 etc/rpc-help.erb %{buildroot}%{_sysconfdir}/mcollective/rpc-help.erb -%{__install} -m0444 etc/data-help.erb %{buildroot}%{_sysconfdir}/mcollective/data-help.erb -%{__install} -m0444 etc/discovery-help.erb %{buildroot}%{_sysconfdir}/mcollective/discovery-help.erb -%{__install} -m0444 etc/metadata-help.erb %{buildroot}%{_sysconfdir}/mcollective/metadata-help.erb -%{__install} -m0444 etc/msg-help.erb %{buildroot}%{_sysconfdir}/mcollective/msg-help.erb %if 0%{?suse_version} %{__install} -m0755 mcollective.init %{buildroot}%{_sysconfdir}/init.d/mcollective %else %{__install} -m0755 ext/redhat/mcollective.init %{buildroot}%{_sysconfdir}/init.d/mcollective %endif +%endif - -cp -R lib/* %{buildroot}/%{ruby_libdir}/ -cp -R plugins/* %{buildroot}%{_libexecdir}/mcollective/ -cp bin/mc-* %{buildroot}%{_sbindir}/ -cp bin/mco %{buildroot}%{_bindir}/ -chmod 0755 %{buildroot}%{_sbindir}/* +%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/mcollective/plugin.d +%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/mcollective/ssl/clients %clean rm -rf %{buildroot} %post +%if 0%{?_with_systemd} +if [ $1 -eq 1 ] ; then + /bin/systemctl daemon-reload >/dev/null 2>&1 || : +fi +%else /sbin/chkconfig --add mcollective || : +%endif %postun +%if 0%{?_with_systemd} +if [ $1 -ge 1 ] ; then + # Package upgrade, not uninstall + /bin/systemctl try-restart mcollective.service >/dev/null 2>&1 || : +fi +%else if [ "$1" -ge 1 ]; then /sbin/service mcollective condrestart &>/dev/null || : fi +%endif %preun +%if 0%{?_with_systemd} +if [ $1 -eq 0 ] ; then + # Package removal, not upgrade + /bin/systemctl --no-reload disable mcollective.service > /dev/null 2>&1 || : + /bin/systemctl stop mcollective.service > /dev/null 2>&1 || : +fi +%else if [ "$1" = 0 ] ; then /sbin/service mcollective stop > /dev/null 2>&1 /sbin/chkconfig --del mcollective || : fi +%endif %files common +%defattr(-, root, root, 0755) %doc COPYING +%doc doc %{ruby_libdir}/mcollective.rb %{ruby_libdir}/mcollective %{_libexecdir}/mcollective/mcollective @@ -113,6 +146,7 @@ fi %config %{_sysconfdir}/mcollective/*.erb %files client +%defattr(-, root, root, 0755) %attr(0755, root, root)%{_sbindir}/mc-call-agent %attr(0755, root, root)%{_bindir}/mco %doc COPYING @@ -121,14 +155,22 @@ fi %{_libexecdir}/mcollective/mcollective/pluginpackager %files +%defattr(-, root, root, 0755) %doc COPYING -%{_sbindir}/mcollectived +%attr(0755, root, root)%{_sbindir}/mcollectived +%if 0%{?_with_systemd} +%{_unitdir}/mcollective.service +%else %{_sysconfdir}/init.d/mcollective +%endif %config(noreplace)%{_sysconfdir}/mcollective/server.cfg %config(noreplace)%{_sysconfdir}/mcollective/facts.yaml %dir %{_sysconfdir}/mcollective/ssl/clients %config(noreplace)%{_sysconfdir}/mcollective/plugin.d %changelog +* Fri Nov 15 2013 Puppet Labs Release - 2.3.3-1 +- Build for 2.3.3 + * Tue Nov 03 2009 R.I.Pienaar - First release diff --git a/install.rb b/install.rb new file mode 100755 index 0000000..3ef1927 --- /dev/null +++ b/install.rb @@ -0,0 +1,306 @@ +#! /usr/bin/env ruby +#-- +# Copyright 2004 Austin Ziegler +# Install utility. Based on the original installation script for rdoc by the +# Pragmatic Programmers. +# +# This program is free software. It may be redistributed and/or modified under +# the terms of the GPL version 2 (or later) or the Ruby licence. +# +# Usage +# ----- +# In most cases, if you have a typical project layout, you will need to do +# absolutely nothing to make this work for you. This layout is: +# +# bin/ # executable files -- "commands" +# lib/ # the source of the library +# +# The default behaviour: +# 1) Build Rdoc documentation from all files in bin/ (excluding .bat and .cmd), +# all .rb files in lib/, ./README, ./ChangeLog, and ./Install. +# and all .rb files in lib/. +# 2) Install configuration files in etc/. +# 3) Install commands from bin/ into the Ruby bin directory. +# 4) Install system commands from bin/ into the Ruby sbin directory. +# 5) Install all library files from lib/ into Ruby's site_lib/version +# directory. +# 6) Install all plugins from plugins/ into the plugins directory +# (usually $libexecdir/mcollective). +# +#++ + +require 'rbconfig' +require 'find' +require 'fileutils' +require 'tempfile' +require 'optparse' +require 'ostruct' +include FileUtils + +begin + require 'rdoc/rdoc' + $haverdoc = true +rescue LoadError + puts "Missing rdoc; skipping documentation" + $haverdoc = false +end + +if (defined?(RbConfig) ? RbConfig : Config)::CONFIG['host_os'] =~ /mswin|win32|dos|mingw|cygwin/i + $stderr.puts "install.rb does not support Microsoft Windows. See ext/windows/README.md for information on installing on Microsoft Windows." + exit(-1) +end + +PREREQS = %w{} + +InstallOptions = OpenStruct.new + +def glob(list) + g = list.map { |i| Dir.glob(i) } + g.flatten! + g.compact! + g.uniq! + g +end + +def check_prereqs + PREREQS.each do |pre| + begin + require pre + rescue LoadError + puts "Could not load #{pre} Ruby library; cannot install" + exit(-1) + end + end +end + +def do_configs(configs, target, strip = 'etc/') + Dir.mkdir(target) unless File.directory? target + configs.each do |cf| + ocf = File.join(target, cf.gsub(Regexp.new(strip), '')) + oc = File.dirname(ocf) + makedirs(oc, {:mode => 0755, :verbose => true}) + install(cf, ocf, {:mode => 0644, :preserve => true, :verbose => true}) + end +end + +def do_bins(bins, target, strip = 's?bin/') + Dir.mkdir(target) unless File.directory? target + bins.each do |bf| + obf = bf.gsub(/#{strip}/, '') + install_binfile(bf, obf, target) + end +end + +def do_libs(libs, target, strip = 'lib/') + libs.each do |lf| + olf = File.join(target, lf.sub(/^#{strip}/, '')) + op = File.dirname(olf) + if File.directory?(lf) + makedirs(olf, {:mode => 0755, :verbose => true}) + else + makedirs(op, {:mode => 0755, :verbose => true}) + install(lf, olf, {:mode => 0644, :preserve => true, :verbose => true}) + end + end +end + +## +# Prepare the file installation. +# +def prepare_installation + InstallOptions.configs = true + + # Only try to do docs if we're sure they have rdoc + if $haverdoc + InstallOptions.rdoc = true + else + InstallOptions.rdoc = false + end + + + ARGV.options do |opts| + opts.banner = "Usage: #{File.basename($0)} [options]" + opts.separator "" + opts.on('--[no-]rdoc', 'Creation of RDoc output.', 'Default is create rdoc.') do |onrdoc| + InstallOptions.rdoc = onrdoc + end + opts.on('--[no-]configs', 'Installation of config files', 'Default is install configs.') do |onconfigs| + InstallOptions.configs = onconfigs + end + opts.on('--destdir[=OPTIONAL]', 'Installation prefix for all targets', 'Default essentially /') do |destdir| + InstallOptions.destdir = destdir + end + opts.on('--configdir[=OPTIONAL]', 'Installation directory for config files', 'Default /etc/mcollective') do |configdir| + InstallOptions.configdir = configdir + end + opts.on('--bindir[=OPTIONAL]', 'Installation directory for binaries', 'overrides RbConfig::CONFIG["bindir"]') do |bindir| + InstallOptions.bindir = bindir + end + opts.on('--sbindir[=OPTIONAL]', 'Installation directory for system binaries', 'overrides RbConfig::CONFIG["sbindir"]') do |sbindir| + InstallOptions.sbindir = sbindir + end + opts.on('--ruby[=OPTIONAL]', 'Ruby interpreter to use with installation', 'overrides ruby used to call install.rb') do |ruby| + InstallOptions.ruby = ruby + end + opts.on('--sitelibdir[=OPTIONAL]', 'Installation directory for libraries', 'overrides RbConfig::CONFIG["sitelibdir"]') do |sitelibdir| + InstallOptions.sitelibdir = sitelibdir + end + opts.on('--plugindir[=OPTIONAL]', 'Installation directory for plugins', 'Default /usr/libexec/mcollective') do |plugindir| + InstallOptions.plugindir = plugindir + end + opts.on('--quick', 'Performs a quick installation. Only the', 'installation is done.') do |quick| + InstallOptions.rdoc = false + InstallOptions.ri = false + InstallOptions.configs = true + end + opts.on('--full', 'Performs a full installation. All', 'optional installation steps are run.') do |full| + InstallOptions.rdoc = true + InstallOptions.ri = true + InstallOptions.configs = true + end + opts.separator("") + opts.on_tail('--help', "Shows this help text.") do + $stderr.puts opts + exit + end + + opts.parse! + end + + version = [RbConfig::CONFIG["MAJOR"], RbConfig::CONFIG["MINOR"]].join(".") + libdir = File.join(RbConfig::CONFIG["libdir"], "ruby", version) + + # Mac OS X 10.5 and higher declare bindir + # /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin + # which is not generally where people expect executables to be installed + # These settings are appropriate defaults for all OS X versions. + if RUBY_PLATFORM =~ /^universal-darwin[\d\.]+$/ + RbConfig::CONFIG['bindir'] = "/usr/bin" + RbConfig::CONFIG['sbindir'] = "/usr/sbin" + end + + if InstallOptions.configdir + configdir = InstallOptions.configdir + else + configdir = "/etc/mcollective" + end + + if InstallOptions.bindir + bindir = InstallOptions.bindir + else + bindir = RbConfig::CONFIG['bindir'] + end + + if InstallOptions.sbindir + sbindir = InstallOptions.sbindir + else + sbindir = RbConfig::CONFIG['sbindir'] + end + + if InstallOptions.sitelibdir + sitelibdir = InstallOptions.sitelibdir + else + sitelibdir = RbConfig::CONFIG["sitelibdir"] + if sitelibdir.nil? + sitelibdir = $LOAD_PATH.find { |x| x =~ /site_ruby/ } + if sitelibdir.nil? + sitelibdir = File.join(libdir, "site_ruby") + elsif sitelibdir !~ Regexp.quote(version) + sitelibdir = File.join(sitelibdir, version) + end + end + end + + if InstallOptions.plugindir + plugindir = InstallOptions.plugindir + else + plugindir = "/usr/libexec/mcollective" + end + + if InstallOptions.destdir + destdir = InstallOptions.destdir + else + destdir = '' + end + + configdir = File.join(destdir, configdir) + bindir = File.join(destdir, bindir) + sbindir = File.join(destdir, sbindir) + sitelibdir = File.join(destdir, sitelibdir) + plugindir = File.join(destdir, plugindir) + + makedirs(configdir) if InstallOptions.configs + makedirs(bindir) + makedirs(sbindir) + makedirs(sitelibdir) + makedirs(plugindir) + + InstallOptions.sitelibdir = sitelibdir + InstallOptions.configdir = configdir + InstallOptions.bindir = bindir + InstallOptions.sbindir = sbindir + InstallOptions.plugindir = plugindir +end + +## +# Build the rdoc documentation. +# +def build_rdoc(files) + return unless $haverdoc + begin + r = RDoc::RDoc.new + r.document(["--main", "MCollective", "--line-numbers"] + files) + rescue RDoc::RDocError => e + $stderr.puts e.message + rescue Exception => e + $stderr.puts "Couldn't build RDoc documentation\n#{e.message}" + end +end + +## +# Install file(s) from ./bin to RbConfig::CONFIG['bindir']. Patch it on the way +# to insert a #! line; on a Unix install, the command is named as expected +def install_binfile(from, op_file, target) + tmp_file = Tempfile.new('mcollective-binfile') + + if InstallOptions.ruby + ruby = InstallOptions.ruby + else + ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name']) + end + + File.open(from) do |ip| + File.open(tmp_file.path, "w") do |op| + op.puts "#!#{ruby}" + contents = ip.readlines + contents.shift if contents[0] =~ /^#!/ + op.write contents.join + end + end + + install(tmp_file.path, File.join(target, op_file), :mode => 0755, :preserve => true, :verbose => true) + tmp_file.unlink +end + +# Change directory into the mcollective root so we don't get the wrong files for install. +cd File.dirname(__FILE__) do + # Set these values to what you want installed. + configs = glob(%w{etc/*.dist}) + erbs = glob(%w{etc/*.erb}) + bins = glob(%w{bin/mco}) + sbins = glob(%w{bin/mcollectived bin/mc-call-agent}) + rdoc = glob(%w{bin/* lib/**/*.rb README* }) + libs = glob(%w{lib/**/*}) + plugins = glob(%w{plugins/**/*}) + + check_prereqs + prepare_installation + + build_rdoc(rdoc) if InstallOptions.rdoc + do_configs(configs, InstallOptions.configdir, 'etc/|\.dist') if InstallOptions.configs + do_configs(erbs, InstallOptions.configdir) if InstallOptions.configs + do_bins(bins, InstallOptions.bindir) + do_bins(sbins, InstallOptions.sbindir) + do_libs(libs, InstallOptions.sitelibdir) + do_libs(plugins, InstallOptions.plugindir, 'plugins/') +end diff --git a/lib/mcollective.rb b/lib/mcollective.rb index 3e38f2a..b90d8a5 100644 --- a/lib/mcollective.rb +++ b/lib/mcollective.rb @@ -60,7 +60,7 @@ module MCollective MCollective::Vendor.load_vendored - VERSION="2.3.2" + VERSION="2.3.3" def self.version VERSION diff --git a/lib/mcollective/rpc/agent.rb b/lib/mcollective/rpc/agent.rb index 857cc76..49a9b3a 100644 --- a/lib/mcollective/rpc/agent.rb +++ b/lib/mcollective/rpc/agent.rb @@ -215,7 +215,7 @@ module MCollective end end - [:stdin, :cwd, :environment].each do |k| + [:stdin, :cwd, :environment, :timeout].each do |k| if options.include?(k) shellopts[k] = options[k] end diff --git a/lib/mcollective/shell.rb b/lib/mcollective/shell.rb index 0f113d5..60f4417 100644 --- a/lib/mcollective/shell.rb +++ b/lib/mcollective/shell.rb @@ -17,9 +17,12 @@ module MCollective # stderr - a variable that will receive stdin, must support << # environment - the shell environment, defaults to include LC_ALL=C # set to nil to clear the environment even of LC_ALL + # timeout - a timeout in seconds after which the subprocess is killed, + # the special value :on_thread_exit kills the subprocess + # when the invoking thread (typically the agent) has ended # class Shell - attr_reader :environment, :command, :status, :stdout, :stderr, :stdin, :cwd + attr_reader :environment, :command, :status, :stdout, :stderr, :stdin, :cwd, :timeout def initialize(command, options={}) @environment = {"LC_ALL" => "C"} @@ -29,6 +32,7 @@ module MCollective @stderr = "" @stdin = nil @cwd = Dir.tmpdir + @timeout = nil options.each do |opt, val| case opt.to_s @@ -54,6 +58,9 @@ module MCollective else @environment.merge!(val.dup) end + when "timeout" + raise "timeout should be a positive integer or the symbol :on_thread_exit symbol" unless val.eql?(:on_thread_exit) || ( val.is_a?(Fixnum) && val>0 ) + @timeout = val end end end @@ -67,25 +74,51 @@ module MCollective opts["stdin"] = @stdin if @stdin - # 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 + # Start a double fork and exec with systemu which implies a guard thread. + # If a valid timeout is configured the guard thread will terminate the + # executing process and reap the pid. + # If no timeout is specified the process will run to completion with the + # guard thread reaping the pid on completion. @status = systemu(@command, opts) do |cid| begin - while(thread.alive?) - sleep 0.1 + if timeout.is_a?(Fixnum) + # wait for the specified timeout + sleep timeout + else + # sleep while the agent thread is still alive + while(thread.alive?) + sleep 0.1 + end end - Process.waitpid(cid) if Process.getpgid(cid) + # if the process is still running + if (Process.kill(0, cid)) + # and a timeout was specified + if timeout + if Util.windows? + Process.kill('KILL', cid) + else + # Kill the process + Process.kill('TERM', cid) + sleep 2 + Process.kill('KILL', cid) if (Process.kill(0, cid)) + end + end + # only wait if the parent thread is dead + Process.waitpid(cid) unless thread.alive? + end rescue SystemExit rescue Errno::ESRCH rescue Errno::ECHILD + Log.warn("Could not reap process '#{cid}'.") rescue Exception => e Log.info("Unexpected exception received while waiting for child process: #{e.class}: #{e}") end end + @status.thread.kill + @status end end end diff --git a/lib/mcollective/vendor/i18n/.gitignore b/lib/mcollective/vendor/i18n/.gitignore deleted file mode 100644 index b066d1e..0000000 --- a/lib/mcollective/vendor/i18n/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -.DS_Store -test/rails/fixtures -nbproject/ -vendor/**/* -*.swp -pkg -.bundle -.rvmrc diff --git a/lib/mcollective/vendor/i18n/.travis.yml b/lib/mcollective/vendor/i18n/.travis.yml deleted file mode 100644 index 792ec6c..0000000 --- a/lib/mcollective/vendor/i18n/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -rvm: - - 1.8.7 - - 1.9.2 - - 1.9.3 - - ree - - rbx - - jruby diff --git a/lib/mcollective/vendor/json/.gitignore b/lib/mcollective/vendor/json/.gitignore deleted file mode 100644 index 726ffce..0000000 --- a/lib/mcollective/vendor/json/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -.*.sw[pon] -coverage -pkg -.nfs.* -.idea -java/Json.iml -Gemfile.lock -.rvmrc diff --git a/lib/mcollective/vendor/json/.travis.yml b/lib/mcollective/vendor/json/.travis.yml deleted file mode 100644 index cb74e2d..0000000 --- a/lib/mcollective/vendor/json/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -# Passes arguments to bundle install (http://gembundler.com/man/bundle-install.1.html) -bundler_args: --binstubs - -# Specify which ruby versions you wish to run your tests on, each version will be used -rvm: - - 1.8.7 - - 1.9.2 - - 1.9.3 - - rbx - - rbx-2.0 - - ree - - jruby - - ruby-head - -script: "bundle exec rake" diff --git a/lib/mcollective/vendor/json/diagrams/.keep b/lib/mcollective/vendor/json/diagrams/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/lib/mcollective/vendor/json/lib/json/ext/.keep b/lib/mcollective/vendor/json/lib/json/ext/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/mcollective.init b/mcollective.init index f599f4a..37e96ab 100755 --- a/mcollective.init +++ b/mcollective.init @@ -2,6 +2,7 @@ # # mcollective Application Server for STOMP based agents # +# chkconfig: 345 24 76 # # description: mcollective lets you build powerful Stomp compatible middleware clients in ruby without having to worry too # much about all the setup and management of a Stomp connection, it also provides stats, logging and so forth @@ -14,23 +15,24 @@ # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start daemon at boot time -# Description: Enable service provided by mcollective. +# Description: Enable service provided by daemon. ### END INIT INFO -# check permissions +mcollectived="/usr/sbin/mcollectived" -uid=`id -u` -[ $uid -gt 0 ] && { echo "You need to be root to run file" ; exit 4 ; } +# Lockfile +if [ -d /var/lock/subsys ]; then + # RedHat/CentOS/etc who use subsys + lock="/var/lock/subsys/mcollective" +else + # The rest of them + lock="/var/lock/mcollective" +fi # PID directory pidfile="/var/run/mcollectived.pid" -name="mcollective" -mcollectived=/usr/sbin/mcollectived -daemonopts="--pid=${pidfile} --config=/etc/mcollective/server.cfg" - - # Source function library. . /lib/lsb/init-functions @@ -38,34 +40,52 @@ daemonopts="--pid=${pidfile} --config=/etc/mcollective/server.cfg" if ! [ -f $mcollectived ] then echo "mcollectived binary not found" - exit 5 + exit 0 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 - start-stop-daemon -S -p ${pidfile} --oknodo -q -a ${mcollectived} -- ${daemonopts} - [ $? = 0 ] && { exit 0 ; } || { exit 1 ; } - log_success_msg "mcollective started" - touch $lock + echo -n "Starting mcollective: " + + if [ -f ${lock} ]; then + # we were not shut down correctly + if [ -s ${pidfile} ]; then + kill `cat ${pidfile}` >/dev/null 2>&1 + fi + rm -f ${pidfile} + + rm -f ${lock} + sleep 2 + fi + + rm -f ${pidfile} + + ${mcollectived} --pid=${pidfile} --config="/etc/mcollective/server.cfg" + if [ $? = 0 ]; then + log_success_msg + touch $lock + exit 0 + else + log_failure_msg + exit 1 + fi ;; stop) - echo "Stopping daemon: " $name - start-stop-daemon -K -R 5 -s "TERM" --oknodo -q -p ${pidfile} - [ $? = 0 ] && { exit 0 ; } || { exit 1 ; } - log_success_msg "mcollective stopped" + echo -n "Shutting down mcollective: " + + if [ -s ${pidfile} ]; then + kill `cat ${pidfile}` >/dev/null 2>&1 + fi + rm -f ${pidfile} + + log_success_msg + rm -f $lock ;; restart) - echo "Restarting daemon: " $name $0 stop sleep 2 $0 start - [ $? = 0 ] && { echo "mcollective restarted" ; exit 0 ; } ;; condrestart) if [ -f $lock ]; then @@ -76,10 +96,27 @@ case "$1" in fi ;; status) - status_of_proc -p ${pidfile} ${mcollectived} ${name} && exit 0 || exit $? + if [ -f ${lock} ]; then + if [ -s ${pidfile} ]; then + if [ -e /proc/`cat ${pidfile}` ]; then + echo "mcollectived (`cat ${pidfile}`) is running" + exit 0 + else + echo "mcollectived (`cat ${pidfile}`) is NOT running" + exit 1 + fi + fi + else + echo "mcollectived: service not started" + exit 1 + fi + ;; + force-reload) + echo "not implemented" ;; *) echo "Usage: mcollectived {start|stop|restart|condrestart|status}" - exit 2 + exit 1 ;; esac +exit 0 diff --git a/plugins/mcollective/application/plugin.rb b/plugins/mcollective/application/plugin.rb index 0a621c8..94b4af9 100644 --- a/plugins/mcollective/application/plugin.rb +++ b/plugins/mcollective/application/plugin.rb @@ -123,10 +123,15 @@ mco plugin package [options] :type => Array option :keep_artifacts, - :dsecription => "Don't remove artifacts after building packages", + :description => "Don't remove artifacts after building packages", :arguments => ['--keep-artifacts'], :type => :boolean + option :module_template, + :description => "Path to the template used by the modulepackager", + :arguments => ['--module-template PATH'], + :type => String + # Handle alternative format that optparser can't parse. def post_option_parser(configuration) if ARGV.length >= 1 @@ -197,7 +202,9 @@ mco plugin package [options] 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], configuration[:keep_artifacts]).create_packages + packager.new(plugin, configuration[:pluginpath], configuration[:sign], + options[:verbose], configuration[:keep_artifacts], + configuration[:module_template]).create_packages end # Agents are just called 'agent' but newer plugin types are diff --git a/plugins/mcollective/pluginpackager/debpackage_packager.rb b/plugins/mcollective/pluginpackager/debpackage_packager.rb index fd680a4..74081cc 100644 --- a/plugins/mcollective/pluginpackager/debpackage_packager.rb +++ b/plugins/mcollective/pluginpackager/debpackage_packager.rb @@ -3,7 +3,7 @@ module MCollective class DebpackagePackager require 'erb' - def initialize(plugin, pluginpath = nil, signature = nil, verbose = false, keep_artifacts = nil) + def initialize(plugin, pluginpath = nil, signature = nil, verbose = false, keep_artifacts = nil, module_template = nil) if PluginPackager.command_available?('debuild') @plugin = plugin @verbose = verbose diff --git a/plugins/mcollective/pluginpackager/modulepackage_packager.rb b/plugins/mcollective/pluginpackager/modulepackage_packager.rb new file mode 100644 index 0000000..6fcd606 --- /dev/null +++ b/plugins/mcollective/pluginpackager/modulepackage_packager.rb @@ -0,0 +1,127 @@ +module MCollective + module PluginPackager + class ModulepackagePackager + require 'erb' + + def initialize(plugin, pluginpath = nil, signature = nil, verbose = false, keep_artifacts = nil, module_template = nil) + assert_new_enough_puppet + @plugin = plugin + @package_name = "#{@plugin.mcname}_#{@plugin.metadata[:name]}".gsub(/-/, '_') + @verbose = verbose + @keep_artifacts = keep_artifacts + @module_template = module_template || File.join(File.dirname(__FILE__), 'templates', 'module') + end + + # Build Process : + # - create module directory + # - run 'puppet module build' + # - move generated package back to cwd + def create_packages + begin + puts "Building module for #{@package_name} plugin." + + @tmpdir = Dir.mktmpdir('mcollective_packager') + make_module + run_build + move_package + + puts "Completed building module for #{@package_name} plugin." + ensure + if @keep_artifacts + puts 'Keeping build artifacts' + puts "Build artifacts saved - #{@tmpdir}" + else + cleanup_tmpdirs + end + end + end + + private + + def assert_new_enough_puppet + unless PluginPackager.command_available?('puppet') + raise("Cannot build package. 'puppet' is not present on the system.") + end + + s = Shell.new('puppet --version') + s.runcommand + actual_version = s.stdout.chomp + + required_version = '3.3.0' + if Util.versioncmp(actual_version, required_version) < 0 + raise("Cannot build package. puppet #{required_version} or greater required. We have #{actual_version}.") + end + end + + def make_module + targetdir = File.join(@tmpdir, 'manifests') + FileUtils.mkdir_p(targetdir) unless File.directory?(targetdir) + + # for each subpackage make a subclass + @plugin.packagedata.each do |klass,data| + data[:files].each do |file| + relative_path = file.sub(/^\.\//, '') + targetdir = File.join(@tmpdir, 'files', klass.to_s, 'mcollective', File.dirname(relative_path)) + FileUtils.mkdir_p(targetdir) unless File.directory?(targetdir) + FileUtils.cp_r(file, targetdir) + end + + @klass = klass.to_s + render_template('_manifest.pp.erb', File.join(@tmpdir, 'manifests', "#{klass}.pp")) + end + + # render all the templates we have + Dir.glob(File.join(@module_template, '*.erb')).each do |template| + filename = File.basename(template, '.erb') + next if filename =~ /^_/ # starting with underscore makes it private + render_template("#{filename}.erb", File.join(@tmpdir, filename)) + end + end + + def render_template(template, path) + begin + erb = ERB.new(File.read(File.join(@module_template, template)), nil, '-') + File.open(path, 'w') do |f| + f.puts erb.result(binding) + end + rescue => e + puts "Could not render template to path - '#{path}'" + raise e + end + end + + def run_build + begin + PluginPackager.execute_verbosely(@verbose) do + Dir.chdir(@tmpdir) do + PluginPackager.safe_system('puppet module build') + end + end + rescue => e + puts 'Build process has failed' + raise e + end + end + + # Move built package to cwd + def move_package + begin + package_file = File.join(@tmpdir, 'pkg', "#{@plugin.vendor}-#{@package_name}-#{@plugin.metadata[:version]}.tar.gz") + FileUtils.cp(package_file, '.') + rescue => e + puts 'Could not copy package to working directory' + raise e + end + end + + def cleanup_tmpdirs + 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 +end diff --git a/plugins/mcollective/pluginpackager/ospackage_packager.rb b/plugins/mcollective/pluginpackager/ospackage_packager.rb index 7641198..f8ae444 100644 --- a/plugins/mcollective/pluginpackager/ospackage_packager.rb +++ b/plugins/mcollective/pluginpackager/ospackage_packager.rb @@ -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, keep_artifacts = false) + def initialize(package, pluginpath = nil, signature = nil, verbose = false, keep_artifacts = false, module_template = nil) if File.exists?("/etc/redhat-release") - @packager = PluginPackager["RpmpackagePackager"].new(package, pluginpath, signature, verbose, keep_artifacts) + @packager = PluginPackager["RpmpackagePackager"].new(package, pluginpath, signature, verbose, keep_artifacts, module_template) @package_type = "RPM" elsif File.exists?("/etc/debian_version") - @packager = PluginPackager["DebpackagePackager"].new(package, pluginpath, signature, verbose, keep_artifacts) + @packager = PluginPackager["DebpackagePackager"].new(package, pluginpath, signature, verbose, keep_artifacts, module_template) @package_type = "Deb" else raise "cannot identify operating system." diff --git a/plugins/mcollective/pluginpackager/rpmpackage_packager.rb b/plugins/mcollective/pluginpackager/rpmpackage_packager.rb index f91418a..7d8fa69 100644 --- a/plugins/mcollective/pluginpackager/rpmpackage_packager.rb +++ b/plugins/mcollective/pluginpackager/rpmpackage_packager.rb @@ -3,7 +3,7 @@ module MCollective class RpmpackagePackager require 'erb' - def initialize(plugin, pluginpath = nil, signature = nil, verbose = false, keep_artifacts = nil) + def initialize(plugin, pluginpath = nil, signature = nil, verbose = false, keep_artifacts = nil, module_template = nil) if @buildtool = select_command @plugin = plugin @package_name = "#{@plugin.mcname}-#{@plugin.metadata[:name]}" diff --git a/plugins/mcollective/pluginpackager/templates/module/Modulefile.erb b/plugins/mcollective/pluginpackager/templates/module/Modulefile.erb new file mode 100644 index 0000000..438bb72 --- /dev/null +++ b/plugins/mcollective/pluginpackager/templates/module/Modulefile.erb @@ -0,0 +1,5 @@ +name '<%= @plugin.vendor %>-<%= @package_name %>' +version '<%= @plugin.metadata[:version] %>' +description '<%= @plugin.metadata[:description] %>' +project_page '<%= @plugin.metadata[:url]%>' +dependency 'puppetlabs/mcollective', '1.x' diff --git a/plugins/mcollective/pluginpackager/templates/module/README.md.erb b/plugins/mcollective/pluginpackager/templates/module/README.md.erb new file mode 100644 index 0000000..eeb1128 --- /dev/null +++ b/plugins/mcollective/pluginpackager/templates/module/README.md.erb @@ -0,0 +1,37 @@ +# <%= @package_name %> + +#### Table of Contents + +1. [Overview](#overview) +2. [Module Description - What the module does and why it is useful](#module-description) +3. [Setup - The basics of getting started with <%= @package_name %>](#setup) + * [What the <%= @package_name %> module affects](#what-the-<%= @package_name %>-module-affects) + * [Setup requirements](#setup-requirements) +4. [Usage - Configuration options and additional functionality](#usage) +5. [Reference - An under-the-hood peek at what the module is doing and how](#reference) + + +## Overview + +The <%= @package_name %> module is a module that wraps a source release of the +<%= @plugin.metadata[:name] %> mcollective plugin for use with the +[puppetlabs mcollective](http://forge.puppetlabs.com/puppetlabs/mcollective) +module. + +## Module description + +## Usage + +<% @plugin.packagedata.keys.map { |x| x.to_s }.sort.each do |klass| -%> +<%# Don't document common class -%> +<% if klass != "common" -%> +### class <%= @package_name %>::<%= klass %> + +Installs the <%= klass %> component of the <%= @plugin.metadata[:name] %> plugin. + +```puppet +include <%= @package_name%>::<%= klass %> +``` +<% end %> +<% end %> + diff --git a/plugins/mcollective/pluginpackager/templates/module/_manifest.pp.erb b/plugins/mcollective/pluginpackager/templates/module/_manifest.pp.erb new file mode 100644 index 0000000..a136f32 --- /dev/null +++ b/plugins/mcollective/pluginpackager/templates/module/_manifest.pp.erb @@ -0,0 +1,9 @@ +# +class <%= @package_name %>::<%= @klass %> { + <% if @plugin.packagedata[:common] && @klass != 'common' %> + include ::<%= @package_name %>::common + <% end %> + mcollective::plugin { '<%= @package_name %>/<%= @klass %>': + source => 'puppet:///modules/<%= @package_name %>/<% @klass %>', + } +} -- 2.32.3