summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Danna <steve@opscode.com>2012-10-17 00:59:00 -0700
committerBryan McLellan <btm@opscode.com>2013-04-18 08:58:26 -0700
commitefcbbc16a007aa492449d885bf1da76980021157 (patch)
tree544b26f6538e72b50736888d4e4bfa360327abba
parent856ff7c66ad2e3b7708fe473aa66eb9b271839ef (diff)
downloadchef-efcbbc16a007aa492449d885bf1da76980021157.tar.gz
[CHEF-2467] Ensure Shef loads run_context using correct run_list and environment.
Currently, Shef in client-mode will not properly process attributes set in roles or environments since we assume an empty runlist and the _default environment when building the node.
-rw-r--r--lib/chef/shell/shell_session.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/shell/shell_session.rb b/lib/chef/shell/shell_session.rb
index 287cf0c166..cf147e778d 100644
--- a/lib/chef/shell/shell_session.rb
+++ b/lib/chef/shell/shell_session.rb
@@ -204,8 +204,8 @@ module Shell
Chef::Cookbook::FileVendor.on_create { |manifest| Chef::Cookbook::RemoteFileVendor.new(manifest, Chef::REST.new(Chef::Config[:server_url])) }
cookbook_hash = @client.sync_cookbooks
cookbook_collection = Chef::CookbookCollection.new(cookbook_hash)
- @run_context = Chef::RunContext.new(node, cookbook_collection, @events)
- @run_context.load(Chef::RunList::RunListExpansionFromAPI.new("_default", []))
+ @run_context = Chef::RunContext.new(node, cookbook_collection, @events)
+ @run_context.load(@node.run_list.expand(@node.chef_environment))
@run_status.run_context = run_context
end