[Pkg-puppet-devel] [facter] 115/180: (FACT-464) Improve support of Mandrake-derived osfamily detection

Stig Sandbeck Mathisen ssm at debian.org
Mon Jun 30 15:06:37 UTC 2014


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository facter.

commit e5b2fbcd1590a3f329e4d33ebfb92a98974532df
Author: Branan Purvine-Riley <branan at puppetlabs.com>
Date:   Mon Jun 2 14:17:32 2014 -0700

    (FACT-464) Improve support of Mandrake-derived osfamily detection
    
    Previously, there were two issues:
    
    * Mageia was not correctly separated from Mandriva as an
      operatingsystem
    * All mandrake-derived distros showed up as "Linux" in osfamily
    
    This adds a proper operatingsystem detection for Mageia and creates a
    Mandrake osfamily for all mandrake-derived distros detected by the
    operatingsystem fact.
---
 lib/facter/operatingsystem.rb     | 2 ++
 lib/facter/osfamily.rb            | 2 ++
 spec/unit/operatingsystem_spec.rb | 1 +
 spec/unit/osfamily_spec.rb        | 3 +++
 4 files changed, 8 insertions(+)

diff --git a/lib/facter/operatingsystem.rb b/lib/facter/operatingsystem.rb
index 609ace9..74fbe1f 100644
--- a/lib/facter/operatingsystem.rb
+++ b/lib/facter/operatingsystem.rb
@@ -60,6 +60,8 @@ Facter.add(:operatingsystem) do
       "Gentoo"
     elsif FileTest.exists?("/etc/fedora-release")
       "Fedora"
+    elsif FileTest.exists?("/etc/mageia-release")
+      "Mageia"
     elsif FileTest.exists?("/etc/mandriva-release")
       "Mandriva"
     elsif FileTest.exists?("/etc/mandrake-release")
diff --git a/lib/facter/osfamily.rb b/lib/facter/osfamily.rb
index f7008c1..fcd9d4d 100644
--- a/lib/facter/osfamily.rb
+++ b/lib/facter/osfamily.rb
@@ -28,6 +28,8 @@ Facter.add(:osfamily) do
       "Gentoo"
     when "Archlinux"
       "Archlinux"
+    when "Mageia", "Mandriva", "Mandrake"
+      "Mandrake"
     else
       Facter.value("kernel")
     end
diff --git a/spec/unit/operatingsystem_spec.rb b/spec/unit/operatingsystem_spec.rb
index 111b56c..3e066aa 100755
--- a/spec/unit/operatingsystem_spec.rb
+++ b/spec/unit/operatingsystem_spec.rb
@@ -58,6 +58,7 @@ describe "Operating System fact" do
       "Debian"      => "/etc/debian_version",
       "Gentoo"      => "/etc/gentoo-release",
       "Fedora"      => "/etc/fedora-release",
+      "Mageia"      => "/etc/mageia-release",
       "Mandriva"    => "/etc/mandriva-release",
       "Mandrake"    => "/etc/mandrake-release",
       "MeeGo"       => "/etc/meego-release",
diff --git a/spec/unit/osfamily_spec.rb b/spec/unit/osfamily_spec.rb
index f1c16f2..195296f 100644
--- a/spec/unit/osfamily_spec.rb
+++ b/spec/unit/osfamily_spec.rb
@@ -31,6 +31,9 @@ describe "OS Family fact" do
     'SLED'         => 'Suse',
     'OpenSuSE'     => 'Suse',
     'SuSE'         => 'Suse',
+    'Mageia'       => 'Mandrake',
+    'Mandriva'     => 'Mandrake',
+    'Mandrake'     => 'Mandrake',
   }.each do |os,family|
     it "should return #{family} on operatingsystem #{os}" do
       Facter.fact(:operatingsystem).stubs(:value).returns os

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-puppet/facter.git



More information about the Pkg-puppet-devel mailing list