Running jobs that resolve to 0 hosts result as 'succeeded'
|Target version:||Foreman - Team Ivan backlog|
|Velocity based estimate||-|
Description of problem:
If we run a remote execution job that has a 'search query' which resolves to 0 hosts, the job will still run but show a mis-leading success.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Goto Monitor -> Jobs
2. Click Run Job
3. Create a search query that resolves to 0 hosts, for example:
last_report < "30 minutes ago" and status.enabled = false
4. Submit job.
Shows evaluated against 0 hosts, but shows succeeded on right side (where we normally see percentage complete for job run).
Hosts tab is empty.
Monitor -> Jobs shows a job with 0 total hosts, and 0 actions, with status 'succeeded'.
Should not allow job to run if it resolves to 0 hosts on job submission.