chef 16.11.7-universal-mingw32 → 16.12.3-universal-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/distro/ruby_bin_folder/AMD64/Chef.PowerShell.Wrapper.dll +0 -0
  3. data/distro/ruby_bin_folder/AMD64/Chef.PowerShell.dll +0 -0
  4. data/distro/ruby_bin_folder/AMD64/Newtonsoft.Json.dll +0 -0
  5. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll +0 -0
  6. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dll +0 -0
  7. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdb +0 -0
  8. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.NETCore.App.deps.json +153 -149
  9. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Diagnostics.dll +0 -0
  10. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Management.dll +0 -0
  11. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Utility.dll +0 -0
  12. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.ConsoleHost.dll +0 -0
  13. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.CoreCLR.Eventing.dll +0 -0
  14. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.MarkdownRender.dll +0 -0
  15. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Security.dll +0 -0
  16. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Management.dll +0 -0
  17. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Runtime.dll +0 -0
  18. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/Newtonsoft.Json.dll +0 -0
  19. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.Messages.dll +0 -0
  20. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.dll +0 -0
  21. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Common.dll +0 -0
  22. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Management.Automation.dll +0 -0
  23. data/distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Pkcs.dll +0 -0
  24. data/distro/ruby_bin_folder/x86/Chef.PowerShell.dll +0 -0
  25. data/distro/ruby_bin_folder/x86/Chef.Powershell.Wrapper.dll +0 -0
  26. data/distro/ruby_bin_folder/x86/Newtonsoft.Json.dll +0 -0
  27. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.PowerShell.Wrapper.Core.dll +0 -0
  28. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.dll +0 -0
  29. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Chef.Powershell.Core.pdb +0 -0
  30. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.NETCore.App.deps.json +153 -149
  31. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Diagnostics.dll +0 -0
  32. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Management.dll +0 -0
  33. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Commands.Utility.dll +0 -0
  34. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.ConsoleHost.dll +0 -0
  35. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.CoreCLR.Eventing.dll +0 -0
  36. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.MarkdownRender.dll +0 -0
  37. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.PowerShell.Security.dll +0 -0
  38. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Management.dll +0 -0
  39. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Microsoft.WSMan.Runtime.dll +0 -0
  40. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/Newtonsoft.Json.dll +0 -0
  41. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.Messages.dll +0 -0
  42. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.dll +0 -0
  43. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Drawing.Common.dll +0 -0
  44. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Management.Automation.dll +0 -0
  45. data/distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Security.Cryptography.Pkcs.dll +0 -0
  46. data/lib/chef/provider/file.rb +1 -1
  47. data/lib/chef/provider/mount.rb +7 -2
  48. data/lib/chef/provider/service/macosx.rb +3 -3
  49. data/lib/chef/resource/chef_client_launchd.rb +1 -1
  50. data/lib/chef/version.rb +1 -1
  51. data/spec/functional/resource/cron_spec.rb +1 -1
  52. data/spec/spec_helper.rb +1 -0
  53. data/spec/support/platform_helpers.rb +4 -0
  54. data/spec/support/shared/unit/provider/file.rb +14 -0
  55. data/spec/unit/provider/mount/mount_spec.rb +51 -0
  56. data/spec/unit/provider/service/macosx_spec.rb +3 -3
  57. metadata +8 -6
@@ -338,7 +338,7 @@ class Chef
338
338
  raise Chef::Exceptions::ChecksumMismatch.new(short_cksum(new_resource.checksum), short_cksum(tempfile_checksum))
339
339
  end
340
340
 
341
- if tempfile
341
+ if tempfile && contents_changed?
342
342
  new_resource.verify.each do |v|
343
343
  unless v.verify(tempfile.path)
344
344
  backupfile = "#{Chef::Config[:file_cache_path]}/failed_validations/#{::File.basename(tempfile.path)}"
@@ -175,8 +175,13 @@ class Chef
175
175
 
176
176
  # Returns the new_resource device as per device_type
177
177
  def device_fstab
