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 over 9 years ago. Updated over 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

Also available in: Atom PDF