Issue #14582 has been updated by Jeff Weiss.

Status changed from Accepted to Merged - Pending Release
Target version changed from 1.6.x to 1.6.10
Branch set to https://github.com/puppetlabs/facter/pull/213

Merged with 
<https://github.com/puppetlabs/facter/commit/ac7aebd8b75ce88cc36209048bb3b65335f0ae9e>
----------------------------------------
Bug #14582: Facter 1.6.9: lsbrelease.rb generates noise and doesn't serve much 
purpose
https://projects.puppetlabs.com/issues/14582#change-63296

Author: Andreas Ntaflos
Status: Merged - Pending Release
Priority: Normal
Assignee: Hailee Kenney
Category: 
Target version: 1.6.10
Keywords: 
Branch: https://github.com/puppetlabs/facter/pull/213
Affected Facter version: 


I've mentioned this on the puppet-users mailing list [1] but I think it 
warrants a report here. Using Ubuntu 10.04 and 12.04, with Puppet 2.7.14 and 
Facter 1.6.9, installed from apt.puppetlabs.com.

Facter 1.6.9 handles LSB facts differently (better) than before. When calling 
`lsb_release -v -s`, as is done in `facter/lsbrelease.rb`, it outputs only "No 
LSB modules are available." to stderr when there are no other LSB modules 
installed, which is the case on, I'd say, a vast majority of Ubuntu servers. 

The problem here is two-fold: first, the noise. When running hundreds of Puppet 
Agents from Cron this generates thousands of Cron mails per day with this 
message, when pre-Facter-1.6.9, everything was quiet. Second, `lsb_release -v 
-s` does not seem to serve much purpose anyway. In Facter <=1.6.8, `lsb.rb` [2] 
would parse the output of `lsb_release -a` and populate the LSB facts 
accordingly. Now, each LSB fact has it's own implementation (calling 
`lsb_release -i -s`, `lsb_release -c -s` and so on), which makes the 
`lsbrelease` fact itself pretty useless (in my non-developer opinion). On our 
systems, calling `facter lsbrelease` outputs nothing, except for that annoying 
message. On a system that has more LSB modules installed, the output is 
something like this:

    
core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:languages-3.2-amd64:languages-3.2-noarch:languages-4.0-amd64:languages-4.0-noarch

I don't know if that is ever useful but that is probably beside the point.

Facter <1.6.8 did take care of the noise though, by redirecting `lsb_release`'s 
stderr to /dev/null. If the `lsbrelease` fact is to be kept around, I suggest 
applying the following patch to `facter/lsbrelease.rb`:

    --- /usr/lib/ruby/1.8/facter/lsbrelease.rb      2012-05-17 
18:51:47.000000000 +0200
    +++ /tmp/puppet-file20120518-549-1kpv5v6-0      2012-05-18 
17:20:56.645918192 +0200
    @@ -13,6 +13,7 @@
     Facter.add(:lsbrelease) do
       confine :kernel => [ :linux, :"gnu/kfreebsd" ]
       setcode do
    -    Facter::Util::Resolution.exec('lsb_release -v -s')
    +    Facter::Util::Resolution.exec('lsb_release -v -s 2> /dev/null')
       end
    end

[1] 
[https://groups.google.com/d/topic/puppet-users/agnwuwumCR0/discussion](https://groups.google.com/d/topic/puppet-users/agnwuwumCR0/discussion)

[2] 
[https://github.com/puppetlabs/facter/blob/e1025c15ee3a01cbae537811679847571bacf619/lib/facter/lsb.rb](https://github.com/puppetlabs/facter/blob/e1025c15ee3a01cbae537811679847571bacf619/lib/facter/lsb.rb)


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to