Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1870372 - [RFE] Add Content View Version to Reporting Engine Template
Summary: [RFE] Add Content View Version to Reporting Engine Template
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Reporting
Version: 6.7.0
Hardware: Unspecified
OS: Linux
unspecified
low
Target Milestone: Unspecified
Assignee: Marek Hulan
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-19 21:39 UTC by Scott Spurrier
Modified: 2024-06-04 10:27 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-06-04 10:27:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 30703 0 Normal New Add Content View Version to Reporting Engine Template 2020-08-25 07:04:21 UTC

Description Scott Spurrier 2020-08-19 21:39:25 UTC
Description of problem:

Its currently not possible to pull out the Content View Version that a client system is using from the Report Template reports.  

Please add the "Content View Version Number" to one of the reports in the  Report Templates.  Possibly in the "Registered hosts" or in the "Entitlements" report that already shows the Content View.

Comment 1 Ondřej Pražák 2020-08-25 07:04:19 UTC
Created redmine issue https://projects.theforeman.org/issues/30703 from this bug

Comment 2 Marek Hulan 2020-08-26 09:10:24 UTC
We only need to allow version method in the safe mode, until that happens, you could disable the safe mode rendering (consider all the implications) and use the following code

> host.content_view.version(host.lifecycle_environment)

where host is the host object you're interested in.

Comment 3 Bryan Kearney 2020-08-26 12:02:06 UTC
Upstream bug assigned to mhulan

Comment 4 Bryan Kearney 2020-08-26 12:02:09 UTC
Upstream bug assigned to mhulan

Comment 5 Bryan Kearney 2021-01-13 13:26:22 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/30703 has been resolved.

Comment 6 Lukáš Hellebrandt 2021-07-09 15:10:35 UTC
Failed with Sat 6.10.0 snap 5.0.

When trying to access CV version like this:
```
'CVV': host.content_view ? '' : host.content_view.version(host.lifecycle_environment).to_s
```

I get this error when generating:
```
undefined method '#version' for NilClass::Jail (NilClass)
```

I also tried this with only the hosts that do have CV with the same result.

Comment 10 Marek Hulan 2021-08-09 14:52:23 UTC
Lukáš, you asked for a fully working example, this is what works as a report template with this new macro. Hope that helps in testing.

<%- load_hosts.each_record do |h| -%>
<%-   cv = '' -%>
<%-   if h.content_view -%>
<%-     cv = h.content_view.version(h.lifecycle_environment).to_s -%>
<%-   end -%>
<%-   report_row 'host': h.name, 'cv': cv -%>
<%- end -%>
<%= report_render -%>

Comment 18 Brad Buckingham 2024-05-29 17:19:35 UTC
Lukáš, 

Did a separate BZ get created for this one based upon comment 17 (and 16)?

If it did, we can CLOSE:CURRENTRELEASE this one with comment that it was resolved in 6.14.

thanks,
Brad

Comment 19 Lukáš Hellebrandt 2024-06-04 10:12:04 UTC
Reported as bug 2290350

Comment 20 Brad Buckingham 2024-06-04 10:27:32 UTC
Thanks Lukáš!

Since bug 2290350 was created to track the remaining issue, moving this one to CLOSED:CURRENTRELEASE.


Note You need to log in before you can comment on or make changes to this bug.