Description of problem:
Currently, the host parameter is accessible in report template only using host.info['parameters']['Parameter Name'] but needs to set "Safemode rendering" to false. We should able to access this when "Safemode rendering" is set to true
Here is an example template
<%- load_hosts().each_record do |host| -%>
<%- end -%>
Version-Release number of selected component (if applicable): 6.5
How reproducible: Always
Actual results: Getting Error message --> Warning! There was an error rendering the parameterreport template: undefined method '#info' for Host::Managed::Jail (Host::Managed)
Expected results: parameter should be accessible when "Safemode rendering" to true
Have you tried host_param macro? From the request, it's not clear if you ask for host parameter of smart class parameter, but both is available when safe mode is enabled. Try:
all of that will work with safe mode. If you find out it's working, please close as notabug.
Created redmine issue https://projects.theforeman.org/issues/27926 from this bug
Upstream bug assigned to email@example.com
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/27926 has been resolved.
Verified with Sat 6.7 snap 4.
With safemode on (Administer -> Settings -> Safemode rendering -> yes), I tried to generate report with contents:
<%- load_hosts(includes: :host_statuses).each_record do |host| -%>
'Parameter 1': host.host_param('test') || 'Unknown',
<%- end -%>
<%= report_render -%>
The generated report contained the correct data.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.