Description of problem:

When creating custom report template, this code

<%- load_hosts(search: input('Hosts filter'), includes: [:operatingsystem, :applicable_errata, :lifecycle_environment]).each_record do |host| -%>
<%-   host_applicable_errata_filtered(host, input('Errata filter')).each do |erratum| -%>
<%= host.name %>
<%= erratum.errata_id %>
<%= erratum.cves %>
<%-   end -%>
<%- end -%>

produces this output:

denjht3.usersys.redhat.com
RHBA-2019:3977
#<Katello::ErratumCve::ActiveRecord_Associations_CollectionProxy:0x00007f3ab9067a70>

However, this code

<%- load_hosts(search: input('Hosts filter'), includes: [:operatingsystem, :applicable_errata, :lifecycle_environment]).each_record do |host| -%>
<%-   host_applicable_errata_filtered(host, input('Errata filter')).each do |erratum| -%>
<%-     report_row(
          'Host': host.name,
          'Erratum': erratum.errata_id,
          'CVEs': erratum.cves
        ) -%>
<%-   end -%>
<%- end -%>
<%= report_render -%>

produces this output:

Host,Erratum,CVEs
denjht3.usersys.redhat.com,RHBA-2020:0365,""
denjht3.usersys.redhat.com,RHSA-2019:4190,"4804,4805"

In the first example, the erratum.cves call produces output like this:

#<Katello::ErratumCve::ActiveRecord_Associations_CollectionProxy:0x00007f3ab9067a70>

In the second example, the same call (embedded within a report_row method) produces output like this:

"4804,4805"

Note that the other members do work without being embedded within a report_row method; this problem is specific to the cves member.


Version-Release number of selected component (if applicable):

Satellite 6.5


How reproducible:

100%


Steps to Reproduce:
1.  Create a custom report with the code supplied above.
2.  Create a Hosts Filter and an Errata Filter, both with input type "User input".
3.  Click the preview button to view the report's results, or generate a report.

Actual results:

cves member gives values like this:

#<Katello::ErratumCve::ActiveRecord_Associations_CollectionProxy:0x00007f3ab9067a70>


Expected results:

cves member should give values like this, even when not embedded within a report_row method:

"4804,4805"



Source link

Write a comment:
*

Your email address will not be published.