bolt 0.20.3 → 0.20.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bolt might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/bolt-modules/boltlib/lib/puppet/functions/run_task.rb +3 -3
- data/bolt-modules/boltlib/lib/puppet/functions/set_feature.rb +33 -0
- data/lib/bolt/inventory.rb +19 -1
- data/lib/bolt/target.rb +15 -0
- data/lib/bolt/transport/local.rb +6 -1
- data/lib/bolt/transport/orch.rb +2 -0
- data/lib/bolt/transport/ssh.rb +7 -2
- data/lib/bolt/transport/winrm.rb +6 -1
- data/lib/bolt/version.rb +1 -1
- data/modules/facts/plans/retrieve.pp +2 -26
- data/modules/facts/tasks/init.json +9 -0
- data/vendored/puppet/lib/hiera/puppet_function.rb +1 -1
- data/vendored/puppet/lib/hiera/scope.rb +24 -2
- data/vendored/puppet/lib/puppet.rb +4 -13
- data/vendored/puppet/lib/puppet/application.rb +2 -2
- data/vendored/puppet/lib/puppet/application/agent.rb +1 -1
- data/vendored/puppet/lib/puppet/application/apply.rb +1 -1
- data/vendored/puppet/lib/puppet/application/cert.rb +1 -1
- data/vendored/puppet/lib/puppet/application/device.rb +8 -8
- data/vendored/puppet/lib/puppet/application/face_base.rb +1 -1
- data/vendored/puppet/lib/puppet/application/lookup.rb +2 -2
- data/vendored/puppet/lib/puppet/application/resource.rb +2 -2
- data/vendored/puppet/lib/puppet/application/script.rb +1 -1
- data/vendored/puppet/lib/puppet/configurer.rb +47 -24
- data/vendored/puppet/lib/puppet/confine.rb +4 -1
- data/vendored/puppet/lib/puppet/context.rb +1 -1
- data/vendored/puppet/lib/puppet/defaults.rb +32 -44
- data/vendored/puppet/lib/puppet/error.rb +14 -7
- data/vendored/puppet/lib/puppet/external/dot.rb +23 -17
- data/vendored/puppet/lib/puppet/face/config.rb +58 -3
- data/vendored/puppet/lib/puppet/face/epp.rb +1 -1
- data/vendored/puppet/lib/puppet/face/module/build.rb +3 -3
- data/vendored/puppet/lib/puppet/face/module/install.rb +0 -4
- data/vendored/puppet/lib/puppet/face/module/list.rb +0 -5
- data/vendored/puppet/lib/puppet/face/module/search.rb +1 -1
- data/vendored/puppet/lib/puppet/face/module/uninstall.rb +0 -4
- data/vendored/puppet/lib/puppet/face/module/upgrade.rb +0 -4
- data/vendored/puppet/lib/puppet/face/status.rb +2 -2
- data/vendored/puppet/lib/puppet/file_serving/base.rb +5 -5
- data/vendored/puppet/lib/puppet/file_serving/metadata.rb +2 -1
- data/vendored/puppet/lib/puppet/forge.rb +7 -8
- data/vendored/puppet/lib/puppet/forge/errors.rb +3 -3
- data/vendored/puppet/lib/puppet/functions/abs.rb +61 -0
- data/vendored/puppet/lib/puppet/functions/all.rb +2 -2
- data/vendored/puppet/lib/puppet/functions/any.rb +2 -2
- data/vendored/puppet/lib/puppet/functions/assert_type.rb +3 -3
- data/vendored/puppet/lib/puppet/functions/break.rb +3 -7
- data/vendored/puppet/lib/puppet/functions/camelcase.rb +62 -0
- data/vendored/puppet/lib/puppet/functions/capitalize.rb +61 -0
- data/vendored/puppet/lib/puppet/functions/ceiling.rb +37 -0
- data/vendored/puppet/lib/puppet/functions/chomp.rb +57 -0
- data/vendored/puppet/lib/puppet/functions/chop.rb +67 -0
- data/vendored/puppet/lib/puppet/functions/compare.rb +125 -0
- data/vendored/puppet/lib/puppet/functions/convert_to.rb +3 -2
- data/vendored/puppet/lib/puppet/functions/dig.rb +21 -1
- data/vendored/puppet/lib/puppet/functions/downcase.rb +89 -0
- data/vendored/puppet/lib/puppet/functions/each.rb +2 -2
- data/vendored/puppet/lib/puppet/functions/empty.rb +1 -3
- data/vendored/puppet/lib/puppet/functions/eyaml_lookup_key.rb +4 -2
- data/vendored/puppet/lib/puppet/functions/filter.rb +2 -2
- data/vendored/puppet/lib/puppet/functions/floor.rb +37 -0
- data/vendored/puppet/lib/puppet/functions/get.rb +150 -0
- data/vendored/puppet/lib/puppet/functions/getvar.rb +87 -0
- data/vendored/puppet/lib/puppet/functions/hiera.rb +5 -5
- data/vendored/puppet/lib/puppet/functions/hiera_array.rb +5 -5
- data/vendored/puppet/lib/puppet/functions/hiera_hash.rb +6 -6
- data/vendored/puppet/lib/puppet/functions/hiera_include.rb +7 -7
- data/vendored/puppet/lib/puppet/functions/hocon_data.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/json_data.rb +3 -3
- data/vendored/puppet/lib/puppet/functions/lest.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/lookup.rb +3 -2
- data/vendored/puppet/lib/puppet/functions/lstrip.rb +58 -0
- data/vendored/puppet/lib/puppet/functions/map.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/match.rb +11 -0
- data/vendored/puppet/lib/puppet/functions/max.rb +183 -0
- data/vendored/puppet/lib/puppet/functions/min.rb +182 -0
- data/vendored/puppet/lib/puppet/functions/next.rb +1 -8
- data/vendored/puppet/lib/puppet/functions/reduce.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/return.rb +1 -8
- data/vendored/puppet/lib/puppet/functions/reverse_each.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/round.rb +24 -0
- data/vendored/puppet/lib/puppet/functions/rstrip.rb +58 -0
- data/vendored/puppet/lib/puppet/functions/size.rb +15 -0
- data/vendored/puppet/lib/puppet/functions/sort.rb +74 -0
- data/vendored/puppet/lib/puppet/functions/step.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/strftime.rb +1 -7
- data/vendored/puppet/lib/puppet/functions/strip.rb +58 -0
- data/vendored/puppet/lib/puppet/functions/then.rb +1 -1
- data/vendored/puppet/lib/puppet/functions/tree_each.rb +7 -7
- data/vendored/puppet/lib/puppet/functions/upcase.rb +89 -0
- data/vendored/puppet/lib/puppet/functions/with.rb +4 -4
- data/vendored/puppet/lib/puppet/functions/yaml_data.rb +4 -2
- data/vendored/puppet/lib/puppet/graph/simple_graph.rb +9 -5
- data/vendored/puppet/lib/puppet/indirector/certificate_revocation_list/rest.rb +0 -11
- data/vendored/puppet/lib/puppet/indirector/indirection.rb +8 -12
- data/vendored/puppet/lib/puppet/indirector/node/exec.rb +1 -1
- data/vendored/puppet/lib/puppet/indirector/node/ldap.rb +1 -1
- data/vendored/puppet/lib/puppet/indirector/request.rb +11 -11
- data/vendored/puppet/lib/puppet/indirector/rest.rb +11 -11
- data/vendored/puppet/lib/puppet/interface/action.rb +2 -5
- data/vendored/puppet/lib/puppet/metatype/manager.rb +0 -2
- data/vendored/puppet/lib/puppet/module.rb +7 -33
- data/vendored/puppet/lib/puppet/module/task.rb +0 -1
- data/vendored/puppet/lib/puppet/module_tool.rb +2 -5
- data/vendored/puppet/lib/puppet/module_tool/applications/application.rb +5 -5
- data/vendored/puppet/lib/puppet/module_tool/applications/builder.rb +2 -2
- data/vendored/puppet/lib/puppet/module_tool/applications/checksummer.rb +3 -3
- data/vendored/puppet/lib/puppet/module_tool/applications/installer.rb +6 -7
- data/vendored/puppet/lib/puppet/module_tool/applications/uninstaller.rb +1 -2
- data/vendored/puppet/lib/puppet/module_tool/applications/unpacker.rb +2 -2
- data/vendored/puppet/lib/puppet/module_tool/applications/upgrader.rb +5 -6
- data/vendored/puppet/lib/puppet/module_tool/dependency.rb +1 -1
- data/vendored/puppet/lib/puppet/module_tool/installed_modules.rb +2 -2
- data/vendored/puppet/lib/puppet/module_tool/local_tarball.rb +3 -3
- data/vendored/puppet/lib/puppet/module_tool/metadata.rb +3 -4
- data/vendored/puppet/lib/puppet/module_tool/shared_behaviors.rb +2 -2
- data/vendored/puppet/lib/puppet/network/authconfig.rb +0 -13
- data/vendored/puppet/lib/puppet/network/format_support.rb +1 -1
- data/vendored/puppet/lib/puppet/network/formats.rb +5 -7
- data/vendored/puppet/lib/puppet/network/http.rb +0 -2
- data/vendored/puppet/lib/puppet/network/http/api.rb +1 -10
- data/vendored/puppet/lib/puppet/network/http/api/master/v3/environment.rb +2 -2
- data/vendored/puppet/lib/puppet/network/http/api/master/v3/environments.rb +2 -2
- data/vendored/puppet/lib/puppet/network/http/compression.rb +1 -1
- data/vendored/puppet/lib/puppet/network/http/connection.rb +11 -3
- data/vendored/puppet/lib/puppet/network/http/error.rb +3 -3
- data/vendored/puppet/lib/puppet/network/http/factory.rb +3 -0
- data/vendored/puppet/lib/puppet/network/http/handler.rb +59 -27
- data/vendored/puppet/lib/puppet/network/resolver.rb +140 -67
- data/vendored/puppet/lib/puppet/node/environment.rb +2 -19
- data/vendored/puppet/lib/puppet/parameter.rb +12 -7
- data/vendored/puppet/lib/puppet/parser/ast.rb +4 -8
- data/vendored/puppet/lib/puppet/parser/ast/branch.rb +3 -3
- data/vendored/puppet/lib/puppet/parser/ast/leaf.rb +5 -0
- data/vendored/puppet/lib/puppet/parser/ast/pops_bridge.rb +18 -0
- data/vendored/puppet/lib/puppet/parser/compiler.rb +3 -4
- data/vendored/puppet/lib/puppet/parser/compiler/catalog_validator/relationship_validator.rb +9 -2
- data/vendored/puppet/lib/puppet/parser/functions.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/assert_type.rb +3 -3
- data/vendored/puppet/lib/puppet/parser/functions/create_resources.rb +1 -7
- data/vendored/puppet/lib/puppet/parser/functions/each.rb +2 -2
- data/vendored/puppet/lib/puppet/parser/functions/filter.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/hiera.rb +4 -4
- data/vendored/puppet/lib/puppet/parser/functions/hiera_array.rb +5 -5
- data/vendored/puppet/lib/puppet/parser/functions/hiera_hash.rb +6 -6
- data/vendored/puppet/lib/puppet/parser/functions/hiera_include.rb +10 -11
- data/vendored/puppet/lib/puppet/parser/functions/inline_template.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/lest.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/lookup.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/map.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/reduce.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/return.rb +22 -1
- data/vendored/puppet/lib/puppet/parser/functions/reverse_each.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/step.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/then.rb +1 -1
- data/vendored/puppet/lib/puppet/parser/functions/with.rb +4 -4
- data/vendored/puppet/lib/puppet/parser/resource.rb +0 -1
- data/vendored/puppet/lib/puppet/parser/resource/param.rb +12 -5
- data/vendored/puppet/lib/puppet/parser/scope.rb +5 -7
- data/vendored/puppet/lib/puppet/pops/evaluator/compare_operator.rb +3 -1
- data/vendored/puppet/lib/puppet/pops/evaluator/runtime3_support.rb +2 -7
- data/vendored/puppet/lib/puppet/pops/issues.rb +4 -0
- data/vendored/puppet/lib/puppet/pops/loader/loader_paths.rb +2 -2
- data/vendored/puppet/lib/puppet/pops/loader/module_loaders.rb +17 -12
- data/vendored/puppet/lib/puppet/pops/loader/task_instantiator.rb +73 -45
- data/vendored/puppet/lib/puppet/pops/lookup/lookup_adapter.rb +55 -6
- data/vendored/puppet/lib/puppet/pops/model/model_label_provider.rb +2 -0
- data/vendored/puppet/lib/puppet/pops/parser/epp_parser.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/parser/epp_support.rb +6 -2
- data/vendored/puppet/lib/puppet/pops/parser/lexer2.rb +1 -1
- data/vendored/puppet/lib/puppet/pops/pcore.rb +7 -7
- data/vendored/puppet/lib/puppet/pops/puppet_stack.rb +15 -1
- data/vendored/puppet/lib/puppet/pops/serialization.rb +2 -2
- data/vendored/puppet/lib/puppet/pops/serialization/from_data_converter.rb +2 -2
- data/vendored/puppet/lib/puppet/pops/serialization/json.rb +7 -7
- data/vendored/puppet/lib/puppet/pops/serialization/to_data_converter.rb +5 -5
- data/vendored/puppet/lib/puppet/pops/types/types.rb +8 -4
- data/vendored/puppet/lib/puppet/pops/validation/checker4_0.rb +73 -0
- data/vendored/puppet/lib/puppet/pops/validation/validator_factory_4_0.rb +4 -3
- data/vendored/puppet/lib/puppet/provider/augeas/augeas.rb +7 -0
- data/vendored/puppet/lib/puppet/provider/service/systemd.rb +1 -1
- data/vendored/puppet/lib/puppet/provider/user/aix.rb +2 -2
- data/vendored/puppet/lib/puppet/provider/yumrepo/inifile.rb +21 -9
- data/vendored/puppet/lib/puppet/reference/providers.rb +1 -1
- data/vendored/puppet/lib/puppet/reference/report.rb +1 -1
- data/vendored/puppet/lib/puppet/resource.rb +1 -1
- data/vendored/puppet/lib/puppet/resource/capability_finder.rb +4 -4
- data/vendored/puppet/lib/puppet/resource/catalog.rb +6 -3
- data/vendored/puppet/lib/puppet/resource/type.rb +6 -2
- data/vendored/puppet/lib/puppet/rest/client.rb +79 -0
- data/vendored/puppet/lib/puppet/rest/errors.rb +14 -0
- data/vendored/puppet/lib/puppet/rest/response.rb +29 -0
- data/vendored/puppet/lib/puppet/rest/route.rb +102 -0
- data/vendored/puppet/lib/puppet/rest/routes.rb +31 -0
- data/vendored/puppet/lib/puppet/settings.rb +9 -5
- data/vendored/puppet/lib/puppet/settings/config_file.rb +1 -1
- data/vendored/puppet/lib/puppet/settings/environment_conf.rb +10 -1
- data/vendored/puppet/lib/puppet/ssl.rb +0 -1
- data/vendored/puppet/lib/puppet/ssl/certificate.rb +6 -2
- data/vendored/puppet/lib/puppet/ssl/certificate_authority.rb +3 -3
- data/vendored/puppet/lib/puppet/ssl/host.rb +258 -19
- data/vendored/puppet/lib/puppet/ssl/validator/default_validator.rb +33 -19
- data/vendored/puppet/lib/puppet/syntax_checkers/json.rb +1 -1
- data/vendored/puppet/lib/puppet/transaction/event.rb +34 -7
- data/vendored/puppet/lib/puppet/transaction/report.rb +17 -14
- data/vendored/puppet/lib/puppet/type.rb +20 -12
- data/vendored/puppet/lib/puppet/type/file.rb +1 -1
- data/vendored/puppet/lib/puppet/type/file/content.rb +15 -2
- data/vendored/puppet/lib/puppet/type/file/ensure.rb +1 -1
- data/vendored/puppet/lib/puppet/type/schedule.rb +1 -1
- data/vendored/puppet/lib/puppet/type/stage.rb +1 -1
- data/vendored/puppet/lib/puppet/type/tidy.rb +5 -1
- data/vendored/puppet/lib/puppet/type/user.rb +35 -18
- data/vendored/puppet/lib/puppet/type/yumrepo.rb +8 -17
- data/vendored/puppet/lib/puppet/util.rb +0 -1
- data/vendored/puppet/lib/puppet/util/autoload.rb +1 -6
- data/vendored/puppet/lib/puppet/util/checksums.rb +0 -2
- data/vendored/puppet/lib/puppet/util/classgen.rb +0 -6
- data/vendored/puppet/lib/puppet/util/fileparsing.rb +27 -5
- data/vendored/puppet/lib/puppet/util/instance_loader.rb +3 -3
- data/vendored/puppet/lib/puppet/util/json.rb +77 -0
- data/vendored/puppet/lib/puppet/util/json_lockfile.rb +3 -3
- data/vendored/puppet/lib/puppet/util/ldap/connection.rb +7 -7
- data/vendored/puppet/lib/puppet/util/log/destinations.rb +2 -2
- data/vendored/puppet/lib/puppet/util/logging.rb +1 -1
- data/vendored/puppet/lib/puppet/util/plist.rb +1 -1
- data/vendored/puppet/lib/puppet/util/provider_features.rb +2 -5
- data/vendored/puppet/lib/puppet/util/reference.rb +5 -4
- data/vendored/puppet/lib/puppet/util/tagging.rb +16 -3
- data/vendored/puppet/lib/puppet/version.rb +1 -1
- metadata +44 -26
- data/vendored/puppet/lib/puppet/application/master.rb +0 -317
- data/vendored/puppet/lib/puppet/feature/rack.rb +0 -19
- data/vendored/puppet/lib/puppet/network/http/api/ca.rb +0 -2
- data/vendored/puppet/lib/puppet/network/http/api/ca/v1.rb +0 -11
- data/vendored/puppet/lib/puppet/network/http/rack.rb +0 -33
- data/vendored/puppet/lib/puppet/network/http/rack/rest.rb +0 -162
- data/vendored/puppet/lib/puppet/network/http/webrick.rb +0 -124
- data/vendored/puppet/lib/puppet/network/http/webrick/rest.rb +0 -114
- data/vendored/puppet/lib/puppet/network/server.rb +0 -39
- data/vendored/puppet/lib/puppet/ssl/configuration.rb +0 -61
- data/vendored/puppet/lib/puppet/util/methodhelper.rb +0 -32
- data/vendored/puppet/lib/puppet/vendor/load_semantic.rb +0 -1
- data/vendored/puppet/lib/puppet/vendor/load_semantic_puppet.rb +0 -1
- data/vendored/puppet/lib/puppet/vendor/semantic/lib/semantic.rb +0 -5
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet.rb +0 -11
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/dependency.rb +0 -181
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/dependency/graph.rb +0 -60
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/dependency/graph_node.rb +0 -117
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/dependency/module_release.rb +0 -58
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/dependency/source.rb +0 -25
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/dependency/unsatisfiable_graph.rb +0 -31
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/gem_version.rb +0 -3
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version.rb +0 -203
- data/vendored/puppet/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb +0 -758
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'puppet/util/logging'
|
2
2
|
require 'puppet/module/task'
|
3
|
-
require 'json'
|
3
|
+
require 'puppet/util/json'
|
4
4
|
require 'semantic_puppet/gem_version'
|
5
5
|
|
6
6
|
# Support for modules
|
@@ -56,29 +56,8 @@ class Puppet::Module
|
|
56
56
|
end
|
57
57
|
|
58
58
|
# @api private
|
59
|
-
def self.parse_range(range
|
60
|
-
|
61
|
-
if @parse_range_method.arity == 1
|
62
|
-
@semver_gem_version ||= SemanticPuppet::Version.parse(SemanticPuppet::VERSION)
|
63
|
-
|
64
|
-
# Give user a heads-up if the desired strict setting cannot be honored
|
65
|
-
if strict
|
66
|
-
if @semver_gem_version.major < 1
|
67
|
-
Puppet.warn_once('strict_version_ranges', 'version_range_cannot_be_strict',
|
68
|
-
_('VersionRanges will never be strict when using non-vendored SemanticPuppet gem, version %{version}') % { version: @semver_gem_version},
|
69
|
-
:default, :default, :notice)
|
70
|
-
end
|
71
|
-
else
|
72
|
-
if @semver_gem_version.major >= 1
|
73
|
-
Puppet.warn_once('strict_version_ranges', 'version_range_always_strict',
|
74
|
-
_('VersionRanges will always be strict when using non-vendored SemanticPuppet gem, version %{version}') % { version: @semver_gem_version},
|
75
|
-
:default, :default, :notice)
|
76
|
-
end
|
77
|
-
end
|
78
|
-
@parse_range_method.call(range)
|
79
|
-
else
|
80
|
-
@parse_range_method.call(range, strict)
|
81
|
-
end
|
59
|
+
def self.parse_range(range)
|
60
|
+
SemanticPuppet::VersionRange.parse(range)
|
82
61
|
end
|
83
62
|
|
84
63
|
attr_reader :name, :environment, :path, :metadata, :tasks
|
@@ -87,10 +66,9 @@ class Puppet::Module
|
|
87
66
|
attr_accessor :dependencies, :forge_name
|
88
67
|
attr_accessor :source, :author, :version, :license, :summary, :description, :project_page
|
89
68
|
|
90
|
-
def initialize(name, path, environment
|
69
|
+
def initialize(name, path, environment)
|
91
70
|
@name = name
|
92
71
|
@path = path
|
93
|
-
@strict_semver = strict_semver
|
94
72
|
@environment = environment
|
95
73
|
|
96
74
|
assert_validity
|
@@ -202,10 +180,10 @@ class Puppet::Module
|
|
202
180
|
|
203
181
|
def read_metadata
|
204
182
|
md_file = metadata_file
|
205
|
-
md_file.nil? ? {} :
|
183
|
+
md_file.nil? ? {} : Puppet::Util::Json.load(File.read(md_file, :encoding => 'utf-8'))
|
206
184
|
rescue Errno::ENOENT
|
207
185
|
{}
|
208
|
-
rescue
|
186
|
+
rescue Puppet::Util::Json::ParseError => e
|
209
187
|
#TRANSLATORS 'metadata.json' is a specific file name and should not be translated.
|
210
188
|
msg = _("%{name} has an invalid and unparsable metadata.json file. The parse error: %{error}") % { name: name, error: e.message }
|
211
189
|
case Puppet[:strict]
|
@@ -406,7 +384,7 @@ class Puppet::Module
|
|
406
384
|
|
407
385
|
if version_string
|
408
386
|
begin
|
409
|
-
required_version_semver_range = self.class.parse_range(version_string
|
387
|
+
required_version_semver_range = self.class.parse_range(version_string)
|
410
388
|
actual_version_semver = SemanticPuppet::Version.parse(dep_mod.version)
|
411
389
|
rescue ArgumentError
|
412
390
|
error_details[:reason] = :non_semantic_version
|
@@ -432,10 +410,6 @@ class Puppet::Module
|
|
432
410
|
self.environment == other.environment
|
433
411
|
end
|
434
412
|
|
435
|
-
def strict_semver?
|
436
|
-
@strict_semver
|
437
|
-
end
|
438
|
-
|
439
413
|
private
|
440
414
|
|
441
415
|
def wanted_manifests_from(pattern)
|
@@ -131,8 +131,6 @@ module Puppet
|
|
131
131
|
# Note: environment will have expanded the path
|
132
132
|
options[:target_dir] = face_environment.full_modulepath.first
|
133
133
|
|
134
|
-
# Default false to retain backward compatibility with SemanticPuppet 0.1.4
|
135
|
-
options[:strict_semver] = false unless options.include?(:strict_semver)
|
136
134
|
end
|
137
135
|
|
138
136
|
# Given a hash of options, we should discover or create a
|
@@ -165,16 +163,15 @@ module Puppet
|
|
165
163
|
# @param where [String] a description of the thing we're parsing the
|
166
164
|
# dependency expression for
|
167
165
|
# @param dep [Hash] the dependency description to parse
|
168
|
-
# @param strict_semver [Boolean] set to `false` to relax range semantics to include pre-releases
|
169
166
|
# @return [Array(String, SemanticPuppet::VersionRange, String)] a tuple of the
|
170
167
|
# dependent module's name, the version range dependency, and the
|
171
168
|
# unparsed range expression.
|
172
|
-
def self.parse_module_dependency(where, dep
|
169
|
+
def self.parse_module_dependency(where, dep)
|
173
170
|
dep_name = dep['name'].tr('/', '-')
|
174
171
|
range = dep['version_requirement'] || '>= 0.0.0'
|
175
172
|
|
176
173
|
begin
|
177
|
-
parsed_range = Module.parse_range(range
|
174
|
+
parsed_range = Module.parse_range(range)
|
178
175
|
rescue ArgumentError => e
|
179
176
|
Puppet.debug "Error in #{where} parsing dependency #{dep_name} (#{e.message}); using empty range."
|
180
177
|
parsed_range = SemanticPuppet::VersionRange::EMPTY_RANGE
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'net/http'
|
2
|
-
require 'json'
|
2
|
+
require 'puppet/util/json'
|
3
3
|
require 'puppet/util/colors'
|
4
4
|
|
5
5
|
module Puppet::ModuleTool
|
@@ -26,7 +26,7 @@ module Puppet::ModuleTool
|
|
26
26
|
when Net::HTTPOK, Net::HTTPCreated
|
27
27
|
Puppet.notice success
|
28
28
|
else
|
29
|
-
errors =
|
29
|
+
errors = Puppet::Util::Json.load(response.body)['error'] rescue "HTTP #{response.code}, #{response.body}"
|
30
30
|
Puppet.warning "#{failure} (#{errors})"
|
31
31
|
end
|
32
32
|
end
|
@@ -40,7 +40,7 @@ module Puppet::ModuleTool
|
|
40
40
|
end
|
41
41
|
|
42
42
|
if require_metadata && !Puppet::ModuleTool.is_module_root?(@path)
|
43
|
-
raise ArgumentError, _("Unable to find metadata.json in module root at %{path} See https://
|
43
|
+
raise ArgumentError, _("Unable to find metadata.json in module root at %{path} See https://puppet.com/docs/puppet/latest/modules_publishing.html for required file format.") % { path: @path }
|
44
44
|
end
|
45
45
|
|
46
46
|
metadata_path = File.join(@path, 'metadata.json')
|
@@ -48,8 +48,8 @@ module Puppet::ModuleTool
|
|
48
48
|
if File.file?(metadata_path)
|
49
49
|
File.open(metadata_path) do |f|
|
50
50
|
begin
|
51
|
-
@metadata.update(
|
52
|
-
rescue
|
51
|
+
@metadata.update(Puppet::Util::Json.load(f))
|
52
|
+
rescue Puppet::Util::Json::ParserError => ex
|
53
53
|
raise ArgumentError, _("Could not parse JSON %{metadata_path}") % { metadata_path: metadata_path }, ex.backtrace
|
54
54
|
end
|
55
55
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'fileutils'
|
2
|
-
require 'json'
|
2
|
+
require 'puppet/util/json'
|
3
3
|
require 'puppet/file_system'
|
4
4
|
require 'pathspec'
|
5
5
|
require 'facter'
|
@@ -140,7 +140,7 @@ module Puppet::ModuleTool
|
|
140
140
|
end
|
141
141
|
|
142
142
|
Puppet::FileSystem.open(File.join(build_path, 'checksums.json'), nil, 'wb') do |f|
|
143
|
-
f.write(
|
143
|
+
f.write(Puppet::Util::Json.dump(Checksums.new(build_path), :pretty => true))
|
144
144
|
end
|
145
145
|
end
|
146
146
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'json'
|
1
|
+
require 'puppet/util/json'
|
2
2
|
require 'puppet/module_tool/checksums'
|
3
3
|
|
4
4
|
module Puppet::ModuleTool
|
@@ -40,10 +40,10 @@ module Puppet::ModuleTool
|
|
40
40
|
|
41
41
|
def checksums
|
42
42
|
if checksums_file.exist?
|
43
|
-
|
43
|
+
Puppet::Util::Json.load(checksums_file.read)
|
44
44
|
elsif metadata_file.exist?
|
45
45
|
# Check metadata.json too; legacy modules store their checksums there.
|
46
|
-
|
46
|
+
Puppet::Util::Json.load(metadata_file.read)['checksums'] or
|
47
47
|
raise ArgumentError, _("No file containing checksums found.")
|
48
48
|
else
|
49
49
|
raise ArgumentError, _("No file containing checksums found.")
|
@@ -25,7 +25,6 @@ module Puppet::ModuleTool
|
|
25
25
|
@ignore_dependencies = forced? || options[:ignore_dependencies]
|
26
26
|
@name = name
|
27
27
|
@install_dir = install_dir
|
28
|
-
@strict_semver = !!options[:strict_semver]
|
29
28
|
|
30
29
|
Puppet::Forge::Cache.clean
|
31
30
|
|
@@ -63,7 +62,7 @@ module Puppet::ModuleTool
|
|
63
62
|
begin
|
64
63
|
if installed_module = installed_modules[name]
|
65
64
|
unless forced?
|
66
|
-
if Puppet::Module.parse_range(version
|
65
|
+
if Puppet::Module.parse_range(version).include? installed_module.version
|
67
66
|
results[:result] = :noop
|
68
67
|
results[:version] = installed_module.version
|
69
68
|
return results
|
@@ -107,7 +106,7 @@ module Puppet::ModuleTool
|
|
107
106
|
# locking it to upgrades within the same major version.
|
108
107
|
installed_range = ">=#{version} #{version.major}.x"
|
109
108
|
graph.add_constraint('installed', mod, installed_range) do |node|
|
110
|
-
Puppet::Module.parse_range(installed_range
|
109
|
+
Puppet::Module.parse_range(installed_range).include? node.version
|
111
110
|
end
|
112
111
|
|
113
112
|
release.mod.dependencies.each do |dep|
|
@@ -115,7 +114,7 @@ module Puppet::ModuleTool
|
|
115
114
|
|
116
115
|
range = dep['version_requirement']
|
117
116
|
graph.add_constraint("#{mod} constraint", dep_name, range) do |node|
|
118
|
-
Puppet::Module.parse_range(range
|
117
|
+
Puppet::Module.parse_range(range).include? node.version
|
119
118
|
end
|
120
119
|
end
|
121
120
|
end
|
@@ -189,12 +188,12 @@ module Puppet::ModuleTool
|
|
189
188
|
private
|
190
189
|
|
191
190
|
def module_repository
|
192
|
-
@repo ||= Puppet::Forge.new(Puppet[:module_repository]
|
191
|
+
@repo ||= Puppet::Forge.new(Puppet[:module_repository])
|
193
192
|
end
|
194
193
|
|
195
194
|
def local_tarball_source
|
196
195
|
@tarball_source ||= begin
|
197
|
-
Puppet::ModuleTool::LocalTarball.new(@name
|
196
|
+
Puppet::ModuleTool::LocalTarball.new(@name)
|
198
197
|
rescue Puppet::Module::Error => e
|
199
198
|
raise InvalidModuleError.new(@name, :action => @action, :error => e)
|
200
199
|
end
|
@@ -209,7 +208,7 @@ module Puppet::ModuleTool
|
|
209
208
|
end
|
210
209
|
|
211
210
|
def build_single_module_graph(name, version)
|
212
|
-
range = Puppet::Module.parse_range(version
|
211
|
+
range = Puppet::Module.parse_range(version)
|
213
212
|
graph = SemanticPuppet::Dependency::Graph.new(name => range)
|
214
213
|
releases = SemanticPuppet::Dependency.fetch_releases(name)
|
215
214
|
releases.each { |release| release.dependencies.clear }
|
@@ -12,7 +12,6 @@ module Puppet::ModuleTool
|
|
12
12
|
@suggestions = []
|
13
13
|
@environment = options[:environment_instance]
|
14
14
|
@ignore_changes = options[:force] || options[:ignore_changes]
|
15
|
-
@strict_semver = !!options[:strict_semver]
|
16
15
|
end
|
17
16
|
|
18
17
|
def run
|
@@ -61,7 +60,7 @@ module Puppet::ModuleTool
|
|
61
60
|
:path => mod.modulepath,
|
62
61
|
}
|
63
62
|
if @options[:version] && mod.version
|
64
|
-
next unless Puppet::Module.parse_range(@options[:version]
|
63
|
+
next unless Puppet::Module.parse_range(@options[:version]).include?(SemanticPuppet::Version.parse(mod.version))
|
65
64
|
end
|
66
65
|
@installed << mod
|
67
66
|
elsif mod_name =~ /#{@name}/
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'pathname'
|
2
2
|
require 'tmpdir'
|
3
|
-
require 'json'
|
3
|
+
require 'puppet/util/json'
|
4
4
|
require 'puppet/file_system'
|
5
5
|
|
6
6
|
module Puppet::ModuleTool
|
@@ -75,7 +75,7 @@ module Puppet::ModuleTool
|
|
75
75
|
|
76
76
|
# @api private
|
77
77
|
def module_name
|
78
|
-
metadata =
|
78
|
+
metadata = Puppet::Util::Json.load((root_dir + 'metadata.json').read)
|
79
79
|
metadata['name'][/-(.*)/, 1]
|
80
80
|
end
|
81
81
|
|
@@ -20,7 +20,6 @@ module Puppet::ModuleTool
|
|
20
20
|
@name = name
|
21
21
|
@ignore_changes = forced? || options[:ignore_changes]
|
22
22
|
@ignore_dependencies = forced? || options[:ignore_dependencies]
|
23
|
-
@strict_semver = !!options[:strict_semver]
|
24
23
|
|
25
24
|
SemanticPuppet::Dependency.add_source(installed_modules_source)
|
26
25
|
SemanticPuppet::Dependency.add_source(module_repository)
|
@@ -94,7 +93,7 @@ module Puppet::ModuleTool
|
|
94
93
|
if available_versions.empty?
|
95
94
|
raise NoCandidateReleasesError, results.merge(:module_name => name, :source => module_repository.host)
|
96
95
|
elsif results[:requested_version] != :latest
|
97
|
-
requested = Puppet::Module.parse_range(results[:requested_version]
|
96
|
+
requested = Puppet::Module.parse_range(results[:requested_version])
|
98
97
|
unless available_versions.any? {|m| requested.include? m.version}
|
99
98
|
raise NoCandidateReleasesError, results.merge(:module_name => name, :source => module_repository.host)
|
100
99
|
end
|
@@ -123,7 +122,7 @@ module Puppet::ModuleTool
|
|
123
122
|
# module, locking it to upgrades within the same major version.
|
124
123
|
installed_range = ">=#{version} #{version.major}.x"
|
125
124
|
graph.add_constraint('installed', installed_module, installed_range) do |node|
|
126
|
-
Puppet::Module.parse_range(installed_range
|
125
|
+
Puppet::Module.parse_range(installed_range).include? node.version
|
127
126
|
end
|
128
127
|
|
129
128
|
release.mod.dependencies.each do |dep|
|
@@ -131,7 +130,7 @@ module Puppet::ModuleTool
|
|
131
130
|
|
132
131
|
range = dep['version_requirement']
|
133
132
|
graph.add_constraint("#{installed_module} constraint", dep_name, range) do |node|
|
134
|
-
Puppet::Module.parse_range(range
|
133
|
+
Puppet::Module.parse_range(range).include? node.version
|
135
134
|
end
|
136
135
|
end
|
137
136
|
end
|
@@ -219,7 +218,7 @@ module Puppet::ModuleTool
|
|
219
218
|
|
220
219
|
private
|
221
220
|
def module_repository
|
222
|
-
@repo ||= Puppet::Forge.new(Puppet[:module_repository]
|
221
|
+
@repo ||= Puppet::Forge.new(Puppet[:module_repository])
|
223
222
|
end
|
224
223
|
|
225
224
|
def installed_modules_source
|
@@ -231,7 +230,7 @@ module Puppet::ModuleTool
|
|
231
230
|
end
|
232
231
|
|
233
232
|
def build_single_module_graph(name, version)
|
234
|
-
range = Puppet::Module.parse_range(version
|
233
|
+
range = Puppet::Module.parse_range(version)
|
235
234
|
graph = SemanticPuppet::Dependency::Graph.new(name => range)
|
236
235
|
releases = SemanticPuppet::Dependency.fetch_releases(name)
|
237
236
|
releases.each { |release| release.dependencies.clear }
|
@@ -16,7 +16,7 @@ module Puppet::ModuleTool
|
|
16
16
|
# TODO: add error checking, the next line raises ArgumentError when +full_module_name+ is invalid
|
17
17
|
@username, @name = Puppet::ModuleTool.username_and_modname_from(full_module_name)
|
18
18
|
@version_requirement = version_requirement
|
19
|
-
@repository = repository ? Puppet::Forge::Repository.new(repository) : nil
|
19
|
+
@repository = repository ? Puppet::Forge::Repository.new(repository, nil) : nil
|
20
20
|
end
|
21
21
|
|
22
22
|
# We override Object's ==, eql, and hash so we can more easily find identical
|
@@ -54,7 +54,7 @@ module Puppet::ModuleTool
|
|
54
54
|
class ModuleRelease < SemanticPuppet::Dependency::ModuleRelease
|
55
55
|
attr_reader :mod, :metadata
|
56
56
|
|
57
|
-
def initialize(source, mod
|
57
|
+
def initialize(source, mod)
|
58
58
|
@mod = mod
|
59
59
|
@metadata = mod.metadata
|
60
60
|
name = mod.forge_name.tr('/', '-')
|
@@ -70,7 +70,7 @@ module Puppet::ModuleTool
|
|
70
70
|
|
71
71
|
if mod.dependencies
|
72
72
|
mod.dependencies.each do |dependency|
|
73
|
-
results = Puppet::ModuleTool.parse_module_dependency(release, dependency
|
73
|
+
results = Puppet::ModuleTool.parse_module_dependency(release, dependency)
|
74
74
|
dep_name, parsed_range, range = results
|
75
75
|
|
76
76
|
add_constraint('initialize', dep_name, range.to_s) do |node|
|
@@ -8,11 +8,11 @@ module Puppet::ModuleTool
|
|
8
8
|
class LocalTarball < SemanticPuppet::Dependency::Source
|
9
9
|
attr_accessor :release
|
10
10
|
|
11
|
-
def initialize(filename
|
11
|
+
def initialize(filename)
|
12
12
|
unpack(filename, tmpdir)
|
13
13
|
Puppet.debug "Unpacked local tarball to #{tmpdir}"
|
14
14
|
|
15
|
-
mod = Puppet::Module.new('tarball', tmpdir, nil
|
15
|
+
mod = Puppet::Module.new('tarball', tmpdir, nil)
|
16
16
|
@release = ModuleRelease.new(self, mod)
|
17
17
|
end
|
18
18
|
|
@@ -52,7 +52,7 @@ module Puppet::ModuleTool
|
|
52
52
|
|
53
53
|
if mod.dependencies
|
54
54
|
dependencies = mod.dependencies.map do |dep|
|
55
|
-
Puppet::ModuleTool.parse_module_dependency(release, dep
|
55
|
+
Puppet::ModuleTool.parse_module_dependency(release, dep)[0..1]
|
56
56
|
end
|
57
57
|
dependencies = Hash[dependencies]
|
58
58
|
end
|
@@ -1,8 +1,7 @@
|
|
1
|
-
require 'puppet/util/methodhelper'
|
2
1
|
require 'puppet/module_tool'
|
3
2
|
require 'puppet/network/format_support'
|
4
3
|
require 'uri'
|
5
|
-
require 'json'
|
4
|
+
require 'puppet/util/json'
|
6
5
|
require 'set'
|
7
6
|
|
8
7
|
module Puppet::ModuleTool
|
@@ -102,8 +101,8 @@ module Puppet::ModuleTool
|
|
102
101
|
data = @data.dup.merge('dependencies' => dependencies)
|
103
102
|
|
104
103
|
contents = data.keys.map do |k|
|
105
|
-
value = (
|
106
|
-
"#{k.
|
104
|
+
value = (Puppet::Util::Json.dump(data[k], :pretty => true) rescue data[k].to_json)
|
105
|
+
%Q("#{k.to_s}": #{value})
|
107
106
|
end
|
108
107
|
|
109
108
|
"{\n" + contents.join(",\n").gsub(/^/, ' ') + "\n}\n"
|
@@ -76,10 +76,10 @@ module Puppet::ModuleTool::Shared
|
|
76
76
|
}
|
77
77
|
|
78
78
|
if forced?
|
79
|
-
range = Puppet::Module.parse_range(@version
|
79
|
+
range = Puppet::Module.parse_range(@version) rescue Puppet::Module.parse_range('>= 0.0.0')
|
80
80
|
else
|
81
81
|
range = (@conditions[mod]).map do |r|
|
82
|
-
Puppet::Module.parse_range(r[:dependency]
|
82
|
+
Puppet::Module.parse_range(r[:dependency]) rescue Puppet::Module.parse_range('>= 0.0.0')
|
83
83
|
end.inject(&:&)
|
84
84
|
end
|
85
85
|
|
@@ -10,10 +10,6 @@ module Puppet
|
|
10
10
|
Puppet::Network::HTTP::MASTER_URL_PREFIX
|
11
11
|
end
|
12
12
|
|
13
|
-
def self.ca_url_prefix
|
14
|
-
Puppet::Network::HTTP::CA_URL_PREFIX
|
15
|
-
end
|
16
|
-
|
17
13
|
def self.default_acl
|
18
14
|
[
|
19
15
|
# Master API V3
|
@@ -28,15 +24,6 @@ module Puppet
|
|
28
24
|
{ :acl => "#{master_url_prefix}/v3/file" },
|
29
25
|
|
30
26
|
{ :acl => "#{master_url_prefix}/v3/status", :method => [:find], :authenticated => true },
|
31
|
-
|
32
|
-
# CA API V1
|
33
|
-
{ :acl => "#{ca_url_prefix}/v1/certificate_revocation_list/ca", :method => :find, :authenticated => true },
|
34
|
-
|
35
|
-
# These allow `auth any`, because if you can do them anonymously you
|
36
|
-
# should probably also be able to do them when trusted.
|
37
|
-
{ :acl => "#{ca_url_prefix}/v1/certificate/ca", :method => :find, :authenticated => :any },
|
38
|
-
{ :acl => "#{ca_url_prefix}/v1/certificate/", :method => :find, :authenticated => :any },
|
39
|
-
{ :acl => "#{ca_url_prefix}/v1/certificate_request", :method => [:find, :save], :authenticated => :any },
|
40
27
|
]
|
41
28
|
end
|
42
29
|
|