summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2009-02-11 14:42:16 +1100
committerJames Turnbull <james@lovedthanlost.net>2009-02-11 14:42:16 +1100
commit552f1504ae4ae1253554afea2fcfb9f6ac79914a (patch)
tree8f21b4004982195333cb3ea8fd63ff7aee763bbc
parenta932a69bcb5a09765d750dddd52fdfb16e0729de (diff)
downloadfacter-552f1504ae4ae1253554afea2fcfb9f6ac79914a.tar.gz
facter-552f1504ae4ae1253554afea2fcfb9f6ac79914a.tar.xz
facter-552f1504ae4ae1253554afea2fcfb9f6ac79914a.zip
Added support for Oracle Enterprise Linux to operatingsystem
and operatingsystemrelease
-rw-r--r--CHANGELOG3
-rw-r--r--lib/facter/operatingsystem.rb2
-rw-r--r--lib/facter/operatingsystemrelease.rb12
3 files changed, 17 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG
index c60317e..8191fe2 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,7 @@
1.5.4:
+ Added support for Oracle Enterprise Linux to operatingsystem
+ and operatingsystemrelease
+
Fixed #1927 - failing facts don't kill Facter
Fixed #1850 - Facter updates for Ruby 1.9
diff --git a/lib/facter/operatingsystem.rb b/lib/facter/operatingsystem.rb
index 918f119..700ff1f 100644
--- a/lib/facter/operatingsystem.rb
+++ b/lib/facter/operatingsystem.rb
@@ -22,6 +22,8 @@ Facter.add(:operatingsystem) do
"Mandrake"
elsif FileTest.exists?("/etc/arch-release")
"Archlinux"
+ elsif FileTest.exists?("/etc/enterprise-release")
+ "OEL"
elsif FileTest.exists?("/etc/redhat-release")
txt = File.read("/etc/redhat-release")
if txt =~ /centos/i
diff --git a/lib/facter/operatingsystemrelease.rb b/lib/facter/operatingsystemrelease.rb
index bbf530a..0afa961 100644
--- a/lib/facter/operatingsystemrelease.rb
+++ b/lib/facter/operatingsystemrelease.rb
@@ -27,6 +27,18 @@ Facter.add(:operatingsystemrelease) do
end
Facter.add(:operatingsystemrelease) do
+ confine :operatingsystem => :oel
+ setcode do
+ File::open("/etc/enterprise-release", "r") do |f|
+ line = f.readline.chomp
+ if line =~ /release (\d+)/
+ $1
+ end
+ end
+ end
+end
+
+Facter.add(:operatingsystemrelease) do
confine :operatingsystem => %w{CentOS}
setcode do
centos_release = Facter::Util::Resolution.exec("sed -r -e 's/CentOS release //' -e 's/ \((Branch|Final)\)//' /etc/redhat-release")