chef 17.1.35 → 17.2.29

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/lib/chef/action_collection.rb +6 -26
  4. data/lib/chef/application.rb +1 -1
  5. data/lib/chef/application/base.rb +15 -0
  6. data/lib/chef/client.rb +6 -0
  7. data/lib/chef/cookbook_version.rb +26 -4
  8. data/lib/chef/data_bag.rb +2 -1
  9. data/lib/chef/data_bag_item.rb +2 -1
  10. data/lib/chef/data_collector.rb +0 -1
  11. data/lib/chef/data_collector/run_end_message.rb +1 -1
  12. data/lib/chef/deprecated.rb +4 -0
  13. data/lib/chef/event_dispatch/base.rb +2 -1
  14. data/lib/chef/exceptions.rb +3 -0
  15. data/lib/chef/handler.rb +46 -8
  16. data/lib/chef/handler/slow_report.rb +66 -0
  17. data/lib/chef/node.rb +20 -19
  18. data/lib/chef/provider/support/zypper_repo.erb +4 -2
  19. data/lib/chef/provider/zypper_repository.rb +27 -31
  20. data/lib/chef/resource/alternatives.rb +5 -5
  21. data/lib/chef/resource/apt_preference.rb +2 -2
  22. data/lib/chef/resource/apt_repository.rb +2 -2
  23. data/lib/chef/resource/apt_update.rb +4 -4
  24. data/lib/chef/resource/build_essential.rb +1 -1
  25. data/lib/chef/resource/chef_client_config.rb +3 -3
  26. data/lib/chef/resource/chef_client_cron.rb +2 -2
  27. data/lib/chef/resource/chef_client_launchd.rb +2 -2
  28. data/lib/chef/resource/chef_client_scheduled_task.rb +14 -14
  29. data/lib/chef/resource/chef_client_systemd_timer.rb +2 -2
  30. data/lib/chef/resource/chef_handler.rb +2 -2
  31. data/lib/chef/resource/chef_sleep.rb +1 -1
  32. data/lib/chef/resource/chocolatey_feature.rb +2 -2
  33. data/lib/chef/resource/chocolatey_source.rb +1 -1
  34. data/lib/chef/resource/cron/cron_d.rb +4 -6
  35. data/lib/chef/resource/cron_access.rb +1 -1
  36. data/lib/chef/resource/dmg_package.rb +1 -1
  37. data/lib/chef/resource/group.rb +4 -4
  38. data/lib/chef/resource/homebrew_cask.rb +17 -6
  39. data/lib/chef/resource/homebrew_package.rb +1 -1
  40. data/lib/chef/resource/homebrew_tap.rb +4 -3
  41. data/lib/chef/resource/homebrew_update.rb +2 -2
  42. data/lib/chef/resource/hostname.rb +49 -7
  43. data/lib/chef/resource/inspec_waiver_file_entry.rb +6 -5
  44. data/lib/chef/resource/kernel_module.rb +6 -6
  45. data/lib/chef/resource/locale.rb +1 -1
  46. data/lib/chef/resource/macos_userdefaults.rb +2 -2
  47. data/lib/chef/resource/ohai_hint.rb +2 -6
  48. data/lib/chef/resource/openbsd_package.rb +17 -0
  49. data/lib/chef/resource/openssl_dhparam.rb +1 -2
  50. data/lib/chef/resource/openssl_ec_private_key.rb +1 -3
  51. data/lib/chef/resource/openssl_ec_public_key.rb +1 -3
  52. data/lib/chef/resource/openssl_rsa_private_key.rb +1 -3
  53. data/lib/chef/resource/openssl_rsa_public_key.rb +1 -3
  54. data/lib/chef/resource/openssl_x509_certificate.rb +1 -4
  55. data/lib/chef/resource/openssl_x509_crl.rb +1 -3
  56. data/lib/chef/resource/openssl_x509_request.rb +1 -3
  57. data/lib/chef/resource/osx_profile.rb +3 -3
  58. data/lib/chef/resource/plist.rb +1 -1
  59. data/lib/chef/resource/powershell_package_source.rb +2 -4
  60. data/lib/chef/resource/reboot.rb +38 -9
  61. data/lib/chef/resource/remote_directory.rb +2 -2
  62. data/lib/chef/resource/rhsm_errata.rb +0 -2
  63. data/lib/chef/resource/rhsm_errata_level.rb +1 -5
  64. data/lib/chef/resource/rhsm_repo.rb +15 -0
  65. data/lib/chef/resource/ssh_known_hosts_entry.rb +4 -7
  66. data/lib/chef/resource/sudo.rb +2 -6
  67. data/lib/chef/resource/swap_file.rb +2 -6
  68. data/lib/chef/resource/sysctl.rb +2 -2
  69. data/lib/chef/resource/timezone.rb +1 -1
  70. data/lib/chef/resource/user_ulimit.rb +2 -2
  71. data/lib/chef/resource/windows_ad_join.rb +2 -2
  72. data/lib/chef/resource/windows_audit_policy.rb +2 -2
  73. data/lib/chef/resource/windows_auto_run.rb +2 -2
  74. data/lib/chef/resource/windows_certificate.rb +1 -1
  75. data/lib/chef/resource/windows_dfs_folder.rb +2 -2
  76. data/lib/chef/resource/windows_dfs_namespace.rb +2 -2
  77. data/lib/chef/resource/windows_dns_record.rb +2 -2
  78. data/lib/chef/resource/windows_dns_zone.rb +2 -2
  79. data/lib/chef/resource/windows_feature.rb +3 -3
  80. data/lib/chef/resource/windows_feature_dism.rb +3 -5
  81. data/lib/chef/resource/windows_feature_powershell.rb +3 -3
  82. data/lib/chef/resource/windows_firewall_profile.rb +2 -2
  83. data/lib/chef/resource/windows_firewall_rule.rb +20 -6
  84. data/lib/chef/resource/windows_font.rb +1 -1
  85. data/lib/chef/resource/windows_pagefile.rb +103 -64
  86. data/lib/chef/resource/windows_path.rb +2 -2
  87. data/lib/chef/resource/windows_printer.rb +5 -20
  88. data/lib/chef/resource/windows_printer_port.rb +48 -65
  89. data/lib/chef/resource/windows_security_policy.rb +2 -2
  90. data/lib/chef/resource/windows_share.rb +2 -2
  91. data/lib/chef/resource/windows_shortcut.rb +1 -1
  92. data/lib/chef/resource/windows_task.rb +1 -1
  93. data/lib/chef/resource/windows_uac.rb +3 -5
  94. data/lib/chef/resource/windows_user_privilege.rb +2 -2
  95. data/lib/chef/resource/windows_workgroup.rb +2 -2
  96. data/lib/chef/resource/yum_package.rb +10 -10
  97. data/lib/chef/resource/zypper_package.rb +4 -4
  98. data/lib/chef/resource/zypper_repository.rb +28 -8
  99. data/lib/chef/resource_reporter.rb +0 -1
  100. data/lib/chef/version.rb +1 -1
  101. data/spec/functional/resource/windows_hostname_spec.rb +91 -0
  102. data/spec/functional/resource/windows_pagefile_spec.rb +98 -0
  103. data/spec/unit/cookbook_version_spec.rb +52 -0
  104. data/spec/unit/data_bag_item_spec.rb +2 -2
  105. data/spec/unit/data_bag_spec.rb +1 -1
  106. data/spec/unit/data_collector_spec.rb +47 -1
  107. data/spec/unit/handler_spec.rb +8 -2
  108. data/spec/unit/provider/zypper_repository_spec.rb +3 -10
  109. data/spec/unit/resource/windows_firewall_rule_spec.rb +12 -7
  110. data/spec/unit/resource/windows_pagefile_spec.rb +4 -9
  111. data/spec/unit/resource/zypper_repository_spec.rb +1 -1
  112. metadata +9 -6
