chef 17.8.25-universal-mingw32 → 17.9.46-universal-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -3
  3. data/README.md +1 -1
  4. data/lib/chef/application/exit_code.rb +7 -21
  5. data/lib/chef/chef_fs/file_system/chef_server/cookbook_file.rb +1 -1
  6. data/lib/chef/chef_fs/file_system/repository/base_file.rb +1 -1
  7. data/lib/chef/chef_fs/file_system/repository/file_system_entry.rb +1 -1
  8. data/lib/chef/compliance/input_collection.rb +1 -1
  9. data/lib/chef/compliance/waiver_collection.rb +1 -1
  10. data/lib/chef/cookbook/syntax_check.rb +1 -1
  11. data/lib/chef/cookbook_uploader.rb +1 -1
  12. data/lib/chef/cookbook_version.rb +1 -1
  13. data/lib/chef/provider/cron.rb +2 -2
  14. data/lib/chef/provider/directory.rb +2 -2
  15. data/lib/chef/provider/ifconfig.rb +5 -5
  16. data/lib/chef/provider/package/yum/python_helper.rb +81 -25
  17. data/lib/chef/provider/package/yum.rb +39 -12
  18. data/lib/chef/provider/package.rb +5 -5
  19. data/lib/chef/provider/user/mac.rb +3 -3
  20. data/lib/chef/provider.rb +4 -1
  21. data/lib/chef/providers.rb +0 -1
  22. data/lib/chef/resource/apt_package.rb +2 -2
  23. data/lib/chef/resource/archive_file.rb +6 -6
  24. data/lib/chef/resource/chef_client_config.rb +2 -3
  25. data/lib/chef/resource/chocolatey_package.rb +3 -3
  26. data/lib/chef/resource/cron/cron.rb +75 -1
  27. data/lib/chef/resource/cron/cron_d.rb +2 -1
  28. data/lib/chef/resource/habitat/habitat_sup.rb +1 -1
  29. data/lib/chef/resource/habitat/habitat_sup_windows.rb +1 -1
  30. data/lib/chef/resource/homebrew_tap.rb +1 -5
  31. data/lib/chef/resource/inspec_waiver_file_entry.rb +1 -1
  32. data/lib/chef/resource/launchd.rb +2 -2
  33. data/lib/chef/resource/lwrp_base.rb +1 -1
  34. data/lib/chef/resource/powershell_package_source.rb +8 -8
  35. data/lib/chef/resource/remote_file.rb +1 -1
  36. data/lib/chef/resource/rhsm_register.rb +3 -3
  37. data/lib/chef/resource/windows_feature_powershell.rb +1 -2
  38. data/lib/chef/resource/windows_task.rb +25 -10
  39. data/lib/chef/resource.rb +2 -2
  40. data/lib/chef/resource_reporter.rb +1 -1
  41. data/lib/chef/run_lock.rb +1 -1
  42. data/lib/chef/secret_fetcher/azure_key_vault.rb +4 -2
  43. data/lib/chef/secret_fetcher/hashi_vault.rb +37 -3
  44. data/lib/chef/util/dsc/configuration_generator.rb +1 -1
  45. data/lib/chef/version.rb +1 -1
  46. data/spec/functional/resource/archive_file_spec.rb +3 -2
  47. data/spec/functional/resource/cookbook_file_spec.rb +1 -1
  48. data/spec/functional/resource/dnf_package_spec.rb +107 -107
  49. data/spec/functional/resource/dsc_script_spec.rb +2 -2
  50. data/spec/functional/resource/template_spec.rb +1 -1
  51. data/spec/functional/resource/yum_package_spec.rb +789 -129
  52. data/spec/integration/client/client_spec.rb +1 -1
  53. data/spec/spec_helper.rb +3 -5
  54. data/spec/support/platform_helpers.rb +1 -1
  55. data/spec/support/ruby_installer.rb +1 -1
  56. data/spec/support/shared/functional/file_resource.rb +2 -2
  57. data/spec/support/shared/functional/http.rb +9 -9
  58. data/spec/support/shared/unit/provider/useradd_based_user_provider.rb +1 -1
  59. data/spec/unit/dsl/registry_helper_spec.rb +6 -6
  60. data/spec/unit/guard_interpreter/resource_guard_interpreter_spec.rb +1 -1
  61. data/spec/unit/lwrp_spec.rb +2 -2
  62. data/spec/unit/provider/dsc_script_spec.rb +8 -8
  63. data/spec/unit/provider/group/usermod_spec.rb +2 -2
  64. data/spec/unit/provider/ifconfig/aix_spec.rb +14 -14
  65. data/spec/unit/provider/ifconfig/debian_spec.rb +1 -1
  66. data/spec/unit/provider/ifconfig/redhat_spec.rb +1 -1
  67. data/spec/unit/provider/ifconfig_spec.rb +3 -3
  68. data/spec/unit/provider/remote_file/cache_control_data_spec.rb +3 -3
  69. data/spec/unit/provider/service/gentoo_service_spec.rb +2 -2
  70. data/spec/unit/provider/service/upstart_service_spec.rb +3 -3
  71. data/spec/unit/provider/user/solaris_spec.rb +1 -1
  72. data/spec/unit/resource/archive_file_spec.rb +1 -2
  73. data/spec/unit/resource/conditional_spec.rb +4 -4
  74. data/spec/unit/resource_spec.rb +2 -2
  75. data/spec/unit/secret_fetcher/hashi_vault_spec.rb +46 -0
  76. metadata +6 -8
  77. data/lib/chef/provider/group/suse.rb +0 -82
  78. data/spec/unit/provider/group/suse_spec.rb +0 -90
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.8.25
4
+ version: 17.9.46
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-02-08 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.8.25
19
+ version: 17.9.46
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.8.25
26
+ version: 17.9.46
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.8.25
33
+ version: 17.9.46
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.8.25
40
+ version: 17.9.46
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: train-core
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -1648,7 +1648,6 @@ files:
1648
1648
  - lib/chef/provider/group/groupmod.rb
