puppet 3.5.1-x86-mingw32 → 3.6.0.rc1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- data/CONTRIBUTING.md +5 -0
- data/Gemfile +17 -9
- data/README.md +1 -0
- data/conf/fileserver.conf +4 -3
- data/ext/README.environment +8 -0
- data/ext/build_defaults.yaml +1 -1
- data/ext/debian/control +2 -2
- data/ext/debian/puppet-common.dirs +4 -0
- data/ext/debian/rules +4 -0
- data/ext/emacs/puppet-mode-init.el +1 -1
- data/ext/emacs/puppet-mode.el +36 -17
- data/ext/redhat/client.init +3 -3
- data/ext/redhat/puppet.spec.erb +9 -0
- data/ext/systemd/puppet.service +3 -4
- data/ext/systemd/puppetmaster.service +1 -3
- data/install.rb +1 -1
- data/lib/puppet.rb +2 -1
- data/lib/puppet/agent.rb +1 -1
- data/lib/puppet/application.rb +17 -17
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/configurer.rb +4 -1
- data/lib/puppet/configurer/downloader.rb +13 -12
- data/lib/puppet/configurer/plugin_handler.rb +3 -3
- data/lib/puppet/context.rb +6 -1
- data/lib/puppet/defaults.rb +82 -12
- data/lib/puppet/environments.rb +169 -13
- data/lib/puppet/external/nagios/grammar.ry +2 -0
- data/lib/puppet/external/nagios/parser.rb +28 -19
- data/lib/puppet/face/config.rb +19 -6
- data/lib/puppet/face/module/generate.rb +209 -7
- data/lib/puppet/face/module/install.rb +17 -16
- data/lib/puppet/face/module/list.rb +83 -82
- data/lib/puppet/face/module/search.rb +1 -1
- data/lib/puppet/face/module/upgrade.rb +10 -9
- data/lib/puppet/face/parser.rb +3 -2
- data/lib/puppet/face/plugin.rb +8 -4
- data/lib/puppet/file_bucket/dipper.rb +6 -3
- data/lib/puppet/file_bucket/file.rb +4 -2
- data/lib/puppet/file_serving/metadata.rb +1 -1
- data/lib/puppet/file_system/memory_file.rb +27 -1
- data/lib/puppet/file_system/memory_impl.rb +15 -1
- data/lib/puppet/forge.rb +148 -52
- data/lib/puppet/forge/cache.rb +5 -1
- data/lib/puppet/forge/errors.rb +10 -0
- data/lib/puppet/forge/repository.rb +61 -26
- data/lib/puppet/functions.rb +548 -0
- data/lib/puppet/functions/assert_type.rb +42 -0
- data/lib/puppet/functions/import.rb +7 -0
- data/lib/puppet/indirector/facts/facter.rb +1 -1
- data/lib/puppet/indirector/file_bucket_file/file.rb +3 -2
- data/lib/puppet/indirector/rest.rb +18 -0
- data/lib/puppet/loaders.rb +20 -0
- data/lib/puppet/module.rb +2 -2
- data/lib/puppet/module_tool.rb +40 -14
- data/lib/puppet/module_tool/applications.rb +0 -1
- data/lib/puppet/module_tool/applications/application.rb +35 -26
- data/lib/puppet/module_tool/applications/builder.rb +16 -6
- data/lib/puppet/module_tool/applications/checksummer.rb +25 -19
- data/lib/puppet/module_tool/applications/installer.rb +196 -35
- data/lib/puppet/module_tool/applications/searcher.rb +1 -0
- data/lib/puppet/module_tool/applications/uninstaller.rb +7 -1
- data/lib/puppet/module_tool/applications/unpacker.rb +57 -31
- data/lib/puppet/module_tool/applications/upgrader.rb +221 -65
- data/lib/puppet/module_tool/checksums.rb +5 -8
- data/lib/puppet/module_tool/errors/installer.rb +12 -44
- data/lib/puppet/module_tool/errors/shared.rb +84 -11
- data/lib/puppet/module_tool/errors/upgrader.rb +16 -45
- data/lib/puppet/module_tool/install_directory.rb +7 -6
- data/lib/puppet/module_tool/installed_modules.rb +92 -0
- data/lib/puppet/module_tool/local_tarball.rb +91 -0
- data/lib/puppet/module_tool/metadata.rb +119 -115
- data/lib/puppet/module_tool/modulefile.rb +9 -9
- data/lib/puppet/module_tool/shared_behaviors.rb +19 -7
- data/lib/puppet/module_tool/skeleton/templates/generator/README.md.erb +79 -0
- data/lib/puppet/module_tool/skeleton/templates/generator/Rakefile +18 -0
- data/lib/puppet/module_tool/skeleton/templates/generator/metadata.json.erb +1 -0
- data/lib/puppet/module_tool/skeleton/templates/generator/spec/classes/init_spec.rb.erb +7 -0
- data/lib/puppet/module_tool/tar.rb +3 -7
- data/lib/puppet/module_tool/tar/gnu.rb +21 -9
- data/lib/puppet/module_tool/tar/mini.rb +2 -8
- data/lib/puppet/network/http/api/v1.rb +1 -1
- data/lib/puppet/network/http/api/v2/authorization.rb +4 -2
- data/lib/puppet/network/http/issues.rb +1 -0
- data/lib/puppet/network/http_pool.rb +15 -6
- data/lib/puppet/node/environment.rb +91 -20
- data/lib/puppet/parser/ast/pops_bridge.rb +44 -3
- data/lib/puppet/parser/collector.rb +1 -1
- data/lib/puppet/parser/compiler.rb +50 -7
- data/lib/puppet/parser/functions.rb +6 -0
- data/lib/puppet/parser/functions/generate.rb +1 -1
- data/lib/puppet/parser/resource.rb +1 -1
- data/lib/puppet/pops.rb +22 -1
- data/lib/puppet/pops/adapters.rb +8 -1
- data/lib/puppet/pops/binder/bindings_composer.rb +1 -1
- data/lib/puppet/pops/binder/bindings_factory.rb +1 -1
- data/lib/puppet/pops/binder/config/binder_config_checker.rb +1 -1
- data/lib/puppet/pops/binder/producers.rb +2 -2
- data/lib/puppet/pops/evaluator/access_operator.rb +65 -25
- data/lib/puppet/pops/evaluator/callable_signature.rb +101 -0
- data/lib/puppet/pops/evaluator/closure.rb +57 -2
- data/lib/puppet/pops/evaluator/compare_operator.rb +1 -1
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +9 -11
- data/lib/puppet/pops/evaluator/runtime3_support.rb +72 -21
- data/lib/puppet/pops/functions/dispatch.rb +71 -0
- data/lib/puppet/pops/functions/dispatcher.rb +237 -0
- data/lib/puppet/pops/functions/function.rb +77 -0
- data/lib/puppet/pops/issues.rb +12 -0
- data/lib/puppet/pops/loader/base_loader.rb +102 -0
- data/lib/puppet/pops/loader/dependency_loader.rb +60 -0
- data/lib/puppet/pops/loader/gem_support.rb +49 -0
- data/lib/puppet/pops/loader/loader.rb +180 -0
- data/lib/puppet/pops/loader/loader_paths.rb +137 -0
- data/lib/puppet/pops/loader/module_loaders.rb +242 -0
- data/lib/puppet/pops/loader/null_loader.rb +44 -0
- data/lib/puppet/pops/loader/ruby_function_instantiator.rb +34 -0
- data/lib/puppet/pops/loader/ruby_legacy_function_instantiator.rb +109 -0
- data/lib/puppet/pops/loader/simple_environment_loader.rb +20 -0
- data/lib/puppet/pops/loader/static_loader.rb +69 -0
- data/lib/puppet/pops/loader/uri_helper.rb +22 -0
- data/lib/puppet/pops/loaders.rb +240 -0
- data/lib/puppet/pops/model/factory.rb +13 -5
- data/lib/puppet/pops/model/model_tree_dumper.rb +12 -4
- data/lib/puppet/pops/parser/egrammar.ra +31 -18
- data/lib/puppet/pops/parser/eparser.rb +1137 -1106
- data/lib/puppet/pops/parser/lexer2.rb +17 -16
- data/lib/puppet/pops/semantic_error.rb +17 -0
- data/lib/puppet/pops/types/type_calculator.rb +150 -15
- data/lib/puppet/pops/types/type_factory.rb +69 -0
- data/lib/puppet/pops/types/type_parser.rb +9 -0
- data/lib/puppet/pops/types/types.rb +65 -4
- data/lib/puppet/pops/validation/checker4_0.rb +1 -1
- data/lib/puppet/pops/validation/validator_factory_4_0.rb +1 -1
- data/lib/puppet/property/list.rb +1 -1
- data/lib/puppet/provider/augeas/augeas.rb +2 -2
- data/lib/puppet/provider/cron/crontab.rb +13 -2
- data/lib/puppet/provider/package.rb +24 -0
- data/lib/puppet/provider/package/apt.rb +6 -1
- data/lib/puppet/provider/package/gem.rb +8 -2
- data/lib/puppet/provider/package/msi.rb +0 -15
- data/lib/puppet/provider/package/openbsd.rb +0 -24
- data/lib/puppet/provider/package/rpm.rb +3 -29
- data/lib/puppet/provider/package/windows.rb +0 -15
- data/lib/puppet/provider/package/yum.rb +101 -24
- data/lib/puppet/provider/package/yumhelper.py +31 -1
- data/lib/puppet/provider/package/zypper.rb +10 -28
- data/lib/puppet/provider/service/debian.rb +1 -1
- data/lib/puppet/provider/service/init.rb +3 -0
- data/lib/puppet/provider/service/openbsd.rb +318 -0
- data/lib/puppet/provider/service/redhat.rb +6 -3
- data/lib/puppet/provider/service/systemd.rb +2 -2
- data/lib/puppet/provider/yumrepo/inifile.rb +115 -42
- data/lib/puppet/resource.rb +13 -9
- data/lib/puppet/resource/catalog.rb +12 -6
- data/lib/puppet/resource/type_collection.rb +3 -3
- data/lib/puppet/settings.rb +57 -36
- data/lib/puppet/settings/config_file.rb +5 -0
- data/lib/puppet/settings/environment_conf.rb +147 -0
- data/lib/puppet/settings/ttl_setting.rb +48 -0
- data/lib/puppet/ssl/certificate_authority.rb +2 -3
- data/lib/puppet/ssl/certificate_authority/autosign_command.rb +1 -1
- data/lib/puppet/ssl/certificate_request.rb +4 -4
- data/lib/puppet/ssl/validator/default_validator.rb +2 -2
- data/lib/puppet/status.rb +1 -1
- data/lib/puppet/test/test_helper.rb +1 -0
- data/lib/puppet/type/augeas.rb +13 -1
- data/lib/puppet/type/cron.rb +32 -18
- data/lib/puppet/type/file.rb +4 -2
- data/lib/puppet/type/file/checksum.rb +15 -5
- data/lib/puppet/type/file/content.rb +3 -1
- data/lib/puppet/type/file/source.rb +5 -5
- data/lib/puppet/type/package.rb +12 -17
- data/lib/puppet/type/resources.rb +3 -1
- data/lib/puppet/type/scheduled_task.rb +4 -5
- data/lib/puppet/type/service.rb +12 -2
- data/lib/puppet/type/user.rb +106 -0
- data/lib/puppet/type/yumrepo.rb +9 -1
- data/lib/puppet/util/checksums.rb +60 -1
- data/lib/puppet/util/diff.rb +3 -1
- data/lib/puppet/util/execution.rb +20 -16
- data/lib/puppet/util/feature.rb +3 -0
- data/lib/puppet/util/logging.rb +19 -12
- data/lib/puppet/util/rubygems.rb +10 -0
- data/lib/puppet/util/watched_file.rb +1 -1
- data/lib/puppet/util/windows/security.rb +5 -3
- data/lib/puppet/vendor/load_semantic.rb +1 -0
- data/lib/puppet/vendor/require_vendored.rb +2 -0
- data/lib/puppet/vendor/semantic/Gemfile +20 -0
- data/lib/puppet/vendor/semantic/Rakefile +69 -0
- data/lib/puppet/vendor/semantic/lib/semantic.rb +7 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency.rb +181 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/graph.rb +60 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/graph_node.rb +117 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/module_release.rb +46 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/source.rb +25 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/unsatisfiable_graph.rb +31 -0
- data/lib/puppet/vendor/semantic/lib/semantic/version.rb +168 -0
- data/lib/puppet/vendor/semantic/lib/semantic/version_range.rb +424 -0
- data/lib/puppet/vendor/semantic/spec/spec_helper.rb +24 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/graph_node_spec.rb +141 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/graph_spec.rb +162 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/module_release_spec.rb +143 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/source_spec.rb +5 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/unsatisfiable_graph_spec.rb +44 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency_spec.rb +383 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/version_range_spec.rb +307 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/version_spec.rb +608 -0
- data/lib/puppet/version.rb +1 -1
- data/spec/fixtures/java.tgz +0 -0
- data/spec/fixtures/stdlib.tgz +0 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/usee/lib/puppet/functions/usee/callee.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/user/lib/puppet/functions/user/caller.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/user/metadata.json +9 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/modulea/rb_func_a.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/rb_func_a.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/manifests/init.pp +3 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/metadata.json +19 -0
- data/spec/fixtures/unit/pops/loaders/loaders/wo_metadata_module/modules/moduleb/lib/puppet/functions/moduleb/rb_func_b.rb +6 -0
- data/spec/fixtures/unit/pops/loaders/loaders/wo_metadata_module/modules/moduleb/manifests/init.pp +3 -0
- data/spec/fixtures/unit/provider/naginator/define_empty_param +6 -0
- data/spec/fixtures/unit/provider/service/systemd/list_unit_files_services +7 -0
- data/spec/fixtures/unit/type/user/authorized_keys +5 -0
- data/spec/integration/application/apply_spec.rb +1 -2
- data/spec/integration/configurer_spec.rb +2 -2
- data/spec/integration/faces/plugin_spec.rb +62 -0
- data/spec/integration/indirector/catalog/compiler_spec.rb +1 -1
- data/spec/integration/indirector/catalog/queue_spec.rb +1 -1
- data/spec/integration/node/environment_spec.rb +2 -2
- data/spec/integration/parser/future_compiler_spec.rb +96 -142
- data/spec/integration/parser/ruby_manifest_spec.rb +0 -5
- data/spec/integration/provider/cron/crontab_spec.rb +35 -0
- data/spec/integration/type/file_spec.rb +74 -72
- data/spec/integration/util/windows/security_spec.rb +17 -0
- data/spec/lib/matchers/resource.rb +45 -13
- data/spec/lib/puppet_spec/files.rb +18 -0
- data/spec/lib/puppet_spec/module_tool/shared_functions.rb +56 -0
- data/spec/lib/puppet_spec/module_tool/stub_source.rb +133 -0
- data/spec/shared_contexts/checksums.rb +55 -0
- data/spec/unit/application/apply_spec.rb +10 -7
- data/spec/unit/application/doc_spec.rb +17 -10
- data/spec/unit/application/indirection_base_spec.rb +18 -10
- data/spec/unit/application/inspect_spec.rb +22 -20
- data/spec/unit/configurer/downloader_spec.rb +7 -6
- data/spec/unit/configurer/plugin_handler_spec.rb +5 -8
- data/spec/unit/configurer_spec.rb +1 -1
- data/spec/unit/context_spec.rb +23 -0
- data/spec/unit/environments_spec.rb +274 -16
- data/spec/unit/face/config_spec.rb +111 -11
- data/spec/unit/face/module/install_spec.rb +14 -85
- data/spec/unit/face/module/list_spec.rb +108 -62
- data/spec/unit/face/module/search_spec.rb +1 -1
- data/spec/unit/face/module/uninstall_spec.rb +21 -42
- data/spec/unit/face/parser_spec.rb +5 -2
- data/spec/unit/file_bucket/dipper_spec.rb +92 -86
- data/spec/unit/file_bucket/file_spec.rb +23 -75
- data/spec/unit/file_serving/metadata_spec.rb +74 -74
- data/spec/unit/forge/module_release_spec.rb +131 -0
- data/spec/unit/forge/repository_spec.rb +21 -20
- data/spec/unit/forge_spec.rb +99 -23
- data/spec/unit/functions/assert_type_spec.rb +59 -0
- data/spec/unit/functions4_spec.rb +671 -0
- data/spec/unit/indirector/catalog/static_compiler_spec.rb +2 -2
- data/spec/unit/indirector/facts/facter_spec.rb +9 -3
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +156 -155
- data/spec/unit/indirector/rest_spec.rb +8 -0
- data/spec/unit/interface/face_collection_spec.rb +35 -23
- data/spec/unit/module_spec.rb +20 -8
- data/spec/unit/module_tool/applications/builder_spec.rb +40 -12
- data/spec/unit/module_tool/applications/checksummer_spec.rb +86 -105
- data/spec/unit/module_tool/applications/installer_spec.rb +293 -261
- data/spec/unit/module_tool/applications/searcher_spec.rb +1 -1
- data/spec/unit/module_tool/applications/uninstaller_spec.rb +90 -154
- data/spec/unit/module_tool/applications/unpacker_spec.rb +12 -12
- data/spec/unit/module_tool/applications/upgrader_spec.rb +286 -18
- data/spec/unit/module_tool/metadata_spec.rb +223 -14
- data/spec/unit/module_tool/tar/gnu_spec.rb +12 -9
- data/spec/unit/module_tool/tar/mini_spec.rb +1 -1
- data/spec/unit/module_tool/tar_spec.rb +4 -18
- data/spec/unit/module_tool_spec.rb +123 -27
- data/spec/unit/network/formats_spec.rb +2 -2
- data/spec/unit/network/http_pool_spec.rb +21 -0
- data/spec/unit/network/rights_spec.rb +10 -8
- data/spec/unit/node/environment_spec.rb +27 -2
- data/spec/unit/parser/collector_spec.rb +1 -1
- data/spec/unit/parser/compiler_spec.rb +1 -1
- data/spec/unit/parser/functions/generate_spec.rb +4 -0
- data/spec/unit/pops/evaluator/access_ops_spec.rb +50 -11
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +25 -0
- data/spec/unit/pops/loaders/dependency_loader_spec.rb +44 -0
- data/spec/unit/pops/loaders/loader_paths_spec.rb +66 -0
- data/spec/unit/pops/loaders/loaders_spec.rb +105 -0
- data/spec/unit/pops/loaders/module_loaders_spec.rb +119 -0
- data/spec/unit/pops/loaders/static_loader_spec.rb +46 -0
- data/spec/unit/pops/types/type_calculator_spec.rb +145 -10
- data/spec/unit/pops/types/type_factory_spec.rb +101 -0
- data/spec/unit/pops/types/type_parser_spec.rb +22 -0
- data/spec/unit/property/list_spec.rb +9 -1
- data/spec/unit/provider/augeas/augeas_spec.rb +58 -11
- data/spec/unit/provider/cron/crontab_spec.rb +1 -0
- data/spec/unit/provider/cron/parsed_spec.rb +15 -0
- data/spec/unit/provider/naginator_spec.rb +14 -0
- data/spec/unit/provider/package/apt_spec.rb +78 -64
- data/spec/unit/provider/package/gem_spec.rb +15 -0
- data/spec/unit/provider/package/rpm_spec.rb +6 -6
- data/spec/unit/provider/package/windows_spec.rb +1 -1
- data/spec/unit/provider/package/yum_spec.rb +199 -104
- data/spec/unit/provider/package/zypper_spec.rb +41 -15
- data/spec/unit/provider/service/openbsd_spec.rb +129 -22
- data/spec/unit/provider/service/redhat_spec.rb +18 -4
- data/spec/unit/provider/service/systemd_spec.rb +5 -9
- data/spec/unit/provider/service/upstart_spec.rb +1 -1
- data/spec/unit/provider/user/directoryservice_spec.rb +10 -0
- data/spec/unit/provider/yumrepo/inifile_spec.rb +171 -15
- data/spec/unit/resource/catalog_spec.rb +20 -104
- data/spec/unit/resource/type_collection_spec.rb +10 -9
- data/spec/unit/settings/config_file_spec.rb +29 -6
- data/spec/unit/settings/environment_conf_spec.rb +51 -0
- data/spec/unit/settings_spec.rb +97 -12
- data/spec/unit/ssl/certificate_authority_spec.rb +2 -0
- data/spec/unit/type/augeas_spec.rb +1 -1
- data/spec/unit/type/cron_spec.rb +6 -7
- data/spec/unit/type/file/checksum_spec.rb +6 -0
- data/spec/unit/type/file/content_spec.rb +277 -207
- data/spec/unit/type/file_spec.rb +9 -7
- data/spec/unit/type/user_spec.rb +106 -18
- data/spec/unit/type/yumrepo_spec.rb +8 -0
- data/spec/unit/util/checksums_spec.rb +12 -5
- data/spec/unit/util/diff_spec.rb +8 -0
- data/spec/unit/util/execution_spec.rb +4 -4
- data/spec/unit/util/feature_spec.rb +2 -0
- data/spec/unit/util/logging_spec.rb +14 -4
- data/spec/unit/util/rdoc/parser_spec.rb +5 -4
- data/spec/unit/util/rubygems_spec.rb +14 -0
- data/tasks/parallel.rake +2 -2
- metadata +154 -21
- checksums.yaml +0 -7
- data/lib/puppet/module_tool/applications/generator.rb +0 -142
- data/lib/puppet/module_tool/skeleton.rb +0 -37
- data/lib/puppet/module_tool/skeleton/templates/generator/Modulefile.erb +0 -11
- data/lib/puppet/module_tool/skeleton/templates/generator/README.erb +0 -16
- data/lib/puppet/module_tool/tar/solaris.rb +0 -5
- data/spec/fixtures/unit/provider/service/systemd/list_units_services +0 -17
- data/spec/unit/module_tool/tar/solaris_spec.rb +0 -22
@@ -29,28 +29,32 @@ module Puppet::Util::Execution
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
# Executes the provided command with STDIN connected to a pipe, yielding the
|
33
|
-
# pipe object.
|
34
|
-
# This allows data to be fed to the subprocess.
|
35
|
-
#
|
36
32
|
# The command can be a simple string, which is executed as-is, or an Array,
|
37
33
|
# which is treated as a set of command arguments to pass through.
|
38
34
|
#
|
39
|
-
# In
|
40
|
-
# are connected together
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
44
|
-
# @param
|
35
|
+
# In either case, the command is passed directly to the shell, STDOUT and
|
36
|
+
# STDERR are connected together, and STDOUT and STDIN are available via the
|
37
|
+
# yielded pipe. (Bear in mind that reading from or writing to a pipe that has
|
38
|
+
# not been opened in read or write mode respectively will block indefinitely.)
|
39
|
+
#
|
40
|
+
# @param command [String, Array<String>] the command to execute as one string,
|
41
|
+
# or as parts in an array. The parts of the array are joined with one
|
42
|
+
# separating space between each entry when converting to the command line
|
43
|
+
# string to execute.
|
44
|
+
# @param failonfail [Boolean] (true) if the execution should fail with
|
45
|
+
# Exception on failure or not.
|
46
|
+
# @param mode [String] ('r') the mode to open the pipe with
|
45
47
|
# @yield [pipe] to a block executing a subprocess
|
46
48
|
# @yieldparam pipe [IO] the opened pipe
|
47
49
|
# @yieldreturn [String] the output to return
|
48
|
-
# @raise [Puppet::ExecutionFailure] if the executed chiled process did not
|
49
|
-
# `true`.
|
50
|
-
# @return [String] a string with the output from the subprocess executed by
|
51
|
-
#
|
50
|
+
# @raise [Puppet::ExecutionFailure] if the executed chiled process did not
|
51
|
+
# exit with status == 0 and `failonfail` is `true`.
|
52
|
+
# @return [String] a string with the output from the subprocess executed by
|
53
|
+
# the given block
|
52
54
|
#
|
53
|
-
|
55
|
+
# @see Kernel#open for `mode` values
|
56
|
+
# @api public
|
57
|
+
def self.execpipe(command, failonfail = true, mode = 'r')
|
54
58
|
# Paste together an array with spaces. We used to paste directly
|
55
59
|
# together, no spaces, which made for odd invocations; the user had to
|
56
60
|
# include whitespace between arguments.
|
@@ -72,7 +76,7 @@ module Puppet::Util::Execution
|
|
72
76
|
# a predictable output
|
73
77
|
english_env = ENV.to_hash.merge( {'LANG' => 'C', 'LC_ALL' => 'C'} )
|
74
78
|
output = Puppet::Util.withenv(english_env) do
|
75
|
-
open("| #{command_str} 2>&1") do |pipe|
|
79
|
+
open("| #{command_str} 2>&1", mode) do |pipe|
|
76
80
|
yield pipe
|
77
81
|
end
|
78
82
|
end
|
data/lib/puppet/util/feature.rb
CHANGED
@@ -70,6 +70,9 @@ class Puppet::Util::Feature
|
|
70
70
|
def load_library(lib, name)
|
71
71
|
raise ArgumentError, "Libraries must be passed as strings not #{lib.class}" unless lib.is_a?(String)
|
72
72
|
|
73
|
+
@rubygems ||= Puppet::Util::RubyGems::Source.new
|
74
|
+
@rubygems.clear_paths
|
75
|
+
|
73
76
|
begin
|
74
77
|
require lib
|
75
78
|
rescue SystemExit,NoMemoryError
|
data/lib/puppet/util/logging.rb
CHANGED
@@ -55,19 +55,22 @@ module Puppet::Util::Logging
|
|
55
55
|
|
56
56
|
class DeprecationWarning < Exception; end
|
57
57
|
|
58
|
-
#
|
59
|
-
# offending lines of code that triggered the
|
60
|
-
#
|
61
|
-
# deprecation warnings
|
62
|
-
#
|
63
|
-
#
|
64
|
-
|
58
|
+
# Logs a warning indicating that the code path is deprecated. Note that this
|
59
|
+
# method keeps track of the offending lines of code that triggered the
|
60
|
+
# deprecation warning, and will only log a warning once per offending line of
|
61
|
+
# code. It will also stop logging deprecation warnings altogether after 100
|
62
|
+
# unique deprecation warnings have been logged.
|
63
|
+
#
|
64
|
+
# @param [String] message The message to log (logs via )
|
65
|
+
# @param [String] key Optional key to mark the message as unique. If not
|
66
|
+
# passed in, the originating call line will be used instead.
|
67
|
+
def deprecation_warning(message, key = nil)
|
65
68
|
$deprecation_warnings ||= {}
|
66
69
|
if $deprecation_warnings.length < 100 then
|
67
|
-
offender = get_deprecation_offender
|
68
|
-
if (! $deprecation_warnings.has_key?(
|
69
|
-
$deprecation_warnings[
|
70
|
-
warning("#{message}\n (at #{offender})")
|
70
|
+
key ||= (offender = get_deprecation_offender)
|
71
|
+
if (! $deprecation_warnings.has_key?(key)) then
|
72
|
+
$deprecation_warnings[key] = message
|
73
|
+
warning("#{message}\n (at #{(offender || get_deprecation_offender).join('; ')})")
|
71
74
|
end
|
72
75
|
end
|
73
76
|
end
|
@@ -78,7 +81,11 @@ module Puppet::Util::Logging
|
|
78
81
|
#
|
79
82
|
# let's find the offending line; we need to jump back up the stack a few steps to find the method that called
|
80
83
|
# the deprecated method
|
81
|
-
|
84
|
+
if Puppet[:trace]
|
85
|
+
caller()[2..-1]
|
86
|
+
else
|
87
|
+
[caller()[2]]
|
88
|
+
end
|
82
89
|
end
|
83
90
|
|
84
91
|
def clear_deprecation_warnings
|
data/lib/puppet/util/rubygems.rb
CHANGED
@@ -45,6 +45,10 @@ module Puppet::Util::RubyGems
|
|
45
45
|
File.join(spec.full_gem_path, 'lib')
|
46
46
|
end
|
47
47
|
end
|
48
|
+
|
49
|
+
def clear_paths
|
50
|
+
Gem.clear_paths
|
51
|
+
end
|
48
52
|
end
|
49
53
|
|
50
54
|
# RubyGems < 1.8.0
|
@@ -53,6 +57,10 @@ module Puppet::Util::RubyGems
|
|
53
57
|
def directories
|
54
58
|
@paths ||= Gem.latest_load_paths
|
55
59
|
end
|
60
|
+
|
61
|
+
def clear_paths
|
62
|
+
Gem.clear_paths
|
63
|
+
end
|
56
64
|
end
|
57
65
|
|
58
66
|
# @api private
|
@@ -60,6 +68,8 @@ module Puppet::Util::RubyGems
|
|
60
68
|
def directories
|
61
69
|
[]
|
62
70
|
end
|
71
|
+
|
72
|
+
def clear_paths; end
|
63
73
|
end
|
64
74
|
end
|
65
75
|
|
@@ -8,7 +8,7 @@ class Puppet::Util::WatchedFile
|
|
8
8
|
attr_reader :filename
|
9
9
|
|
10
10
|
# @param filename [String] The fully qualified path to the file.
|
11
|
-
# @param
|
11
|
+
# @param timer [Puppet::Util::Watcher::Timer] The polling interval for checking for file
|
12
12
|
# changes. Setting the timeout to a negative value will treat the file as
|
13
13
|
# always changed. Defaults to `Puppet[:filetimeout]`
|
14
14
|
def initialize(filename, timer = Puppet::Util::Watcher::Timer.new(Puppet[:filetimeout]))
|
@@ -398,11 +398,13 @@ module Puppet::Util::Windows::Security
|
|
398
398
|
end
|
399
399
|
end
|
400
400
|
|
401
|
-
def add_access_denied_ace(acl, mask, sid)
|
401
|
+
def add_access_denied_ace(acl, mask, sid, inherit = nil)
|
402
|
+
inherit ||= NO_INHERITANCE
|
403
|
+
|
402
404
|
string_to_sid_ptr(sid) do |sid_ptr|
|
403
405
|
raise Puppet::Util::Windows::Error.new("Invalid SID") unless IsValidSid(sid_ptr)
|
404
406
|
|
405
|
-
unless
|
407
|
+
unless AddAccessDeniedAceEx(acl, ACL_REVISION, inherit, mask, sid_ptr)
|
406
408
|
raise Puppet::Util::Windows::Error.new("Failed to add access control entry")
|
407
409
|
end
|
408
410
|
end
|
@@ -606,7 +608,7 @@ module Puppet::Util::Windows::Security
|
|
606
608
|
add_access_allowed_ace(acl, ace.mask, ace.sid, ace.flags)
|
607
609
|
when ACCESS_DENIED_ACE_TYPE
|
608
610
|
#puts "ace: deny, sid #{sid_to_name(ace.sid)}, mask 0x#{ace.mask.to_s(16)}"
|
609
|
-
add_access_denied_ace(acl, ace.mask, ace.sid)
|
611
|
+
add_access_denied_ace(acl, ace.mask, ace.sid, ace.flags)
|
610
612
|
else
|
611
613
|
raise "We should never get here"
|
612
614
|
# TODO: this should have been a warning in an earlier commit
|
@@ -0,0 +1 @@
|
|
1
|
+
$: << File.join([File.dirname(__FILE__), "semantic/lib"])
|
@@ -0,0 +1,20 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
group :development do
|
4
|
+
gem 'rake'
|
5
|
+
gem 'rubygems-tasks'
|
6
|
+
end
|
7
|
+
|
8
|
+
group :test do
|
9
|
+
gem 'rspec'
|
10
|
+
end
|
11
|
+
|
12
|
+
group :metrics do
|
13
|
+
gem 'cane', :platform => [ :mri_19, :mri_20, :mri_21 ]
|
14
|
+
gem 'simplecov', :platform => [ :mri_19, :mri_20, :mri_21 ]
|
15
|
+
end
|
16
|
+
|
17
|
+
group :doc do
|
18
|
+
gem 'yard', '~> 0.8', :platform => [ :mri_19, :mri_20, :mri_21 ]
|
19
|
+
gem 'redcarpet', :platform => [ :mri_19, :mri_20, :mri_21 ]
|
20
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# RSpec tasks
|
2
|
+
begin
|
3
|
+
require 'rspec/core/rake_task'
|
4
|
+
|
5
|
+
# Create the 'spec' task
|
6
|
+
RSpec::Core::RakeTask.new(:spec) do |task|
|
7
|
+
task.rspec_opts = '--color'
|
8
|
+
end
|
9
|
+
|
10
|
+
namespace :spec do
|
11
|
+
desc "Run the test suite and generate coverage metrics"
|
12
|
+
task :coverage => [ :simplecov, :spec ]
|
13
|
+
|
14
|
+
# Add test coverage to the 'spec' task.
|
15
|
+
task :simplecov do
|
16
|
+
ENV['COVERAGE'] = '1'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
task :default => :spec
|
21
|
+
rescue LoadError
|
22
|
+
warn "[Warning]: Could not load `rspec`."
|
23
|
+
end
|
24
|
+
|
25
|
+
# YARD tasks
|
26
|
+
begin
|
27
|
+
require 'yard'
|
28
|
+
require 'yard/rake/yardoc_task'
|
29
|
+
|
30
|
+
YARD::Rake::YardocTask.new(:doc) do |yardoc|
|
31
|
+
yardoc.files = [ 'lib/**/*.rb', '-', '**/*.md' ]
|
32
|
+
end
|
33
|
+
rescue LoadError
|
34
|
+
warn "[Warning]: Could not load `yard`."
|
35
|
+
end
|
36
|
+
|
37
|
+
# Cane tasks
|
38
|
+
begin
|
39
|
+
require 'cane/rake_task'
|
40
|
+
|
41
|
+
Cane::RakeTask.new(:cane) do |cane|
|
42
|
+
cane.add_threshold 'coverage/.last_run.json', :>=, 100
|
43
|
+
cane.abc_max = 15
|
44
|
+
end
|
45
|
+
|
46
|
+
Rake::Task['cane'].prerequisites << Rake::Task['spec:coverage']
|
47
|
+
Rake::Task[:default].clear_prerequisites
|
48
|
+
task :default => :cane
|
49
|
+
rescue LoadError
|
50
|
+
warn "[Warning]: Could not load `cane`."
|
51
|
+
end
|
52
|
+
|
53
|
+
# Gem tasks
|
54
|
+
begin
|
55
|
+
require 'rubygems/tasks'
|
56
|
+
|
57
|
+
task :gem => 'gem:build'
|
58
|
+
task :validate => [ 'cane', 'doc', 'gem:validate' ]
|
59
|
+
|
60
|
+
namespace :gem do
|
61
|
+
Gem::Tasks.new(
|
62
|
+
:tag => { :format => 'v%s' },
|
63
|
+
:sign => { :checksum => true, :pgp => true },
|
64
|
+
:build => { :tar => true }
|
65
|
+
)
|
66
|
+
end
|
67
|
+
rescue LoadError
|
68
|
+
warn "[Warning]: Could not load `rubygems/tasks`."
|
69
|
+
end
|
@@ -0,0 +1,181 @@
|
|
1
|
+
require 'semantic'
|
2
|
+
|
3
|
+
module Semantic
|
4
|
+
module Dependency
|
5
|
+
extend self
|
6
|
+
|
7
|
+
autoload :Graph, 'semantic/dependency/graph'
|
8
|
+
autoload :GraphNode, 'semantic/dependency/graph_node'
|
9
|
+
autoload :ModuleRelease, 'semantic/dependency/module_release'
|
10
|
+
autoload :Source, 'semantic/dependency/source'
|
11
|
+
|
12
|
+
autoload :UnsatisfiableGraph, 'semantic/dependency/unsatisfiable_graph'
|
13
|
+
|
14
|
+
# @!group Sources
|
15
|
+
|
16
|
+
# @return [Array<Source>] a frozen copy of the {Source} list
|
17
|
+
def sources
|
18
|
+
(@sources ||= []).dup.freeze
|
19
|
+
end
|
20
|
+
|
21
|
+
# Appends a new {Source} to the current list.
|
22
|
+
# @param source [Source] the {Source} to add
|
23
|
+
# @return [void]
|
24
|
+
def add_source(source)
|
25
|
+
sources
|
26
|
+
@sources << source
|
27
|
+
nil
|
28
|
+
end
|
29
|
+
|
30
|
+
# Clears the current list of {Source}s.
|
31
|
+
# @return [void]
|
32
|
+
def clear_sources
|
33
|
+
sources
|
34
|
+
@sources.clear
|
35
|
+
nil
|
36
|
+
end
|
37
|
+
|
38
|
+
# @!endgroup
|
39
|
+
|
40
|
+
# Fetches a graph of modules and their dependencies from the currently
|
41
|
+
# configured list of {Source}s.
|
42
|
+
#
|
43
|
+
# @todo Return a specialized "Graph" object.
|
44
|
+
# @todo Allow for external constraints to be added to the graph.
|
45
|
+
# @see #sources
|
46
|
+
# @see #add_source
|
47
|
+
# @see #clear_sources
|
48
|
+
#
|
49
|
+
# @param modules [{ String => String }]
|
50
|
+
# @return [Graph] the root of a dependency graph
|
51
|
+
def query(modules)
|
52
|
+
constraints = Hash[modules.map { |k, v| [ k, VersionRange.parse(v) ] }]
|
53
|
+
|
54
|
+
graph = Graph.new(constraints)
|
55
|
+
fetch_dependencies(graph)
|
56
|
+
return graph
|
57
|
+
end
|
58
|
+
|
59
|
+
# Given a graph result from {#query}, this method will resolve the graph of
|
60
|
+
# dependencies, if possible, into a flat list of the best suited modules. If
|
61
|
+
# the dependency graph does not have a suitable resolution, this method will
|
62
|
+
# raise an exception to that effect.
|
63
|
+
#
|
64
|
+
# @param graph [Graph] the root of a dependency graph
|
65
|
+
# @return [Array<ModuleRelease>] the list of releases to act on
|
66
|
+
def resolve(graph)
|
67
|
+
catch :next do
|
68
|
+
return walk(graph, graph.dependencies.dup)
|
69
|
+
end
|
70
|
+
raise UnsatisfiableGraph.new(graph)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Fetches all available releases for the given module name.
|
74
|
+
#
|
75
|
+
# @param name [String] the module name to find releases for
|
76
|
+
# @return [Array<ModuleRelease>] the available releases
|
77
|
+
def fetch_releases(name)
|
78
|
+
releases = {}
|
79
|
+
|
80
|
+
sources.each do |source|
|
81
|
+
source.fetch(name).each do |dependency|
|
82
|
+
releases[dependency.version] ||= dependency
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
return releases.values
|
87
|
+
end
|
88
|
+
|
89
|
+
private
|
90
|
+
|
91
|
+
# Iterates over a changing set of dependencies in search of the best
|
92
|
+
# solution available. Fitness is specified as meeting all the constraints
|
93
|
+
# placed on it, being {ModuleRelease#satisfied? satisfied}, and having the
|
94
|
+
# greatest version number (with stability being preferred over prereleases).
|
95
|
+
#
|
96
|
+
# @todo Traversal order is not presently guaranteed.
|
97
|
+
#
|
98
|
+
# @param graph [Graph] the root of a dependency graph
|
99
|
+
# @param dependencies [{ String => Array<ModuleRelease> }] the dependencies
|
100
|
+
# @param considering [Array<GraphNode>] the set of releases being tested
|
101
|
+
# @return [Array<GraphNode>] the list of releases to use, if successful
|
102
|
+
def walk(graph, dependencies, *considering)
|
103
|
+
return considering if dependencies.empty?
|
104
|
+
|
105
|
+
# Selecting a dependency from the collection...
|
106
|
+
name = dependencies.keys.sort.first
|
107
|
+
deps = dependencies.delete(name)
|
108
|
+
|
109
|
+
# ... (and stepping over it if we've seen it before) ...
|
110
|
+
unless (deps & considering).empty?
|
111
|
+
return walk(graph, dependencies, *considering)
|
112
|
+
end
|
113
|
+
|
114
|
+
# ... we'll iterate through the list of possible versions in order.
|
115
|
+
preferred_releases(deps).reverse_each do |dep|
|
116
|
+
|
117
|
+
# We should skip any releases that violate any module's constraints.
|
118
|
+
unless [graph, *considering].all? { |x| x.satisfies_constraints?(dep) }
|
119
|
+
next
|
120
|
+
end
|
121
|
+
|
122
|
+
# We should skip over any releases that violate graph-level constraints.
|
123
|
+
potential_solution = considering.dup << dep
|
124
|
+
unless graph.satisfies_graph? potential_solution
|
125
|
+
next
|
126
|
+
end
|
127
|
+
|
128
|
+
catch :next do
|
129
|
+
# After adding any new dependencies and imposing our own constraints
|
130
|
+
# on existing dependencies, we'll mark ourselves as "under
|
131
|
+
# consideration" and recurse.
|
132
|
+
merged = dependencies.merge(dep.dependencies) { |_,a,b| a & b }
|
133
|
+
|
134
|
+
# If all subsequent dependencies resolved well, the recursive call
|
135
|
+
# will return a completed dependency list. If there were problems
|
136
|
+
# resolving our dependencies, we'll catch `:next`, which will cause
|
137
|
+
# us to move to the next possibility.
|
138
|
+
return walk(graph, merged, *potential_solution)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
# Once we've exhausted all of our possible versions, we know that our
|
143
|
+
# last choice was unusable, so we'll unwind the stack and make a new
|
144
|
+
# choice.
|
145
|
+
throw :next
|
146
|
+
end
|
147
|
+
|
148
|
+
# Given a {ModuleRelease}, this method will iterate through the current
|
149
|
+
# list of {Source}s to find the complete list of versions available for its
|
150
|
+
# dependencies.
|
151
|
+
#
|
152
|
+
# @param node [GraphNode] the node to fetch details for
|
153
|
+
# @return [void]
|
154
|
+
def fetch_dependencies(node, cache = {})
|
155
|
+
node.dependency_names.each do |name|
|
156
|
+
unless cache.key?(name)
|
157
|
+
cache[name] = fetch_releases(name)
|
158
|
+
cache[name].each { |dep| fetch_dependencies(dep, cache) }
|
159
|
+
end
|
160
|
+
|
161
|
+
node << cache[name]
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
# Given a list of potential releases, this method returns the most suitable
|
166
|
+
# releases for exploration. Only {ModuleRelease#satisfied? satisfied}
|
167
|
+
# releases are considered, and releases with stable versions are preferred.
|
168
|
+
#
|
169
|
+
# @param releases [Array<ModuleRelease>] a list of potential releases
|
170
|
+
# @return [Array<ModuleRelease>] releases open for consideration
|
171
|
+
def preferred_releases(releases)
|
172
|
+
satisfied = releases.select { |x| x.satisfied? }
|
173
|
+
|
174
|
+
if satisfied.any? { |x| x.version.stable? }
|
175
|
+
return satisfied.select { |x| x.version.stable? }
|
176
|
+
else
|
177
|
+
return satisfied
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|