chef 12.4.0-universal-mingw32 → 12.4.1-universal-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/lib/chef/api_client.rb +31 -129
  3. data/lib/chef/api_client_v1.rb +325 -0
  4. data/lib/chef/chef_class.rb +15 -7
  5. data/lib/chef/chef_fs/file_system/chef_server_root_dir.rb +2 -2
  6. data/lib/chef/dsl/resources.rb +6 -4
  7. data/lib/chef/exceptions.rb +2 -2
  8. data/lib/chef/guard_interpreter/resource_guard_interpreter.rb +2 -1
  9. data/lib/chef/knife/bootstrap/templates/chef-full.erb +4 -4
  10. data/lib/chef/knife/client_bulk_delete.rb +2 -2
  11. data/lib/chef/knife/client_create.rb +4 -4
  12. data/lib/chef/knife/client_delete.rb +3 -3
  13. data/lib/chef/knife/client_edit.rb +10 -2
  14. data/lib/chef/knife/client_list.rb +2 -2
  15. data/lib/chef/knife/client_reregister.rb +2 -2
  16. data/lib/chef/knife/client_show.rb +2 -2
  17. data/lib/chef/knife/osc_user_create.rb +3 -3
  18. data/lib/chef/knife/osc_user_delete.rb +2 -2
  19. data/lib/chef/knife/osc_user_edit.rb +3 -3
  20. data/lib/chef/knife/osc_user_list.rb +2 -2
  21. data/lib/chef/knife/osc_user_reregister.rb +2 -2
  22. data/lib/chef/knife/osc_user_show.rb +2 -2
  23. data/lib/chef/knife/user_create.rb +3 -3
  24. data/lib/chef/knife/user_delete.rb +4 -4
  25. data/lib/chef/knife/user_edit.rb +3 -3
  26. data/lib/chef/knife/user_list.rb +2 -2
  27. data/lib/chef/knife/user_reregister.rb +2 -2
  28. data/lib/chef/knife/user_show.rb +2 -2
  29. data/lib/chef/node_map.rb +14 -18
  30. data/lib/chef/platform/handler_map.rb +45 -0
  31. data/lib/chef/platform/priority_map.rb +19 -32
  32. data/lib/chef/platform/provider_handler_map.rb +29 -0
  33. data/lib/chef/platform/provider_mapping.rb +3 -2
  34. data/lib/chef/platform/resource_handler_map.rb +29 -0
  35. data/lib/chef/platform/resource_priority_map.rb +0 -6
  36. data/lib/chef/provider.rb +1 -1
  37. data/lib/chef/provider/dsc_resource.rb +2 -2
  38. data/lib/chef/provider/dsc_script.rb +1 -1
  39. data/lib/chef/provider/mount/aix.rb +1 -1
  40. data/lib/chef/provider/package.rb +0 -31
  41. data/lib/chef/provider/package/aix.rb +1 -0
  42. data/lib/chef/provider/package/apt.rb +1 -0
  43. data/lib/chef/provider/package/homebrew.rb +1 -0
  44. data/lib/chef/provider/package/ips.rb +1 -0
  45. data/lib/chef/provider/package/macports.rb +1 -0
  46. data/lib/chef/provider/package/openbsd.rb +1 -0
  47. data/lib/chef/provider/package/pacman.rb +1 -0
  48. data/lib/chef/provider/package/paludis.rb +1 -0
  49. data/lib/chef/provider/package/portage.rb +2 -0
  50. data/lib/chef/provider/package/smartos.rb +1 -0
  51. data/lib/chef/provider/package/solaris.rb +2 -0
  52. data/lib/chef/provider/package/yum.rb +1 -0
  53. data/lib/chef/provider/package/zypper.rb +1 -0
  54. data/lib/chef/provider/service.rb +4 -22
  55. data/lib/chef/provider/service/debian.rb +2 -0
  56. data/lib/chef/provider/service/insserv.rb +2 -0
  57. data/lib/chef/provider/service/invokercd.rb +2 -0
  58. data/lib/chef/provider/service/openbsd.rb +1 -1
  59. data/lib/chef/provider/service/redhat.rb +2 -0
  60. data/lib/chef/provider/service/upstart.rb +3 -0
  61. data/lib/chef/provider_resolver.rb +59 -53
  62. data/lib/chef/resource.rb +22 -73
  63. data/lib/chef/resource/dsc_script.rb +1 -1
  64. data/lib/chef/resource/ips_package.rb +1 -0
  65. data/lib/chef/resource/mount.rb +8 -0
  66. data/lib/chef/resource/openbsd_package.rb +0 -11
  67. data/lib/chef/resource/solaris_package.rb +1 -4
  68. data/lib/chef/resource_resolver.rb +54 -26
  69. data/lib/chef/run_list/versioned_recipe_list.rb +6 -5
  70. data/lib/chef/user.rb +52 -188
  71. data/lib/chef/user_v1.rb +335 -0
  72. data/lib/chef/version.rb +1 -1
  73. data/spec/data/trusted_certs/opscode.pem +53 -56
  74. data/spec/functional/provider/whyrun_safe_ruby_block_spec.rb +1 -1
  75. data/spec/functional/resource/package_spec.rb +0 -2
  76. data/spec/integration/recipes/recipe_dsl_spec.rb +661 -126
  77. data/spec/spec_helper.rb +19 -13
  78. data/spec/support/shared/unit/api_versioning.rb +2 -2
  79. data/spec/unit/api_client_spec.rb +22 -201
  80. data/spec/unit/api_client_v1_spec.rb +457 -0
  81. data/spec/unit/knife/client_bulk_delete_spec.rb +4 -4
  82. data/spec/unit/knife/client_create_spec.rb +1 -1
  83. data/spec/unit/knife/client_delete_spec.rb +3 -3
  84. data/spec/unit/knife/client_edit_spec.rb +14 -1
  85. data/spec/unit/knife/client_list_spec.rb +1 -1
  86. data/spec/unit/knife/client_reregister_spec.rb +2 -2
  87. data/spec/unit/knife/client_show_spec.rb +2 -2
  88. data/spec/unit/knife/osc_user_create_spec.rb +5 -5
  89. data/spec/unit/knife/osc_user_delete_spec.rb +1 -1
  90. data/spec/unit/knife/osc_user_edit_spec.rb +1 -1
  91. data/spec/unit/knife/osc_user_list_spec.rb +1 -1
  92. data/spec/unit/knife/osc_user_reregister_spec.rb +1 -1
  93. data/spec/unit/knife/osc_user_show_spec.rb +1 -1
  94. data/spec/unit/knife/user_create_spec.rb +1 -1
  95. data/spec/unit/knife/user_delete_spec.rb +2 -2
  96. data/spec/unit/knife/user_edit_spec.rb +2 -2
  97. data/spec/unit/knife/user_list_spec.rb +1 -1
  98. data/spec/unit/knife/user_reregister_spec.rb +1 -1
  99. data/spec/unit/knife/user_show_spec.rb +2 -2
  100. data/spec/unit/lwrp_spec.rb +146 -134
  101. data/spec/unit/node_map_spec.rb +12 -0
  102. data/spec/unit/platform_spec.rb +1 -1
  103. data/spec/unit/provider/deploy_spec.rb +1 -1
  104. data/spec/unit/provider/dsc_resource_spec.rb +3 -3
  105. data/spec/unit/provider/dsc_script_spec.rb +2 -2
  106. data/spec/unit/provider_resolver_spec.rb +170 -135
  107. data/spec/unit/recipe_spec.rb +3 -3
  108. data/spec/unit/resource/breakpoint_spec.rb +1 -1
  109. data/spec/unit/resource/cron_spec.rb +1 -1
  110. data/spec/unit/resource/directory_spec.rb +1 -1
  111. data/spec/unit/resource/dsc_resource_spec.rb +1 -1
  112. data/spec/unit/resource/dsc_script_spec.rb +2 -2
  113. data/spec/unit/resource/env_spec.rb +1 -1
  114. data/spec/unit/resource/erl_call_spec.rb +1 -1
  115. data/spec/unit/resource/file_spec.rb +1 -1
  116. data/spec/unit/resource/group_spec.rb +1 -1
  117. data/spec/unit/resource/link_spec.rb +1 -1
  118. data/spec/unit/resource/mdadm_spec.rb +1 -1
  119. data/spec/unit/resource/mount_spec.rb +1 -1
  120. data/spec/unit/resource/ohai_spec.rb +1 -1
  121. data/spec/unit/resource/registry_key_spec.rb +1 -1
  122. data/spec/unit/resource/route_spec.rb +1 -1
  123. data/spec/unit/resource/ruby_block_spec.rb +3 -3
  124. data/spec/unit/resource/user_spec.rb +1 -1
  125. data/spec/unit/resource/windows_service_spec.rb +1 -1
  126. data/spec/unit/resource_resolver_spec.rb +8 -4
  127. data/spec/unit/resource_spec.rb +89 -3
  128. data/spec/unit/run_list/versioned_recipe_list_spec.rb +115 -48
  129. data/spec/unit/user_spec.rb +97 -405
  130. data/spec/unit/user_v1_spec.rb +584 -0
  131. metadata +11 -6
  132. data/lib/chef/osc_user.rb +0 -194
  133. data/spec/unit/osc_user_spec.rb +0 -276
