    # File lib/chef/cookbook/synchronizer.rb, line 92
        def sync_cookbooks
          Chef::Log.info("Loading cookbooks [#{cookbook_names.sort.join(', ')}]")
          Chef::Log.debug("Cookbooks detail: #{cookbooks.inspect}")

          clear_obsoleted_cookbooks

          @events.cookbook_sync_start(cookbook_count)

          # Synchronize each of the node's cookbooks, and add to the
          # valid_cache_entries hash.
          cookbooks.each do |cookbook|
            sync_cookbook(cookbook)
          end

        rescue Exception => e
          @events.cookbook_sync_failed(cookbooks, e)
          raise
        else
          @events.cookbook_sync_complete
          true
        end