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
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'digest/md5'
|
2
|
+
require 'puppet/network/format_support'
|
2
3
|
|
3
4
|
module Puppet::ModuleTool
|
4
5
|
|
@@ -7,6 +8,7 @@ module Puppet::ModuleTool
|
|
7
8
|
# This class proides methods for generating checksums for data and adding
|
8
9
|
# them to +Metadata+.
|
9
10
|
class Checksums
|
11
|
+
include Puppet::Network::FormatSupport
|
10
12
|
include Enumerable
|
11
13
|
|
12
14
|
# Instantiate object with string +path+ to create checksums from.
|
@@ -36,17 +38,12 @@ module Puppet::ModuleTool
|
|
36
38
|
return @data
|
37
39
|
end
|
38
40
|
|
41
|
+
alias :to_data_hash :data
|
42
|
+
alias :to_hash :data
|
43
|
+
|
39
44
|
# TODO: Why?
|
40
45
|
def each(&block)
|
41
46
|
data.each(&block)
|
42
47
|
end
|
43
|
-
|
44
|
-
# Update +Metadata+'s checksums with this object's.
|
45
|
-
def annotate(metadata)
|
46
|
-
metadata.checksums.replace(data)
|
47
|
-
end
|
48
|
-
|
49
|
-
# TODO: Move the Checksummer#run checksum checking to here?
|
50
|
-
|
51
48
|
end
|
52
49
|
end
|
@@ -22,56 +22,25 @@ module Puppet::ModuleTool::Errors
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
class
|
25
|
+
class MissingPackageError < InstallError
|
26
26
|
def initialize(options)
|
27
|
-
@
|
28
|
-
@
|
29
|
-
|
30
|
-
@
|
31
|
-
@metadata = options[:metadata]
|
32
|
-
super "'#{@requested_module}' (#{@requested_version}) requested; Installation conflict"
|
27
|
+
@requested_package = options[:requested_package]
|
28
|
+
@source = options[:source]
|
29
|
+
|
30
|
+
super "Could not install '#{@requested_package}'; no releases are available from #{@source}"
|
33
31
|
end
|
34
32
|
|
35
33
|
def multiline
|
36
34
|
message = []
|
37
|
-
message << "Could not install
|
35
|
+
message << "Could not install '#{@requested_package}'"
|
38
36
|
|
39
|
-
|
40
|
-
|
41
|
-
else
|
42
|
-
message << " Installation would overwrite #{@directory}"
|
43
|
-
end
|
44
|
-
|
45
|
-
if @metadata
|
46
|
-
message << " Currently, '#{@metadata[:name]}' (#{v(@metadata[:version])}) is installed to that directory"
|
47
|
-
end
|
48
|
-
|
49
|
-
message << " Use `puppet module install --target-dir <DIR>` to install modules elsewhere"
|
50
|
-
|
51
|
-
if @dependency
|
52
|
-
message << " Use `puppet module install --ignore-dependencies` to install only this module"
|
53
|
-
else
|
54
|
-
message << " Use `puppet module install --force` to install this module anyway"
|
55
|
-
end
|
37
|
+
message << " No releases are available from #{@source}"
|
38
|
+
message << " Does '#{@requested_package}' have at least one published release?"
|
56
39
|
|
57
40
|
message.join("\n")
|
58
41
|
end
|
59
42
|
end
|
60
43
|
|
61
|
-
class MissingPackageError < InstallError
|
62
|
-
def initialize(options)
|
63
|
-
@requested_package = options[:requested_package]
|
64
|
-
super "#{@requested_package} requested; Package #{@requested_package} does not exist"
|
65
|
-
end
|
66
|
-
|
67
|
-
def multiline
|
68
|
-
<<-MSG.strip
|
69
|
-
Could not install package #{@requested_package}
|
70
|
-
Package #{@requested_package} does not exist
|
71
|
-
MSG
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
44
|
class InstallPathExistsNotDirectoryError < InstallError
|
76
45
|
def initialize(original, options)
|
77
46
|
@requested_module = options[:requested_module]
|
@@ -110,16 +79,15 @@ Could not install module '#{@requested_module}' (#{@requested_version})
|
|
110
79
|
|
111
80
|
class InvalidPathInPackageError < InstallError
|
112
81
|
def initialize(options)
|
113
|
-
@
|
114
|
-
@
|
115
|
-
@directory = options[:directory]
|
82
|
+
@entry_path = options[:entry_path]
|
83
|
+
@directory = options[:directory]
|
116
84
|
super "Attempt to install file into #{@entry_path.inspect} under #{@directory.inspect}"
|
117
85
|
end
|
118
86
|
|
119
87
|
def multiline
|
120
88
|
<<-MSG.strip
|
121
|
-
Could not install package
|
122
|
-
Package
|
89
|
+
Could not install package
|
90
|
+
Package attempted to install file into
|
123
91
|
#{@entry_path.inspect} under #{@directory.inspect}.
|
124
92
|
MSG
|
125
93
|
end
|
@@ -5,25 +5,81 @@ module Puppet::ModuleTool::Errors
|
|
5
5
|
@requested_name = options[:requested_name]
|
6
6
|
@requested_version = options[:requested_version]
|
7
7
|
@installed_version = options[:installed_version]
|
8
|
-
@dependency_name = options[:dependency_name]
|
9
8
|
@conditions = options[:conditions]
|
10
9
|
@action = options[:action]
|
11
10
|
|
12
|
-
super "Could not #{@action} '#{@requested_name}' (#{vstring});
|
11
|
+
super "Could not #{@action} '#{@requested_name}' (#{vstring}); no version satisfies all dependencies"
|
13
12
|
end
|
14
13
|
|
15
14
|
def multiline
|
16
|
-
same_mod = @requested_name == @dependency_name
|
17
|
-
|
18
15
|
message = []
|
19
16
|
message << "Could not #{@action} module '#{@requested_name}' (#{vstring})"
|
20
|
-
message << " No version of '#{@
|
21
|
-
message << "
|
22
|
-
|
23
|
-
|
17
|
+
message << " No version of '#{@requested_name}' can satisfy all dependencies"
|
18
|
+
message << " Use `puppet module #{@action} --ignore-dependencies` to #{@action} only this module"
|
19
|
+
|
20
|
+
message.join("\n")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
class NoCandidateReleasesError < ModuleToolError
|
25
|
+
def initialize(options)
|
26
|
+
@module_name = options[:module_name]
|
27
|
+
@requested_version = options[:requested_version]
|
28
|
+
@installed_version = options[:installed_version]
|
29
|
+
@source = options[:source]
|
30
|
+
@action = options[:action]
|
31
|
+
|
32
|
+
if @requested_version == :latest
|
33
|
+
super "Could not #{@action} '#{@module_name}'; no releases are available from #{@source}"
|
34
|
+
else
|
35
|
+
super "Could not #{@action} '#{@module_name}'; no releases matching '#{@requested_version}' are available from #{@source}"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def multiline
|
40
|
+
message = []
|
41
|
+
message << "Could not #{@action} '#{@module_name}' (#{vstring})"
|
42
|
+
|
43
|
+
if @requested_version == :latest
|
44
|
+
message << " No releases are available from #{@source}"
|
45
|
+
message << " Does '#{@module_name}' have at least one published release?"
|
46
|
+
else
|
47
|
+
message << " No releases matching '#{@requested_version}' are available from #{@source}"
|
48
|
+
end
|
49
|
+
|
50
|
+
message.join("\n")
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
class InstallConflictError < ModuleToolError
|
55
|
+
def initialize(options)
|
56
|
+
@requested_module = options[:requested_module]
|
57
|
+
@requested_version = v(options[:requested_version])
|
58
|
+
@dependency = options[:dependency]
|
59
|
+
@directory = options[:directory]
|
60
|
+
@metadata = options[:metadata]
|
61
|
+
super "'#{@requested_module}' (#{@requested_version}) requested; installation conflict"
|
62
|
+
end
|
63
|
+
|
64
|
+
def multiline
|
65
|
+
message = []
|
66
|
+
message << "Could not install module '#{@requested_module}' (#{@requested_version})"
|
67
|
+
|
68
|
+
if @dependency
|
69
|
+
message << " Dependency '#{@dependency[:name]}' (#{v(@dependency[:version])}) would overwrite #{@directory}"
|
70
|
+
else
|
71
|
+
message << " Installation would overwrite #{@directory}"
|
72
|
+
end
|
73
|
+
|
74
|
+
if @metadata
|
75
|
+
message << " Currently, '#{@metadata["name"]}' (#{v(@metadata["version"])}) is installed to that directory"
|
76
|
+
end
|
77
|
+
|
78
|
+
if @dependency
|
79
|
+
message << " Use `puppet module install --ignore-dependencies` to install only this module"
|
80
|
+
else
|
81
|
+
message << " Use `puppet module install --force` to install this module anyway"
|
24
82
|
end
|
25
|
-
message << " Use `puppet module #{@action} --force` to #{@action} this module anyway" if same_mod
|
26
|
-
message << " Use `puppet module #{@action} --ignore-dependencies` to #{@action} only this module" unless same_mod
|
27
83
|
|
28
84
|
message.join("\n")
|
29
85
|
end
|
@@ -101,7 +157,7 @@ module Puppet::ModuleTool::Errors
|
|
101
157
|
@requested_version = options[:requested_version]
|
102
158
|
@installed_version = options[:installed_version]
|
103
159
|
@action = options[:action]
|
104
|
-
super "Could not #{@action} '#{@module_name}'; module
|
160
|
+
super "Could not #{@action} '#{@module_name}'; module has had changes made locally"
|
105
161
|
end
|
106
162
|
|
107
163
|
def multiline
|
@@ -112,4 +168,21 @@ module Puppet::ModuleTool::Errors
|
|
112
168
|
message.join("\n")
|
113
169
|
end
|
114
170
|
end
|
171
|
+
|
172
|
+
class InvalidModuleError < ModuleToolError
|
173
|
+
def initialize(name, options)
|
174
|
+
@name = name
|
175
|
+
@action = options[:action]
|
176
|
+
@error = options[:error]
|
177
|
+
super "Could not #{@action} '#{@name}'; #{@error.message}"
|
178
|
+
end
|
179
|
+
|
180
|
+
def multiline
|
181
|
+
message = []
|
182
|
+
message << "Could not #{@action} module '#{@name}'"
|
183
|
+
message << " Failure trying to parse metadata"
|
184
|
+
message << " Original message was: #{@error.message}"
|
185
|
+
message.join("\n")
|
186
|
+
end
|
187
|
+
end
|
115
188
|
end
|
@@ -8,64 +8,35 @@ module Puppet::ModuleTool::Errors
|
|
8
8
|
end
|
9
9
|
|
10
10
|
class VersionAlreadyInstalledError < UpgradeError
|
11
|
+
attr_reader :newer_versions
|
12
|
+
|
11
13
|
def initialize(options)
|
12
14
|
@module_name = options[:module_name]
|
13
15
|
@requested_version = options[:requested_version]
|
14
16
|
@installed_version = options[:installed_version]
|
15
17
|
@dependency_name = options[:dependency_name]
|
16
|
-
@
|
17
|
-
|
18
|
+
@newer_versions = options[:newer_versions]
|
19
|
+
@possible_culprits = options[:possible_culprits]
|
20
|
+
super "Could not upgrade '#{@module_name}'; more recent versions not found"
|
18
21
|
end
|
19
22
|
|
20
23
|
def multiline
|
21
24
|
message = []
|
22
25
|
message << "Could not upgrade module '#{@module_name}' (#{vstring})"
|
23
|
-
if @
|
24
|
-
message << " The installed version is already the latest version"
|
26
|
+
if @newer_versions.empty?
|
27
|
+
message << " The installed version is already the latest version matching #{vstring}"
|
25
28
|
else
|
26
|
-
message << "
|
27
|
-
message
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
message << " There are #{@newer_versions.length} newer versions"
|
30
|
+
message << " No combination of dependency upgrades would satisfy all dependencies"
|
31
|
+
unless @possible_culprits.empty?
|
32
|
+
message << " Dependencies will not be automatically upgraded across major versions"
|
33
|
+
message << " Upgrading one or more of these modules may permit the upgrade to succeed:"
|
34
|
+
@possible_culprits.each do |name|
|
35
|
+
message << " - #{name}"
|
36
|
+
end
|
32
37
|
end
|
33
38
|
end
|
34
|
-
message << " Use `puppet module
|
35
|
-
message.join("\n")
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
class UnknownModuleError < UpgradeError
|
40
|
-
def initialize(options)
|
41
|
-
@module_name = options[:module_name]
|
42
|
-
@installed_version = options[:installed_version]
|
43
|
-
@requested_version = options[:requested_version]
|
44
|
-
@repository = options[:repository]
|
45
|
-
super "Could not upgrade '#{@module_name}'; module is unknown to #{@repository}"
|
46
|
-
end
|
47
|
-
|
48
|
-
def multiline
|
49
|
-
message = []
|
50
|
-
message << "Could not upgrade module '#{@module_name}' (#{vstring})"
|
51
|
-
message << " Module '#{@module_name}' does not exist on #{@repository}"
|
52
|
-
message.join("\n")
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
class UnknownVersionError < UpgradeError
|
57
|
-
def initialize(options)
|
58
|
-
@module_name = options[:module_name]
|
59
|
-
@installed_version = options[:installed_version]
|
60
|
-
@requested_version = options[:requested_version]
|
61
|
-
@repository = options[:repository]
|
62
|
-
super "Could not upgrade '#{@module_name}' (#{vstring}); module has no versions #{ @requested_version && "matching #{v(@requested_version)} "}published on #{@repository}"
|
63
|
-
end
|
64
|
-
|
65
|
-
def multiline
|
66
|
-
message = []
|
67
|
-
message << "Could not upgrade module '#{@module_name}' (#{vstring})"
|
68
|
-
message << " No version matching '#{@requested_version || ">= 0.0.0"}' exists on #{@repository}"
|
39
|
+
message << " Use `puppet module upgrade --force` to upgrade only this module"
|
69
40
|
message.join("\n")
|
70
41
|
end
|
71
42
|
end
|
@@ -7,18 +7,19 @@ module Puppet
|
|
7
7
|
class InstallDirectory
|
8
8
|
include Puppet::ModuleTool::Errors
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
attr_reader :target
|
11
|
+
def initialize(target)
|
12
|
+
@target = target
|
12
13
|
end
|
13
14
|
|
14
15
|
# prepare the module install location. This will create the location if
|
15
16
|
# needed.
|
16
17
|
def prepare(module_name, version)
|
17
|
-
return if @
|
18
|
+
return if @target.directory?
|
18
19
|
|
19
20
|
begin
|
20
|
-
@
|
21
|
-
Puppet.notice "Created target directory #{@
|
21
|
+
@target.mkpath
|
22
|
+
Puppet.notice "Created target directory #{@target}"
|
22
23
|
rescue SystemCallError => orig_error
|
23
24
|
raise converted_to_friendly_error(module_name, version, orig_error)
|
24
25
|
end
|
@@ -37,7 +38,7 @@ module Puppet
|
|
37
38
|
ERROR_MAPPINGS[orig_error.class].new(orig_error,
|
38
39
|
:requested_module => module_name,
|
39
40
|
:requested_version => version,
|
40
|
-
:directory => @
|
41
|
+
:directory => @target.to_s)
|
41
42
|
end
|
42
43
|
end
|
43
44
|
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
|
3
|
+
require 'puppet/forge'
|
4
|
+
require 'puppet/module_tool'
|
5
|
+
|
6
|
+
module Puppet::ModuleTool
|
7
|
+
class InstalledModules < Semantic::Dependency::Source
|
8
|
+
attr_reader :modules, :by_name
|
9
|
+
|
10
|
+
def priority
|
11
|
+
10
|
12
|
+
end
|
13
|
+
|
14
|
+
def initialize(env)
|
15
|
+
@env = env
|
16
|
+
modules = env.modules_by_path
|
17
|
+
|
18
|
+
@fetched = []
|
19
|
+
@modules = {}
|
20
|
+
@by_name = {}
|
21
|
+
env.modulepath.each do |path|
|
22
|
+
modules[path].each do |mod|
|
23
|
+
@by_name[mod.name] = mod
|
24
|
+
next unless mod.has_metadata?
|
25
|
+
release = ModuleRelease.new(self, mod)
|
26
|
+
@modules[release.name] ||= release
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
@modules.freeze
|
31
|
+
end
|
32
|
+
|
33
|
+
# Fetches {ModuleRelease} entries for each release of the named module.
|
34
|
+
#
|
35
|
+
# @param name [String] the module name to look up
|
36
|
+
# @return [Array<Semantic::Dependency::ModuleRelease>] a list of releases for
|
37
|
+
# the given name
|
38
|
+
# @see Semantic::Dependency::Source#fetch
|
39
|
+
def fetch(name)
|
40
|
+
name = name.tr('/', '-')
|
41
|
+
|
42
|
+
if @modules.key? name
|
43
|
+
@fetched << name
|
44
|
+
[ @modules[name] ]
|
45
|
+
else
|
46
|
+
[ ]
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def fetched
|
51
|
+
@fetched
|
52
|
+
end
|
53
|
+
|
54
|
+
class ModuleRelease < Semantic::Dependency::ModuleRelease
|
55
|
+
attr_reader :mod, :metadata
|
56
|
+
|
57
|
+
def initialize(source, mod)
|
58
|
+
@mod = mod
|
59
|
+
@metadata = mod.metadata
|
60
|
+
name = mod.forge_name.tr('/', '-')
|
61
|
+
version = Semantic::Version.parse(mod.version)
|
62
|
+
|
63
|
+
super(source, name, version, {})
|
64
|
+
|
65
|
+
if mod.dependencies
|
66
|
+
mod.dependencies.each do |dep|
|
67
|
+
range = dep['version_requirement'] || dep['versionRequirement'] || '>=0'
|
68
|
+
range = Semantic::VersionRange.parse(range) rescue Semantic::VersionRange::EMPTY_RANGE
|
69
|
+
|
70
|
+
dep.tap do |dep|
|
71
|
+
add_constraint('initialize', dep['name'].tr('/', '-'), range.to_s) do |node|
|
72
|
+
range === node.version
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def install_dir
|
80
|
+
Pathname.new(@mod.path).dirname
|
81
|
+
end
|
82
|
+
|
83
|
+
def install(dir)
|
84
|
+
# If we're already installed, there's no need for us to faff about.
|
85
|
+
end
|
86
|
+
|
87
|
+
def prepare
|
88
|
+
# We're already installed; what preparation remains?
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|