diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-03-18 11:08:39 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-03-18 11:08:39 -0700 |
commit | 9ec0d7835fa55110a5c76a83e03ae54223202989 (patch) | |
tree | 6a78829344374cb0b6115b5535bcbf55f323b027 /lib/chef/provider.rb | |
parent | 559ce1da6ce142ebfb553f1124ab9e86a68709a8 (diff) | |
download | chef-9ec0d7835fa55110a5c76a83e03ae54223202989.tar.gz |
rearrange dsl mixinslcg/dsl-rearrangement
- creates Chef::DSL::MethodMissing which will be nuked in Chef 13
- creates Chef::DSL::Core which is the mixins into core providers
- adds build_resource/define_resource to core providers
The intent here is to create Chef::DSL::Core which is intended to
become the DSL minus method_missing and things that are only intended
for recipes. Right now I've only added build_resource/declare_resource
to core providers. We should probably push more into the "Core" DSL
so that core providers could do things like use the search API.
I would have moved everything other than resources and definitions over
but the audit mode stuff is really only appropriate for recipes and not
provider code and probably should not be moved over. We should probably
have an intermediate mixin which is the "Custom Provider" DSL that has
Resources and Definitions mixed into it, but which does not mix in the
audit stuff that should only go into the Recipe DSL.
There may also be a "Resources DSL" which has mixins for use with
not_if/only_if and I'm unclear if that should be the "Core DSL" or
another fourth mixin of DSL files.
Diffstat (limited to 'lib/chef/provider.rb')
-rw-r--r-- | lib/chef/provider.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/provider.rb b/lib/chef/provider.rb index 014fccbb48..cef95a4db8 100644 --- a/lib/chef/provider.rb +++ b/lib/chef/provider.rb @@ -22,8 +22,8 @@ require "chef/mixin/convert_to_class_name" require "chef/mixin/enforce_ownership_and_permissions" require "chef/mixin/why_run" require "chef/mixin/shell_out" -require "chef/mixin/powershell_out" require "chef/mixin/provides" +require "chef/dsl/core" require "chef/platform/service_helpers" require "chef/node_map" require "forwardable" @@ -31,13 +31,13 @@ require "forwardable" class Chef class Provider require "chef/mixin/why_run" - require "chef/mixin/shell_out" require "chef/mixin/provides" include Chef::Mixin::WhyRun - include Chef::Mixin::ShellOut - include Chef::Mixin::PowershellOut extend Chef::Mixin::Provides + # includes the "core" DSL and not the "recipe" DSL by design + include Chef::DSL::Core + # supports the given resource and action (late binding) def self.supports?(resource, action) true |