178
- # Removed "/" from the end of str, because it was causing idempotency issue.
179
- device = @new_resource.device == "/" ? @new_resource.device : @new_resource.device.chomp("/")
178
+ # Removed "/" from the end of str unless it's a network mount, because it was causing idempotency issue.
179
+ device =
180
+ if @new_resource.device == "/" || @new_resource.device.match?(":/$")
181
+ @new_resource.device
182
+ else
183
+ @new_resource.device.chomp("/")
184
+ end
180
185
  case @new_resource.device_type
181
186
  when :device
182
187
  device
@@ -169,12 +169,12 @@ class Chef
169
169
 
170
170
  def load_service
171
171
  session = @session_type ? "-S #{@session_type} " : ""
172
- cmd = "launchctl load -w " + session + @plist
172
+ cmd = "/bin/launchctl load -w " + session + @plist
173
173
  shell_out_as_user(cmd)
174
174
  end
175
175
 
176
176
  def unload_service
177
- cmd = "launchctl unload -w " + @plist
177
+ cmd = "/bin/launchctl unload -w " + @plist
178
178
  shell_out_as_user(cmd)
179
179
  end
180
180
 
@@ -190,7 +190,7 @@ class Chef
190
190
  def set_service_status
191
191
  return if @plist.nil? || @service_label.to_s.empty?
192
192
 
193
- cmd = "launchctl list #{@service_label}"
193
+ cmd = "/bin/launchctl list #{@service_label}"
194
194
  res = shell_out_as_user(cmd)
195
195
 
196
196
  if res.exitstatus == 0
@@ -134,7 +134,7 @@ class Chef
134
134
  standard_error_path ::File.join(new_resource.log_directory, new_resource.log_file_name)
135
135
  program_arguments ["/bin/bash",
136
136
  "-c",
137
- "echo; echo #{ChefUtils::Dist::Infra::PRODUCT} launchd daemon config has been updated. Manually unloading and reloading the daemon; echo Now unloading the daemon; launchctl unload /Library/LaunchDaemons/com.#{ChefUtils::Dist::Infra::SHORT}.#{ChefUtils::Dist::Infra::CLIENT}.plist; sleep 2; echo Now loading the daemon; launchctl load /Library/LaunchDaemons/com.#{ChefUtils::Dist::Infra::SHORT}.#{ChefUtils::Dist::Infra::CLIENT}.plist"]
137
+ "echo; echo #{ChefUtils::Dist::Infra::PRODUCT} launchd daemon config has been updated. Manually unloading and reloading the daemon; echo Now unloading the daemon; /bin/launchctl unload /Library/LaunchDaemons/com.#{ChefUtils::Dist::Infra::SHORT}.#{ChefUtils::Dist::Infra::CLIENT}.plist; sleep 2; echo Now loading the daemon; /bin/launchctl load /Library/LaunchDaemons/com.#{ChefUtils::Dist::Infra::SHORT}.#{ChefUtils::Dist::Infra::CLIENT}.plist"]
138
138
  action :enable # enable creates the plist & triggers service restarts on change
139
139
  end
140
140
 
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.11.7")
26
+ VERSION = Chef::VersionString.new("16.12.3")
27
27
  end
28
28
 
29
29
  #
@@ -19,7 +19,7 @@
19
19
  require "spec_helper"
20
20
  require "chef/mixin/shell_out"
21
21
 
22
- describe Chef::Resource::Cron, :requires_root, :unix_only do
22
+ describe Chef::Resource::Cron, :requires_root, :unix_only, :not_macos_gte_11 do
23
23
 
24
24
  include Chef::Mixin::ShellOut
25
25
 
data/spec/spec_helper.rb CHANGED
@@ -145,6 +145,7 @@ RSpec.configure do |config|
145
145
  config.filter_run_excluding macos_only: true unless macos?
146
146
  config.filter_run_excluding macos_1013: true unless macos_1013?
147
147
  config.filter_run_excluding macos_gte_1014: true unless macos_gte_1014?
148
+ config.filter_run_excluding not_macos_gte_11: true if macos_gte_11?
148
149
  config.filter_run_excluding not_supported_on_aix: true if aix?
149
150
  config.filter_run_excluding not_supported_on_solaris: true if solaris?
150
151
  config.filter_run_excluding not_supported_on_gce: true if gce?
