The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #13117

semodule broken in 2.7.12

Added by Jesse Weisner almost 3 years ago. Updated over 2 years ago.

Status:ClosedStart date:03/14/2012
Priority:NormalDue date:
Assignee:Patrick Carlisle% Done:

0%

Category:provider
Target version:2.7.14
Affected Puppet version: Branch:https://github.com/puppetlabs/puppet/pull/580
Keywords:semodule rhel6

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

The SELinux module provider is broken in Puppet 2.7.12 (using puppet-2.7.12-1.el6.noarch from the Puppet Labs YUM repo) on RHEL-6.2:

err: /Stage[main]/.../Selmodule[...]: Could not evaluate: undefined method `each_line' for #<Array:0x7fc2db333628>

Changing the selmodule provider to use @each@ instead of @each_line@ seems to fix it.

--- /usr/lib/ruby/site_ruby/1.8/puppet/provider/selmodule/semodule.rb.orig   2012-03-14 13:49:20.937956593 -0700
+++ /usr/lib/ruby/site_ruby/1.8/puppet/provider/selmodule/semodule.rb   2012-03-14 13:55:36.172042784 -0700
@@ -21,7 +21,7 @@
   def exists?
     self.debug "Checking for module #{@resource[:name]}"
     execpipe("#{command(:semodule)} --list") do |out|
-      out.each_line do |line|
+      out.each do |line|
         if line =~ /#{@resource[:name]}\b/
           return :true
         end
@@ -118,7 +118,7 @@
     begin
       execpipe("#{command(:semodule)} --list") do |output|
         lines = output.readlines
-        lines.each_line do |line|
+        lines.each do |line|
           line.chomp!
           bits = line.split
           if bits[0] == @resource[:name]

History

#1 Updated by Jesse Weisner almost 3 years ago

Argh. Wiki text ate my <Array>

Could not evaluate: undefined method `each_line' for #< Array:0x7fc2db333628>

#2 Updated by Patrick Carlisle almost 3 years ago

  • Status changed from Unreviewed to Investigating

#3 Updated by Patrick Carlisle almost 3 years ago

  • Status changed from Investigating to Accepted
  • Assignee set to Patrick Carlisle

It should only be necessary to change the second case of each_line back to each.

#4 Updated by Jesse Weisner almost 3 years ago

Confirmed. I reverted the first each back to each_line, and I’m not getting any array errors. Doing an initial Google search for this issue, I stumbled on Issue #12268 which I assumed meant all each_line usage would be converted to each. I’m not fluent in Ruby yet, so I don’t fully understand the problem(s).

#5 Updated by Patrick Carlisle almost 3 years ago

  • Status changed from Accepted to In Topic Branch Pending Review
  • Branch set to https://github.com/puppetlabs/puppet/pull/580

Pull request at https://github.com/puppetlabs/puppet/pull/580

The problem was that you can’t call both readlines and each_line, because readlines returns an array.

#6 Updated by Patrick Carlisle almost 3 years ago

  • Description updated (diff)

#7 Updated by Anonymous almost 3 years ago

  • Target version changed from 2.7.12 to 2.7.x
  • Affected Puppet version set to 2.7.12rc2

#8 Updated by Stijn Hoop over 2 years ago

  • Affected Puppet version deleted (2.7.12rc2)

Still in 2.7.13 on EL6 (RPMs).

#9 Updated by Patrick Carlisle over 2 years ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release
  • Target version changed from 2.7.x to 2.7.14

2.7.13 only has security fixes, this will go into 2.7.14.

#10 Updated by Matthaus Owens over 2 years ago

  • Status changed from Merged - Pending Release to Closed

Released in Puppet 2.7.14rc1

Also available in: Atom PDF