chef 16.17.51-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: e393b6b1ef502963fc7b6638e4026c754569d53b6f8812d933cf1b92f5ff1da8
4
- data.tar.gz: 9d268133ba1992db7a357933c6e9c3de040501bc55d4dda1f364f17319ff6961
3
+ metadata.gz: bf9b607f89bdfd3d844ef57c3d1b4f6e0d873a00d30ae6a2ac8ba9ec749fd1d1
4
+ data.tar.gz: d22b5af8fcd9df1a6e3749830e06c558944793578952d6b2f1399820df92c8ce
5
5
  SHA512:
6
- metadata.gz: 9546d5fc6f9829b8e43166f51885b10b5d9fb4e32222a69e1457bf86d2265d88183c14b3bc0875c1f3851652f91f7514b1c5f935eb9d6fd80c3680209353e463
7
- data.tar.gz: c80518566e1d96223de075c3790b15d21817b73099ac698169b0961c35b759d51a290035e717c1a6eb96546a984cc30e0f01ea001ab668724ba8b496cc4b2fe5
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
 
@@ -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.51")
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)
@@ -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.51
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: 2022-02-16 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.51
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.51
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.51
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.51
40
+ version: 16.18.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: train-core
43
43
  requirement: !ruby/object:Gem::Requirement