Issue #2060 has been updated by ohookins.
Actually, scratch that. This is much simpler:
<pre>
--- operatingsystemrelease.rb.orig 2009-03-09 15:21:18.000000000 +1100
+++ operatingsystemrelease.rb 2009-03-09 15:22:01.000000000 +1100
@@ -13,7 +13,7 @@
end
Facter.add(:operatingsystemrelease) do
- confine :operatingsystem => %w{RedHat}
+ confine :operatingsystem => %w{RedHat CentOS}
setcode do
File::open("/etc/redhat-release", "r") do |f|
line = f.readline.chomp
@@ -51,18 +51,6 @@
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")
- if centos_release =~ /5/
- release = Facter::Util::Resolution.exec('rpm -q --qf
\'%{VERSION}.%{RELEASE}\' centos-release | cut -d. -f1,2')
- else
- release = centos_release
- end
- end
-end
-
-Facter.add(:operatingsystemrelease) do
confine :operatingsystem => %w{Debian}
setcode do
release = Facter::Util::Resolution.exec('cat /etc/debian_version')
</pre>
----------------------------------------
Bug #2060: Inconsistent output in operatingsystemrelease between RedHat and
CentOS
http://projects.reductivelabs.com/issues/2060
Author: ohookins
Status: Unreviewed
Priority: Normal
Assigned to:
Category:
Target version:
Complexity: Unknown
Keywords:
<pre>
[r...@centos ~]# cat /etc/redhat-release
CentOS release 5.2 (Final)
[r...@centos ~]# facter operatingsystemrelease
5.2
[r...@rhel ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.3 (Tikanga)
[r...@rhel ~]# facter operatingsystemrelease
5
</pre>
It doesn't make sense that one reports the point release version and the other
doesn't, especially given they are more or less equivalent platforms. If I had
my way I would prefer without the point release.
You could patch it like this:
<pre>
--- operatingsystemrelease.rb.orig 2009-03-09 15:16:22.000000000 +1100
+++ operatingsystemrelease.rb 2009-03-09 15:16:46.000000000 +1100
@@ -55,7 +55,7 @@
setcode do
centos_release = Facter::Util::Resolution.exec("sed -r -e 's/CentOS
release //' -e 's/ \((Branch|Final)\)//' /etc/redhat-release")
if centos_release =~ /5/
- release = Facter::Util::Resolution.exec('rpm -q --qf
\'%{VERSION}.%{RELEASE}\' centos-release | cut -d. -f1,2')
+ release = Facter::Util::Resolution.exec('rpm -q --qf
\'%{VERSION}.%{RELEASE}\' centos-release | cut -d. -f1')
else
release = centos_release
end
</pre>
----------------------------------------
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://reductivelabs.com/redmine/my/account
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" 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-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---