@@ -131,6 +131,18 @@ describe Chef::NodeMap do
131
131
  allow(node).to receive(:[]).with(:platform_version).and_return("6.0")
132
132
  expect(node_map.get(node, :thing)).to eql(nil)
133
133
  end
134
+
135
+ context "when there is a less specific definition" do
136
+ before do
137
+ node_map.set(:thing, :bar, platform_family: "rhel")
138
+ end
139
+
140
+ it "returns the value when the node matches" do
141
+ allow(node).to receive(:[]).with(:platform_family).and_return("rhel")
142
+ allow(node).to receive(:[]).with(:platform_version).and_return("7.0")
143
+ expect(node_map.get(node, :thing)).to eql(:foo)
144
+ end
145
+ end
134
146
  end
135
147
 
136
148
  describe "resource back-compat testing" do
@@ -103,7 +103,7 @@ describe Chef::Platform do
103
103
  end
104
104
 
105
105
  it "should raise an exception if a provider cannot be found for a resource type" do
106
- expect { Chef::Platform.find_provider("Darwin", "9.2.2", :coffee) }.to raise_error(ArgumentError)
106
+ expect { Chef::Platform.find_provider("Darwin", "9.2.2", :coffee) }.to raise_error(Chef::Exceptions::ProviderNotFound)
107
107
  end
