diff options
author | John Keiser <john@johnkeiser.com> | 2015-06-29 12:53:16 -0600 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2015-06-30 11:18:41 -0600 |
commit | 65f2812ffbd306bde3b1512e87e8bfae324d8087 (patch) | |
tree | 37c3291769d60ce03d28b0bb73ce0e4e35447d27 /lib/chef | |
parent | 097d130a8761bca6e9f79934b0cffd2d151b302b (diff) | |
download | chef-65f2812ffbd306bde3b1512e87e8bfae324d8087.tar.gz |
Fix broken specs
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/provider_resolver.rb | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/lib/chef/provider_resolver.rb b/lib/chef/provider_resolver.rb index d810900a03..f8e161f721 100644 --- a/lib/chef/provider_resolver.rb +++ b/lib/chef/provider_resolver.rb @@ -66,8 +66,24 @@ class Chef potential_handlers.include?(provider_class) end + def enabled_handlers + @enabled_handlers ||= potential_handlers.select { |handler| handler.method(:provides?).owner == Chef::Provider || handler.provides?(node, resource) } + end + + # TODO deprecate this and allow actions to be passed as a filter to + # `provides` so we don't have to have two separate things. + # @api private + def supported_handlers + @supported_handlers ||= + enabled_handlers.select { |handler| handler.supports?(resource, action) } + end + private + def potential_handlers + priority_map.list_handlers(node, resource.resource_name).flatten(1).uniq + end + # if resource.provider is set, just return one of those objects def maybe_explicit_provider(resource) return nil unless resource.provider @@ -105,23 +121,6 @@ class Chef Chef::Platform::ProviderPriorityMap.instance end - # @api private - def potential_handlers - priority_map.list_handlers(node, resource.resource_name).flatten(1).uniq - end - - def enabled_handlers - @enabled_handlers ||= potential_handlers.select { |handler| handler.method(:provides?).owner == Chef::Provider || handler.provides?(node, resource) } - end - - # TODO deprecate this and allow actions to be passed as a filter to - # `provides` so we don't have to have two separate things. - # @api private - def supported_handlers - @supported_handlers ||= - enabled_handlers.select { |handler| handler.supports?(resource, action) } - end - module Deprecated # return a deterministically sorted list of Chef::Provider subclasses def providers |