Bug 1349364
Summary: | Cannot create new discovered host through /api/v2/discovered_hosts/facts | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Oleksandr Shtaier <oshtaier> | ||||
Component: | Fact | Assignee: | Lukas Zapletal <lzap> | ||||
Status: | CLOSED ERRATA | QA Contact: | Peter Ondrejka <pondrejk> | ||||
Severity: | high | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 6.2.0 | CC: | bbuckingham, bkearney, brubisch, dlezzoum, lzap, peter.vreman | ||||
Target Milestone: | Unspecified | Keywords: | AutomationBlocker, Triaged | ||||
Target Release: | Unused | ||||||
Hardware: | x86_64 | ||||||
OS: | Linux | ||||||
URL: | http://projects.theforeman.org/issues/16449 | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2018-02-21 16:51:07 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 1122832 | ||||||
Attachments: |
|
Description
Oleksandr Shtaier
2016-06-23 10:32:09 UTC
Thanks for report. Valid 6.2.z bug, non critical. You need to create valid subnet that will match pxebooted interface assigning it org and loc you want to discover into. Might be doco only bug, need to investigate. The problem is that on the host the set_taxonomy from facts is only done after the facts that set the interfaces is done. And in the set of the interfaces there is a check that validates that the host.location must be included in the subnet.location. This will ofcourse fail because the host.location is then still NULL. Swapping the set_taxonomy and other fact parsign will fix this. --- /usr/share/foreman/app/models/host/base.rb.160825-2 2016-08-25 14:15:43.286873877 +0000 +++ /usr/share/foreman/app/models/host/base.rb 2016-08-25 14:16:01.335925013 +0000 @@ -150,8 +150,8 @@ self.importing_facts = true save(:validate => false) - populate_fields_from_facts(facts, type) set_taxonomies(facts) + populate_fields_from_facts(facts, type) # we are saving here with no validations, as we want this process to be as fast # as possible, assuming we already have all the right settings in Foreman. Thanks for analysis and the patch, I submitted it for review. http://projects.theforeman.org/issues/16449 Upstream bug component is Fact Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16449 has been resolved. Verified in Satellite 6.3 snap 6 using robotello test (https://github.com/SatelliteQE/robottelo/blob/a8e4b3782a12adef2e175a54bb4edc00098ad85c/tests/foreman/api/test_discoveredhost.py#L132) Facts are uploaded correctly for discovered hosts, see the attached screenshot Created attachment 1225236 [details]
screenshot
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
>
> For information on the advisory, and where to find the updated files, follow the link below.
>
> If the solution does not work for you, open a new bug report.
>
> https://access.redhat.com/errata/RHSA-2018:0336
For the record, few months after the patch was merged a refactoring of puppet codebase reordered it back. I have noticed this and filed a fix with proper comment this should not be reversed anymore: https://projects.theforeman.org/issues/15409 However, I think the change does not have any impact on this particular bugzilla. |