puppet 7.11.0-x86-mingw32 → 7.14.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CODEOWNERS +1 -1
- data/Gemfile +2 -2
- data/Gemfile.lock +24 -19
- data/ext/project_data.yaml +1 -1
- data/lib/puppet/application/lookup.rb +78 -24
- data/lib/puppet/concurrent/thread_local_singleton.rb +5 -3
- data/lib/puppet/configurer.rb +74 -25
- data/lib/puppet/defaults.rb +20 -1
- data/lib/puppet/face/generate.rb +2 -0
- data/lib/puppet/file_serving/metadata.rb +3 -0
- data/lib/puppet/file_system/file_impl.rb +7 -7
- data/lib/puppet/file_system/jruby.rb +1 -1
- data/lib/puppet/file_system/path_pattern.rb +10 -15
- data/lib/puppet/file_system/uniquefile.rb +1 -1
- data/lib/puppet/file_system/windows.rb +4 -4
- data/lib/puppet/file_system.rb +3 -2
- data/lib/puppet/functions/versioncmp.rb +6 -2
- data/lib/puppet/generate/type.rb +9 -0
- data/lib/puppet/graph/simple_graph.rb +2 -1
- data/lib/puppet/http/client.rb +1 -1
- data/lib/puppet/http/redirector.rb +5 -0
- data/lib/puppet/node.rb +1 -1
- data/lib/puppet/parser/resource.rb +1 -1
- data/lib/puppet/pops/evaluator/closure.rb +7 -5
- data/lib/puppet/pops/evaluator/runtime3_resource_support.rb +1 -0
- data/lib/puppet/pops/parser/code_merger.rb +4 -4
- data/lib/puppet/pops/parser/egrammar.ra +2 -0
- data/lib/puppet/pops/parser/eparser.rb +574 -558
- data/lib/puppet/pops/serialization/to_data_converter.rb +6 -18
- data/lib/puppet/pops/validation/checker4_0.rb +7 -2
- data/lib/puppet/provider/package/pkg.rb +10 -0
- data/lib/puppet/provider/service/init.rb +5 -4
- data/lib/puppet/provider/user/useradd.rb +20 -0
- data/lib/puppet/resource/catalog.rb +1 -1
- data/lib/puppet/resource/type_collection.rb +21 -17
- data/lib/puppet/resource.rb +38 -5
- data/lib/puppet/ssl/verifier.rb +3 -1
- data/lib/puppet/transaction/persistence.rb +22 -12
- data/lib/puppet/type/file/data_sync.rb +1 -1
- data/lib/puppet/type/file/group.rb +8 -1
- data/lib/puppet/type/file/owner.rb +8 -1
- data/lib/puppet/type/service.rb +8 -3
- data/lib/puppet/type/user.rb +41 -39
- data/lib/puppet/util/autoload.rb +1 -1
- data/lib/puppet/util/json.rb +20 -0
- data/lib/puppet/util/log.rb +7 -2
- data/lib/puppet/util/monkey_patches.rb +26 -2
- data/lib/puppet/util/package.rb +25 -16
- data/lib/puppet/util/windows/service.rb +0 -5
- data/lib/puppet/util/windows.rb +3 -0
- data/lib/puppet/util/yaml.rb +16 -1
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet.rb +1 -0
- data/locales/puppet.pot +5 -9737
- data/man/man5/puppet.conf.5 +21 -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 +9 -6
- 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/fixtures/integration/application/agent/cached_deferred_catalog.json +2 -1
- data/spec/fixtures/unit/forge/bacula.json +1 -1
- data/spec/integration/application/agent_spec.rb +28 -0
- data/spec/integration/application/lookup_spec.rb +32 -6
- data/spec/integration/parser/pcore_resource_spec.rb +20 -0
- data/spec/shared_contexts/l10n.rb +5 -0
- data/spec/unit/application/lookup_spec.rb +131 -10
- data/spec/unit/concurrent/thread_local_singleton_spec.rb +39 -0
- data/spec/unit/configurer_spec.rb +167 -60
- data/spec/unit/face/generate_spec.rb +64 -0
- data/spec/unit/file_system/uniquefile_spec.rb +7 -1
- data/spec/unit/file_system_spec.rb +34 -4
- data/spec/unit/forge/module_release_spec.rb +3 -3
- data/spec/unit/functions/versioncmp_spec.rb +40 -4
- data/spec/unit/http/client_spec.rb +58 -1
- data/spec/unit/network/formats_spec.rb +6 -0
- data/spec/unit/node_spec.rb +6 -0
- data/spec/unit/pops/parser/parse_containers_spec.rb +2 -2
- data/spec/unit/pops/serialization/to_from_hr_spec.rb +0 -58
- data/spec/unit/pops/validator/validator_spec.rb +5 -0
- data/spec/unit/provider/package/pkg_spec.rb +15 -0
- data/spec/unit/provider/service/gentoo_spec.rb +6 -5
- data/spec/unit/provider/service/init_spec.rb +15 -9
- data/spec/unit/provider/service/openwrt_spec.rb +21 -29
- data/spec/unit/provider/service/redhat_spec.rb +3 -2
- data/spec/unit/provider/user/useradd_spec.rb +40 -0
- data/spec/unit/resource/catalog_spec.rb +14 -1
- data/spec/unit/resource_spec.rb +58 -2
- data/spec/unit/transaction/persistence_spec.rb +51 -0
- data/spec/unit/type/file/group_spec.rb +7 -0
- data/spec/unit/type/file/owner_spec.rb +7 -0
- data/spec/unit/type/service_spec.rb +27 -0
- data/spec/unit/type/user_spec.rb +67 -45
- data/spec/unit/util/autoload_spec.rb +25 -8
- data/spec/unit/util/json_spec.rb +126 -0
- data/spec/unit/util/yaml_spec.rb +37 -13
- metadata +15 -5
data/lib/puppet/util/package.rb
CHANGED
@@ -1,6 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Puppet::Util::Package
|
2
|
-
def versioncmp(version_a, version_b)
|
3
|
+
def versioncmp(version_a, version_b, ignore_trailing_zeroes = false)
|
3
4
|
vre = /[-.]|\d+|[^-.\d]+/
|
5
|
+
|
6
|
+
if ignore_trailing_zeroes
|
7
|
+
version_a = normalize(version_a)
|
8
|
+
version_b = normalize(version_b)
|
9
|
+
end
|
10
|
+
|
4
11
|
ax = version_a.scan(vre)
|
5
12
|
bx = version_b.scan(vre)
|
6
13
|
|
@@ -8,24 +15,26 @@ module Puppet::Util::Package
|
|
8
15
|
a = ax.shift
|
9
16
|
b = bx.shift
|
10
17
|
|
11
|
-
if
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
elsif (a =~ /^\d+$/ && b =~ /^\d+$/) then
|
19
|
-
if( a =~ /^0/ or b =~ /^0/ ) then
|
20
|
-
return a.to_s.upcase <=> b.to_s.upcase
|
21
|
-
end
|
18
|
+
next if a == b
|
19
|
+
return -1 if a == '-'
|
20
|
+
return 1 if b == '-'
|
21
|
+
return -1 if a == '.'
|
22
|
+
return 1 if b == '.'
|
23
|
+
if a =~ /^\d+$/ && b =~ /^\d+$/
|
24
|
+
return a.to_s.upcase <=> b.to_s.upcase if a =~ /^0/ || b =~ /^0/
|
22
25
|
return a.to_i <=> b.to_i
|
23
|
-
else
|
24
|
-
return a.upcase <=> b.upcase
|
25
26
|
end
|
27
|
+
return a.upcase <=> b.upcase
|
26
28
|
end
|
27
|
-
version_a <=> version_b
|
29
|
+
version_a <=> version_b
|
28
30
|
end
|
29
|
-
|
30
31
|
module_function :versioncmp
|
32
|
+
|
33
|
+
def self.normalize(version)
|
34
|
+
version = version.split('-')
|
35
|
+
version.first.sub!(/([\.0]+)$/, '')
|
36
|
+
|
37
|
+
version.join('-')
|
38
|
+
end
|
39
|
+
private_class_method :normalize
|
31
40
|
end
|
@@ -18,11 +18,6 @@ module Puppet::Util::Windows
|
|
18
18
|
include Puppet::FFI::Windows::Functions
|
19
19
|
extend Puppet::FFI::Windows::Functions
|
20
20
|
|
21
|
-
# integer value of the floor for timeouts when waiting for service pending states.
|
22
|
-
# puppet will wait the length of dwWaitHint if it is longer than this value, but
|
23
|
-
# no shorter
|
24
|
-
DEFAULT_TIMEOUT = 30
|
25
|
-
|
26
21
|
# Returns true if the service exists, false otherwise.
|
27
22
|
#
|
28
23
|
# @param [String] service_name name of the service
|
data/lib/puppet/util/windows.rb
CHANGED
data/lib/puppet/util/yaml.rb
CHANGED
@@ -24,7 +24,11 @@ module Puppet::Util::Yaml
|
|
24
24
|
# @raise [YamlLoadException] If deserialization fails.
|
25
25
|
# @return The parsed YAML, which can be Hash, Array or scalar types.
|
26
26
|
def self.safe_load(yaml, allowed_classes = [], filename = nil)
|
27
|
-
|
27
|
+
if Gem::Version.new(Psych::VERSION) >= Gem::Version.new('3.1.0')
|
28
|
+
data = YAML.safe_load(yaml, permitted_classes: allowed_classes, aliases: true, filename: filename)
|
29
|
+
else
|
30
|
+
data = YAML.safe_load(yaml, allowed_classes, [], true, filename)
|
31
|
+
end
|
28
32
|
data = false if data.nil?
|
29
33
|
data
|
30
34
|
rescue ::Psych::DisallowedClass => detail
|
@@ -42,6 +46,17 @@ module Puppet::Util::Yaml
|
|
42
46
|
safe_load(yaml, allowed_classes, filename)
|
43
47
|
end
|
44
48
|
|
49
|
+
# Safely load the content from a file as YAML if
|
50
|
+
# contents are in valid format. This method does not
|
51
|
+
# raise error but returns `nil` when invalid file is
|
52
|
+
# given.
|
53
|
+
def self.safe_load_file_if_valid(filename, allowed_classes = [])
|
54
|
+
safe_load_file(filename, allowed_classes)
|
55
|
+
rescue YamlLoadError, ArgumentError, Errno::ENOENT => detail
|
56
|
+
Puppet.debug("Could not retrieve YAML content from '#{filename}': #{detail.message}")
|
57
|
+
nil
|
58
|
+
end
|
59
|
+
|
45
60
|
def self.dump(structure, filename)
|
46
61
|
Puppet::FileSystem.replace_file(filename, 0660) do |fh|
|
47
62
|
YAML.dump(structure, fh)
|
data/lib/puppet/version.rb
CHANGED
data/lib/puppet.rb
CHANGED