summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-04-05 10:22:19 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2018-04-05 10:22:19 -0700
commitc0fad89a7d7e361eaf14f30b8731a2e8babfd06d (patch)
treeac047daf8765327df88356839ba2942b1e99948c
parentf6e80867dfecdbd4a9d4bb092ed09dcad4bf84dd (diff)
downloadchef-c0fad89a7d7e361eaf14f30b8731a2e8babfd06d.tar.gz
add delegator for property_is_set? to providers
This was dropped in Chef 14.0.190 by chef/chef#6952 as a side effect of stripping out all the Chef::Resource automagic delegators. People were using this one inside of provider code, and it seems fine to continue to use it. Moving it to inject it directly into the Provider class instead of just custom resource action_classes to make our API more consistent. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/provider.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/chef/provider.rb b/lib/chef/provider.rb
index 58659c4e95..1751c35129 100644
--- a/lib/chef/provider.rb
+++ b/lib/chef/provider.rb
@@ -42,6 +42,7 @@ class Chef
include Chef::Mixin::WhyRun
extend Chef::Mixin::Provides
+ extend Forwardable
# includes the "core" DSL and not the "recipe" DSL by design
include Chef::DSL::Core
@@ -77,6 +78,10 @@ class Chef
# Chef.deprecated(:use_inline_resources, "The use_inline_resources mode is no longer optional and the line enabling it can be removed")
end
+ # delegate to the resource
+ #
+ def_delegators :@new_resource, :property_is_set?
+
#--
# TODO: this should be a reader, and the action should be passed in the
# constructor; however, many/most subclasses override the constructor so