summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2014-12-05 16:40:13 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2014-12-05 16:40:13 -0800
commitc9a31edeaf2fdd14d72ad87ca83d3489718455f1 (patch)
treea38de7d09f4ca3f9be616b28679cd0c766c10761
parent02e30cf7d3236e2fb3b80fc89835922ca7cb245c (diff)
downloadchef-c9a31edeaf2fdd14d72ad87ca83d3489718455f1.tar.gz
Fix issue where LWRP resources using `provides` fails
-rw-r--r--lib/chef/provider/lwrp_base.rb4
-rw-r--r--lib/chef/resource/lwrp_base.rb2
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/chef/provider/lwrp_base.rb b/lib/chef/provider/lwrp_base.rb
index 135a3f6b7c..121abf5fdb 100644
--- a/lib/chef/provider/lwrp_base.rb
+++ b/lib/chef/provider/lwrp_base.rb
@@ -92,10 +92,8 @@ class Chef
provider_class = Chef::Provider.const_get(class_name)
else
provider_class = Class.new(self)
- provider_class.class_from_file(filename)
-
- class_name = convert_to_class_name(provider_name)
Chef::Provider.const_set(class_name, provider_class)
+ provider_class.class_from_file(filename)
Chef::Log.debug("Loaded contents of #{filename} into a provider named #{provider_name} defined in Chef::Provider::#{class_name}")
end
diff --git a/lib/chef/resource/lwrp_base.rb b/lib/chef/resource/lwrp_base.rb
index a4606be842..20d177f507 100644
--- a/lib/chef/resource/lwrp_base.rb
+++ b/lib/chef/resource/lwrp_base.rb
@@ -46,11 +46,11 @@ class Chef
else
resource_class = Class.new(self)
+ Chef::Resource.const_set(class_name, resource_class)
resource_class.resource_name = rname
resource_class.run_context = run_context
resource_class.class_from_file(filename)
- Chef::Resource.const_set(class_name, resource_class)
Chef::Log.debug("Loaded contents of #{filename} into a resource named #{rname} defined in Chef::Resource::#{class_name}")
end