# File lib/chef/client.rb, line 140
    def run
      run_context = nil

      run_ohai
      register unless Chef::Config[:solo]
      build_node
      
      begin

        run_status.start_clock
        Chef::Log.info("Starting Chef Run (Version #{Chef::VERSION})")
        run_started
        
        if Chef::Config[:solo]
          Chef::Cookbook::FileVendor.on_create { |manifest| Chef::Cookbook::FileSystemFileVendor.new(manifest) }
          run_context = Chef::RunContext.new(node, Chef::CookbookCollection.new(Chef::CookbookLoader.new))
          run_status.run_context = run_context
          assert_cookbook_path_not_empty(run_context)
          converge(run_context)
        else
          # Sync_cookbooks eagerly loads all files except files and templates.
          # It returns the cookbook_hash -- the return result from
          # /nodes/#{nodename}/cookbooks -- which we will use for our
          # run_context.
          Chef::Cookbook::FileVendor.on_create { |manifest| Chef::Cookbook::RemoteFileVendor.new(manifest, rest) }
          cookbook_hash = sync_cookbooks
          run_context = Chef::RunContext.new(node, Chef::CookbookCollection.new(cookbook_hash))
          run_status.run_context = run_context

          assert_cookbook_path_not_empty(run_context)
          
          converge(run_context)
          Chef::Log.debug("Saving the current state of node #{node_name}")
          @node.save
        end
        
        run_status.stop_clock
        Chef::Log.info("Chef Run complete in #{run_status.elapsed_time} seconds")
        run_completed_successfully
        true
      rescue Exception => e
        run_status.stop_clock
        run_status.exception = e
        run_failed
        Chef::Log.debug("Re-raising exception: #{e.class} - #{e.message}\n#{e.backtrace.join("\n  ")}")
        raise
      ensure
        run_status = nil
      end
    end