class Shell::ClientSession
Public Instance Methods
definitions()
click to toggle source
# File lib/chef/shell/shell_session.rb, line 202 def definitions @run_context.definitions end
rebuild_context()
click to toggle source
# 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_node()
click to toggle source
# File lib/chef/shell/shell_session.rb, line 206 def save_node @client.save_node end
Private Instance Methods
rebuild_node()
click to toggle source
# File lib/chef/shell/shell_session.rb, line 222 def rebuild_node # Make sure the client knows this is not chef solo Chef::Config[:solo_legacy_mode] = false @client = Chef::Client.new(json_configuration, Chef::Config[:shell_config]) @client.run_ohai @client.register @client.load_node @client.build_node end