108
108
 
109
109
  it "should look up a provider for a resource with a Chef::Resource object" do
@@ -622,7 +622,7 @@ describe Chef::Provider::Deploy do
622
622
 
623
623
  gems = @provider.send(:gem_packages)
624
624
 
625
- expect(gems.map { |g| g.action }).to eq([:install])
625
+ expect(gems.map { |g| g.action }).to eq([%i{install}])
626
626
  expect(gems.map { |g| g.name }).to eq(%w{eventmachine})
627
627
  expect(gems.map { |g| g.version }).to eq(%w{0.12.9})
628
628
  end
@@ -35,10 +35,10 @@ describe Chef::Provider::DscResource do
35
35
  node
36
36
  }
37
37
 
38
- it 'raises a NoProviderAvailable exception' do
38
+ it 'raises a ProviderNotFound exception' do
39
39
  expect(provider).not_to receive(:meta_configuration)
40
40
  expect{provider.run_action(:run)}.to raise_error(
41
- Chef::Exceptions::NoProviderAvailable, /5\.0\.10018\.0/)
41
+ Chef::Exceptions::ProviderNotFound, /5\.0\.10018\.0/)
42
42
  end
43
43
  end
44
44
 
@@ -56,7 +56,7 @@ describe Chef::Provider::DscResource do
56
56
  expect(provider).to receive(:meta_configuration).and_return(
57
57
  meta_configuration)
58
58
  expect { provider.run_action(:run) }.to raise_error(
59
- Chef::Exceptions::NoProviderAvailable, /Disabled/)
59
+ Chef::Exceptions::ProviderNotFound, /Disabled/)
60
60
  end
61
61
  end
62
62
 
@@ -158,14 +158,14 @@ describe Chef::Provider::DscScript do
158
158
 
159
159
  expect {
160
160
  provider.run_action(:run)
161
- }.to raise_error(Chef::Exceptions::NoProviderAvailable)
161
+ }.to raise_error(Chef::Exceptions::ProviderNotFound)
162
162
  end
163
163
  end
164
164
 
165
165
  it 'raises an exception if Powershell is not present' do
166
166
  expect {
167
167
  provider.run_action(:run)
168
- }.to raise_error(Chef::Exceptions::NoProviderAvailable)
168
+ }.to raise_error(Chef::Exceptions::ProviderNotFound)
169
169
  end
170
170
 
171
171
  end
@@ -28,30 +28,37 @@ include Chef::Mixin::ConvertToClassName
28
28
 
29
29
  describe Chef::ProviderResolver do
30
30
 
31
+ let(:resource_name) { :service }
32
+ let(:provider) { nil }
33
+ let(:action) { :start }
34
+
31
35
  let(:node) do
32
36
  node = Chef::Node.new
33
- allow(node).to receive(:[]).with(:os).and_return(os)
34
- allow(node).to receive(:[]).with(:platform_family).and_return(platform_family)
35
- allow(node).to receive(:[]).with(:platform).and_return(platform)
36
- allow(node).to receive(:[]).with(:platform_version).and_return(platform_version)
37
- allow(node).to receive(:is_a?).and_return(Chef::Node)
37
+ node.automatic[:os] = os
38
+ node.automatic[:platform_family] = platform_family
39
+ node.automatic[:platform] = platform
40
+ node.automatic[:platform_version] = platform_version
41
+ node.automatic[:kernel] = { machine: 'i386' }
38
42
  node
39
43
  end
44
+ let(:run_context) { Chef::RunContext.new(node, nil, nil) }
40
45
 
41
46
  let(:provider_resolver) { Chef::ProviderResolver.new(node, resource, action) }
47
+ let(:resolved_provider) do
48
+ begin
49
+ resource ? resource.provider_for_action(action).class : nil
50
+ rescue Chef::Exceptions::ProviderNotFound
51
+ nil
52
+ end
53
+ end
42
54
 
43
- let(:action) { :start }
44
-
45
- let(:resolved_provider) { provider_resolver.resolve }
46
-
47
- let(:provider) { nil }
48
-
49
- let(:resource_name) { :service }
50
-
51
- let(:resource) { double(Chef::Resource, provider: provider, resource_name: resource_name) }
52
-
53
- before do
54
- allow(resource).to receive(:is_a?).with(Chef::Resource).and_return(true)
55
+ let(:resource) do
56
+ resource_class = Chef::ResourceResolver.resolve(resource_name, node: node)
57
+ if resource_class
58
+ resource = resource_class.new('test', run_context)
59
+ resource.provider = provider if provider
60
+ end
61
+ resource
55
62
  end
