def delete(entry)
      return true if !entry.id

      @lock.synchronize do
        with_index_lock do
          return true if !@machines[entry.id]

          # If we don't have the lock, then we need to acquire it.
          if !@machine_locks[entry.id]
            raise "Unlocked delete on machine: #{entry.id}"
          end

          # Reload so we have the latest data, then delete and save
          unlocked_reload
          @machines.delete(entry.id)
          unlocked_save

          # Release access on this machine
          unlocked_release(entry.id)
        end
      end

      true
    end
def delete(entry)
      return true if !entry.id

      @lock.synchronize do
        with_index_lock do
          return true if !@machines[entry.id]

          # If we don't have the lock, then we need to acquire it.
          if !@machine_locks[entry.id]
            raise "Unlocked delete on machine: #{entry.id}"
          end

          # Reload so we have the latest data, then delete and save
          unlocked_reload
          @machines.delete(entry.id)
          unlocked_save

          # Release access on this machine
          unlocked_release(entry.id)
        end
      end

      true
    end
Initializes a MachineIndex at the given file location.

 @param [Pathname] data_dir Path to the directory where data for the
   index can be stored. This folder should exist and must be writable.
 Deletes a machine by UUID.

 The machine being deleted with this UUID must either be locked
 by this index or must be unlocked.

 @param [Entry] entry The entry to delete.
 @return [Boolean] true if delete is successful