On Tue, May 31, 2011 at 14:30, James Turnbull <ja...@puppetlabs.com> wrote:
> 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 Facter.value(:lsbdistid) == "Ubuntu"
>>             "Ubuntu"
>>          elsif FileTest.exists?("/etc/debian_version")
>> +          if FileTest.exists?("/etc/lsb-release")
>> +            File.read("/etc/lsb-release") =~ /ubuntu/i ? "Ubuntu" : "Debian"
>> +          else
>>              "Debian"
>> +          end
>>          elsif FileTest.exists?("/etc/gentoo-release")
>>              "Gentoo"
>>          elsif FileTest.exists?("/etc/fedora-release")
>
> Doesn't this assume LSB is always installed - is that the case?

Yes, and no.  The minimal Debian bootstrap still doesn't include
lsb-base, TTBOMK.  Certainly, it doesn't in distributions (etch,
lenny) still available from the Debian main site.

The change doesn't assume it, because it checks if that file exists,
so it reduces the number of cases things go wrong on Ubuntu ... and I
believe 'ubuntu-minimal' *does* get lsb-bas installed, leading it to
be correct except in cases upstream consider "not Ubuntu" anyhow. :)

Daniel
-- 
⎋ Puppet Labs Developer – http://puppetlabs.com
✉ Daniel Pittman <dan...@puppetlabs.com>
✆ Contact me via gtalk, email, or phone: +1 (877) 575-9775
♲ Made with 100 percent post-consumer electrons

-- 
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.

Reply via email to