puppet 5.5.17-x64-mingw32 → 5.5.18-x64-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.
- checksums.yaml +4 -4
- data/CODEOWNERS +1 -1
- data/Gemfile +2 -3
- data/Gemfile.lock +35 -31
- data/ext/build_defaults.yaml +1 -0
- data/ext/cert_inspector +3 -3
- data/ext/puppet-test +2 -2
- data/ext/regexp_nodes/regexp_nodes.rb +4 -4
- data/ext/windows/service/daemon.rb +54 -8
- data/install.rb +6 -6
- data/lib/puppet/application.rb +1 -1
- data/lib/puppet/application/apply.rb +2 -2
- data/lib/puppet/application/describe.rb +3 -9
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/application/lookup.rb +1 -1
- data/lib/puppet/application/script.rb +2 -2
- data/lib/puppet/configurer.rb +86 -28
- data/lib/puppet/configurer/downloader.rb +2 -6
- data/lib/puppet/defaults.rb +17 -4
- data/lib/puppet/error.rb +9 -1
- data/lib/puppet/external/nagios/base.rb +1 -1
- data/lib/puppet/face/ca.rb +1 -1
- data/lib/puppet/face/module/list.rb +5 -5
- data/lib/puppet/face/module/search.rb +1 -1
- data/lib/puppet/face/module/uninstall.rb +1 -1
- data/lib/puppet/face/module/upgrade.rb +1 -1
- data/lib/puppet/file_serving/http_metadata.rb +1 -1
- data/lib/puppet/file_system.rb +0 -8
- data/lib/puppet/file_system/memory_file.rb +1 -1
- data/lib/puppet/file_system/posix.rb +3 -2
- data/lib/puppet/forge.rb +3 -3
- data/lib/puppet/functions/epp.rb +4 -4
- data/lib/puppet/functions/inline_epp.rb +5 -5
- data/lib/puppet/gettext/module_translations.rb +1 -1
- data/lib/puppet/graph/rb_tree_map.rb +2 -2
- data/lib/puppet/graph/simple_graph.rb +6 -5
- data/lib/puppet/indirector/file_bucket_file/file.rb +1 -1
- data/lib/puppet/indirector/hiera.rb +2 -0
- data/lib/puppet/indirector/resource/ral.rb +1 -3
- data/lib/puppet/indirector/resource/validator.rb +1 -1
- data/lib/puppet/interface.rb +2 -1
- data/lib/puppet/loaders.rb +0 -1
- data/lib/puppet/metatype/manager.rb +1 -1
- data/lib/puppet/module.rb +1 -1
- data/lib/puppet/module_tool/applications/builder.rb +1 -1
- data/lib/puppet/module_tool/applications/installer.rb +1 -1
- data/lib/puppet/module_tool/applications/uninstaller.rb +3 -3
- data/lib/puppet/module_tool/metadata.rb +1 -1
- data/lib/puppet/module_tool/shared_behaviors.rb +4 -4
- data/lib/puppet/module_tool/tar/mini.rb +1 -1
- data/lib/puppet/network/http/api/indirected_routes.rb +12 -11
- data/lib/puppet/network/http/connection.rb +10 -12
- data/lib/puppet/network/http/pool.rb +2 -0
- data/lib/puppet/network/http/rack/rest.rb +2 -2
- data/lib/puppet/network/http/site.rb +1 -1
- data/lib/puppet/network/resolver.rb +2 -2
- data/lib/puppet/node/environment.rb +4 -2
- data/lib/puppet/parser/ast.rb +1 -1
- data/lib/puppet/parser/ast/resourceparam.rb +1 -1
- data/lib/puppet/parser/functions.rb +1 -1
- data/lib/puppet/parser/functions/epp.rb +3 -3
- data/lib/puppet/parser/functions/inline_epp.rb +5 -5
- data/lib/puppet/pops/evaluator/collectors/catalog_collector.rb +1 -1
- data/lib/puppet/pops/evaluator/collectors/exported_collector.rb +1 -1
- data/lib/puppet/pops/evaluator/external_syntax_support.rb +3 -2
- data/lib/puppet/pops/evaluator/runtime3_support.rb +4 -4
- data/lib/puppet/pops/loaders.rb +1 -1
- data/lib/puppet/pops/lookup/hiera_config.rb +1 -0
- data/lib/puppet/pops/lookup/sub_lookup.rb +1 -1
- data/lib/puppet/pops/merge_strategy.rb +22 -18
- data/lib/puppet/pops/parser/heredoc_support.rb +1 -1
- data/lib/puppet/pops/parser/interpolation_support.rb +4 -4
- data/lib/puppet/pops/parser/locator.rb +1 -1
- data/lib/puppet/pops/parser/pn_parser.rb +17 -16
- data/lib/puppet/pops/puppet_stack.rb +51 -48
- data/lib/puppet/pops/types/p_sensitive_type.rb +1 -1
- data/lib/puppet/pops/types/string_converter.rb +10 -10
- data/lib/puppet/pops/types/types.rb +3 -3
- data/lib/puppet/property.rb +1 -1
- data/lib/puppet/property/ensure.rb +1 -1
- data/lib/puppet/provider/augeas/augeas.rb +1 -1
- data/lib/puppet/provider/cron/crontab.rb +1 -1
- data/lib/puppet/provider/exec.rb +6 -2
- data/lib/puppet/provider/mount.rb +1 -1
- data/lib/puppet/provider/mount/parsed.rb +8 -8
- data/lib/puppet/provider/nameservice/directoryservice.rb +1 -1
- data/lib/puppet/provider/nameservice/pw.rb +2 -2
- data/lib/puppet/provider/package/dnfmodule.rb +87 -0
- data/lib/puppet/provider/package/dpkg.rb +3 -12
- data/lib/puppet/provider/package/openbsd.rb +1 -1
- data/lib/puppet/provider/package/pip.rb +34 -9
- data/lib/puppet/provider/package/portage.rb +4 -4
- data/lib/puppet/provider/package/rpm.rb +6 -6
- data/lib/puppet/provider/package/windows/package.rb +1 -1
- data/lib/puppet/provider/package/yum.rb +1 -1
- data/lib/puppet/provider/package_targetable.rb +5 -4
- data/lib/puppet/provider/parsedfile.rb +1 -1
- data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +3 -3
- data/lib/puppet/provider/service/daemontools.rb +9 -9
- data/lib/puppet/provider/service/openbsd.rb +1 -1
- data/lib/puppet/provider/service/rcng.rb +2 -2
- data/lib/puppet/provider/service/runit.rb +2 -8
- data/lib/puppet/provider/service/systemd.rb +8 -8
- data/lib/puppet/provider/user/directoryservice.rb +1 -1
- data/lib/puppet/provider/user/hpux.rb +1 -1
- data/lib/puppet/provider/user/user_role_add.rb +1 -1
- data/lib/puppet/provider/user/useradd.rb +22 -13
- data/lib/puppet/provider/user/windows_adsi.rb +4 -5
- data/lib/puppet/provider/yumrepo/inifile.rb +2 -2
- data/lib/puppet/reference/indirection.rb +2 -2
- data/lib/puppet/reference/metaparameter.rb +1 -3
- data/lib/puppet/reference/providers.rb +1 -1
- data/lib/puppet/reference/type.rb +3 -9
- data/lib/puppet/reports.rb +1 -1
- data/lib/puppet/resource.rb +1 -1
- data/lib/puppet/resource/catalog.rb +1 -1
- data/lib/puppet/settings.rb +3 -3
- data/lib/puppet/settings/environment_conf.rb +1 -0
- data/lib/puppet/ssl/certificate_authority/interface.rb +1 -1
- data/lib/puppet/ssl/certificate_factory.rb +2 -2
- data/lib/puppet/ssl/host.rb +3 -3
- data/lib/puppet/ssl/oids.rb +1 -1
- data/lib/puppet/transaction/report.rb +1 -1
- data/lib/puppet/type.rb +2 -4
- data/lib/puppet/type/cron.rb +1 -1
- data/lib/puppet/type/exec.rb +7 -3
- data/lib/puppet/type/file.rb +1 -2
- data/lib/puppet/type/file/data_sync.rb +5 -1
- data/lib/puppet/type/group.rb +4 -2
- data/lib/puppet/type/interface.rb +1 -1
- data/lib/puppet/type/notify.rb +3 -2
- data/lib/puppet/type/package.rb +2 -2
- data/lib/puppet/type/schedule.rb +1 -1
- data/lib/puppet/type/selboolean.rb +17 -3
- data/lib/puppet/type/service.rb +1 -1
- data/lib/puppet/type/user.rb +4 -2
- data/lib/puppet/util.rb +35 -12
- data/lib/puppet/util/command_line/trollop.rb +1 -1
- data/lib/puppet/util/http_proxy.rb +8 -14
- data/lib/puppet/util/instance_loader.rb +1 -1
- data/lib/puppet/util/log.rb +1 -1
- data/lib/puppet/util/log/destinations.rb +2 -2
- data/lib/puppet/util/logging.rb +30 -18
- data/lib/puppet/util/metric.rb +2 -2
- data/lib/puppet/util/monkey_patches.rb +1 -1
- data/lib/puppet/util/nagios_maker.rb +2 -2
- data/lib/puppet/util/network_device/cisco/device.rb +1 -1
- data/lib/puppet/util/network_device/cisco/interface.rb +2 -2
- data/lib/puppet/util/network_device/transport/ssh.rb +1 -1
- data/lib/puppet/util/provider_features.rb +2 -4
- data/lib/puppet/util/rdoc.rb +1 -1
- data/lib/puppet/util/reference.rb +1 -1
- data/lib/puppet/util/resource_template.rb +1 -1
- data/lib/puppet/util/selinux.rb +3 -1
- data/lib/puppet/util/windows/adsi.rb +58 -28
- data/lib/puppet/util/windows/registry.rb +7 -5
- data/lib/puppet/vendor.rb +1 -1
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet_pal.rb +2 -2
- data/locales/puppet.pot +115 -95
- data/man/man5/puppet.conf.5 +21 -5
- data/man/man8/puppet-agent.8 +1 -1
- data/man/man8/puppet-apply.8 +1 -1
- data/man/man8/puppet-ca.8 +1 -1
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-cert.8 +1 -1
- data/man/man8/puppet-certificate.8 +1 -1
- data/man/man8/puppet-certificate_request.8 +1 -1
- data/man/man8/puppet-certificate_revocation_list.8 +1 -1
- data/man/man8/puppet-config.8 +1 -1
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +1 -1
- data/man/man8/puppet-doc.8 +1 -1
- data/man/man8/puppet-epp.8 +1 -1
- data/man/man8/puppet-facts.8 +1 -1
- data/man/man8/puppet-filebucket.8 +1 -1
- data/man/man8/puppet-generate.8 +1 -1
- data/man/man8/puppet-help.8 +1 -1
- data/man/man8/puppet-key.8 +1 -1
- data/man/man8/puppet-lookup.8 +1 -1
- data/man/man8/puppet-man.8 +1 -1
- data/man/man8/puppet-master.8 +1 -1
- data/man/man8/puppet-module.8 +1 -1
- data/man/man8/puppet-node.8 +1 -1
- data/man/man8/puppet-parser.8 +1 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-report.8 +1 -1
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-script.8 +1 -1
- data/man/man8/puppet-status.8 +1 -1
- data/man/man8/puppet.8 +2 -2
- data/spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-installed.txt +11 -0
- data/spec/integration/configurer_spec.rb +52 -0
- data/spec/integration/type/notify_spec.rb +46 -0
- data/spec/unit/configurer_spec.rb +380 -397
- data/spec/unit/forge/forge_spec.rb +1 -3
- data/spec/unit/forge/repository_spec.rb +1 -3
- data/spec/unit/indirector/resource/ral_spec.rb +4 -4
- data/spec/unit/network/http/connection_spec.rb +26 -0
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +8 -3
- data/spec/unit/provider/exec_spec.rb +209 -0
- data/spec/unit/provider/package/dnfmodule_spec.rb +186 -0
- data/spec/unit/provider/package/dpkg_spec.rb +15 -3
- data/spec/unit/provider/package/pip_spec.rb +51 -6
- data/spec/unit/provider/package/portage_spec.rb +4 -4
- data/spec/unit/provider/package_targetable_spec.rb +60 -0
- data/spec/unit/provider/service/daemontools_spec.rb +24 -0
- data/spec/unit/provider/service/runit_spec.rb +24 -0
- data/spec/unit/provider/service/systemd_spec.rb +22 -22
- data/spec/unit/provider/user/hpux_spec.rb +2 -2
- data/spec/unit/provider/user/useradd_spec.rb +46 -0
- data/spec/unit/type/exec_spec.rb +6 -12
- data/spec/unit/type/file/content_spec.rb +9 -3
- data/spec/unit/type/file_spec.rb +9 -4
- data/spec/unit/type/selboolean_spec.rb +4 -6
- data/spec/unit/util/execution_spec.rb +16 -0
- data/spec/unit/util/http_proxy_spec.rb +97 -0
- data/spec/unit/util/log/destinations_spec.rb +7 -3
- data/spec/unit/util/log_spec.rb +0 -138
- data/spec/unit/util/logging_spec.rb +200 -0
- data/spec/unit/util/windows/adsi_spec.rb +51 -0
- data/tasks/manpages.rake +1 -0
- metadata +12 -5
- data/lib/puppet/pops/loader/null_loader.rb +0 -60
- data/locales/ja/puppet.po +0 -12114
data/lib/puppet/forge.rb
CHANGED
@@ -59,7 +59,7 @@ class Puppet::Forge < SemanticPuppet::Dependency::Source
|
|
59
59
|
matches = []
|
60
60
|
uri = "/v3/modules?query=#{term}"
|
61
61
|
if Puppet[:module_groups]
|
62
|
-
uri += "&module_groups=#{Puppet[:module_groups].
|
62
|
+
uri += "&module_groups=#{Puppet[:module_groups].tr('+', ' ')}"
|
63
63
|
end
|
64
64
|
|
65
65
|
while uri
|
@@ -95,7 +95,7 @@ class Puppet::Forge < SemanticPuppet::Dependency::Source
|
|
95
95
|
name = input.tr('/', '-')
|
96
96
|
uri = "/v3/releases?module=#{name}&sort_by=version&exclude_fields=#{MODULE_RELEASE_EXCLUSIONS}"
|
97
97
|
if Puppet[:module_groups]
|
98
|
-
uri += "&module_groups=#{Puppet[:module_groups].
|
98
|
+
uri += "&module_groups=#{Puppet[:module_groups].tr('+', ' ')}"
|
99
99
|
end
|
100
100
|
releases = []
|
101
101
|
|
@@ -240,6 +240,6 @@ class Puppet::Forge < SemanticPuppet::Dependency::Source
|
|
240
240
|
def decode_uri(uri)
|
241
241
|
return if uri.nil?
|
242
242
|
|
243
|
-
URI.decode(uri.
|
243
|
+
URI.decode(uri.tr('+', ' '))
|
244
244
|
end
|
245
245
|
end
|
data/lib/puppet/functions/epp.rb
CHANGED
@@ -6,12 +6,12 @@
|
|
6
6
|
# The first argument to this function should be a `<MODULE NAME>/<TEMPLATE FILE>`
|
7
7
|
# reference, which loads `<TEMPLATE FILE>` from `<MODULE NAME>`'s `templates`
|
8
8
|
# directory. In most cases, the last argument is optional; if used, it should be a
|
9
|
-
# [hash](/puppet/latest/
|
9
|
+
# [hash](https://puppet.com/docs/puppet/latest/lang_data_hash.html) that contains parameters to
|
10
10
|
# pass to the template.
|
11
11
|
#
|
12
|
-
# - See the [template](/puppet/latest/
|
13
|
-
# for general template usage information.
|
14
|
-
# - See the [EPP syntax](/puppet/latest/
|
12
|
+
# - See the [template](https://puppet.com/docs/puppet/latest/lang_template.html)
|
13
|
+
# documentation for general template usage information.
|
14
|
+
# - See the [EPP syntax](https://puppet.com/docs/puppet/latest/lang_template_epp.html)
|
15
15
|
# documentation for examples of EPP.
|
16
16
|
#
|
17
17
|
# For example, to call the apache module's `templates/vhost/_docroot.epp`
|
@@ -5,12 +5,12 @@
|
|
5
5
|
#
|
6
6
|
# The first argument to this function should be a string containing an EPP
|
7
7
|
# template. In most cases, the last argument is optional; if used, it should be a
|
8
|
-
# [hash](/puppet/latest/
|
8
|
+
# [hash](https://puppet.com/docs/puppet/latest/lang_data_hash.html) that contains parameters to
|
9
9
|
# pass to the template.
|
10
10
|
#
|
11
|
-
# - See the [template](/puppet/latest/
|
12
|
-
# for general template usage information.
|
13
|
-
# - See the [EPP syntax](/puppet/latest/
|
11
|
+
# - See the [template](https://puppet.com/docs/puppet/latest/lang_template.html)
|
12
|
+
# documentation for general template usage information.
|
13
|
+
# - See the [EPP syntax](https://puppet.com/docs/puppet/latest/lang_template_epp.html)
|
14
14
|
# documentation for examples of EPP.
|
15
15
|
#
|
16
16
|
# For example, to evaluate an inline EPP template and pass it the `docroot` and
|
@@ -28,7 +28,7 @@
|
|
28
28
|
# `inline_epp` function fails to pass any required parameter.
|
29
29
|
#
|
30
30
|
# An inline EPP template should be written as a single-quoted string or
|
31
|
-
# [heredoc](/puppet/latest/
|
31
|
+
# [heredoc](https://puppet.com/docs/puppet/latest/lang_data_string.html#heredocs).
|
32
32
|
# A double-quoted string is subject to expression interpolation before the string
|
33
33
|
# is parsed as an EPP template.
|
34
34
|
#
|
@@ -11,7 +11,7 @@ module Puppet::ModuleTranslations
|
|
11
11
|
modules.each do |mod|
|
12
12
|
next unless mod.forge_name && mod.has_translations?(Puppet::GettextConfig.current_locale)
|
13
13
|
|
14
|
-
module_name = mod.forge_name.
|
14
|
+
module_name = mod.forge_name.tr('/', '-')
|
15
15
|
if Puppet::GettextConfig.load_translations(module_name, mod.locale_directory, :po)
|
16
16
|
Puppet.debug "Loaded translations for #{module_name}."
|
17
17
|
elsif Puppet::GettextConfig.gettext_loaded?
|
@@ -213,8 +213,8 @@ class Puppet::Graph::RbTreeMap
|
|
213
213
|
:color => @color,
|
214
214
|
}
|
215
215
|
}
|
216
|
-
h
|
217
|
-
h
|
216
|
+
h[:left] = left.to_hash if @left
|
217
|
+
h[:right] = right.to_hash if @right
|
218
218
|
h
|
219
219
|
end
|
220
220
|
|
@@ -133,11 +133,12 @@ class Puppet::Graph::SimpleGraph
|
|
133
133
|
else
|
134
134
|
if s[:lowlink][vertex] == s[:index][vertex] then
|
135
135
|
this_scc = []
|
136
|
-
|
136
|
+
loop do
|
137
137
|
top = s[:stack].pop
|
138
138
|
s[:seen][top] = false
|
139
139
|
this_scc << top
|
140
|
-
|
140
|
+
break if top == vertex
|
141
|
+
end
|
141
142
|
s[:scc] << this_scc
|
142
143
|
end
|
143
144
|
recur.pop # done with this node, finally.
|
@@ -436,8 +437,8 @@ class Puppet::Graph::SimpleGraph
|
|
436
437
|
# undirected Graph. _params_ can contain any graph property specified in
|
437
438
|
# rdot.rb. If an edge or vertex label is a kind of Hash then the keys
|
438
439
|
# which match +dot+ properties will be used as well.
|
439
|
-
def to_dot_graph
|
440
|
-
params['name'] ||= self.class.name.
|
440
|
+
def to_dot_graph(params = {})
|
441
|
+
params['name'] ||= self.class.name.tr(':','_')
|
441
442
|
fontsize = params['fontsize'] ? params['fontsize'] : '8'
|
442
443
|
graph = (directed? ? DOT::DOTDigraph : DOT::DOTSubgraph).new(params)
|
443
444
|
edge_klass = directed? ? DOT::DOTDirectedEdge : DOT::DOTEdge
|
@@ -462,7 +463,7 @@ class Puppet::Graph::SimpleGraph
|
|
462
463
|
end
|
463
464
|
|
464
465
|
# Output the dot format as a string
|
465
|
-
def to_dot
|
466
|
+
def to_dot(params={}) to_dot_graph(params).to_s; end
|
466
467
|
|
467
468
|
# Produce the graph files if requested.
|
468
469
|
def write_graph(name)
|
@@ -15,7 +15,7 @@ module Puppet::FileBucketFile
|
|
15
15
|
request.options[:bucket_path] ||= Puppet[:bucketdir]
|
16
16
|
# If filebucket mode is 'list'
|
17
17
|
if request.options[:list_all]
|
18
|
-
return nil unless ::File.
|
18
|
+
return nil unless ::File.exist?(request.options[:bucket_path])
|
19
19
|
return list(request)
|
20
20
|
end
|
21
21
|
checksum, files_original_path = request_to_checksum_and_path(request)
|
@@ -25,9 +25,7 @@ class Puppet::Resource::Ral < Puppet::Indirector::Code
|
|
25
25
|
res.to_resource
|
26
26
|
end.find_all do |res|
|
27
27
|
conditions.all? {|property, value| res.to_resource[property].to_s == value.to_s}
|
28
|
-
end.
|
29
|
-
a.title <=> b.title
|
30
|
-
end
|
28
|
+
end.sort_by(&:title)
|
31
29
|
end
|
32
30
|
|
33
31
|
def save( request )
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Puppet::Resource::Validator
|
2
2
|
def validate_key(request)
|
3
3
|
type, title = request.key.split('/', 2)
|
4
|
-
unless type.
|
4
|
+
unless type.casecmp(request.instance.type).zero? and title == request.instance.title
|
5
5
|
raise Puppet::Indirector::ValidationError, _("Resource instance does not match request key")
|
6
6
|
end
|
7
7
|
end
|
data/lib/puppet/interface.rb
CHANGED
@@ -96,7 +96,7 @@ class Puppet::Interface
|
|
96
96
|
if Puppet::Interface::FaceCollection[name, :current]
|
97
97
|
raise Puppet::Error, "Could not find version #{version} of #{name}"
|
98
98
|
else
|
99
|
-
raise Puppet::Error, "Could not find Puppet Face #{name
|
99
|
+
raise Puppet::Error, "Could not find Puppet Face #{name}"
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
@@ -234,4 +234,5 @@ class Puppet::Interface
|
|
234
234
|
define_method(name, proc)
|
235
235
|
instance_method(name)
|
236
236
|
end
|
237
|
+
private_class_method :__add_method
|
237
238
|
end
|
data/lib/puppet/loaders.rb
CHANGED
@@ -9,7 +9,6 @@ module Puppet
|
|
9
9
|
require 'puppet/pops/loader/gem_support'
|
10
10
|
require 'puppet/pops/loader/module_loaders'
|
11
11
|
require 'puppet/pops/loader/dependency_loader'
|
12
|
-
require 'puppet/pops/loader/null_loader'
|
13
12
|
require 'puppet/pops/loader/static_loader'
|
14
13
|
require 'puppet/pops/loader/runtime3_type_loader'
|
15
14
|
require 'puppet/pops/loader/ruby_function_instantiator'
|
@@ -123,7 +123,7 @@ module Manager
|
|
123
123
|
|
124
124
|
# Now set up autoload any providers that might exist for this type.
|
125
125
|
|
126
|
-
klass.providerloader = Puppet::Util::Autoload.new(klass, "puppet/provider/#{klass.name
|
126
|
+
klass.providerloader = Puppet::Util::Autoload.new(klass, "puppet/provider/#{klass.name}")
|
127
127
|
|
128
128
|
# We have to load everything so that we can figure out the default provider.
|
129
129
|
klass.providerloader.loadall Puppet.lookup(:current_environment)
|
data/lib/puppet/module.rb
CHANGED
@@ -225,7 +225,7 @@ class Puppet::Module
|
|
225
225
|
@metadata = data = read_metadata
|
226
226
|
return if data.empty?
|
227
227
|
|
228
|
-
@forge_name = data['name'].
|
228
|
+
@forge_name = data['name'].tr('-', '/') if data['name']
|
229
229
|
|
230
230
|
[:source, :author, :version, :license, :dependencies].each do |attr|
|
231
231
|
value = data[attr.to_s]
|
@@ -103,7 +103,7 @@ module Puppet::ModuleTool
|
|
103
103
|
end
|
104
104
|
|
105
105
|
# make dir tree, copy files, and add symlinks to the symlinks list
|
106
|
-
dest = "#{build_path}/#{rel
|
106
|
+
dest = "#{build_path}/#{rel}"
|
107
107
|
if File.directory? path
|
108
108
|
FileUtils.mkdir dest, :mode => File.stat(path).mode
|
109
109
|
elsif Puppet::FileSystem.symlink? path
|
@@ -304,7 +304,7 @@ module Puppet::ModuleTool
|
|
304
304
|
@environment.modules_by_path[options[:target_dir]].each do |mod|
|
305
305
|
if mod.has_metadata?
|
306
306
|
metadata = {
|
307
|
-
:name => mod.forge_name.
|
307
|
+
:name => mod.forge_name.tr('/', '-'),
|
308
308
|
:version => mod.version
|
309
309
|
}
|
310
310
|
next if release[:module] == metadata[:name]
|
@@ -53,7 +53,7 @@ module Puppet::ModuleTool
|
|
53
53
|
|
54
54
|
def find_installed_module
|
55
55
|
@environment.modules_by_path.values.flatten.each do |mod|
|
56
|
-
mod_name = (mod.forge_name || mod.name).
|
56
|
+
mod_name = (mod.forge_name || mod.name).tr('/', '-')
|
57
57
|
if mod_name == @name
|
58
58
|
@unfiltered << {
|
59
59
|
:name => mod_name,
|
@@ -102,7 +102,7 @@ module Puppet::ModuleTool
|
|
102
102
|
if mod.has_metadata? && !changes.empty?
|
103
103
|
raise LocalChangesError,
|
104
104
|
:action => :uninstall,
|
105
|
-
:module_name => (mod.forge_name || mod.name).
|
105
|
+
:module_name => (mod.forge_name || mod.name).tr('/', '-'),
|
106
106
|
:requested_version => @options[:version],
|
107
107
|
:installed_version => mod.version
|
108
108
|
end
|
@@ -110,7 +110,7 @@ module Puppet::ModuleTool
|
|
110
110
|
|
111
111
|
if !@options[:force] && !mod.required_by.empty?
|
112
112
|
raise ModuleIsRequiredError,
|
113
|
-
:module_name => (mod.forge_name || mod.name).
|
113
|
+
:module_name => (mod.forge_name || mod.name).tr('/', '-'),
|
114
114
|
:required_by => mod.required_by,
|
115
115
|
:requested_version => @options[:version],
|
116
116
|
:installed_version => mod.version
|
@@ -103,7 +103,7 @@ module Puppet::ModuleTool
|
|
103
103
|
|
104
104
|
contents = data.keys.map do |k|
|
105
105
|
value = (Puppet::Util::Json.dump(data[k], :pretty => true) rescue data[k].to_json)
|
106
|
-
%Q("#{k
|
106
|
+
%Q("#{k}": #{value})
|
107
107
|
end
|
108
108
|
|
109
109
|
"{\n" + contents.join(",\n").gsub(/^/, ' ') + "\n}\n"
|
@@ -8,12 +8,12 @@ module Puppet::ModuleTool::Shared
|
|
8
8
|
@installed = Hash.new { |h,k| h[k] = [] }
|
9
9
|
|
10
10
|
@environment.modules_by_path.values.flatten.each do |mod|
|
11
|
-
mod_name = (mod.forge_name || mod.name).
|
11
|
+
mod_name = (mod.forge_name || mod.name).tr('/', '-')
|
12
12
|
@installed[mod_name] << mod
|
13
13
|
d = @local["#{mod_name}@#{mod.version}"]
|
14
14
|
(mod.dependencies || []).each do |hash|
|
15
15
|
name, conditions = hash['name'], hash['version_requirement']
|
16
|
-
name = name.
|
16
|
+
name = name.tr('/', '-')
|
17
17
|
d[name] = conditions
|
18
18
|
@conditions[name] << {
|
19
19
|
:module => mod_name,
|
@@ -34,7 +34,7 @@ module Puppet::ModuleTool::Shared
|
|
34
34
|
info = forge.remote_dependency_info(author, modname, @options[:version])
|
35
35
|
info.each do |pair|
|
36
36
|
mod_name, releases = pair
|
37
|
-
mod_name = mod_name.
|
37
|
+
mod_name = mod_name.tr('/', '-')
|
38
38
|
releases.each do |rel|
|
39
39
|
semver = SemanticPuppet::Version.parse(rel['version']) rescue SemanticPuppet::Version::MIN
|
40
40
|
@versions[mod_name] << { :vstring => rel['version'], :semver => semver }
|
@@ -42,7 +42,7 @@ module Puppet::ModuleTool::Shared
|
|
42
42
|
@urls["#{mod_name}@#{rel['version']}"] = rel['file']
|
43
43
|
d = @remote["#{mod_name}@#{rel['version']}"]
|
44
44
|
(rel['dependencies'] || []).each do |name, conditions|
|
45
|
-
d[name.
|
45
|
+
d[name.tr('/', '-')] = conditions
|
46
46
|
end
|
47
47
|
end
|
48
48
|
end
|
@@ -93,7 +93,7 @@ class Puppet::ModuleTool::Tar::Mini
|
|
93
93
|
def find_valid_files(tarfile)
|
94
94
|
Archive::Tar::Minitar.open(tarfile).collect do |entry|
|
95
95
|
flag = entry.typeflag
|
96
|
-
if flag.nil? || flag =~ /[[:digit:]]/ && (0..7).
|
96
|
+
if flag.nil? || flag =~ /[[:digit:]]/ && (0..7).cover?(flag.to_i)
|
97
97
|
entry.full_name
|
98
98
|
else
|
99
99
|
Puppet.debug "Invalid tar flag '#{flag}' will not be extracted: #{entry.name}"
|
@@ -114,6 +114,17 @@ class Puppet::Network::HTTP::API::IndirectedRoutes
|
|
114
114
|
[indirection, method, key, params]
|
115
115
|
end
|
116
116
|
|
117
|
+
def self.request_to_uri(request)
|
118
|
+
uri, body = request_to_uri_and_body(request)
|
119
|
+
"#{uri}?#{body}"
|
120
|
+
end
|
121
|
+
|
122
|
+
def self.request_to_uri_and_body(request)
|
123
|
+
url_prefix = IndirectionType.url_prefix_for(request.indirection_name.to_s)
|
124
|
+
indirection = request.method == :search ? pluralize(request.indirection_name.to_s) : request.indirection_name.to_s
|
125
|
+
["#{url_prefix}/#{indirection}/#{Puppet::Util.uri_encode(request.key)}", "environment=#{request.environment.name}&#{request.query_string}"]
|
126
|
+
end
|
127
|
+
|
117
128
|
private
|
118
129
|
|
119
130
|
# Execute our find.
|
@@ -246,20 +257,10 @@ class Puppet::Network::HTTP::API::IndirectedRoutes
|
|
246
257
|
method
|
247
258
|
end
|
248
259
|
|
249
|
-
def self.request_to_uri(request)
|
250
|
-
uri, body = request_to_uri_and_body(request)
|
251
|
-
"#{uri}?#{body}"
|
252
|
-
end
|
253
|
-
|
254
|
-
def self.request_to_uri_and_body(request)
|
255
|
-
url_prefix = IndirectionType.url_prefix_for(request.indirection_name.to_s)
|
256
|
-
indirection = request.method == :search ? pluralize(request.indirection_name.to_s) : request.indirection_name.to_s
|
257
|
-
["#{url_prefix}/#{indirection}/#{Puppet::Util.uri_encode(request.key)}", "environment=#{request.environment.name}&#{request.query_string}"]
|
258
|
-
end
|
259
|
-
|
260
260
|
def self.pluralize(indirection)
|
261
261
|
return(indirection == "status" ? "statuses" : indirection + "s")
|
262
262
|
end
|
263
|
+
private_class_method :pluralize
|
263
264
|
|
264
265
|
def plurality(indirection)
|
265
266
|
# NOTE These specific hooks for paths are ridiculous, but it's a *many*-line
|
@@ -311,19 +311,17 @@ module Puppet::Network::HTTP
|
|
311
311
|
rescue => exception
|
312
312
|
elapsed = (Time.now - start).to_f.round(3)
|
313
313
|
uri = [@site.addr, request.path.split('?')[0]].join('/')
|
314
|
-
eclass = exception.class
|
315
|
-
|
316
|
-
err = case exception
|
317
|
-
when EOFError
|
318
|
-
eclass.new(_('request %{uri} interrupted after %{elapsed} seconds') % {uri: uri, elapsed: elapsed})
|
319
|
-
when Timeout::Error
|
320
|
-
eclass.new(_('request %{uri} timed out after %{elapsed} seconds') % {uri: uri, elapsed: elapsed})
|
321
|
-
else
|
322
|
-
eclass.new(_('request %{uri} failed: %{msg}') % {uri: uri, msg: exception.message})
|
323
|
-
end
|
324
314
|
|
325
|
-
|
326
|
-
|
315
|
+
case exception
|
316
|
+
when EOFError
|
317
|
+
Puppet.log_exception(exception, _('request %{uri} interrupted after %{elapsed} seconds') % {uri: uri, elapsed: elapsed})
|
318
|
+
when Timeout::Error
|
319
|
+
Puppet.log_exception(exception, _('request %{uri} timed out after %{elapsed} seconds') % {uri: uri, elapsed: elapsed})
|
320
|
+
else
|
321
|
+
Puppet.log_exception(exception, _('request %{uri} failed: %{msg}') % {uri: uri, msg: exception.message})
|
322
|
+
end
|
323
|
+
|
324
|
+
raise exception
|
327
325
|
end
|
328
326
|
|
329
327
|
def with_connection(site, &block)
|
@@ -52,7 +52,7 @@ class Puppet::Network::HTTP::RackREST
|
|
52
52
|
# Retrieve all headers from the http request, as a map.
|
53
53
|
def headers(request)
|
54
54
|
headers = request.env.select {|k,v| k.start_with? 'HTTP_'}.inject({}) do |m, (k,v)|
|
55
|
-
m[k.sub(/^HTTP_/, '').
|
55
|
+
m[k.sub(/^HTTP_/, '').tr('_','-').downcase] = v
|
56
56
|
m
|
57
57
|
end
|
58
58
|
headers['content-type'] = request.content_type
|
@@ -113,7 +113,7 @@ class Puppet::Network::HTTP::RackREST
|
|
113
113
|
# in contrast to the environment variable, the client cert is passed in
|
114
114
|
# as single string, therefore restore the certificate to a valid pem
|
115
115
|
# encoded certificate
|
116
|
-
cert.
|
116
|
+
cert.tr!(' ', "\n")
|
117
117
|
cert.gsub!(/BEGIN\nCERT/, "BEGIN CERT")
|
118
118
|
cert.gsub!(/END\nCERT/, "END CERT")
|
119
119
|
cert = Puppet::SSL::Certificate.from_instance(OpenSSL::X509::Certificate.new(cert))
|
@@ -18,7 +18,7 @@ module Puppet::Network::Resolver
|
|
18
18
|
when :ca then service = '_x-puppet-ca'
|
19
19
|
when :report then service = '_x-puppet-report'
|
20
20
|
when :file then service = '_x-puppet-fileserver'
|
21
|
-
else service = "_x-puppet-#{service_name
|
21
|
+
else service = "_x-puppet-#{service_name}"
|
22
22
|
end
|
23
23
|
srv_record = "#{service}._tcp.#{domain}"
|
24
24
|
|
@@ -33,7 +33,7 @@ module Puppet::Network::Resolver
|
|
33
33
|
else
|
34
34
|
each_priority(records) do |priority, recs|
|
35
35
|
while next_rr = recs.delete(find_weighted_server(recs))
|
36
|
-
Puppet.debug "Yielding next server of #{next_rr.target
|
36
|
+
Puppet.debug "Yielding next server of #{next_rr.target}:#{next_rr.port}"
|
37
37
|
yield next_rr.target.to_s, next_rr.port
|
38
38
|
end
|
39
39
|
end
|