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


200
201
202
203
204
205
206
207
208
# File 'lib/chef/shef/shef_session.rb', line 200

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


196
197
198
# File 'lib/chef/shef/shef_session.rb', line 196

def save_node
  @client.save_node
end