[Report Template] How to list package names and versions in report templates?

Below is a snippet of the Applicable Errata Report Template, it lists packages but as names erratum.package_names.
How do I get names as well as versions? I can’t find any documentation on this here https://www.rubydoc.info/search/gems/katello

<%-   host_applicable_errata_filtered(host, input('Errata filter')).each do |erratum| -%>
<%-     report_row(
          'Host': host.name,
          'Operating System': host.operatingsystem,
          'Environment': host.lifecycle_environment,
          'Erratum': erratum.errata_id,
          'Type': erratum.errata_type,
          'Published': erratum.issued,
          'Applicable since': erratum.created_at,
          'Severity': erratum.severity,
          'Packages': erratum.package_names,
          'CVEs': erratum.cves.map { |c| c.cve_id },
          'Reboot suggested': erratum.reboot_suggested,
        ) -%>

I think erratum.packages would give you what you’re looking for (for example, python3-pip-9.0.3-22.el8.noarch

However, this would only work with safe mode turned off. In order to work with safe mode, :packages would have to be added here.

1 Like

Looks like if you’re using Satellite 6.11, .packages only shows names still. Equivalent to .package_names.
Can anyone else confirm this or on other versions of foreman?

I’m on 3.5.2 and can confirm that .packages and .package_names displays the same thing. For the HTML output, all of the cells where the package name is supposed to be shown, I get text like this:

#<Katello::ErratumPackage::ActiveRecord_Associations_CollectionProxy:0x000055b1c4d4b248>

The CSV reports don’t seem to have this issue (minus the not displaying the package version part)