Bug #24059
closedDiscovery API update call is always set with build flag
Description
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):
6.3.1
How reproducible:
Easy
Steps to Reproduce:
Sending a put request to /api/v2/discovered_hosts/id with the data like this
{
"discovered_host": {
"name": "$hostname",
"mac": "$mac",
"ip": "$ip",
"hostgroup_name": "$hostgroup_name",
"root_pass": "$root_pass",
"build": 0,
}
Actual results:
The discovered host went directly into provisioning and host.build = 1
Expected results:
The discovered host shouldn't go directly into provisioning and host.build = 0
Additional info:
Comparing this two lines in foreman_discovery/app/controllers/api/v2/discovered_hosts_controller.rb
6.2:
@host = ::ForemanDiscovery::HostConverter.to_managed(@discovered_host)
6.3:
@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.
Updated by The Foreman Bot over 6 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman_discovery/pull/441 added
Updated by Lukas Zapletal over 6 years ago
- Target version set to Discovery Plugin 12.0.1
Updated by Anonymous over 6 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset foreman_discovery|85883f1c8ad552ca13f4b3fb19db1ac980ac332a.