Signed-off-by: Luke Kanies <[EMAIL PROTECTED]>
---
 CHANGELOG                            |    2 ++
 lib/facter/operatingsystemrelease.rb |   10 ++++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index f591b42..0fb096c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,6 @@
 ?:
+    Fixed #1400 - OperatingSystemRelease should now work on CentOS
+
     Changed 'timeout' option to 'limit' to avoid scope issue
 
     Fixes #1376 - Display memory facts for AIX
diff --git a/lib/facter/operatingsystemrelease.rb 
b/lib/facter/operatingsystemrelease.rb
index 291b82c..843dfdb 100644
--- a/lib/facter/operatingsystemrelease.rb
+++ b/lib/facter/operatingsystemrelease.rb
@@ -29,10 +29,12 @@ end
 Facter.add(:operatingsystemrelease) do
     confine :operatingsystem => %w{CentOS}
     setcode do
-        release = Facter::Util::Resolution.exec('rpm -q centos-release')
-            if release =~ /release-(\d+)/
-                $1
-            end
+      centosrelease = Facter::Util::Resolution.exec('cat /etc/redhat-release | 
sed -e \'s/CentOS release//g\' -e \'s/(Final)//g\'')
+        if centosrelease =~ /^5^/
+          release = Facter::Util::Resolution.exec('rpm -q --qf 
\'%{VERSION}.%{RELEASE}\' centos-release | cut -d. -f1,2')
+        else
+          release = Facter::Util::Resolution.exec('cat /etc/redhat-release | 
sed -e \'s/CentOS release//g\' -e \'s/(Final)//g\'')
+        end
     end
 end
 
-- 
1.5.3.7


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" 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-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to