Bug #12185
closedInconsistent Host Creation
Description
I've found that when my hostname contains capital letters (e.g. HOSTNAME.domain.local) that two hosts will get created in the Foreman. One that contains the report information (that's upper-case), the other contains the fact information (that's lower-case). The debug logs for POSTing to /api/host/facts with a host that contains capitals looks like below:
http://pastie.org/private/13dhogrtbzxfjn4hdf1omq
I've also attached a sanitized screenshot of what this looks like in the Foreman.
I see in the code that you're down casing hostnames for importing facts, but don't see the same action taken when a node is created from a report upload:
Would it be possible to standardize how hosts are created from an import of reports and facts? I'm not fully aware of what the ramifications of this would be, but is it possible to not modify the hostname at all (i.e. create a host with the same name that was passed to the API)? As an experiment, I tried commenting out line 489 in the code above to see if it would only create one host, and tie the facts to the host with the capital hostname. It succeeded in the latter, but not the former. That is, I still ended up with 2 hosts in the Foreman UI, but the capital hostname entry had the facts tied to it. However, it still didn't auto-generate the Properties table of the host view for that capital hostname entry (i.e. Domain, MAC, IP Address). That table was still only filled out for the lower case host.
Setup:
Foreman 1.9.1
SmartProxy 1.9.1
Files
Updated by Marek Hulán about 9 years ago
- Project changed from Smart Proxy to Foreman
- Category set to Reporting
- Status changed from New to Assigned
- Assignee changed from Riley Shott to Marek Hulán
Thanks for the report. I saw the PR you've opened against chef-handler-foreman. That would fix it only for chef plugin but the same should be applied for all cfgmgmt tools so I'll send another fix against Foreman core.
Updated by The Foreman Bot about 9 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2836 added
- Pull request deleted (
)
Updated by Marek Hulán about 9 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 5ef1e692a49950f503c9a95b8b88b7e569d79be7.
Updated by Dominic Cleal about 9 years ago
- Translation missing: en.field_release set to 63
Updated by Marek Hulán about 9 years ago
- Related to Bug #12848: Duplicates host in Foreman console added