Class: Shell::ClientSession

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

Direct Known Subclasses

DoppelGangerSession, SoloSession

Instance Attribute Summary

Attributes inherited from ShellSession

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

Instance Method Summary collapse

Methods inherited from ShellSession

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

Constructor Details

This class inherits a constructor from Shell::ShellSession

Instance Method Details

#definitionsObject



202
203
204
# File 'lib/chef/shell/shell_session.rb', line 202

def definitions
  @run_context.definitions
end

#rebuild_contextObject



210
211
212
213
214
215
216
217
218
# File 'lib/chef/shell/shell_session.rb', line 210

def rebuild_context
  @run_status = Chef::RunStatus.new(@node, @events)
  Chef::Cookbook::FileVendor.fetch_from_remote(Chef::ServerAPI.new(Chef::Config[:chef_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_nodeObject



206
207
208
# File 'lib/chef/shell/shell_session.rb', line 206

def save_node
  @client.save_node
end