Permalink
Browse files

Add temporary monkey patch for client-mode role handling

  • Loading branch information...
1 parent c2d7784 commit e939b679a618de934d8f08ff93e6540c0190359a @stevendanna committed Feb 7, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 shef/client_session_fix.rb
@@ -0,0 +1,16 @@
+# Temporary monkey-patch for CHEF-2467
+# Ensure we call @run_context.load with the
+# correct run_list_expansion
+#
+module Shef
+ class ClientSession
+ def rebuild_context
+ @run_status = Chef::RunStatus.new(@node)
+ Chef::Cookbook::FileVendor.on_create { |manifest| Chef::Cookbook::RemoteFileVendor.new(manifest, Chef::REST.new(Chef::Config[:server_url])) }
+ cookbook_hash = @client.sync_cookbooks
+ @run_context = Chef::RunContext.new(node, Chef::CookbookCollection.new(cookbook_hash))
+ @run_context.load(@node.run_list.expand(@node.chef_environment))
+ @run_status.run_context = run_context
+ end
+ end
+end

0 comments on commit e939b67

Please sign in to comment.