puppet 6.8.1-x64-mingw32 → 6.9.0-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/Gemfile +0 -1
- data/Gemfile.lock +10 -11
- data/ext/project_data.yaml +1 -0
- data/lib/puppet.rb +9 -1
- data/lib/puppet/application/agent.rb +12 -0
- data/lib/puppet/application_support.rb +1 -1
- data/lib/puppet/context.rb +120 -48
- data/lib/puppet/face/config.rb +10 -48
- data/lib/puppet/face/help.rb +1 -1
- data/lib/puppet/face/plugin.rb +9 -2
- data/lib/puppet/forge/repository.rb +1 -1
- data/lib/puppet/functions/regsubst.rb +58 -37
- data/lib/puppet/indirector/catalog/compiler.rb +10 -6
- data/lib/puppet/module_tool/applications/uninstaller.rb +2 -3
- data/lib/puppet/network/http/connection.rb +1 -1
- data/lib/puppet/network/http/factory.rb +1 -1
- data/lib/puppet/network/http_pool.rb +1 -0
- data/lib/puppet/provider/package/dnf.rb +1 -1
- data/lib/puppet/provider/package/rpm.rb +51 -13
- data/lib/puppet/provider/package/yum.rb +8 -4
- data/lib/puppet/provider/service/systemd.rb +1 -1
- data/lib/puppet/settings.rb +40 -0
- data/lib/puppet/ssl.rb +1 -1
- data/lib/puppet/ssl/base.rb +1 -1
- data/lib/puppet/ssl/openssl_loader.rb +28 -0
- data/lib/puppet/ssl/validator.rb +1 -1
- data/lib/puppet/ssl/validator/default_validator.rb +1 -1
- data/lib/puppet/ssl/validator/no_validator.rb +1 -1
- data/lib/puppet/thread_local.rb +7 -0
- data/lib/puppet/type/exec.rb +14 -6
- data/lib/puppet/type/group.rb +4 -2
- data/lib/puppet/type/package.rb +10 -0
- data/lib/puppet/type/user.rb +4 -2
- data/lib/puppet/util/checksums.rb +3 -3
- data/lib/puppet/util/http_proxy.rb +8 -6
- data/lib/puppet/util/monkey_patches.rb +53 -47
- data/lib/puppet/util/platform.rb +16 -0
- data/lib/puppet/util/ssl.rb +1 -1
- data/lib/puppet/util/windows/root_certs.rb +1 -1
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet/x509.rb +1 -1
- data/locales/puppet.pot +119 -119
- data/man/man5/puppet.conf.5 +2 -2
- data/man/man8/puppet-agent.8 +1 -1
- data/man/man8/puppet-apply.8 +1 -1
- data/man/man8/puppet-catalog.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-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-ssl.8 +1 -1
- data/man/man8/puppet-status.8 +1 -1
- data/man/man8/puppet.8 +3 -3
- data/spec/integration/provider/service/systemd_spec.rb +7 -6
- data/spec/integration/util/execution_spec.rb +1 -1
- data/spec/lib/puppet_spec/matchers.rb +0 -13
- data/spec/spec_helper.rb +1 -3
- data/spec/unit/application/agent_spec.rb +19 -0
- data/spec/unit/context_spec.rb +119 -38
- data/spec/unit/face/help_spec.rb +1 -1
- data/spec/unit/face/plugin_spec.rb +8 -0
- data/spec/unit/forge/forge_spec.rb +1 -3
- data/spec/unit/forge/repository_spec.rb +1 -3
- data/spec/unit/functions/contain_spec.rb +1 -1
- data/spec/unit/indirector/catalog/compiler_spec.rb +62 -5
- data/spec/unit/module_tool/applications/uninstaller_spec.rb +16 -7
- data/spec/unit/node/environment_spec.rb +1 -1
- data/spec/unit/provider/package/aptrpm_spec.rb +1 -1
- data/spec/unit/provider/package/dnf_spec.rb +7 -0
- data/spec/unit/provider/package/pkgin_spec.rb +1 -1
- data/spec/unit/provider/package/rpm_spec.rb +150 -16
- data/spec/unit/provider/package/yum_spec.rb +7 -0
- data/spec/unit/type/exec_spec.rb +9 -0
- data/spec/unit/type/schedule_spec.rb +1 -1
- data/spec/unit/util/http_proxy_spec.rb +50 -0
- data/spec/unit/util/inifile_spec.rb +5 -5
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f14e2dd4455f8b218d798533eb87d8ce7cb8cb2af36b0b4305a38baae009399
|
4
|
+
data.tar.gz: 3e332fc85a5e3d105ac59c1d412901df06569f59c85adc8c56a1eb65f33ead49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e687c3f9ec3448af122f41f31c2eac6fdc59fd85b6da38d88a399c3be384d5679db9fedf401918ab94c70263bfa1fffd1c2a7e67cf94d57ec185af042885826
|
7
|
+
data.tar.gz: d15dea408572ab6d45efe130fd70ffacb8809b51e0cc8ea8520d218e1252adfdd7ed75fb3cbcc9462a3eacc670ce19f182f994e4e6937479eadb5dac59c3eb3f
|
data/Gemfile
CHANGED
@@ -39,7 +39,6 @@ group(:test) do
|
|
39
39
|
gem "rake", *location_for(ENV['RAKE_LOCATION'] || '~> 12.2')
|
40
40
|
gem "rspec", "~> 3.1", require: false
|
41
41
|
gem "rspec-its", "~> 1.1", require: false
|
42
|
-
gem "rspec-collection_matchers", "~> 1.1", require: false
|
43
42
|
gem 'vcr', '~> 2.9', require: false
|
44
43
|
gem 'webmock', '~> 1.24', require: false
|
45
44
|
gem 'yard', require: false
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
puppet (6.
|
4
|
+
puppet (6.9.0)
|
5
5
|
CFPropertyList (~> 2.2)
|
6
|
+
concurrent-ruby (~> 1.0)
|
6
7
|
facter (>= 2.4.0, < 4)
|
7
8
|
fast_gettext (~> 1.1)
|
8
9
|
hiera (>= 3.2.1, < 4)
|
@@ -15,11 +16,12 @@ GEM
|
|
15
16
|
remote: https://artifactory.delivery.puppetlabs.net/artifactory/api/gems/rubygems/
|
16
17
|
specs:
|
17
18
|
CFPropertyList (2.3.6)
|
18
|
-
addressable (2.
|
19
|
-
public_suffix (>= 2.0.2, <
|
19
|
+
addressable (2.7.0)
|
20
|
+
public_suffix (>= 2.0.2, < 5.0)
|
20
21
|
artifactory (2.8.2)
|
21
22
|
ast (2.4.0)
|
22
23
|
coderay (1.1.2)
|
24
|
+
concurrent-ruby (1.1.5)
|
23
25
|
crack (0.4.3)
|
24
26
|
safe_yaml (~> 1.0.0)
|
25
27
|
diff-lcs (1.3)
|
@@ -46,22 +48,22 @@ GEM
|
|
46
48
|
locale (2.1.2)
|
47
49
|
memory_profiler (0.9.14)
|
48
50
|
method_source (0.9.2)
|
49
|
-
minitar (0.
|
51
|
+
minitar (0.9)
|
50
52
|
msgpack (1.3.1)
|
51
53
|
multi_json (1.13.1)
|
52
54
|
mustache (1.1.0)
|
53
55
|
optimist (3.0.0)
|
54
|
-
packaging (0.99.
|
56
|
+
packaging (0.99.42)
|
55
57
|
artifactory (~> 2)
|
56
58
|
rake (~> 12.3)
|
57
59
|
parallel (1.17.0)
|
58
|
-
parser (2.6.
|
60
|
+
parser (2.6.4.1)
|
59
61
|
ast (~> 2.4.0)
|
60
62
|
powerpack (0.1.2)
|
61
63
|
pry (0.12.2)
|
62
64
|
coderay (~> 1.1.0)
|
63
65
|
method_source (~> 0.9.0)
|
64
|
-
public_suffix (
|
66
|
+
public_suffix (4.0.1)
|
65
67
|
puppet-resource_api (1.8.6)
|
66
68
|
hocon (>= 1.0)
|
67
69
|
puppetserver-ca (1.4.0)
|
@@ -71,7 +73,7 @@ GEM
|
|
71
73
|
rake
|
72
74
|
rake (12.3.3)
|
73
75
|
rdiscount (2.2.0.1)
|
74
|
-
rdoc (6.
|
76
|
+
rdoc (6.2.0)
|
75
77
|
ronn (0.7.3)
|
76
78
|
hpricot (>= 0.8.2)
|
77
79
|
mustache (>= 0.7.0)
|
@@ -80,8 +82,6 @@ GEM
|
|
80
82
|
rspec-core (~> 3.8.0)
|
81
83
|
rspec-expectations (~> 3.8.0)
|
82
84
|
rspec-mocks (~> 3.8.0)
|
83
|
-
rspec-collection_matchers (1.1.3)
|
84
|
-
rspec-expectations (>= 2.99.0.beta1)
|
85
85
|
rspec-core (3.8.2)
|
86
86
|
rspec-support (~> 3.8.0)
|
87
87
|
rspec-expectations (3.8.4)
|
@@ -138,7 +138,6 @@ DEPENDENCIES
|
|
138
138
|
rdoc (~> 6.0)
|
139
139
|
ronn (~> 0.7.3)
|
140
140
|
rspec (~> 3.1)
|
141
|
-
rspec-collection_matchers (~> 1.1)
|
142
141
|
rspec-its (~> 1.1)
|
143
142
|
rubocop (~> 0.49)
|
144
143
|
rubocop-i18n (~> 1.2.0)
|
data/ext/project_data.yaml
CHANGED
data/lib/puppet.rb
CHANGED
@@ -148,7 +148,7 @@ module Puppet
|
|
148
148
|
Puppet.settings.initialize_global_settings(args, require_config)
|
149
149
|
run_mode = Puppet::Util::RunMode[run_mode]
|
150
150
|
Puppet.settings.initialize_app_defaults(Puppet::Settings.app_defaults_for_run_mode(run_mode))
|
151
|
-
|
151
|
+
push_context_global(Puppet.base_context(Puppet.settings), "Initial context after settings initialization")
|
152
152
|
Puppet::Parser::Functions.reset
|
153
153
|
end
|
154
154
|
private_class_method :do_initialize_settings_for_run_mode
|
@@ -245,6 +245,14 @@ module Puppet
|
|
245
245
|
@context.push(overrides, description)
|
246
246
|
end
|
247
247
|
|
248
|
+
# Push something onto the the context and make it global across threads. This
|
249
|
+
# has the potential to convert threadlocal overrides earlier on the stack into
|
250
|
+
# global overrides.
|
251
|
+
# @api private
|
252
|
+
def self.push_context_global(overrides, description = '')
|
253
|
+
@context.unsafe_push_global(overrides, description)
|
254
|
+
end
|
255
|
+
|
248
256
|
# Return to the previous context.
|
249
257
|
# @raise [StackUnderflow] if the current context is the root
|
250
258
|
# @api private
|
@@ -351,6 +351,8 @@ Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License
|
|
351
351
|
# Setup signal traps immediately after daemonization so we clean up the daemon
|
352
352
|
daemon.set_signal_traps
|
353
353
|
|
354
|
+
log_config if Puppet[:daemonize]
|
355
|
+
|
354
356
|
Puppet.override(ssl_context: wait_for_certificates) do
|
355
357
|
if Puppet[:onetime]
|
356
358
|
onetime(daemon)
|
@@ -361,6 +363,16 @@ Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License
|
|
361
363
|
end
|
362
364
|
end
|
363
365
|
|
366
|
+
def log_config
|
367
|
+
#skip also config reading and parsing if debug is not enabled
|
368
|
+
return unless Puppet::Util::Log.sendlevel?(:debug)
|
369
|
+
|
370
|
+
Puppet.settings.stringify_settings(:agent, :all).each_pair do |k,v|
|
371
|
+
next if k.include?("password") || v.to_s.empty?
|
372
|
+
Puppet.debug("Using setting: #{k}=#{v}")
|
373
|
+
end
|
374
|
+
end
|
375
|
+
|
364
376
|
def fingerprint
|
365
377
|
Puppet::Util::Log.newdestination(:console)
|
366
378
|
cert_provider = Puppet::X509::CertProvider.new
|
@@ -19,7 +19,7 @@ module Puppet
|
|
19
19
|
# @return [void]
|
20
20
|
# @api private
|
21
21
|
def self.push_application_context(run_mode, environment_mode = :local)
|
22
|
-
Puppet.
|
22
|
+
Puppet.push_context_global(Puppet.base_context(Puppet.settings), "Update for application settings (#{run_mode})")
|
23
23
|
# This use of configured environment is correct, this is used to establish
|
24
24
|
# the defaults for an application that does not override, or where an override
|
25
25
|
# has not been made from the command line.
|
data/lib/puppet/context.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'puppet/thread_local'
|
2
|
+
|
1
3
|
# Puppet::Context is a system for tracking services and contextual information
|
2
4
|
# that puppet needs to be able to run. Values are "bound" in a context when it is created
|
3
5
|
# and cannot be changed; however a child context can be created, using
|
@@ -19,66 +21,47 @@ class Puppet::Context
|
|
19
21
|
|
20
22
|
# @api private
|
21
23
|
def initialize(initial_bindings)
|
22
|
-
@
|
23
|
-
|
24
|
-
@
|
25
|
-
|
26
|
-
|
27
|
-
@
|
24
|
+
@stack = Puppet::ThreadLocal.new(EmptyStack.new.push(initial_bindings))
|
25
|
+
|
26
|
+
# By initializing @rollbacks to nil and creating a hash lazily when #mark or
|
27
|
+
# #rollback are called we ensure that the hashes are never shared between
|
28
|
+
# threads and it's safe to mutate them
|
29
|
+
@rollbacks = Puppet::ThreadLocal.new(nil)
|
30
|
+
end
|
31
|
+
|
32
|
+
# @api private
|
33
|
+
def push(overrides, description = '')
|
34
|
+
@stack.value = @stack.value.push(overrides, description)
|
28
35
|
end
|
29
36
|
|
37
|
+
# Push a context and make this global across threads
|
38
|
+
# Do not use in a context where multiple threads may already exist
|
39
|
+
#
|
30
40
|
# @api private
|
31
|
-
def
|
32
|
-
@
|
33
|
-
|
34
|
-
|
35
|
-
@description = description
|
41
|
+
def unsafe_push_global(overrides, description = '')
|
42
|
+
@stack = Puppet::ThreadLocal.new(
|
43
|
+
@stack.value.push(overrides, description)
|
44
|
+
)
|
36
45
|
end
|
37
46
|
|
38
47
|
# @api private
|
39
48
|
def pop
|
40
|
-
|
41
|
-
raise(StackUnderflow, _("Attempted to pop, but already at root of the context stack."))
|
42
|
-
else
|
43
|
-
(_, @table, @description) = @stack.pop
|
44
|
-
end
|
49
|
+
@stack.value = @stack.value.pop
|
45
50
|
end
|
46
51
|
|
47
52
|
# @api private
|
48
53
|
def lookup(name, &block)
|
49
|
-
|
50
|
-
value = @table[name]
|
51
|
-
value.is_a?(Proc) ? (@table[name] = value.call) : value
|
52
|
-
elsif block
|
53
|
-
block.call
|
54
|
-
else
|
55
|
-
raise UndefinedBindingError, _("Unable to lookup '%{name}'") % { name: name }
|
56
|
-
end
|
54
|
+
@stack.value.lookup(name, &block)
|
57
55
|
end
|
58
56
|
|
59
57
|
# @api private
|
60
|
-
def override(bindings, description =
|
61
|
-
|
62
|
-
mark(mark_point)
|
58
|
+
def override(bindings, description = '', &block)
|
59
|
+
saved_point = @stack.value
|
63
60
|
push(bindings, description)
|
64
61
|
|
65
62
|
yield
|
66
63
|
ensure
|
67
|
-
|
68
|
-
end
|
69
|
-
|
70
|
-
# @api private
|
71
|
-
def ignore(name)
|
72
|
-
@ignores << name
|
73
|
-
end
|
74
|
-
|
75
|
-
# @api private
|
76
|
-
def restore(name)
|
77
|
-
if @ignores.include?(name)
|
78
|
-
@ignores.delete(name)
|
79
|
-
else
|
80
|
-
raise UndefinedBindingError, _("no '%{name}' in ignores %{ignores} at top of %{stack}") % { name: name, ignores: @ignores.inspect, stack: @stack.inspect }
|
81
|
-
end
|
64
|
+
@stack.value = saved_point
|
82
65
|
end
|
83
66
|
|
84
67
|
# Mark a place on the context stack to later return to with {rollback}.
|
@@ -87,8 +70,9 @@ class Puppet::Context
|
|
87
70
|
#
|
88
71
|
# @api private
|
89
72
|
def mark(name)
|
90
|
-
|
91
|
-
|
73
|
+
@rollbacks.value ||= {}
|
74
|
+
if @rollbacks.value[name].nil?
|
75
|
+
@rollbacks.value[name] = @stack.value
|
92
76
|
else
|
93
77
|
raise DuplicateRollbackMarkError, _("Mark for '%{name}' already exists") % { name: name }
|
94
78
|
end
|
@@ -103,14 +87,102 @@ class Puppet::Context
|
|
103
87
|
#
|
104
88
|
# @api private
|
105
89
|
def rollback(name)
|
106
|
-
|
90
|
+
@rollbacks.value ||= {}
|
91
|
+
if @rollbacks.value[name].nil?
|
107
92
|
raise UnknownRollbackMarkError, _("Unknown mark '%{name}'") % { name: name }
|
108
93
|
end
|
109
94
|
|
110
|
-
|
111
|
-
|
95
|
+
@stack.value = @rollbacks.value.delete(name)
|
96
|
+
end
|
97
|
+
|
98
|
+
# Base case for Puppet::Context::Stack.
|
99
|
+
#
|
100
|
+
# @api private
|
101
|
+
class EmptyStack
|
102
|
+
# Lookup a binding. Since there are none in EmptyStack, this always raises
|
103
|
+
# an exception unless a block is passed, in which case the block is called
|
104
|
+
# and its return value is used.
|
105
|
+
#
|
106
|
+
# @api private
|
107
|
+
def lookup(name, &block)
|
108
|
+
if block
|
109
|
+
block.call
|
110
|
+
else
|
111
|
+
raise UndefinedBindingError, _("Unable to lookup '%{name}'") % { name: name }
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
# Base case of #pop always raises an error since this is the bottom
|
116
|
+
#
|
117
|
+
# @api private
|
118
|
+
def pop
|
119
|
+
raise(StackUnderflow,
|
120
|
+
_('Attempted to pop, but already at root of the context stack.'))
|
121
|
+
end
|
122
|
+
|
123
|
+
# Push bindings onto the stack by creating a new Stack object with `self` as
|
124
|
+
# the parent
|
125
|
+
#
|
126
|
+
# @api private
|
127
|
+
def push(overrides, description = '')
|
128
|
+
Puppet::Context::Stack.new(self, overrides, description)
|
112
129
|
end
|
113
130
|
|
114
|
-
|
131
|
+
# Return the bindings table, which is always empty here
|
132
|
+
#
|
133
|
+
# @api private
|
134
|
+
def bindings
|
135
|
+
{}
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
# Internal implementation of the bindings stack used by Puppet::Context. An
|
140
|
+
# instance of Puppet::Context::Stack represents one level of bindings. It
|
141
|
+
# caches a merged copy of all the bindings in the stack up to this point.
|
142
|
+
# Each element of the stack is immutable, allowing the base to be shared
|
143
|
+
# between threads.
|
144
|
+
#
|
145
|
+
# @api private
|
146
|
+
class Stack
|
147
|
+
attr_reader :bindings
|
148
|
+
|
149
|
+
def initialize(parent, bindings, description = '')
|
150
|
+
@parent = parent
|
151
|
+
@bindings = parent.bindings.merge(bindings || {})
|
152
|
+
@description = description
|
153
|
+
end
|
154
|
+
|
155
|
+
# Lookup a binding in the current stack. Return the value if it is present.
|
156
|
+
# If the value is a stored Proc, evaluate, cache, and return the result. If
|
157
|
+
# no binding is found and a block is passed evaluate it and return the
|
158
|
+
# result. Otherwise an exception is raised.
|
159
|
+
#
|
160
|
+
# @api private
|
161
|
+
def lookup(name, &block)
|
162
|
+
if @bindings.include?(name)
|
163
|
+
value = @bindings[name]
|
164
|
+
value.is_a?(Proc) ? (@bindings[name] = value.call) : value
|
165
|
+
elsif block
|
166
|
+
block.call
|
167
|
+
else
|
168
|
+
raise UndefinedBindingError,
|
169
|
+
_("Unable to lookup '%{name}'") % { name: name }
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
# Pop one level off the stack by returning the parent object.
|
174
|
+
#
|
175
|
+
# @api private
|
176
|
+
def pop
|
177
|
+
@parent
|
178
|
+
end
|
179
|
+
|
180
|
+
# Push bindings onto the stack by creating a new Stack object with `self` as
|
181
|
+
# the parent
|
182
|
+
#
|
183
|
+
# @api private
|
184
|
+
def push(overrides, description = '')
|
185
|
+
Puppet::Context::Stack.new(self, overrides, description)
|
186
|
+
end
|
115
187
|
end
|
116
188
|
end
|
data/lib/puppet/face/config.rb
CHANGED
@@ -66,41 +66,18 @@ Puppet::Face.define(:config, '0.0.1') do
|
|
66
66
|
@default_section = true
|
67
67
|
end
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
values_from_the_selected_section =
|
74
|
-
Puppet.settings.values(nil, options[:section].to_sym)
|
75
|
-
|
76
|
-
loader_settings = {
|
77
|
-
:environmentpath => values_from_the_selected_section.interpolate(:environmentpath),
|
78
|
-
:basemodulepath => values_from_the_selected_section.interpolate(:basemodulepath),
|
79
|
-
}
|
80
|
-
|
81
|
-
to_be_rendered = nil
|
82
|
-
Puppet.override(Puppet.base_context(loader_settings),
|
83
|
-
_("New environment loaders generated from the requested section.")) do
|
84
|
-
# And now we can lookup values that include those from environments configured from
|
85
|
-
# the requested section
|
86
|
-
values = Puppet.settings.values(Puppet[:environment].to_sym, options[:section].to_sym)
|
87
|
-
|
88
|
-
if Puppet::Util::Log.sendlevel?(:info)
|
89
|
-
warn_default_section(options[:section]) if @default_section
|
90
|
-
report_section_and_environment(options[:section], Puppet.settings[:environment])
|
91
|
-
end
|
92
|
-
|
93
|
-
to_be_rendered = {}
|
94
|
-
args.sort.each do |setting_name|
|
95
|
-
to_be_rendered[setting_name] = values.print(setting_name.to_sym)
|
96
|
-
end
|
69
|
+
if Puppet::Util::Log.sendlevel?(:info)
|
70
|
+
warn_default_section(options[:section]) if @default_section
|
71
|
+
report_section_and_environment(options[:section], Puppet.settings[:environment])
|
97
72
|
end
|
98
73
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
74
|
+
names = if args.empty? || args == ['all']
|
75
|
+
:all
|
76
|
+
else
|
77
|
+
args
|
78
|
+
end
|
79
|
+
|
80
|
+
Puppet.settings.stringify_settings(options[:section], names)
|
104
81
|
end
|
105
82
|
|
106
83
|
when_rendering :console do |to_be_rendered|
|
@@ -117,21 +94,6 @@ Puppet::Face.define(:config, '0.0.1') do
|
|
117
94
|
end
|
118
95
|
end
|
119
96
|
|
120
|
-
def stringifyhash(hash)
|
121
|
-
newhash = {}
|
122
|
-
hash.each do |key, val|
|
123
|
-
key = key.to_s
|
124
|
-
if val.is_a? Hash
|
125
|
-
newhash[key] = stringifyhash(val)
|
126
|
-
elsif val.is_a? Symbol
|
127
|
-
newhash[key] = val.to_s
|
128
|
-
else
|
129
|
-
newhash[key] = val
|
130
|
-
end
|
131
|
-
end
|
132
|
-
newhash
|
133
|
-
end
|
134
|
-
|
135
97
|
def warn_default_section(section_name)
|
136
98
|
messages = []
|
137
99
|
messages << _("No section specified; defaulting to '%{section_name}'.") %
|