refresh_facts on a renamed discovered host creating second discovered host record
Description of problem:
Trying to refresh facts on an existing discovered host creates a new discovered host. The new host has the same information but a name based on mac address.
Steps to Reproduce:
1. Discover a host
2. Update the name on the discovered host to something other than mac address based name
4. Refresh discovered hosts page or data.
I was doing this through the api calls to discovered hosts, but was also able to reproduce on the console:
dh = ::Host::Discovered.find(<id>)
dh.name = 'copyme'
A new discovered host with a name based on mac address was found. At this point repeating the process will not create a copy since one already exists.
The facts on the host would be refreshed without creating a new host.
It looked like refresh_facts calling Host::Discovered.import_host would find_by_name and come up empty and create a new host.
#5 Updated by Christopher Chase almost 3 years ago
Not allowed to edit the Bugzilla Link field, though
#8 Updated by Anonymous almost 3 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset foreman_discovery|7dc5b8d48a7fd09766e5ecdb667ab77a02956f7b.