summaryrefslogtreecommitdiff
path: root/lib/chef/chef_class.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/chef_class.rb')
-rw-r--r--lib/chef/chef_class.rb109
1 files changed, 44 insertions, 65 deletions
diff --git a/lib/chef/chef_class.rb b/lib/chef/chef_class.rb
index d3f7ee55c7..f0c7693a49 100644
--- a/lib/chef/chef_class.rb
+++ b/lib/chef/chef_class.rb
@@ -33,50 +33,16 @@ class Chef
# Public API
#
- # Get the node object
- #
- # @return [Chef::Node] node object of the chef-client run
- attr_reader :node
-
# Get the run context
#
# @return [Chef::RunContext] run_context of the chef-client run
attr_reader :run_context
- # Get the array of providers associated with a resource_name for the current node
- #
- # @param resource_name [Symbol] name of the resource as a symbol
- # @return [Array<Class>] Priority Array of Provider Classes to use for the resource_name on the node
- def get_provider_priority_array(resource_name)
- @provider_priority_map.get_priority_array(node, resource_name).dup
- end
-
- # Get the array of resources associated with a resource_name for the current node
- #
- # @param resource_name [Symbol] name of the resource as a symbol
- # @return [Array<Class>] Priority Array of Resource Classes to use for the resource_name on the node
- def get_resource_priority_array(resource_name)
- @resource_priority_map.get_priority_array(node, resource_name).dup
- end
-
- # Set the array of providers associated with a resource_name for the current node
- #
- # @param resource_name [Symbol] name of the resource as a symbol
- # @param priority_array [Array<Class>] Array of Classes to set as the priority for resource_name on the node
- # @param filter [Hash] Chef::Nodearray-style filter
- # @return [Array<Class>] Modified Priority Array of Provider Classes to use for the resource_name on the node
- def set_provider_priority_array(resource_name, priority_array, *filter)
- @provider_priority_map.set_priority_array(resource_name, priority_array, *filter).dup
- end
-
- # Get the array of resources associated with a resource_name for the current node
+ # Get the node object
#
- # @param resource_name [Symbol] name of the resource as a symbol
- # @param priority_array [Array<Class>] Array of Classes to set as the priority for resource_name on the node
- # @param filter [Hash] Chef::Nodearray-style filter
- # @return [Array<Class>] Modified Priority Array of Resource Classes to use for the resource_name on the node
- def set_resource_priority_array(resource_name, priority_array, *filter)
- @resource_priority_map.set_priority_array(resource_name, priority_array, *filter).dup
+ # @return [Chef::Node] node object of the chef-client run
+ def node
+ run_context.node
end
#
@@ -85,30 +51,6 @@ class Chef
# *NOT* for public consumption ]
#
- # Sets the resource_priority_map
- #
- # @api private
- # @param resource_priority_map [Chef::Platform::ResourcePriorityMap]
- def set_resource_priority_map(resource_priority_map)
- @resource_priority_map = resource_priority_map
- end
-
- # Sets the provider_priority_map
- #
- # @api private
- # @param provider_priority_map [Chef::Platform::providerPriorityMap]
- def set_provider_priority_map(provider_priority_map)
- @provider_priority_map = provider_priority_map
- end
-
- # Sets the node object
- #
- # @api private
- # @param node [Chef::Node]
- def set_node(node)
- @node = node
- end
-
# Sets the run_context object
#
# @api private
@@ -122,9 +64,46 @@ class Chef
# @api private
def reset!
@run_context = nil
- @node = nil
- @provider_priority_map = nil
- @resource_priority_map = nil
end
+
+ module BackcompatBreak
+ # Get the array of providers associated with a resource_name for the current node
+ #
+ # @param resource_name [Symbol] name of the resource as a symbol
+ # @return [Array<Class>] Priority Array of Provider Classes to use for the resource_name on the node
+ def get_provider_priority_array(resource_name)
+ raise NotImplementedError, "this will no longer work"
+ end
+
+ # Get the array of resources associated with a resource_name for the current node
+ #
+ # @param resource_name [Symbol] name of the resource as a symbol
+ # @return [Array<Class>] Priority Array of Resource Classes to use for the resource_name on the node
+ def get_resource_priority_array(resource_name)
+ raise NotImplementedError, "this will no longer work"
+ end
+
+ # Set the array of providers associated with a resource_name for the current node
+ #
+ # @param resource_name [Symbol] name of the resource as a symbol
+ # @param priority_array [Array<Class>] Array of Classes to set as the priority for resource_name on the node
+ # @param filter [Hash] Chef::Nodearray-style filter
+ # @return [Array<Class>] Modified Priority Array of Provider Classes to use for the resource_name on the node
+ def set_provider_priority_array(resource_name, priority_array, *filter)
+ raise NotImplementedError, "this will no longer work"
+ end
+
+ # Get the array of resources associated with a resource_name for the current node
+ #
+ # @param resource_name [Symbol] name of the resource as a symbol
+ # @param priority_array [Array<Class>] Array of Classes to set as the priority for resource_name on the node
+ # @param filter [Hash] Chef::Nodearray-style filter
+ # @return [Array<Class>] Modified Priority Array of Resource Classes to use for the resource_name on the node
+ def set_resource_priority_array(resource_name, priority_array, *filter)
+ raise NotImplementedError, "this will no longer work"
+ end
+
+ end
+ include BackcompatBreak
end
end