# File lib/cloudmasterd/syncer.rb, line 126
  def sync_owners
    # Sync up any unowned machines that now have an owner (handles race condition with syncing states)
    unowned_machines = {}
    Machine.find(:all, :conditions => "email = 'unknown'").each do |machine|
      unowned_machines[machine.name] = machine
    end

    owned_machines = {}
    Machine.find(:all, :conditions => "email <> 'unknown'").each do |machine|
      owned_machines[machine.name] = machine
    end

    owned_machines.each do |name, machine|
      if unowned_machines.has_key?(name) then
        # Delete the unowned machine and update the owned one
        u_machine = unowned_machines[name]
        machine.update_attributes(:cloud => u_machine.cloud, :state => u_machine.state)
        u_machine.destroy()
      end
    end
  end