Actions
Bug #10365
closedMigration to delete duplicate tokens doesn't work when there are no managed hosts
Difficulty:
Triaged:
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.
Actions