Class: Shell::ClientSession

Inherits:
SoloSession show all
Defined in:
lib/chef/shell/shell_session.rb

Direct Known Subclasses

DoppelGangerSession

Instance Attribute Summary

Attributes inherited from ShellSession

#client, #compile, #node, #node_attributes, #recipe, #run_context

Instance Method Summary collapse

Methods inherited from SoloSession

#definitions

Methods inherited from ShellSession

#cookbook_loader, #definitions, #initialize, inspect, #node_built?, #reset!, #resource_collection, session_type

Constructor Details

This class inherits a constructor from Shell::ShellSession

Instance Method Details

#rebuild_contextObject



202
203
204
205
206
207
208
209
210
# 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(Chef::RunList::RunListExpansionFromAPI.new("_default", []))
  @run_status.run_context = run_context
end

#save_nodeObject



198
199
200
# File 'lib/chef/shell/shell_session.rb', line 198

def save_node
  @client.save_node
end