@@ -122,6 +122,10 @@ def macos?
122
122
  RUBY_PLATFORM.include?("darwin")
123
123
  end
124
124
 
125
+ def macos_gte_11?
126
+ macos? && !!(ohai[:platform_version].to_i >= 11)
127
+ end
128
+
125
129
  def solaris?
126
130
  RUBY_PLATFORM.include?("solaris")
127
131
  end
@@ -479,12 +479,14 @@ shared_examples_for Chef::Provider::File do
479
479
  it "calls #verify on each verification with tempfile path" do
480
480
  provider.new_resource.verify windows? ? "REM" : "true"
481
481
  provider.new_resource.verify windows? ? "REM" : "true"
482
+ allow(provider).to receive(:contents_changed?).and_return(true)
482
483
  provider.send(:do_validate_content)
483
484
  end
484
485
 
485
486
  it "raises an exception if any verification fails" do
486
487
  allow(File).to receive(:directory?).with("C:\\Windows\\system32/cmd.exe").and_return(false)
487
488
  allow(provider).to receive(:tempfile).and_return(tempfile)
489
+ allow(provider).to receive(:contents_changed?).and_return(true)
488
490
  provider.new_resource.verify windows? ? "cmd.exe c exit 1" : "false"
489
491
  provider.new_resource.verify.each do |v|
490
492
  allow(v).to receive(:verify).and_return(false)
@@ -492,9 +494,21 @@ shared_examples_for Chef::Provider::File do
492
494
  expect { provider.send(:do_validate_content) }.to raise_error(Chef::Exceptions::ValidationFailed)
493
495
  end
494
496
 
497
+ it "does not run verifications when the contents did not change" do
498
+ allow(File).to receive(:directory?).with("C:\\Windows\\system32/cmd.exe").and_return(false)
499
+ allow(provider).to receive(:tempfile).and_return(tempfile)
500
+ allow(provider).to receive(:contents_changed?).and_return(false)
501
+ provider.new_resource.verify windows? ? "cmd.exe c exit 1" : "false"
502
+ provider.new_resource.verify.each do |v|
503
+ expect(v).not_to receive(:verify)
504
+ end
505
+ provider.send(:do_validate_content)
506
+ end
507
+
495
508
  it "does not show verification for sensitive resources" do
496
509
  allow(File).to receive(:directory?).with("C:\\Windows\\system32/cmd.exe").and_return(false)
497
510
  allow(provider).to receive(:tempfile).and_return(tempfile)
511
+ allow(provider).to receive(:contents_changed?).and_return(true)
498
512
  provider.new_resource.sensitive true
499
513
  provider.new_resource.verify windows? ? "cmd.exe c exit 1" : "false"
500
514
  provider.new_resource.verify.each do |v|
@@ -506,6 +506,57 @@ describe Chef::Provider::Mount::Mount do
506
506
  end
507
507
  end
508
508
 
509
+ context "network mount" do
510
+ before(:each) do
511
+ @node = Chef::Node.new
512
+ @events = Chef::EventDispatch::Dispatcher.new
513
+ @run_context = Chef::RunContext.new(@node, {}, @events)
514
+
515
+ @new_resource = Chef::Resource::Mount.new("/tmp/bar")
516
+ @new_resource.device "cephserver:6789:/"
517
+ @new_resource.device_type :device
518
+ @new_resource.fstype "cephfs"
519
+
520
+ @new_resource.supports remount: false
521
+
522
+ @provider = Chef::Provider::Mount::Mount.new(@new_resource, @run_context)
523
+
524
+ allow(::File).to receive(:exists?).with("cephserver:6789:/").and_return true
525
+ allow(::File).to receive(:exists?).with("/tmp/bar").and_return true
526
+ allow(::File).to receive(:realpath).with("cephserver:6789:/").and_return "cephserver:6789:/"
527
+ allow(::File).to receive(:realpath).with("/tmp/bar").and_return "/tmp/foo"
528
+ end
529
+
530
+ before do
531
+ @current_resource = Chef::Resource::Mount.new("/tmp/foo")
532
+ @current_resource.device "cephserver:6789:/"
533
+ @current_resource.device_type :device
534
+ @current_resource.fstype "cephfs"
535
+
536
+ @provider.current_resource = @current_resource
537
+ end
538
+
539
+ it "should enable network mount if enabled isn't true" do
540
+ @current_resource.enabled(false)
541
+
542
+ @fstab = StringIO.new
543
+ allow(::File).to receive(:open).with("/etc/fstab", "a").and_yield(@fstab)
544
+ @provider.enable_fs
545
+ expect(@fstab.string).to match(%r{^cephserver:6789:/\s+/tmp/bar\s+cephfs\s+defaults\s+0\s+2\s*$})
546
+ end
547
+
548
+ it "should not enable network if enabled is true and resources match" do
549
+ @current_resource.enabled(true)
550
+ @current_resource.fstype("cephfs")
551
+ @current_resource.options(["defaults"])
552
+ @current_resource.dump(0)
553
+ @current_resource.pass(2)
554
+ expect(::File).not_to receive(:open).with("/etc/fstab", "a")
555
+
556
+ @provider.enable_fs
557
+ end
558
+ end
559
+
509
560
  # the fstab might contain the mount with the device as a device but the resource has a label.
