Discovery to organization without subnet works after reboot
Description of problem:
there is a validation in place where on POSTing to /facts, satellite ensures that the default discovery org/loc has a subnet assigned.
If it doesn't discovery fails with a proepr 422 message.
However, it looks like foreman somehow keeps the host record as if one re-runs the discovery (or POST to /facts again with the same facts), the discovery passes and the discovery host is created.
This is an inconsistent behaviour.
- i don't see a reason of denying a discovery on a satellite misconfig (since that one might get remediated after discovery) - the only problem arises when one has some auto-provision rules in place. But i would treat a failed auto provisioning as a reasonable "answer".
Also, it should be possible to check the "misconfig" much sooner than the during the discovery - one could get notified at discovered hosts pages about the existing misconfig (like showing a warning that the currently used organization does not come with a subnet assigned and thus the provisioning won't work).
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. create a subnet
2. create an organization and assure it has no subnets assigned
2.b repeat the #1 with a location
3. set this org/locs as the default discovery taxonomies using global settings -> discovery
4. get a host and boot FDI
5. the discovery should fail (production.log shows 422 complaining about org not belonging to the subnet
6. now rerun (reboot) the discovery image to send the facts again
7. the discovery should now be successful with a message that some fact got updated
inconsistent behaviour across reboots (1st run fails, all the future run succeed)
bonus points for allowing discovery to pass even if no subnet is attached to the hosts taxonomies (only if there is no good reason for this)