56
63
 
57
64
  def self.on_platform(platform, *tags,
@@ -83,16 +90,41 @@ describe Chef::ProviderResolver do
83
90
  end
84
91
 
85
92
  def self.expect_providers(**providers)
86
- providers.each do |name, provider|
93
+ providers.each do |name, expected|
87
94
  describe name.to_s do
88
95
  let(:resource_name) { name }
89
- if provider
90
- it "resolves to a #{provider}" do
91
- expect(resolved_provider).to eql(provider)
96
+
97
+ tags = []
98
+ expected_provider = nil
99
+ expected_resource = nil
100
+ Array(expected).each do |p|
101
+ if p.is_a?(Class) && p <= Chef::Provider
102
+ expected_provider = p
103
+ elsif p.is_a?(Class) && p <= Chef::Resource
104
+ expected_resource = p
105
+ else
106
+ tags << p
107
+ end
108
+ end
109
+
110
+ if expected_resource && expected_provider
111
+ it "'#{name}' resolves to resource #{expected_resource} and provider #{expected_provider}", *tags do
112
+ expect(resource.class).to eql(expected_resource)
113
+ provider = double(expected_provider, class: expected_provider)
114
+ expect(provider).to receive(:action=).with(action)
115
+ expect(expected_provider).to receive(:new).with(resource, run_context).and_return(provider)
116
+ expect(resolved_provider).to eql(expected_provider)
117
+ end
118
+ elsif expected_provider
119
+ it "'#{name}' resolves to provider #{expected_provider}", *tags do
120
+ provider = double(expected_provider)
121
+ expect(provider).to receive(:action=).with(action)
122
+ expect(expected_provider).to receive(:new).with(resource, run_context).and_return(provider)
123
+ expect(resolved_provider).to eql(expected_provider)
92
124
  end
93
125
  else
94
- it "Fails to resolve (since #{name.inspect} is unsupported on #{platform} #{platform_version})" do
95
- expect { resolved_provider }.to raise_error /Cannot find a provider/
126
+ it "'#{name}' fails to resolve (since #{name.inspect} is unsupported on #{platform} #{platform_version})", *tags do
127
+ expect(resolved_provider).to be_nil
96
128
  end
97
129
  end
98
130
  end
@@ -454,48 +486,48 @@ describe Chef::ProviderResolver do
454
486
 
455
487
  PROVIDERS =
456
488
  {
457
- bash: Chef::Provider::Script,
458
- breakpoint: Chef::Provider::Breakpoint,
459
- chef_gem: Chef::Provider::Package::Rubygems,
460
- cookbook_file: Chef::Provider::CookbookFile,
461
- csh: Chef::Provider::Script,
462
- deploy: Chef::Provider::Deploy::Timestamped,
463
- deploy_revision: Chef::Provider::Deploy::Revision,
464
- directory: Chef::Provider::Directory,
465
- easy_install_package: Chef::Provider::Package::EasyInstall,
466
- erl_call: Chef::Provider::ErlCall,
467
- execute: Chef::Provider::Execute,
468
- file: Chef::Provider::File,
469
- gem_package: Chef::Provider::Package::Rubygems,
470
- git: Chef::Provider::Git,
471
- group: Chef::Provider::Group::Gpasswd,
472
- homebrew_package: Chef::Provider::Package::Homebrew,
473
- http_request: Chef::Provider::HttpRequest,
474
- ifconfig: Chef::Provider::Ifconfig,
475
- link: Chef::Provider::Link,
476
- log: Chef::Provider::Log::ChefLog,
477
- macports_package: Chef::Provider::Package::Macports,
478
- mdadm: Chef::Provider::Mdadm,
479
- mount: Chef::Provider::Mount::Mount,
480
- perl: Chef::Provider::Script,
481
- portage_package: Chef::Provider::Package::Portage,
482
- python: Chef::Provider::Script,
483
- remote_directory: Chef::Provider::RemoteDirectory,
484
- route: Chef::Provider::Route,
485
- ruby: Chef::Provider::Script,
486
- ruby_block: Chef::Provider::RubyBlock,
487
- script: Chef::Provider::Script,
488
- subversion: Chef::Provider::Subversion,
489
- template: Chef::Provider::Template,
490
- timestamped_deploy: Chef::Provider::Deploy::Timestamped,
491
- user: Chef::Provider::User::Useradd,
492
- whyrun_safe_ruby_block: Chef::Provider::WhyrunSafeRubyBlock,
489
+ bash: [ Chef::Resource::Bash, Chef::Provider::Script ],
490
+ breakpoint: [ Chef::Resource::Breakpoint, Chef::Provider::Breakpoint ],
491
+ chef_gem: [ Chef::Resource::ChefGem, Chef::Provider::Package::Rubygems ],
492
+ cookbook_file: [ Chef::Resource::CookbookFile, Chef::Provider::CookbookFile ],
493
+ csh: [ Chef::Resource::Csh, Chef::Provider::Script ],
494
+ deploy: [ Chef::Resource::Deploy, Chef::Provider::Deploy::Timestamped ],
495
+ deploy_revision: [ Chef::Resource::DeployRevision, Chef::Provider::Deploy::Revision ],
496
+ directory: [ Chef::Resource::Directory, Chef::Provider::Directory ],
497
+ easy_install_package: [ Chef::Resource::EasyInstallPackage, Chef::Provider::Package::EasyInstall ],
498
+ erl_call: [ Chef::Resource::ErlCall, Chef::Provider::ErlCall ],
499
+ execute: [ Chef::Resource::Execute, Chef::Provider::Execute ],
500
+ file: [ Chef::Resource::File, Chef::Provider::File ],
501
+ gem_package: [ Chef::Resource::GemPackage, Chef::Provider::Package::Rubygems ],
502
+ git: [ Chef::Resource::Git, Chef::Provider::Git ],
503
+ group: [ Chef::Resource::Group, Chef::Provider::Group::Gpasswd ],
504
+ homebrew_package: [ Chef::Resource::HomebrewPackage, Chef::Provider::Package::Homebrew ],
505
+ http_request: [ Chef::Resource::HttpRequest, Chef::Provider::HttpRequest ],
506
+ ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ],
507
+ link: [ Chef::Resource::Link, Chef::Provider::Link ],
508
+ log: [ Chef::Resource::Log, Chef::Provider::Log::ChefLog ],
509
+ macports_package: [ Chef::Resource::MacportsPackage, Chef::Provider::Package::Macports ],
510
+ mdadm: [ Chef::Resource::Mdadm, Chef::Provider::Mdadm ],
511
+ mount: [ Chef::Resource::Mount, Chef::Provider::Mount::Mount ],
512
+ perl: [ Chef::Resource::Perl, Chef::Provider::Script ],
513
+ portage_package: [ Chef::Resource::PortagePackage, Chef::Provider::Package::Portage ],
514
+ python: [ Chef::Resource::Python, Chef::Provider::Script ],
515
+ remote_directory: [ Chef::Resource::RemoteDirectory, Chef::Provider::RemoteDirectory ],
516
+ route: [ Chef::Resource::Route, Chef::Provider::Route ],
517
+ ruby: [ Chef::Resource::Ruby, Chef::Provider::Script ],
518
+ ruby_block: [ Chef::Resource::RubyBlock, Chef::Provider::RubyBlock ],
519
+ script: [ Chef::Resource::Script, Chef::Provider::Script ],
520
+ subversion: [ Chef::Resource::Subversion, Chef::Provider::Subversion ],
521
+ template: [ Chef::Resource::Template, Chef::Provider::Template ],
522
+ timestamped_deploy: [ Chef::Resource::TimestampedDeploy, Chef::Provider::Deploy::Timestamped ],
523
+ user: [ Chef::Resource::User, Chef::Provider::User::Useradd ],
524
+ whyrun_safe_ruby_block: [ Chef::Resource::WhyrunSafeRubyBlock, Chef::Provider::WhyrunSafeRubyBlock ],
493
525
 
494
526
  # We want to check that these are unsupported:
495
527
  apt_package: nil,
496
528
  bff_package: nil,
497
- dsc_script: nil,
498
529
  dpkg_package: nil,
530
+ dsc_script: nil,
499
531
  ips_package: nil,
500
532
  pacman_package: nil,
501
533
  paludis_package: nil,
@@ -507,61 +539,62 @@ describe Chef::ProviderResolver do
507
539
  windows_service: nil,
508
540
 
509
541
  "linux" => {
510
- apt_package: Chef::Provider::Package::Apt,
511
- dpkg_package: Chef::Provider::Package::Dpkg,
512
- pacman_package: Chef::Provider::Package::Pacman,
513
- paludis_package: Chef::Provider::Package::Paludis,
514
- rpm_package: Chef::Provider::Package::Rpm,
515
- yum_package: Chef::Provider::Package::Yum,
542
+ apt_package: [ Chef::Resource::AptPackage, Chef::Provider::Package::Apt ],
543
+ dpkg_package: [ Chef::Resource::DpkgPackage, Chef::Provider::Package::Dpkg ],
544
+ pacman_package: [ Chef::Resource::PacmanPackage, Chef::Provider::Package::Pacman ],
545
+ paludis_package: [ Chef::Resource::PaludisPackage, Chef::Provider::Package::Paludis ],
546
+ rpm_package: [ Chef::Resource::RpmPackage, Chef::Provider::Package::Rpm ],
547
+ yum_package: [ Chef::Resource::YumPackage, Chef::Provider::Package::Yum ],
516
548
 
517
549
  "debian" => {
518
- ifconfig: Chef::Provider::Ifconfig::Debian,
519
- package: Chef::Provider::Package::Apt,
520
- # service: Chef::Provider::Service::Debian,
550
+ ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig::Debian ],
551
+ package: [ Chef::Resource::AptPackage, Chef::Provider::Package::Apt ],
552
+ # service: [ Chef::Resource::DebianService, Chef::Provider::Service::Debian ],
521
553
 
522
554
  "debian" => {
523
555
  "7.0" => {
524
556
  },
525
557
  "6.0" => {
526
- ifconfig: Chef::Provider::Ifconfig,
527
- # service: Chef::Provider::Service::Insserv,
558
+ ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ],
559
+ # service: [ Chef::Resource::InsservService, Chef::Provider::Service::Insserv ],
528
560
  },
529
561
  "5.0" => {
530
- ifconfig: Chef::Provider::Ifconfig,
562
+ ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ],
531
563
  },
532
564
  },
