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): Satellite 6.2.1: rubygem-smart_proxy_remote_execution_ssh-0.1.2-2.el7sat.noarch tfm-rubygem-smart_proxy_remote_execution_ssh_core-0.1.2-1.el7sat.noarch How reproducible: 100% 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. Actual results: 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'. Expected results: Should not allow job to run if it resolves to 0 hosts on job submission.
REX can handle resolving the search query two ways, static and dynamic. Static is evaluated when the user submits the form, dynamic is evaluated REX has two ways of resolving the search query. Citing the explanation from the new job invocation form: "Type has impact on when is the query evaulated to hosts. Static evaluates just after you submit this form. Dynamic evaluates just before the execution is started, so if it's planed in future, targeted hosts set may change before it." This means we can implement a check and display some kind of validation error in case there are no hosts, but this can be done only when using the static query. When using the dynamic query we could show some kind of warning like "right now, this search query would resolve to no hosts", but we can't stop the execution, because the query will be resolved later and the number of hosts matching it might change. Would this work for you?
Created redmine issue http://projects.theforeman.org/issues/16993 from this bug
This sounds fine to me. I really was not aware of the other type of query.
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the foreseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.