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