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 1267646 - Failed to render the smart proxy name
Summary: Failed to render the smart proxy name
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Provisioning Templates
Version: 6.1.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Stephen Benjamin
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1122832
TreeView+ depends on / blocked
 
Reported: 2015-09-30 14:56 UTC by Peter Vreman
Modified: 2015-10-15 13:35 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-15 13:35:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Peter Vreman 2015-09-30 14:56:11 UTC
Description of problem:
Printing the name of the content_source is not allowed. We wanted to use it in the logging like:

%post
echo "==> Registering to Satellite 6 '<%= @host.content_source.name %>'"

There was an error rendering the Unnamed template: undefined method 'name' for SmartProxy::Jail 


Patch to add support:

--- /usr/share/foreman/app/models/smart_proxy.rb.old    2015-09-30 14:46:12.954768684 +0000
+++ /usr/share/foreman/app/models/smart_proxy.rb        2015-09-30 14:47:00.845945575 +0000
@@ -94,6 +94,10 @@
     conditions
   end

+  class Jail < Safemode::Jail
+    allow :name
+  end
+
   private

   def sanitize_url


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


How reproducible:


Steps to Reproduce:
1. Include <%= @host.content_source.name %> in the template
2.
3.

Actual results:
Error thrown

Expected results:
The smart proxy name is shown

Additional info:

Comment 2 Stephen Benjamin 2015-10-15 13:35:04 UTC
You can do this instead:

echo "==> Registering to Satellite 6 '<%= @host.content_source %>'"

It will implicitly do a .to_s on the content_source, which is allowed in the Jail.
In the case of the Smart Proxy, that returns the name.


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