Project

General

Profile

Actions

Bug #10365

closed

Migration to delete duplicate tokens doesn't work when there are no managed hosts

Added by Ori Rabin almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

The migration to fix: http://projects.theforeman.org/issues/9597
finds all the tokens that don't belong to a managed host.
When there are no managed hosts

Host::Managed.all.map(&:token).compact

is empty and so this line:
https://github.com/theforeman/foreman_discovery/commit/bc01733928b6babaf0feefbbce326169ae588b08#diff-791d17258792727551dfb2f3bb0e43b1R3
doesn't delete anything.

To fix this if there are no manged hosts all of the tokens should be deleted.


Related issues 1 (0 open1 closed)

Related to Discovery - Bug #9597: FK violation when trying to delete a discovered host after provisionClosedOri Rabin03/01/2015Actions
Actions #1

Updated by The Foreman Bot almost 9 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_discovery/pull/179 added
  • Pull request deleted ()
Actions #2

Updated by Ori Rabin almost 9 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #3

Updated by Ori Rabin almost 9 years ago

  • Related to Bug #9597: FK violation when trying to delete a discovered host after provision added
Actions

Also available in: Atom PDF