chef 16.17.18-universal-mingw32 → 16.18.0-universal-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chef/client.rb +3 -3
- data/lib/chef/node/attribute.rb +20 -3
- data/lib/chef/node/mixin/deep_merge_cache.rb +4 -4
- data/lib/chef/resource/archive_file.rb +6 -6
- data/lib/chef/resource/support/client.erb +0 -2
- data/lib/chef/version.rb +1 -1
- data/spec/functional/resource/chocolatey_package_spec.rb +4 -0
- data/spec/unit/client_spec.rb +4 -4
- data/spec/unit/mixin/powershell_out_spec.rb +2 -2
- data/spec/unit/resource/archive_file_spec.rb +13 -1
- data/spec/unit/resource_spec.rb +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf9b607f89bdfd3d844ef57c3d1b4f6e0d873a00d30ae6a2ac8ba9ec749fd1d1
|
4
|
+
data.tar.gz: d22b5af8fcd9df1a6e3749830e06c558944793578952d6b2f1399820df92c8ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb0db3cbed98050af4657173aba63c150dafe108589fefb8388a2a053e249ddee38d213614c725742cf99ec1b8c9c80029563085156ec5f2b93f985d0cc60522
|
7
|
+
data.tar.gz: c6a5bc11afe72fb929457d2ecb9dd55ba1955d958e69a244a32a97f089f21772ec28b7e7af9377722783b43b18ccaa8fdfe6341bd7c58621c516de7053836ce9
|
data/lib/chef/client.rb
CHANGED
@@ -327,12 +327,12 @@ class Chef
|
|
327
327
|
def warn_if_eol
|
328
328
|
require_relative "version"
|
329
329
|
|
330
|
-
# We make a release every year so take the version you're on +
|
330
|
+
# We make a release every year so take the version you're on + 2007 and you get
|
331
331
|
# the year it goes EOL
|
332
332
|
eol_year = 2006 + Gem::Version.new(Chef::VERSION).segments.first
|
333
333
|
|
334
|
-
if Time.now > Time.new(eol_year,
|
335
|
-
logger.warn("This release of #{ChefUtils::Dist::Infra::PRODUCT} became end of life (EOL) on
|
334
|
+
if Time.now > Time.new(eol_year, 11, 30)
|
335
|
+
logger.warn("This release of #{ChefUtils::Dist::Infra::PRODUCT} became end of life (EOL) on November 30th #{eol_year}. Please update to a supported release to receive new features, bug fixes, and security updates.")
|
336
336
|
end
|
337
337
|
end
|
338
338
|
|
data/lib/chef/node/attribute.rb
CHANGED
@@ -450,17 +450,34 @@ class Chef
|
|
450
450
|
# method-style access to attributes (has to come after the prepended ImmutablizeHash)
|
451
451
|
|
452
452
|
def read(*path)
|
453
|
-
|
453
|
+
if path[0].nil?
|
454
|
+
Chef::Log.warn "Calling node.read() without any path argument is very slow, probably a bug, and should be avoided"
|
455
|
+
merged_attributes.read(*path) # re-merges everything, slow edge case
|
456
|
+
else
|
457
|
+
self[path[0]] unless path[0].nil? # force deep_merge_cache key construction if necessary
|
458
|
+
deep_merge_cache.read(*path)
|
459
|
+
end
|
454
460
|
end
|
455
461
|
|
456
462
|
alias :dig :read
|
457
463
|
|
458
464
|
def read!(*path)
|
459
|
-
|
465
|
+
if path[0].nil?
|
466
|
+
Chef::Log.warn "Calling node.read!() without any path argument is very slow, probably a bug, and should be avoided"
|
467
|
+
merged_attributes.read!(*path) # re-merges everything, slow edge case
|
468
|
+
else
|
469
|
+
self[path[0]] unless path[0].nil? # force deep_merge_cache key construction if necessary
|
470
|
+
deep_merge_cache.read!(*path)
|
471
|
+
end
|
460
472
|
end
|
461
473
|
|
462
474
|
def exist?(*path)
|
463
|
-
|
475
|
+
if path[0].nil?
|
476
|
+
true
|
477
|
+
else
|
478
|
+
self[path[0]] unless path[0].nil? # force deep_merge_cache key construction if necessary
|
479
|
+
deep_merge_cache.exist?(*path)
|
480
|
+
end
|
464
481
|
end
|
465
482
|
|
466
483
|
def write(level, *args, &block)
|
@@ -28,7 +28,7 @@ class Chef
|
|
28
28
|
@merged_attributes = nil
|
29
29
|
@combined_override = nil
|
30
30
|
@combined_default = nil
|
31
|
-
@deep_merge_cache =
|
31
|
+
@deep_merge_cache = Chef::Node::ImmutableMash.new
|
32
32
|
end
|
33
33
|
|
34
34
|
# Invalidate a key in the deep_merge_cache. If called with nil, or no arg, this will invalidate
|
@@ -37,9 +37,9 @@ class Chef
|
|
37
37
|
# must invalidate the entire cache and re-deep-merge the entire node object.
|
38
38
|
def reset_cache(path = nil)
|
39
39
|
if path.nil?
|
40
|
-
deep_merge_cache.
|
40
|
+
deep_merge_cache.regular_clear
|
41
41
|
else
|
42
|
-
deep_merge_cache.
|
42
|
+
deep_merge_cache.regular_delete(path.to_s)
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
@@ -51,7 +51,7 @@ class Chef
|
|
51
51
|
deep_merge_cache[key.to_s]
|
52
52
|
else
|
53
53
|
# save all the work of computing node[key]
|
54
|
-
deep_merge_cache
|
54
|
+
deep_merge_cache.internal_set(key.to_s, merged_attributes(key))
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
@@ -20,6 +20,12 @@
|
|
20
20
|
|
21
21
|
require_relative "../resource"
|
22
22
|
require "fileutils" unless defined?(FileUtils)
|
23
|
+
begin
|
24
|
+
# ffi-libarchive must be eager loaded see: https://github.com/chef/chef/issues/12228
|
25
|
+
require "ffi-libarchive" unless defined?(Archive::Reader)
|
26
|
+
rescue LoadError
|
27
|
+
STDERR.puts "ffi-libarchive could not be loaded, libarchive is probably not installed on system, archive_file will not be available"
|
28
|
+
end
|
23
29
|
|
24
30
|
class Chef
|
25
31
|
class Resource
|
@@ -88,8 +94,6 @@ class Chef
|
|
88
94
|
action :extract do
|
89
95
|
description "Extract and archive file."
|
90
96
|
|
91
|
-
require_libarchive
|
92
|
-
|
93
97
|
unless ::File.exist?(new_resource.path)
|
94
98
|
raise Errno::ENOENT, "No archive found at #{new_resource.path}! Cannot continue."
|
95
99
|
end
|
@@ -127,10 +131,6 @@ class Chef
|
|
127
131
|
end
|
128
132
|
|
129
133
|
action_class do
|
130
|
-
def require_libarchive
|
131
|
-
require "ffi-libarchive"
|
132
|
-
end
|
133
|
-
|
134
134
|
def define_resource_requirements
|
135
135
|
if new_resource.mode.is_a?(Integer)
|
136
136
|
Chef.deprecated(:archive_file_integer_file_mode, "The mode property should be passed to archive_file resources as a String and not an Integer to ensure the value is properly interpreted.")
|
data/lib/chef/version.rb
CHANGED
data/spec/unit/client_spec.rb
CHANGED
@@ -310,14 +310,14 @@ describe Chef::Client do
|
|
310
310
|
|
311
311
|
describe "eol release warning" do
|
312
312
|
it "warns when running an EOL release" do
|
313
|
-
stub_const("Chef::VERSION",
|
314
|
-
allow(Time).to receive(:now).and_return(Time.new(
|
315
|
-
expect(logger).to receive(:warn).with(
|
313
|
+
stub_const("Chef::VERSION", 16)
|
314
|
+
allow(Time).to receive(:now).and_return(Time.new(2022, 11, 30, 5))
|
315
|
+
expect(logger).to receive(:warn).with("This release of #{ChefUtils::Dist::Infra::PRODUCT} became end of life (EOL) on November 30th 2022. Please update to a supported release to receive new features, bug fixes, and security updates.")
|
316
316
|
client.warn_if_eol
|
317
317
|
end
|
318
318
|
|
319
319
|
it "does not warn when running an non-EOL release" do
|
320
|
-
stub_const("Chef::VERSION",
|
320
|
+
stub_const("Chef::VERSION", 16)
|
321
321
|
allow(Time).to receive(:now).and_return(Time.new(2021, 4, 31))
|
322
322
|
expect(logger).to_not receive(:warn).with(/became end of life/)
|
323
323
|
client.warn_if_eol
|
@@ -30,7 +30,7 @@ describe Chef::Mixin::PowershellOut, :windows_only do
|
|
30
30
|
it "runs a command and returns the shell_out object" do
|
31
31
|
ret = double("Mixlib::ShellOut")
|
32
32
|
expect(object).to receive(:shell_out).with(
|
33
|
-
"powershell.exe #{flags} -Command \"Get-Process\""
|
33
|
+
"powershell.exe #{flags} -Command \"Get-Process\"", {}
|
34
34
|
).and_return(ret)
|
35
35
|
expect(object.powershell_out("Get-Process")).to eql(ret)
|
36
36
|
end
|
@@ -75,7 +75,7 @@ describe Chef::Mixin::PowershellOut, :windows_only do
|
|
75
75
|
it "runs a command and returns the shell_out object" do
|
76
76
|
mixlib_shellout = double("Mixlib::ShellOut")
|
77
77
|
expect(object).to receive(:shell_out).with(
|
78
|
-
"powershell.exe #{flags} -Command \"Get-Process\""
|
78
|
+
"powershell.exe #{flags} -Command \"Get-Process\"", {}
|
79
79
|
).and_return(mixlib_shellout)
|
80
80
|
expect(mixlib_shellout).to receive(:error!)
|
81
81
|
expect(object.powershell_out!("Get-Process")).to eql(mixlib_shellout)
|
@@ -17,7 +17,19 @@
|
|
17
17
|
|
18
18
|
require "spec_helper"
|
19
19
|
|
20
|
-
|
20
|
+
begin
|
21
|
+
require "ffi-libarchive"
|
22
|
+
rescue LoadError
|
23
|
+
module Archive
|
24
|
+
class Reader
|
25
|
+
def close; end
|
26
|
+
def each_entry; end
|
27
|
+
def extract(entry, flags = 0, destination: nil); end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe Chef::Resource::ArchiveFile, :not_supported_on_aix do
|
21
33
|
let(:node) { Chef::Node.new }
|
22
34
|
let(:events) { Chef::EventDispatch::Dispatcher.new }
|
23
35
|
let(:run_context) { Chef::RunContext.new(node, {}, events) }
|
data/spec/unit/resource_spec.rb
CHANGED
@@ -931,14 +931,14 @@ describe Chef::Resource do
|
|
931
931
|
|
932
932
|
it "adds mappings for all platforms", ruby: "< 2.7" do
|
933
933
|
expect(Chef.resource_handler_map).to receive(:set).with(
|
934
|
-
:tape_deck, Chef::Resource::Klz
|
934
|
+
:tape_deck, Chef::Resource::Klz
|
935
935
|
)
|
936
936
|
klz.provides :tape_deck
|
937
937
|
end
|
938
938
|
|
939
939
|
it "adds mappings for all platforms", ruby: ">= 2.7" do
|
940
940
|
expect(Chef.resource_handler_map).to receive(:set).with(
|
941
|
-
:tape_deck, Chef::Resource::Klz
|
941
|
+
:tape_deck, Chef::Resource::Klz, {}
|
942
942
|
)
|
943
943
|
klz.provides :tape_deck
|
944
944
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 16.
|
4
|
+
version: 16.18.0
|
5
5
|
platform: universal-mingw32
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef-config
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 16.
|
19
|
+
version: 16.18.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 16.
|
26
|
+
version: 16.18.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: chef-utils
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 16.
|
33
|
+
version: 16.18.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 16.
|
40
|
+
version: 16.18.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: train-core
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|