Problem:
I want to see if if host_applicable_errata_filtered(host, input(‘Errata filter’)) is empty. I do not know how to do this.
The following did not yield any results
host_applicable_errata_filtered(host, input(‘Errata filter’)).empty
host_applicable_errata_filtered(host, input(‘Errata filter’)).nil
host_applicable_errata_filtered(host, input(‘Errata filter’)) != nil
<%- report_headers 'Host' -%>
<%- load_hosts(search: input('Hosts filter'), preload: [:operatingsystem, :lifecycle_environment]).each_record do |host| -%>
<%- if host_applicable_errata_filtered(host, input('Errata filter')) -%>
<%- host_applicable_errata_filtered(host, input('Errata filter')).each do |erratum| -%>
<%- report_row(
'Host': host.name
) -%>
<%- end -%>
<%- else -%>
<%- report_row('Host': host.name) -%>
<%- end -%>
<%- end -%>
Additionally is it alright to use host_applicable_errata_filtered(host) - no errata filter as a second argument? It looks like it works, but I’m not sure if there’s any bad nuances I’m missing by omitting it. Unsure if there’s a better way to get the same data.