# class Shell::DoppelGangerSession

### Public Instance Methods

assume_identity(node_name) click to toggle source

    # File lib/chef/shell/shell_session.rb, line 269
    def assume_identity(node_name)
      Chef::Config[:doppelganger] = @node_name = node_name
      reset!
    rescue Exception => e
      puts "#{e.class.name}: #{e.message}"
      puts Array(e.backtrace).join("\n")
      puts
      puts "* " * 40
      puts "failed to assume the identity of node '#{node_name}', resetting"
      puts "* " * 40
      puts
      Chef::Config[:doppelganger] = false
      @node_built = false
      Shell.session
    end

rebuild_node() click to toggle source

    # File lib/chef/shell/shell_session.rb, line 285
    def rebuild_node
      # Make sure the client knows this is not chef solo
      Chef::Config[:solo] = false
      @client = DoppelGangerClient.new(@node_name)
      @client.run_ohai
      @client.register
      @client.load_node
      @client.build_node
      @client.sync_cookbooks
    end

save_node() click to toggle source

    # File lib/chef/shell/shell_session.rb, line 265
    def save_node
      puts "A doppelganger should think twice before saving the node"
    end