533
565
  "gcel" => {
534
566
  "3.1.4" => {
535
- ifconfig: Chef::Provider::Ifconfig,
567
+ ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ],
536
568
  },
537
569
  },
538
570
  "linaro" => {
539
571
  "3.1.4" => {
540
- ifconfig: Chef::Provider::Ifconfig,
572
+ ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ],
541
573
  },
542
574
  },
543
575
  "linuxmint" => {
544
576
  "3.1.4" => {
545
- ifconfig: Chef::Provider::Ifconfig,
546
- # service: Chef::Provider::Service::Upstart,
577
+ ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ],
578
+ # service: [ Chef::Resource::UpstartService, Chef::Provider::Service::Upstart ],
547
579
  },
548
580
  },
549
581
  "raspbian" => {
550
582
  "3.1.4" => {
551
- ifconfig: Chef::Provider::Ifconfig,
583
+ ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ],
552
584
  },
553
585
  },
554
586
  "ubuntu" => {
555
587
  "11.10" => {
556
588
  },
557
589
  "10.04" => {
558
- ifconfig: Chef::Provider::Ifconfig,
590
+ ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig ],
559
591
  },
560
592
  },
561
593
  },
562
594
 
563
595
  "arch" => {
564
- package: Chef::Provider::Package::Pacman,
596
+ # TODO should be Chef::Resource::PacmanPackage
597
+ package: [ Chef::Resource::Package, Chef::Provider::Package::Pacman ],
565
598
 
566
599
  "arch" => {
567
600
  "3.1.4" => {
@@ -570,8 +603,8 @@ describe Chef::ProviderResolver do
570
603
  },
571
604
 
572
605
  "freebsd" => {
573
- group: Chef::Provider::Group::Pw,
574
- user: Chef::Provider::User::Pw,
606
+ group: [ Chef::Resource::Group, Chef::Provider::Group::Pw ],
607
+ user: [ Chef::Resource::User, Chef::Provider::User::Pw ],
575
608
 
576
609
  "freebsd" => {
577
610
  "3.1.4" => {
@@ -579,30 +612,31 @@ describe Chef::ProviderResolver do
579
612
  },
580
613
  },
581
614
  "suse" => {
582
- group: Chef::Provider::Group::Gpasswd,
615
+ group: [ Chef::Resource::Group, Chef::Provider::Group::Gpasswd ],
583
616
  "suse" => {
584
617
  "12.0" => {
585
618
  },
586
619
  %w(11.1 11.2 11.3) => {
587
- group: Chef::Provider::Group::Suse,
620
+ group: [ Chef::Resource::Group, Chef::Provider::Group::Suse ],
588
621
  },
589
622
  },
590
623
  "opensuse" => {
591
- # service: Chef::Provider::Service::Redhat,
592
- package: Chef::Provider::Package::Zypper,
593
- group: Chef::Provider::Group::Usermod,
624
+ # service: [ Chef::Resource::RedhatService, Chef::Provider::Service::Redhat ],
625
+ package: [ Chef::Resource::ZypperPackage, Chef::Provider::Package::Zypper ],
626
+ group: [ Chef::Resource::Group, Chef::Provider::Group::Usermod ],
594
627
  "12.3" => {
595
628
  },
596
629
  "12.2" => {
597
- group: Chef::Provider::Group::Suse,
630
+ group: [ Chef::Resource::Group, Chef::Provider::Group::Suse ],
598
631
  },
599
632
  },
600
633
  },
601
634
 
602
635
  "gentoo" => {
603
- package: Chef::Provider::Package::Portage,
604
- portage_package: Chef::Provider::Package::Portage,
605
- # service: Chef::Provider::Service::Gentoo,
636
+ # TODO should be Chef::Resource::PortagePackage
637
+ package: [ Chef::Resource::Package, Chef::Provider::Package::Portage ],
638
+ portage_package: [ Chef::Resource::PortagePackage, Chef::Provider::Package::Portage ],
639
+ # service: [ Chef::Resource::GentooService, Chef::Provider::Service::Gentoo ],
606
640
 
607
641
  "gentoo" => {
608
642
  "3.1.4" => {
@@ -611,27 +645,27 @@ describe Chef::ProviderResolver do
611
645
  },
612
646
 
613
647
  "rhel" => {
614
- # service: Chef::Provider::Service::Systemd,
615
- package: Chef::Provider::Package::Yum,
616
- ifconfig: Chef::Provider::Ifconfig::Redhat,
648
+ # service: [ Chef::Resource::SystemdService, Chef::Provider::Service::Systemd ],
649
+ package: [ Chef::Resource::YumPackage, Chef::Provider::Package::Yum ],
650
+ ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig::Redhat ],
617
651
 
618
652
  %w(amazon xcp xenserver ibm_powerkvm cloudlinux parallels) => {
619
653
  "3.1.4" => {
620
- # service: Chef::Provider::Service::Redhat,
654
+ # service: [ Chef::Resource::RedhatService, Chef::Provider::Service::Redhat ],
621
655
  },
622
656
  },
623
657
  %w(redhat centos scientific oracle) => {
624
658
  "7.0" => {
625
659
  },
626
660
  "6.0" => {
627
- # service: Chef::Provider::Service::Redhat,
661
+ # service: [ Chef::Resource::RedhatService, Chef::Provider::Service::Redhat ],
628
662
  },
629
663
  },
630
664
  "fedora" => {
631
665
  "15.0" => {
632
666
  },
633
667
  "14.0" => {
634
- # service: Chef::Provider::Service::Redhat,
668
+ # service: [ Chef::Resource::RedhatService, Chef::Provider::Service::Redhat ],
635
669
  },
636
670
  },
637
671
  },
@@ -640,9 +674,9 @@ describe Chef::ProviderResolver do
640
674
 
641
675
  "darwin" => {
642
676
  %w(mac_os_x mac_os_x_server) => {
643
- group: Chef::Provider::Group::Dscl,
644
- package: Chef::Provider::Package::Homebrew,
645
- user: Chef::Provider::User::Dscl,
677
+ group: [ Chef::Resource::Group, Chef::Provider::Group::Dscl ],
678
+ package: [ Chef::Resource::HomebrewPackage, Chef::Provider::Package::Homebrew ],
679
+ user: [ Chef::Resource::User, Chef::Provider::User::Dscl ],
646
680
 
647
681
  "mac_os_x" => {
648
682
  "10.9.2" => {
@@ -652,17 +686,17 @@ describe Chef::ProviderResolver do
652
686
  },
653
687
 
654
688
  "windows" => {
655
- batch: Chef::Provider::Batch,
656
- dsc_script: Chef::Provider::DscScript,
657
- env: Chef::Provider::Env::Windows,
658
- group: Chef::Provider::Group::Windows,
659
- mount: Chef::Provider::Mount::Windows,
660
- package: Chef::Provider::Package::Windows,
661
- powershell_script: Chef::Provider::PowershellScript,
662
- service: Chef::Provider::Service::Windows,
663
- user: Chef::Provider::User::Windows,
664
- windows_package: Chef::Provider::Package::Windows,
665
- windows_service: Chef::Provider::Service::Windows,
689
+ batch: [ Chef::Resource::Batch, Chef::Provider::Batch ],
690
+ dsc_script: [ Chef::Resource::DscScript, Chef::Provider::DscScript ],
691
+ env: [ Chef::Resource::Env, Chef::Provider::Env::Windows ],
692
+ group: [ Chef::Resource::Group, Chef::Provider::Group::Windows ],
693
+ mount: [ Chef::Resource::Mount, Chef::Provider::Mount::Windows ],
694
+ package: [ Chef::Resource::WindowsPackage, Chef::Provider::Package::Windows ],
695
+ powershell_script: [ Chef::Resource::PowershellScript, Chef::Provider::PowershellScript ],
696
+ service: [ Chef::Resource::WindowsService, Chef::Provider::Service::Windows ],
697
+ user: [ Chef::Resource::User, Chef::Provider::User::Windows ],
698
+ windows_package: [ Chef::Resource::WindowsPackage, Chef::Provider::Package::Windows ],
699
+ windows_service: [ Chef::Resource::WindowsService, Chef::Provider::Service::Windows ],
666
700
 
667
701
  "windows" => {
668
702
  %w(mswin mingw32 windows) => {
@@ -673,15 +707,16 @@ describe Chef::ProviderResolver do
673
707
  },
674
708
 
675
709
  "aix" => {
676
- bff_package: Chef::Provider::Package::Aix,
677
- cron: Chef::Provider::Cron::Aix,
678
- group: Chef::Provider::Group::Aix,
679
- ifconfig: Chef::Provider::Ifconfig::Aix,
680
- mount: Chef::Provider::Mount::Aix,
681
- package: Chef::Provider::Package::Aix,
682
- rpm_package: Chef::Provider::Package::Rpm,
683
- user: Chef::Provider::User::Aix,
684
- # service: Chef::Provider::Service::Aix,
710
+ bff_package: [ Chef::Resource::BffPackage, Chef::Provider::Package::Aix ],
711
+ cron: [ Chef::Resource::Cron, Chef::Provider::Cron::Aix ],
712
+ group: [ Chef::Resource::Group, Chef::Provider::Group::Aix ],
713
+ ifconfig: [ Chef::Resource::Ifconfig, Chef::Provider::Ifconfig::Aix ],
714
+ mount: [ Chef::Resource::Mount, Chef::Provider::Mount::Aix ],
715
+ # TODO should be Chef::Resource::BffPackage
716
+ package: [ Chef::Resource::Package, Chef::Provider::Package::Aix ],
717
+ rpm_package: [ Chef::Resource::RpmPackage, Chef::Provider::Package::Rpm ],
718
+ user: [ Chef::Resource::User, Chef::Provider::User::Aix ],
719
+ # service: [ Chef::Resource::AixService, Chef::Provider::Service::Aix ],
685
720
 
686
721
  "aix" => {
687
722
  "aix" => {
@@ -695,7 +730,7 @@ describe Chef::ProviderResolver do
695
730
  "hpux" => {
696
731
  "hpux" => {
697
732
  "3.1.4" => {
698
- group: Chef::Provider::Group::Usermod
733
+ group: [ Chef::Resource::Group, Chef::Provider::Group::Usermod ]
699
734
  }
700
735
  }
701
736
  }
@@ -705,15 +740,15 @@ describe Chef::ProviderResolver do
705
740
  "netbsd" => {
706
741
  "netbsd" => {
707
742
  "3.1.4" => {
708
- group: Chef::Provider::Group::Groupmod,
743
+ group: [ Chef::Resource::Group, Chef::Provider::Group::Groupmod ],
709
744
  },
710
745
  },
711
746
  },
712
747
  },
713
748
 
714
749
  "openbsd" => {
715
- group: Chef::Provider::Group::Usermod,
716
- package: Chef::Provider::Package::Openbsd,
750
+ group: [ Chef::Resource::Group, Chef::Provider::Group::Usermod ],
751
+ package: [ Chef::Resource::OpenbsdPackage, Chef::Provider::Package::Openbsd ],
717
752
 
718
753
  "openbsd" => {
719
754
  "openbsd" => {
@@ -724,15 +759,15 @@ describe Chef::ProviderResolver do
724
759
  },
725
760
 
726
761
  "solaris2" => {
727
- group: Chef::Provider::Group::Usermod,
728
- ips_package: Chef::Provider::Package::Ips,
729
- package: Chef::Provider::Package::Ips,
730
- mount: Chef::Provider::Mount::Solaris,
731
- solaris_package: Chef::Provider::Package::Solaris,
762
+ group: [ Chef::Resource::Group, Chef::Provider::Group::Usermod ],
763
+ ips_package: [ Chef::Resource::IpsPackage, Chef::Provider::Package::Ips ],
764
+ package: [ Chef::Resource::SolarisPackage, Chef::Provider::Package::Solaris ],
765
+ mount: [ Chef::Resource::Mount, Chef::Provider::Mount::Solaris ],
766
+ solaris_package: [ Chef::Resource::SolarisPackage, Chef::Provider::Package::Solaris ],
732
767
 
733
768
  "smartos" => {
734
- smartos_package: Chef::Provider::Package::SmartOS,
735
- package: Chef::Provider::Package::SmartOS,
769
+ smartos_package: [ Chef::Resource::SmartosPackage, Chef::Provider::Package::SmartOS ],
770
+ package: [ Chef::Resource::SmartosPackage, Chef::Provider::Package::SmartOS ],
736
771
 
737
772
  "smartos" => {
738
773
  "3.1.4" => {
@@ -743,12 +778,11 @@ describe Chef::ProviderResolver do
743
778
  "solaris2" => {
744
779
  "nexentacore" => {
745
780
  "3.1.4" => {
746
- package: Chef::Provider::Package::Solaris,
747
781
  },
748
782
  },
749
783
  "omnios" => {
750
784
  "3.1.4" => {
751
- user: Chef::Provider::User::Solaris,
785
+ user: [ Chef::Resource::User, Chef::Provider::User::Solaris ],
752
786
  }
753
787
  },
754
788
  "openindiana" => {
@@ -760,11 +794,11 @@ describe Chef::ProviderResolver do
760
794
  },
761
795
  },
762
796
  "solaris2" => {
763
- user: Chef::Provider::User::Solaris,
797
+ user: [ Chef::Resource::User, Chef::Provider::User::Solaris ],
764
798
  "5.11" => {
799
+ package: [ Chef::Resource::IpsPackage, Chef::Provider::Package::Ips ],
765
800
  },
766
801
  "5.9" => {
767
- package: Chef::Provider::Package::Solaris,
768
802
  },
769
803
  },
770
804
  },
@@ -784,7 +818,8 @@ describe Chef::ProviderResolver do
784
818
  "exherbo" => {
785
819
  "exherbo" => {
786
820
  "3.1.4" => {
787
- package: Chef::Provider::Package::Paludis
821
+ # TODO should be Chef::Resource::PaludisPackage
822
+ package: [ Chef::Resource::Package, Chef::Provider::Package::Paludis ]
788
823
  }
789
824
  }
790
825
  }