Bug #22121
openFailed to refresh facts on discovered host for custom fact in the discovery_hostname setting
Description
Description of problem: Refreshing fact on discovered host with custom facts set using manual network setup (see attachment) gives error
Error: ERF50-7522 [Foreman::WrappedException]: Failed to refresh facts for hostfactvalue with error ERF50-0929 [Foreman::WrappedException]: Could not get facts from Capsule https://satellite:9090/discovery/192.168.100.11: ERF42-9632 [Foreman::Exception]: Invalid facts: hash does not contain a valid value for any of the facts in the discovery_hostname setting: testfact ([Foreman::Exception]: ERF42-9632 [Foreman::Exception]: Invalid facts: hash does not contain a valid value for...) ([Foreman::WrappedException]: ERF50-0929 [Foreman::WrappedException]: Could not get facts from Capsule https://satellite...)
Version-Release number of selected component (if applicable): Satellite 6.3 snap 30
How reproducible: always
Steps to Reproduce:
1. Set the Hostname facts in Administer -> settings -> Discovered (ex : testfact )
2. Discover a host with pxe and without dhcp (i.e. manually set network)
3. Add custom fact name (ex : testfact) and fact value(ex : factvalue) see attachment.
4. Refresh facts on discovered host from satellite UI.
Actual results:
Refreshing facts gives error
Error: ERF50-7522 [Foreman::WrappedException]: Failed to refresh facts for hostfactvalue with error ERF50-0929 [Foreman::WrappedException]: Could not get facts from Capsule https://satellite:9090/discovery/192.168.100.11: ERF42-9632 [Foreman::Exception]: Invalid facts: hash does not contain a valid value for any of the facts in the discovery_hostname setting: testfact ([Foreman::Exception]: ERF42-9632 [Foreman::Exception]: Invalid facts: hash does not contain a valid value for...) ([Foreman::WrappedException]: ERF50-0929 [Foreman::WrappedException]: Could not get facts from Capsule https://satellite...)
Expected results: Refresh facts should work.