On May 31, 2011, at 3:53 PM, Nick Lewis wrote: > On Tuesday, May 31, 2011 at 2:24 PM, Ivan Porto Carrero wrote: > >> >> Signed-off-by: Ivan Porto Carrero <i...@flanders.co.nz> >> --- >> lib/facter/operatingsystem.rb | 4 ++++ >> lib/facter/operatingsystemrelease.rb | 2 +- >> 2 files changed, 5 insertions(+), 1 deletions(-) >> >> diff --git a/lib/facter/operatingsystem.rb b/lib/facter/operatingsystem.rb >> index a90c283..8381da1 100644 >> --- a/lib/facter/operatingsystem.rb >> +++ b/lib/facter/operatingsystem.rb >> @@ -24,7 +24,11 @@ Facter.add(:operatingsystem) do >> if FFacter.value(:lsbdistid) == "Ubuntu" >> "Ubuntu" >> elsif FileTest.exists?("/etc/debian_version") >> + if FileTest.exists?("/etc/lsb-release") >> + FFile.read("/etc/lsb-release") =~ /ubuntu/i ? "Ubuntu" : "Debian" >> + else >> "Debian" >> + end > > This was proposed on the ticket #7670 as a workaround, but doesn't actually > do anything now that we've fixed the core issue of the lsbdistid fact not > being available. This will just check the same source of truth that lsbdistid > uses. >> elsif FileTest.exists?("/etc/gentoo-release") >> "Gentoo" >> elsif FileTest.exists?("/etc/fedora-release") >> diff --git a/lib/facter/operatingsystemrelease.rb >> b/lib/facter/operatingsystemrelease.rb >> index 347fe7f..5416202 100644 >> --- a/lib/facter/operatingsystemrelease.rb >> +++ b/lib/facter/operatingsystemrelease.rb >> @@ -51,7 +51,7 @@ end >> Facter.add(:operatingsystemrelease) do >> confine :operatingsystem => %w{Ubuntu} >> setcode do >> - release = Facter::Util::Resolution.exec('cat /etc/issue') >> + release = Facter::Util::Resolution.exec('cat /etc/lsb-release') >> if release =~ /Ubuntu (\d+.\d+)/ >> $1 >> end >> -- >> 1.7.5.3 >> > In this case, we should just use the lsbrelease fact, which is the same thing. > > I've opened ticket #7722 for that change, because it's a refactor unrelated > to #7670.
Doesn't the lsbrelease fact rely on the lsb command, rather than the file? Stig has confirmed that the file is always present, but not (that I know of) the command. -- Susskind's Rule of Thumb: Don't ask what they think. Ask what they do. --------------------------------------------------------------------- Luke Kanies -|- http://puppetlabs.com -|- http://about.me/lak -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com. To unsubscribe from this group, send email to puppet-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.