Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1315754

Summary: 'kickstart_networking_setup' threw an error: undefined method 'present?' for String::Jail (String) while provisioning a host with extra interfaces
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: Provisioning TemplatesAssignee: Marek Hulan <mhulan>
Status: CLOSED ERRATA QA Contact: Sachin Ghai <sghai>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bbuckingham, bkearney, ehelms, mhulan
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 09:05:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sachin Ghai 2016-03-08 14:16:44 UTC
Description of problem: I was configuring alias and vlan interfaces while provisioning a host and provisioning failed with below error:

2016-03-08 08:44:01 [app] [I] Started GET "/unattended/provision?token=bb9a07e8-5425-44d3-b45c-013f9d89d3d5" for 192.168.100.22 at 2016-03-08 08:44:01 -0500
2016-03-08 08:44:01 [app] [I] Processing by UnattendedController#host_template as */*
2016-03-08 08:44:01 [app] [I]   Parameters: {"token"=>"bb9a07e8-5425-44d3-b45c-013f9d89d3d5", "kind"=>"provision"}
2016-03-08 08:44:01 [app] [I] Found mac525400490367.idmqe.lab.eng.bos.redhat.com
2016-03-08 08:44:03 [app] [I]   Rendered inline template (126.6ms)
2016-03-08 08:44:03 [app]2016-03-08 08:44:01 [app] [I] Started GET "/unattended/provision?token=bb9a07e8-5425-44d3-b45c-013f9d89d3d5" for 192.168.100.22 at 2016-03-08 08:44:01 -0500
2016-03-08 08:44:01 [app] [I] Processing by UnattendedController#host_template as */*
2016-03-08 08:44:01 [app] [I]   Parameters: {"token"=>"bb9a07e8-5425-44d3-b45c-013f9d89d3d5", "kind"=>"provision"}
2016-03-08 08:44:01 [app] [I] Found mac525400490367.idmqe.lab.eng.bos.redhat.com
2016-03-08 08:44:03 [app] [I]   Rendered inline template (126.6ms)
2016-03-08 08:44:03 [app] [W] There was an error rendering the Katello Kickstart Default template: 
 | ActionView::Template::Error: The snippet 'kickstart_networking_setup' threw an error: undefined method 'present?' for String::Jail (String)
 | /usr/share/foreman/lib/foreman/renderer.rb:75:in `rescue in snippet'
 | /usr/share/foreman/lib/foreman/renderer.rb:72:in `snippet'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.2/lib/safemode/scope.rb:37:in `method_missing'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.2/lib/safemode.rb:141:in `bind'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.2/lib/safemode.rb:51:in `eval'
 [W] There was an error rendering the Katello Kickstart Default template: 
 | ActionView::Template::Error: The snippet 'kickstart_networking_setup' threw an error: undefined method 'present?' for String::Jail (String)
 | /usr/share/foreman/lib/foreman/renderer.rb:75:in `rescue in snippet'
 | /usr/share/foreman/lib/foreman/renderer.rb:72:in `snippet'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.2/lib/safemode/scope.rb:37:in `method_missing'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.2/lib/safemode.rb:141:in `bind'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.2.2/lib/safemode.rb:51:in `eval'

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

How reproducible:
always

Steps to Reproduce:
1. provision a host with alias interface so that it uses  'kickstart_networking_setup' scriptlet
2.
3.

Actual results:
| ActionView::Template::Error: The snippet 'kickstart_networking_setup' threw an error: undefined method 'present?' for String::Jail (String)

Expected results:


Additional info:

Comment 2 Marek Hulan 2016-03-09 09:05:49 UTC
Fixed in gem safemode 1.2.3, to workaround you can either install the gem from here

    http://koji.katello.org/packages/tfm-rubygem-safemode/1.2.3/

or disable safemode rendering (Settings -> Provisioning). Don't forget to restart httpd afterwards (in both cases)

Comment 4 Sachin Ghai 2016-03-21 09:11:59 UTC
Verified with sat6.2 snap4. The reported issue has been fixed with following :

 ~]# rpm -qa | grep safemode
tfm-rubygem-safemode-1.2.3-1.el7sat.noarch

I can provision the host with configuration of virtual interfaces and didn't see the reported exception related to snippet 'kickstart_networking_setup'

Comment 7 errata-xmlrpc 2016-07-27 09:05:11 UTC
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.

https://access.redhat.com/errata/RHBA-2016:1500