class Shell::ClientSession

Public Instance Methods

rebuild_context() click to toggle source
# File lib/chef/shell/shell_session.rb, line 202
def rebuild_context
  @run_status = Chef::RunStatus.new(@node, @events)
  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(@node.run_list.expand(@node.chef_environment))
  @run_status.run_context = run_context
end
save_node() click to toggle source
# File lib/chef/shell/shell_session.rb, line 198
def save_node
  @client.save_node
end

Private Instance Methods

rebuild_node() click to toggle source
# File lib/chef/shell/shell_session.rb, line 214
def rebuild_node
  # Make sure the client knows this is not chef solo
  Chef::Config[:solo] = false
  @client = Chef::Client.new(nil, Chef::Config[:shell_config])
  @client.run_ohai
  @client.register
  @client.load_node
  @client.build_node
end