diff options
author | Lamont Granquist <lamont@chef.io> | 2020-03-30 13:09:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-30 13:09:26 -0700 |
commit | 079c5e43402759c80e26352e9266a1af0e719ec6 (patch) | |
tree | ae287d16be53710eb9d422fa8af065bf8430db8c | |
parent | f4542f3c3f4a99ca8063b94201723a5fabf0bc6b (diff) | |
parent | c598c15afc988cc7d312e06e6f522daa45230d39 (diff) | |
download | chef-079c5e43402759c80e26352e9266a1af0e719ec6.tar.gz |
Merge pull request #9532 from chef/lcg/restore-magic-resource-name-order
restore magic resource name ordering
-rw-r--r-- | lib/chef/resource/lwrp_base.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/chef/resource/lwrp_base.rb b/lib/chef/resource/lwrp_base.rb index 152482434f..c5887e5104 100644 --- a/lib/chef/resource/lwrp_base.rb +++ b/lib/chef/resource/lwrp_base.rb @@ -51,7 +51,6 @@ class Chef resource_class = Class.new(self) resource_class.run_context = run_context - resource_class.provides resource_name.to_sym resource_class.class_from_file(filename) # Make a useful string for the class (rather than <Class:312894723894>) @@ -66,6 +65,10 @@ class Chef LWRPBase.loaded_lwrps[filename] = true + # wire up the default resource name after the class is parsed only if we haven't declared one. + # (this ordering is important for MapCollision deprecation warnings) + resource_class.provides resource_name.to_sym unless Chef::ResourceResolver.includes_handler?(resource_name.to_sym, self) + resource_class end |