Class: Shef::ClientSession

Inherits:
SoloSession show all
Defined in:
lib/chef/shef/shef_session.rb

Direct Known Subclasses

DoppelGangerSession

Instance Attribute Summary

Attributes inherited from ShefSession

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

Instance Method Summary collapse

Methods inherited from SoloSession

#definitions

Methods inherited from ShefSession

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

Constructor Details

This class inherits a constructor from Shef::ShefSession

Instance Method Details

#rebuild_contextObject



190
191
192
193
194
195
196
197
# File 'lib/chef/shef/shef_session.rb', line 190

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(Chef::RunList::RunListExpansionFromAPI.new("_default", []))
  @run_status.run_context = run_context
end

#save_nodeObject



186
187
188
# File 'lib/chef/shef/shef_session.rb', line 186

def save_node
  @client.save_node
end