@@ -107,13 +107,6 @@ describe Chef::Provider::ZypperRepository do
107
107
  end
108
108
  end
109
109
 
110
- describe "#cookbook_name" do
111
- it "returns 'test' when the cookbook property is set" do
112
- new_resource.cookbook("test")
113
- expect(provider.cookbook_name).to eq("test")
114
- end
115
- end
116
-
117
110
  describe "#key_type" do
118
111
  it "returns :remote_file with an http URL" do
119
112
  expect(provider.key_type("https://www.chef.io/key")).to eq(:remote_file)
@@ -167,10 +160,10 @@ describe Chef::Provider::ZypperRepository do
167
160
  end
168
161
  end
169
162
 
170
- describe "#install_gpg_key" do
171
- it "skips installing the key if a nil value for key is passed" do
163
+ describe "#install_gpg_keys" do
164
+ it "skips installing the key if an empty array for key URL is passed" do
172
165
  expect(logger).to receive(:debug)
173
- provider.install_gpg_key(nil)
166
+ provider.install_gpg_keys([])
174
167
  end
175
168
  end
176
169
  end
@@ -85,7 +85,12 @@ describe Chef::Resource::WindowsFirewallRule do
85
85
 
86
86
  it "the remote_address property accepts strings" do
87
87
  resource.remote_address("8.8.4.4")