1649
1649
  - lib/chef/provider/group/pw.rb
1650
1650
  - lib/chef/provider/group/solaris.rb
1651
- - lib/chef/provider/group/suse.rb
1652
1651
  - lib/chef/provider/group/usermod.rb
1653
1652
  - lib/chef/provider/group/windows.rb
1654
1653
  - lib/chef/provider/http_request.rb
@@ -2820,7 +2819,6 @@ files:
2820
2819
  - spec/unit/provider/group/groupmod_spec.rb
2821
2820
  - spec/unit/provider/group/pw_spec.rb
2822
2821
  - spec/unit/provider/group/solaris_spec.rb
2823
- - spec/unit/provider/group/suse_spec.rb
2824
2822
  - spec/unit/provider/group/usermod_spec.rb
2825
2823
  - spec/unit/provider/group/windows_spec.rb
2826
2824
  - spec/unit/provider/group_spec.rb
@@ -1,82 +0,0 @@
1
- #
2
- # Author:: AJ Christensen (<aj@chef.io>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
-
19
- require_relative "groupadd"
20
- require "etc" unless defined?(Etc)
21
-
22
- class Chef
23
- class Provider
24
- class Group
25
- class Suse < Chef::Provider::Group::Groupadd
26
- provides :group, platform: "suse", platform_version: "< 12.0"
27
-
28
- def load_current_resource
29
- super
30
- end
31
-
32
- def define_resource_requirements
33
- super
34
- requirements.assert(:all_actions) do |a|
35
- a.assertion { ::File.exist?("/usr/sbin/groupmod") }
36
- a.failure_message Chef::Exceptions::Group, "Could not find binary /usr/sbin/groupmod for #{new_resource.name}"
37
- # No whyrun alternative: this component should be available in the base install of any given system that uses it
38
- end
39
-
40
- requirements.assert(:create, :manage, :modify) do |a|
41
- a.assertion do
42
-
43
- to_add(new_resource.members).all? { |member| Etc.getpwnam(member) }
44
- rescue
45
- false
46
-
47
- end
48
- a.failure_message Chef::Exceptions::Group, "Could not add users #{to_add(new_resource.members).join(", ")} to #{new_resource.group_name}: one of these users does not exist"
49
- a.whyrun "Could not find one of these users: #{to_add(new_resource.members).join(", ")}. Assuming it will be created by a prior step"
50
- end
51
- end
52
-
53
- def set_members(members)
54
- to_remove(members).each do |member|
55
- remove_member(member)
56
- end
57
-
58
- to_add(members).each do |member|
59
- add_member(member)
60
- end
61
- end
62
-
63
- def to_add(members)
64
- members - current_resource.members
65
- end
66
-
67
- def add_member(member)
68
- shell_out!("groupmod", "-A", member, new_resource.group_name)
69
- end
70
-
71
- def to_remove(members)
72
- current_resource.members - members
73
- end
74
-
75
- def remove_member(member)
76
- shell_out!("groupmod", "-R", member, new_resource.group_name)
77
- end
78
-
79
- end
80
- end
81
- end
82
- end
@@ -1,90 +0,0 @@
1
- #
2
- # Author:: Tom Duffield (<tom@chef.io>)
3
- # Copyright:: Copyright (c) Chef Software Inc.
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- #      http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
-
19
- require "spec_helper"
20
-
21
- describe Chef::Provider::Group::Suse do
22
- let(:node) { Chef::Node.new }
23
- let(:events) { Chef::EventDispatch::Dispatcher.new }
24
- let(:run_context) { Chef::RunContext.new(node, {}, events) }
25
- let(:new_members) { %w{root new_user} }
26
- let(:new_resource) do
27
- Chef::Resource::Group.new("new_group").tap do |r|
28
- r.gid 50
29
- r.members new_members
30
- r.system false
31
- r.non_unique false
32
- end
33
- end
34
- let(:current_resource) do
35
- Chef::Resource::Group.new("new_group").tap do |r|
36
- r.gid 50
37
- r.members %w{root}
38
- r.system false
39
- r.non_unique false
40
- end
41
- end
42
- let(:provider) do
43
- described_class.new(new_resource, run_context).tap do |p|
44
- p.current_resource = current_resource
45
- end
46
- end
47
-
48
- describe "when determining the current group state" do
49
- before(:each) do
50
- allow(File).to receive(:exist?).and_return(true)
51
- provider.action = :create
52
- provider.define_resource_requirements
53
- end
54
-
55
- # Checking for required binaries is already done in the spec
56
- # for Chef::Provider::Group - no need to repeat it here. We'll
57
- # include only what's specific to this provider.
58
- it "should raise an error if the required binary /usr/sbin/groupmod doesn't exist" do
59
- expect(File).to receive(:exist?).with("/usr/sbin/groupmod").and_return(false)
60
- expect { provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Group)
61
- end
62
-
63
- it "should raise error if one of the member users does not exist" do
64
- expect(Etc).to receive(:getpwnam).with("new_user").and_raise ArgumentError
65
- expect { provider.process_resource_requirements }.to raise_error(Chef::Exceptions::Group)
66
- end
67
- end
68
-
69
- describe "#set_members" do
70
- it "should add missing members and remove deleted members" do
71
- expect(provider).not_to receive(:remove_member)
72
- expect(provider).to receive(:add_member).with("new_user")
73
- provider.set_members(new_members)
74
- end
75
- end
76
-
77
- describe "#add_member" do
78
- it "should call out to groupmod to add user" do
79
- expect(provider).to receive(:shell_out_compacted!).with("groupmod", "-A", "new_user", "new_group")
80
- provider.add_member("new_user")
81
- end
82
- end
83
-
84
- describe "#remove_member" do
85
- it "should call out to groupmod to remove user" do
86
- expect(provider).to receive(:shell_out_compacted!).with("groupmod", "-R", "new_user", "new_group")
87
- provider.remove_member("new_user")
88
- end
89
- end
90
- end