puppet 7.11.0-universal-darwin → 7.12.0-universal-darwin
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.lock +5 -5
- data/lib/puppet/configurer.rb +15 -16
- data/lib/puppet/file_system.rb +2 -1
- data/lib/puppet/pops/evaluator/closure.rb +7 -5
- data/lib/puppet/provider/package/pkg.rb +10 -0
- data/lib/puppet/provider/user/useradd.rb +20 -0
- data/lib/puppet/type/service.rb +8 -3
- data/lib/puppet/util/autoload.rb +1 -1
- data/lib/puppet/util/json.rb +3 -0
- data/lib/puppet/version.rb +1 -1
- data/locales/puppet.pot +183 -179
- 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-lookup.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.8 +2 -2
- data/spec/unit/configurer_spec.rb +14 -0
- data/spec/unit/network/formats_spec.rb +6 -0
- data/spec/unit/provider/package/pkg_spec.rb +15 -0
- data/spec/unit/provider/user/useradd_spec.rb +40 -0
- data/spec/unit/type/service_spec.rb +27 -0
- data/spec/unit/util/autoload_spec.rb +25 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80c8959d7f9d2257510417c41f768ae46015863b7396b67355234d512df8dff5
|
4
|
+
data.tar.gz: d1bbb5aafb8caab6986323491c4d1de3a0314de821ba1c587710df78b4234a66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35cb5bea648b50ca2dc7f6e2b2226ae2ba7b0aa84b256d65248f4c751dcea710405b38e3c90db355f4ec77939e99ed9962ef7c0957cfc6bcb1d0b71522aacba6
|
7
|
+
data.tar.gz: c144a4de5426eacdc507b744bb2a27f1f2afcc13799af443e8799d52dba00daa605a0c4a4862c58a2377457f4f7aff2ae246c4944e196fb90bda00f3c461cdb8
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
GIT
|
2
2
|
remote: git://github.com/puppetlabs/packaging
|
3
|
-
revision:
|
3
|
+
revision: 03722ea5c9106c1b31a58b22cc41bacade8c8fa8
|
4
4
|
branch: 1.0.x
|
5
5
|
specs:
|
6
|
-
packaging (0.
|
6
|
+
packaging (0.101.0)
|
7
7
|
artifactory (~> 2)
|
8
8
|
csv (= 3.1.5)
|
9
9
|
rake (>= 12.3)
|
@@ -12,7 +12,7 @@ GIT
|
|
12
12
|
PATH
|
13
13
|
remote: .
|
14
14
|
specs:
|
15
|
-
puppet (7.
|
15
|
+
puppet (7.12.0)
|
16
16
|
CFPropertyList (~> 2.2)
|
17
17
|
concurrent-ruby (~> 1.0)
|
18
18
|
deep_merge (~> 1.0)
|
@@ -40,7 +40,7 @@ GEM
|
|
40
40
|
deep_merge (1.2.1)
|
41
41
|
diff-lcs (1.4.4)
|
42
42
|
docopt (0.6.1)
|
43
|
-
facter (4.2.
|
43
|
+
facter (4.2.5)
|
44
44
|
hocon (~> 1.3)
|
45
45
|
thor (>= 1.0.1, < 2.0)
|
46
46
|
fast_gettext (1.1.2)
|
@@ -127,7 +127,7 @@ GEM
|
|
127
127
|
semantic_puppet (1.0.4)
|
128
128
|
text (1.3.1)
|
129
129
|
thor (1.1.0)
|
130
|
-
unicode-display_width (1.
|
130
|
+
unicode-display_width (1.8.0)
|
131
131
|
vcr (5.1.0)
|
132
132
|
webmock (3.14.0)
|
133
133
|
addressable (>= 2.8.0)
|
data/lib/puppet/configurer.rb
CHANGED
@@ -393,6 +393,8 @@ class Puppet::Configurer
|
|
393
393
|
if last_server_specified_environment
|
394
394
|
@environment = last_server_specified_environment
|
395
395
|
report.environment = last_server_specified_environment
|
396
|
+
|
397
|
+
push_current_environment_and_loaders
|
396
398
|
else
|
397
399
|
Puppet.debug(_("Could not find a usable environment in the lastrunfile. Either the file does not exist, does not have the required keys, or the values of 'initial_environment' and 'converged_environment' are identical."))
|
398
400
|
end
|
@@ -403,14 +405,7 @@ class Puppet::Configurer
|
|
403
405
|
# This is to maintain compatibility with anyone using this class
|
404
406
|
# aside from agent, apply, device.
|
405
407
|
unless Puppet.lookup(:loaders) { nil }
|
406
|
-
|
407
|
-
Puppet.push_context(
|
408
|
-
{
|
409
|
-
current_environment: new_env,
|
410
|
-
loaders: Puppet::Pops::Loaders.new(new_env, true)
|
411
|
-
},
|
412
|
-
"Local node environment #{@environment} for configurer transaction"
|
413
|
-
)
|
408
|
+
push_current_environment_and_loaders
|
414
409
|
end
|
415
410
|
|
416
411
|
temp_value = options[:pluginsync]
|
@@ -446,14 +441,7 @@ class Puppet::Configurer
|
|
446
441
|
@environment = catalog.environment
|
447
442
|
report.environment = @environment
|
448
443
|
|
449
|
-
|
450
|
-
Puppet.push_context(
|
451
|
-
{
|
452
|
-
:current_environment => new_env,
|
453
|
-
:loaders => Puppet::Pops::Loaders.new(new_env, true)
|
454
|
-
},
|
455
|
-
"Local node environment #{@environment} for configurer transaction"
|
456
|
-
)
|
444
|
+
push_current_environment_and_loaders
|
457
445
|
|
458
446
|
query_options, facts = get_facts(options)
|
459
447
|
query_options[:configured_environment] = configured_environment
|
@@ -649,6 +637,17 @@ class Puppet::Configurer
|
|
649
637
|
end
|
650
638
|
end
|
651
639
|
|
640
|
+
def push_current_environment_and_loaders
|
641
|
+
new_env = Puppet::Node::Environment.remote(@environment)
|
642
|
+
Puppet.push_context(
|
643
|
+
{
|
644
|
+
:current_environment => new_env,
|
645
|
+
:loaders => Puppet::Pops::Loaders.new(new_env, true)
|
646
|
+
},
|
647
|
+
"Local node environment #{@environment} for configurer transaction"
|
648
|
+
)
|
649
|
+
end
|
650
|
+
|
652
651
|
def retrieve_catalog_from_cache(query_options)
|
653
652
|
result = nil
|
654
653
|
@duration = thinmark do
|
data/lib/puppet/file_system.rb
CHANGED
@@ -345,7 +345,8 @@ module Puppet::FileSystem
|
|
345
345
|
# value ~ will be expanded to something like /Users/Foo
|
346
346
|
#
|
347
347
|
# This method exists primarlily to resolve a Ruby deficiency where
|
348
|
-
# File.expand_path doesn't
|
348
|
+
# File.expand_path doesn't convert short paths to long paths, which is
|
349
|
+
# important when resolving the path to load.
|
349
350
|
#
|
350
351
|
# @param path [Object] a path handle produced by {#pathname}
|
351
352
|
# @return [String] a string representation of the path
|
@@ -219,16 +219,15 @@ class Closure < CallableSignature
|
|
219
219
|
def call_with_scope(scope, args)
|
220
220
|
variable_bindings = combine_values_with_parameters(scope, args)
|
221
221
|
|
222
|
-
|
223
|
-
final_args = tc.infer_set(parameters.reduce([]) do |tmp_args, param|
|
222
|
+
final_args = parameters.reduce([]) do |tmp_args, param|
|
224
223
|
if param.captures_rest
|
225
224
|
tmp_args.concat(variable_bindings[param.name])
|
226
225
|
else
|
227
226
|
tmp_args << variable_bindings[param.name]
|
228
227
|
end
|
229
|
-
end
|
228
|
+
end
|
230
229
|
|
231
|
-
if type.
|
230
|
+
if type.callable_with?(final_args, block_type)
|
232
231
|
result = catch(:next) do
|
233
232
|
@evaluator.evaluate_block_with_bindings(scope, variable_bindings, @model.body)
|
234
233
|
end
|
@@ -236,7 +235,9 @@ class Closure < CallableSignature
|
|
236
235
|
"value returned from #{closure_name}"
|
237
236
|
end
|
238
237
|
else
|
239
|
-
|
238
|
+
tc = Types::TypeCalculator.singleton
|
239
|
+
args_type = tc.infer_set(final_args)
|
240
|
+
raise ArgumentError, Types::TypeMismatchDescriber.describe_signatures(closure_name, [self], args_type)
|
240
241
|
end
|
241
242
|
end
|
242
243
|
|
@@ -309,6 +310,7 @@ class Closure < CallableSignature
|
|
309
310
|
to += param_range[1]
|
310
311
|
end
|
311
312
|
param_types = Types::PTupleType.new(types, Types::PIntegerType.new(from, to))
|
313
|
+
# The block_type for a Closure is always nil for now, see comment in block_name above
|
312
314
|
Types::PCallableType.new(param_types, nil, return_type)
|
313
315
|
end
|
314
316
|
|
@@ -237,7 +237,17 @@ Puppet::Type.type(:package).provide :pkg, :parent => Puppet::Provider::Package d
|
|
237
237
|
end
|
238
238
|
self.unhold if self.properties[:mark] == :hold
|
239
239
|
begin
|
240
|
+
tries = 1
|
241
|
+
# pkg install exits with code 7 when the image is currently in use by another process and cannot be modified
|
240
242
|
r = exec_cmd(command(:pkg), command, *args, name)
|
243
|
+
while r[:exit] == 7 do
|
244
|
+
if tries > 4
|
245
|
+
raise Puppet::Error, _("Pkg could not install %{name} after %{tries} tries. Aborting run") % { name: name, tries: tries }
|
246
|
+
end
|
247
|
+
sleep 2 ** tries
|
248
|
+
tries += 1
|
249
|
+
r = exec_cmd(command(:pkg), command, *args, name)
|
250
|
+
end
|
241
251
|
ensure
|
242
252
|
self.hold if @resource[:mark] == :hold
|
243
253
|
end
|
@@ -72,6 +72,16 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ
|
|
72
72
|
get(:comment)
|
73
73
|
end
|
74
74
|
|
75
|
+
def shell
|
76
|
+
return localshell if @resource.forcelocal?
|
77
|
+
get(:shell)
|
78
|
+
end
|
79
|
+
|
80
|
+
def home
|
81
|
+
return localhome if @resource.forcelocal?
|
82
|
+
get(:home)
|
83
|
+
end
|
84
|
+
|
75
85
|
def groups
|
76
86
|
return localgroups if @resource.forcelocal?
|
77
87
|
super
|
@@ -123,6 +133,16 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ
|
|
123
133
|
user[:gecos]
|
124
134
|
end
|
125
135
|
|
136
|
+
def localshell
|
137
|
+
user = finduser(:account, resource[:name])
|
138
|
+
user[:shell]
|
139
|
+
end
|
140
|
+
|
141
|
+
def localhome
|
142
|
+
user = finduser(:account, resource[:name])
|
143
|
+
user[:directory]
|
144
|
+
end
|
145
|
+
|
126
146
|
def localgroups
|
127
147
|
@groups_of ||= {}
|
128
148
|
group_file = '/etc/group'
|
data/lib/puppet/type/service.rb
CHANGED
@@ -272,9 +272,14 @@ module Puppet
|
|
272
272
|
|
273
273
|
newparam(:timeout, :required_features => :configurable_timeout) do
|
274
274
|
desc "Specify an optional minimum timeout (in seconds) for puppet to wait when syncing service properties"
|
275
|
-
defaultto { provider.
|
276
|
-
|
277
|
-
|
275
|
+
defaultto { provider.respond_to?(:default_timeout) ? provider.default_timeout : 10 }
|
276
|
+
|
277
|
+
munge do |value|
|
278
|
+
begin
|
279
|
+
value = value.to_i
|
280
|
+
raise if value < 1
|
281
|
+
value
|
282
|
+
rescue
|
278
283
|
raise Puppet::Error.new(_("\"%{value}\" is not a positive integer: the timeout parameter must be specified as a positive integer") % { value: value })
|
279
284
|
end
|
280
285
|
end
|
data/lib/puppet/util/autoload.rb
CHANGED
@@ -117,7 +117,7 @@ class Puppet::Util::Autoload
|
|
117
117
|
|
118
118
|
# @api private
|
119
119
|
def files_in_dir(dir, path)
|
120
|
-
dir = Pathname.new(
|
120
|
+
dir = Pathname.new(Puppet::FileSystem.expand_path(dir))
|
121
121
|
Dir.glob(File.join(dir, path, "*.rb")).collect do |file|
|
122
122
|
Pathname.new(file).relative_path_from(dir).to_s
|
123
123
|
end
|
data/lib/puppet/util/json.rb
CHANGED
@@ -60,6 +60,9 @@ module Puppet::Util
|
|
60
60
|
def self.dump(object, options = {})
|
61
61
|
if defined? MultiJson
|
62
62
|
MultiJson.dump(object, options)
|
63
|
+
elsif options.is_a?(JSON::State)
|
64
|
+
# we're being called recursively
|
65
|
+
object.to_json(options)
|
63
66
|
else
|
64
67
|
options.merge!(::JSON::PRETTY_STATE_PROTOTYPE.to_h) if options.delete(:pretty)
|
65
68
|
object.to_json(options)
|
data/lib/puppet/version.rb
CHANGED