diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2015-04-13 11:22:20 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-04-13 11:36:21 -0700 |
commit | e4d14202198b5599b89ee82c73a5410267095629 (patch) | |
tree | 0f76cd9f24c00b70edf2308da881f2a64c00c1cc | |
parent | c3e7a43f7dd669c4f6a125555f1b0d49982d9c5c (diff) | |
download | chef-lcg/resource_priority_map.tar.gz |
move where we dep inject the priority mapslcg/resource_priority_map
fixes the priority maps on chef-apply by wiring it up in the
constructor of the client
-rw-r--r-- | lib/chef/client.rb | 7 | ||||
-rw-r--r-- | lib/chef/policy_builder/expand_node_object.rb | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/lib/chef/client.rb b/lib/chef/client.rb index 098345a9e2..d04a3dbbd5 100644 --- a/lib/chef/client.rb +++ b/lib/chef/client.rb @@ -166,6 +166,13 @@ class Chef if new_runlist = args.delete(:runlist) @json_attribs["run_list"] = new_runlist end + + # these slurp in the resource+provider world, so be exceedingly lazy about requiring them + require 'chef/platform/provider_priority_map' unless defined? Chef::Platform::ProviderPriorityMap + require 'chef/platform/resource_priority_map' unless defined? Chef::Platform::ResourcePriorityMap + + Chef.set_provider_priority_map(Chef::Platform::ProviderPriorityMap.instance) + Chef.set_resource_priority_map(Chef::Platform::ResourcePriorityMap.instance) end def configure_formatters diff --git a/lib/chef/policy_builder/expand_node_object.rb b/lib/chef/policy_builder/expand_node_object.rb index aa761926d3..524bdd95b1 100644 --- a/lib/chef/policy_builder/expand_node_object.rb +++ b/lib/chef/policy_builder/expand_node_object.rb @@ -61,13 +61,7 @@ class Chef # # @param run_context [Chef::RunContext] the run_context to inject def setup_chef_class(run_context) - # these slurp in the resource+provider world, so be exceedingly lazy about requiring them - require 'chef/platform/provider_priority_map' - require 'chef/platform/resource_priority_map' - Chef.set_run_context(run_context) - Chef.set_provider_priority_map(Chef::Platform::ProviderPriorityMap.instance) - Chef.set_resource_priority_map(Chef::Platform::ResourcePriorityMap.instance) end def setup_run_context(specific_recipes=nil) |