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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f258b4a13c64598da41b7aef050413f9533219989693547c29bcf1557609959
4
- data.tar.gz: 3bd79431f6abc51a625dae8b78da408b533e440d7cfc42c2a878e59f55fb6f7d
3
+ metadata.gz: bf9b607f89bdfd3d844ef57c3d1b4f6e0d873a00d30ae6a2ac8ba9ec749fd1d1
4
+ data.tar.gz: d22b5af8fcd9df1a6e3749830e06c558944793578952d6b2f1399820df92c8ce
5
5
  SHA512:
6
- metadata.gz: c415c399a32e7d9f3f8abe23d79997c57f876cf46b0ba9c5ffb309ebb6be10a54eef663306c684246f546885e95415c2922e52575a218011227a787e8ecc77a1
7
- data.tar.gz: 2be4e2e2af5366b2ac39db427d06c18ef6780e2e317fa01ff2f6ac4b6b69c98488155443c53e3d0c796dfb1c610b96f9e13b58fd762ae47724fd2015579bd8a4
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 + 2006 and you get
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, 5, 01)
335
- logger.warn("This release of #{ChefUtils::Dist::Infra::PRODUCT} became end of life (EOL) on May 1st #{eol_year}. Please update to a supported release to receive new features, bug fixes, and security updates.")
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
 
@@ -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
- merged_attributes.read(*path)
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
- merged_attributes.read!(*path)
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
- merged_attributes.exist?(*path)
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.clear
40
+ deep_merge_cache.regular_clear
41
41
  else
42
- deep_merge_cache.delete(path.to_s)
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[key.to_s] = merged_attributes(key)
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.")
@@ -13,8 +13,6 @@
13
13
  @minimal_ohai
14
14
  @named_run_list
15
15
  @no_proxy
16
- @ohai_disabled_plugins
17
- @ohai_optional_plugins
18
16
  @pid_file
19
17
  @policy_group
20
18
  @policy_name
data/lib/chef/version.rb CHANGED
@@ -23,7 +23,7 @@ require_relative "version_string"
23
23
 
24
24
  class Chef
25
25
  CHEF_ROOT = File.expand_path("..", __dir__)
26
- VERSION = Chef::VersionString.new("16.17.18")
26
+ VERSION = Chef::VersionString.new("16.18.0")
27
27
  end
28
28
 
29
29
  #
@@ -41,6 +41,10 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do
41
41
  provider
42
42
  end
43
43
 
44
+ before(:all) do
45
+ ENV["Path"] = ENV.delete("Path")
46
+ end
47
+
44
48
  context "installing a package" do
45
49
  after { remove_package }
46
50
 
@@ -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", 15)
314
- allow(Time).to receive(:now).and_return(Time.new(2021, 5, 1, 5))
315
- expect(logger).to receive(:warn).with(/This release of.*became end of life \(EOL\) on May 1st 2021/)
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", 15)
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
- describe Chef::Resource::ArchiveFile do
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) }
@@ -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.17.18
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: 2021-12-01 00:00:00.000000000 Z
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.17.18
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.17.18
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.17.18
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.17.18
40
+ version: 16.18.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: train-core
43
43
  requirement: !ruby/object:Gem::Requirement