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



185
186
187
188
189
190
191
# File 'lib/chef/shef/shef_session.rb', line 185

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_status.run_context = run_context
end

#save_nodeObject



181
182
183
# File 'lib/chef/shef/shef_session.rb', line 181

def save_node
  @client.save_node
end