Unable to be provision when using DHCP+Discovery in Foreman 2.1

Finally got around to updating to Foreman 2.1 and discovered a new behavior.

If you use the Discovery ISO, and boot using the DHCP option, the system will get a DHCP IP like say, and then connect to the smart proxy and discover (Success) as normal.

However, if you then go to Discovered Hosts, do all the setup of that system, including setting the “final” IP address you want on the system after being built like say, and then click submit to kick off the kexec and start the build. It will FAIL.

What I am seeing in the logs is that Foreman 2.1 seems to be doing is trying to kexec the FINAL IP of the system, not the current IP. This used to work correctly and Foreman would send the kexec to the current IP of the discovered host.

2020-07-22T14:40:05 [W|app|2b782eb3] Unable to perform kexec on mac005056abcxxx (https://mysmarproxy.mydomain.com:9090/discovery/ 500 Internal Server Error
2020-07-22T14:40:05 [W|app|2b782eb3] Unable to kexec

If you select MANUAL network setup when booting the Discovery ISO, and use the same IP as the final IP then it works fine, because the system is currently at the final IP so the kexec attempt works.

This is a definite CHANGE in behavior from previous versions, and it makes the DHCP option on the Foreman Discovery ISO unable to be used at all.

Also seeing foreman-proxy sending the discovery client power request to the wrong IP.

Started PUT /discovery/NEW IP/power/kexec
Finished PUT /discovery/NEW IP/power/kexec with 500

instead of what it should be doing

Started PUT /discovery/CURRENT IP/power/kexec
Finished PUT /discovery/CURRENT IP/power/kexec with 200