summaryrefslogtreecommitdiff
path: root/lib/chef/resource.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-04-12 18:01:38 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2018-04-12 18:01:38 -0700
commitdd93333a3fc0851a0b63ec5bf63f67ce82ea4a21 (patch)
treef98a02afa5b7ae362f4bc67f471a5315d7ede5fa /lib/chef/resource.rb
parent84657b2e7ef92ac81d98e265db4305dfb6b5aab3 (diff)
downloadchef-lcg/fix-resources-dsl-method.tar.gz
add the resources() dsl method to providerslcg/fix-resources-dsl-method
Custom resource actions were picking this up via delegation to the wrapping resource, and that wiring was removed in 14, so that API then got dropped accidentally. This should fix that back up. It also consistently injects the resource APIs into resources and providers both now (and consistently across core resources and custom resources). Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/resource.rb')
-rw-r--r--lib/chef/resource.rb22
1 files changed, 2 insertions, 20 deletions
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index 46bc25b713..7cfb907795 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -23,6 +23,7 @@ require "chef/dsl/data_query"
require "chef/dsl/registry_helper"
require "chef/dsl/reboot_pending"
require "chef/dsl/resources"
+require "chef/dsl/declare_resource"
require "chef/json_compat"
require "chef/mixin/convert_to_class_name"
require "chef/guard_interpreter/resource_guard_interpreter"
@@ -51,6 +52,7 @@ class Chef
# Generic User DSL (not resource-specific)
#
+ include Chef::DSL::DeclareResource
include Chef::DSL::DataQuery
include Chef::DSL::RegistryHelper
include Chef::DSL::RebootPending
@@ -98,26 +100,6 @@ class Chef
end
#
- # Find existing resources by searching the list of existing resources. Possible
- # forms are:
- #
- # find(:file => "foobar")
- # find(:file => [ "foobar", "baz" ])
- # find("file[foobar]", "file[baz]")
- # find("file[foobar,baz]")
- #
- # Calls `run_context.resource_collection.find(*args)`
- #
- # @return the matching resource, or an Array of matching resources.
- #
- # @raise ArgumentError if you feed it bad lookup information
- # @raise RuntimeError if it can't find the resources you are looking for.
- #
- def resources(*args)
- run_context.resource_collection.find(*args)
- end
-
- #
# Resource User Interface (for users)
#