Refactor #15525
Fact-type specific host's last_compile time
Description
The last_compile time is right now global. Which means:
1. importing facts of one type would prevent importing facts of another type (see http://projects.theforeman.org/issues/15524 for specific case), due to https://github.com/theforeman/foreman/blob/1.11.3/app/models/host/base.rb#L142
2. the time of the fact might be wrong https://github.com/theforeman/foreman/blob/1.11.3/app/helpers/fact_values_helper.rb#L3, as the last_compile time is used
to show time of the fact.
We should probably make the last_compile a type-specific type so that they don't interfere with each other.
Related issues
Associated revisions
fixes #15525 - always update facts
Previously, last_compile was checked to see if facts were uploaded in
the last minute and if so, ignore processing them. This code dates back
to the very first tagged version of Foreman in git - but these days we
have multiple providers so this check doesn't make sense. It's quite
conceivable that Salt/Chef/Puppet/Subscription Manager could upload
facts within such a short window - in fact, it does happen during
provisioning.
(cherry picked from commit abdced078c280a72ee1992fbbfd29772d7fc1ce2)
History
#1
Updated by Ivan Necas over 4 years ago
- Category set to Facts
#2
Updated by Ivan Necas over 4 years ago
- Description updated (diff)
#3
Updated by Ivan Necas over 4 years ago
- Related to Bug #15524: Registering host with subscription-manager prevents loading puppet facts in subequent run added
#4
Updated by The Foreman Bot over 4 years ago
- Status changed from New to Ready For Testing
- Assignee set to Stephen Benjamin
- Pull request https://github.com/theforeman/foreman/pull/3615 added
#5
Updated by Stephen Benjamin over 4 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset abdced078c280a72ee1992fbbfd29772d7fc1ce2.
#6
Updated by Dominic Cleal over 4 years ago
- Legacy Backlogs Release (now unused) set to 161
fixes #15525 - always update facts
Previously, last_compile was checked to see if facts were uploaded in
the last minute and if so, ignore processing them. This code dates back
to the very first tagged version of Foreman in git - but these days we
have multiple providers so this check doesn't make sense. It's quite
conceivable that Salt/Chef/Puppet/Subscription Manager could upload
facts within such a short window - in fact, it does happen during
provisioning.