Project

General

Profile

Refactor #4032

TFTP orchestration uses direct object comparison

Added by Greg Sutcliffe over 7 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Category:
Orchestration
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

It shouldn't. This was the root cause of why the TFTP orchestration was working for the last year - the build? flag was never read correctly, but because old.os != os was always returning true (even when the OS wasn't changed) the TFTP orchestration was working.

We've fixed the problem in build? (PR 1159) but the object comparisons remain. You can prove that Rails does odd things with a smple snippet:

u = User.first
reload!
u1 = User.first
u == u1
=> false

As a start I've altered the TFTP orchestration to use object.id which is reliable (since it's loaded from the db). There are probably a lot more of these around the codebase though...


Related issues

Related to Foreman - Bug #4031: TFTP record is not updated after host is builtClosed2014-01-16

Associated revisions

Revision 409ce13e (diff)
Added by Greg Sutcliffe over 7 years ago

Fixes #4032 - Use object.id for comparisons

Revision d9998ea1 (diff)
Added by Greg Sutcliffe over 7 years ago

Fixes #4032 - Use object.id for comparisons

(cherry picked from commit 409ce13e71b5a23178e109b0fb240fc2e2c6ff94)

History

#2 Updated by Greg Sutcliffe over 7 years ago

  • Related to Bug #4031: TFTP record is not updated after host is built added

#3 Updated by Dominic Cleal over 7 years ago

  • Legacy Backlogs Release (now unused) set to 2

#4 Updated by Greg Sutcliffe over 7 years ago

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

Also available in: Atom PDF