diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/platform/provider_mapping.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/chef/platform/provider_mapping.rb b/lib/chef/platform/provider_mapping.rb index 0d7285729f..763ae79368 100644 --- a/lib/chef/platform/provider_mapping.rb +++ b/lib/chef/platform/provider_mapping.rb @@ -292,6 +292,8 @@ class Chef :user => Chef::Provider::User::Useradd, :group => Chef::Provider::Group::Gpasswd, :ifconfig => Chef::Provider::Ifconfig, + :package => Chef::Provider::Package, + :service => Chef::Provider::Service, } } end @@ -463,7 +465,11 @@ class Chef def resource_matching_provider(platform, version, resource_type) if resource_type.kind_of?(Chef::Resource) begin - Chef::Provider.const_get(resource_type.class.to_s.split('::').last) + class_name = resource_type.class.to_s.split('::').last + result = Chef::Provider.const_get(class_name) + Chef::Log.warn("Class Chef::Provider::#{class_name} does not declare 'provides #{resource_type.class.dsl_name.to_sym.inspect}'.") + Chef::Log.warn("This will no longer work in Chef 13: you must use 'provides' to provide DSL.") + result rescue NameError nil end |