88
- expect(resource.remote_address).to eql("8.8.4.4")
88
+ expect(resource.remote_address).to eql(["8.8.4.4"])
89
+ end
90
+
91
+ it "the remote_address property accepts comma separated lists" do
92
+ resource.remote_address(["10.17.3.101", "172.7.7.53"])
93
+ expect(resource.remote_address).to eql(%w{10.17.3.101 172.7.7.53})
89
94
  end
90
95
 
91
96
  it "the remote_port property accepts strings" do
@@ -223,8 +228,8 @@ describe Chef::Resource::WindowsFirewallRule do
223
228
  end
224
229
 
225
230
  it "aliases :remoteip to :remote_address" do
226
- resource.remoteip("8.8.8.8")
227
- expect(resource.remote_address).to eql("8.8.8.8")
231
+ resource.remoteip(["8.8.8.8"])
232
+ expect(resource.remote_address).to eql(["8.8.8.8"])
228
233
  end
229
234
 
230
235
  it "aliases :localport to :local_port" do
@@ -288,7 +293,7 @@ describe Chef::Resource::WindowsFirewallRule do
288
293
  end
289
294
 
290
295
  it "sets RemoteAddress" do
291
- resource.remote_address("8.8.8.8")
296
+ resource.remote_address(["8.8.8.8"])
292
297
  expect(provider.firewall_command("New")).to eql("New-NetFirewallRule -Name 'test_rule' -DisplayName 'test_rule' -RemoteAddress '8.8.8.8' -Direction 'inbound' -Protocol 'TCP' -IcmpType 'Any' -Action 'allow' -Profile 'any' -InterfaceType 'any' -Enabled 'true'")
293
298
  end
294
299
 
@@ -365,7 +370,7 @@ describe Chef::Resource::WindowsFirewallRule do
365
370
  resource.group("new group")
366
371
  resource.local_address("192.168.40.40")
367
372
  resource.local_port("80")
368
- resource.remote_address("8.8.4.4")
373
+ resource.remote_address(["8.8.4.4"])
369
374
  resource.remote_port("8081")
370
375
  resource.direction(:outbound)
371
376
  resource.protocol("UDP")
@@ -416,7 +421,7 @@ describe Chef::Resource::WindowsFirewallRule do
416
421
  end
417
422
 
418
423
  it "sets RemoteAddress" do
419
- resource.remote_address("8.8.8.8")
424
+ resource.remote_address(["8.8.8.8"])
420
425
  expect(provider.firewall_command("Set")).to eql("Set-NetFirewallRule -Name 'test_rule' -NewDisplayName 'test_rule' -RemoteAddress '8.8.8.8' -Direction 'inbound' -Protocol 'TCP' -IcmpType 'Any' -Action 'allow' -Profile 'any' -InterfaceType 'any' -Enabled 'true'")