510
561
  # we should not create two mount lines, but update the existing one
511
562
  # not supported on solaris because it can't cope with a UUID device type
@@ -78,7 +78,7 @@ describe Chef::Provider::Service::Macosx do
78
78
  @getpwuid = double("Etc::Passwd", { name: "mikedodge04" })
79
79
  allow(Etc).to receive(:getpwuid).and_return(@getpwuid)
80
80
  allow(node).to receive(:[]).with("platform_version").and_return("10.11.1")
81
- cmd = "launchctl list #{service_label}"
81
+ cmd = "/bin/launchctl list #{service_label}"
82
82
  allow(provider).to receive(:shell_out)
83
83
  .with(/(#{su_cmd} '#{cmd}'|#{cmd})/, default_env: false)
84
84
  .and_return(double("Status",
@@ -265,7 +265,7 @@ describe Chef::Provider::Service::Macosx do
265
265
  end
266
266
 
267
267
  it "starts service via launchctl if service found" do
268
- cmd = "launchctl load -w " + session + plist
268
+ cmd = "/bin/launchctl load -w " + session + plist
269
269
  expect(provider).to receive(:shell_out)
270
270
  .with(/(#{su_cmd} .#{cmd}.|#{cmd})/, default_env: false)
271
271
  .and_return(0)
@@ -297,7 +297,7 @@ describe Chef::Provider::Service::Macosx do
297
297
  end
298
298
 
299
299
  it "stops the service via launchctl if service found" do
300
- cmd = "launchctl unload -w " + plist
300
+ cmd = "/bin/launchctl unload -w " + plist
301
301
  expect(provider).to receive(:shell_out)
302
302
  .with(/(#{su_cmd} .#{cmd}.|#{cmd})/, default_env: false)
303
303
  .and_return(0)
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.11.7
4
+ version: 16.12.3
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-03-17 00:00:00.000000000 Z
11
+ date: 2021-04-03 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.11.7
19
+ version: 16.12.3
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.11.7
26
+ version: 16.12.3
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.11.7
33
+ version: 16.12.3
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.11.7
40
+ version: 16.12.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: train-core
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -852,6 +852,7 @@ files:
852
852
  - distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Contracts.dll
853
853
  - distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Debug.dll
854
854
  - distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.DiagnosticSource.dll
855
+ - distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.Messages.dll
855
856
  - distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.dll
856
857
  - distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.FileVersionInfo.dll
857
858
  - distro/ruby_bin_folder/AMD64/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Process.dll
@@ -1156,6 +1157,7 @@ files:
1156
1157
  - distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Contracts.dll
1157
1158
  - distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Debug.dll
1158
1159
  - distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.DiagnosticSource.dll
1160
+ - distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.Messages.dll
1159
1161
  - distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.EventLog.dll
1160
1162
  - distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.FileVersionInfo.dll
1161
1163
  - distro/ruby_bin_folder/x86/shared/Microsoft.NETCore.App/5.0.0/System.Diagnostics.Process.dll