Project

General

Profile

Actions

Bug #10535

closed

Tokens are created for managed hosts after validation

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

Status:
Closed
Priority:
Normal
Assignee:
Category:
Host creation
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

set_token is called fr managed host after validations and not after save.
This can't be moved to after_save since the token is needed before save for templates.
The result is a token can be created for a host that eventually isn't saved as a managed host.
I only reproduced this with discovery: http://projects.theforeman.org/issues/9597
when provisioning a discovered host, trying to save causes validations and then a token was created.
As a result after canceling there was a token connected to a discovered host.


Related issues 3 (0 open3 closed)

Related to Discovery - Bug #9597: FK violation when trying to delete a discovered host after provisionClosedOri Rabin03/01/2015Actions
Related to Foreman - Bug #10558: Remove and prevent duplicate tokens via DB migrationClosedOri Rabin05/20/2015Actions
Has duplicate Foreman - Bug #10645: ERROR: update or delete on table "hosts" violates foreign key constraint "tokens_host_id_fk" on table "tokens" DETAIL: Key (id)=(2) is still referenced from table "tokens". Duplicate05/28/2015Actions
Actions

Also available in: Atom PDF