421
426
  end
422
427
 
@@ -487,7 +492,7 @@ describe Chef::Resource::WindowsFirewallRule do
487
492
  resource.displayname("some cool display name")
488
493
  resource.local_address("192.168.40.40")
489
494
  resource.local_port("80")
490
- resource.remote_address("8.8.4.4")
495
+ resource.remote_address(["8.8.4.4"])
491
496
  resource.remote_port("8081")
492
497
  resource.direction(:outbound)
493
498
  resource.protocol("UDP")
@@ -18,14 +18,14 @@
18
18
  require "spec_helper"
19
19
 
20
20
  describe Chef::Resource::WindowsPagefile do
21
- let(:resource) { Chef::Resource::WindowsPagefile.new("C:\\pagefile.sys") }
21
+ let(:resource) { Chef::Resource::WindowsPagefile.new("c:\\pagefile.sys") }
22
22
 
23
23
  it "sets resource name as :windows_pagefile" do
24
24
  expect(resource.resource_name).to eql(:windows_pagefile)
25
25
  end
26
26
 
27
27
  it "the path property is the name_property" do
28
- expect(resource.path).to eql("C:\\pagefile.sys")
28
+ expect(resource.path).to eql("c:\\pagefile.sys")
29
29
  end
30
30
 
31
31
  it "sets the default action as :set" do
@@ -38,12 +38,7 @@ describe Chef::Resource::WindowsPagefile do
38
38
  end
39
39
 
40
40
  it "coerces forward slashes in the path property to back slashes" do
41
- resource.path "C:/pagefile.sys"
42
- expect(resource.path).to eql("C:\\pagefile.sys")
41
+ resource.path "c:/pagefile.sys"
42
+ expect(resource.path).to eql("c:\\pagefile.sys")
43
43
  end
44
-
45
- it "automatic_managed property defaults to false" do
46
- expect(resource.automatic_managed).to eql(false)
47
- end
48
-
49
44
  end
@@ -85,7 +85,7 @@ describe Chef::Resource::ZypperRepository do
85
85
 
86
86
  it "accepts the legacy 'key' property" do
87
87
  resource.key "foo"
88
- expect(resource.gpgkey).to eql("foo")
88
+ expect(resource.gpgkey).to eql(["foo"])
89
89
  end
90
90
 
91
91
  it "accepts the legacy 'uri' property" do
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: 17.1.35
4
+ version: 17.2.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-11 00:00:00.000000000 Z
11
+ date: 2021-06-09 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: 17.1.35
19
+ version: 17.2.29
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: 17.1.35
26
+ version: 17.2.29
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: 17.1.35
33
+ version: 17.2.29
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: 17.1.35
40
+ version: 17.2.29
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: train-core
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -681,6 +681,7 @@ files:
681
681
  - lib/chef/handler.rb
682
682
  - lib/chef/handler/error_report.rb
683
683
  - lib/chef/handler/json_file.rb
684
+ - lib/chef/handler/slow_report.rb
684
685
  - lib/chef/http.rb
685
686
  - lib/chef/http/api_versions.rb
686
687
  - lib/chef/http/auth_credentials.rb
@@ -1665,7 +1666,9 @@ files:
1665
1666
  - spec/functional/resource/windows_env_spec.rb
1666
1667
  - spec/functional/resource/windows_firewall_rule_spec.rb
1667
1668
  - spec/functional/resource/windows_font_spec.rb
1669
+ - spec/functional/resource/windows_hostname_spec.rb
1668
1670
  - spec/functional/resource/windows_package_spec.rb
1671
+ - spec/functional/resource/windows_pagefile_spec.rb
1669
1672
  - spec/functional/resource/windows_path_spec.rb
1670
1673
  - spec/functional/resource/windows_security_policy_spec.rb
1671
1674
  - spec/functional/resource/windows_share_spec.rb