Discovery API update call is always set with build flag
Description of problem:
There is a regression introduced in foremand_discovery by this commit 044cd42ffcb96819af0bd3d88bb348f2f9dc8ea9.
Sending a put request to /api/v2/discovered_hosts/id with build=0 used to work in 6.2 but now host.build is always set 1 by this API in Satellite 6.3.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Sending a put request to /api/v2/discovered_hosts/id with the data like this
The discovered host went directly into provisioning and host.build = 1
The discovered host shouldn't go directly into provisioning and host.build = 0
Comparing this two lines in foreman_discovery/app/controllers/api/v2/discovered_hosts_controller.rb
@host = ::ForemanDiscovery::HostConverter.to_managed(@discovered_host)
@host = ::ForemanDiscovery::HostConverter.to_managed(@discovered_host, true, true, managed_host_params)
Then take a look foreman_discovery/app/services/foreman_discovery/host_converter.rb +37 in 6.3
host.build = true
This just ignores the build parameter from the API request which is not right.
#3 Updated by Anonymous about 2 years ago
- % Done changed from 0 to 100
- Status changed from Ready For Testing to Closed
Applied in changeset foreman_discovery|85883f1c8ad552ca13f4b3fb19db1ac980ac332a.