[PATCH 1/1] Added support for SUSE Linux Enterprise Desktop to operatingsystem and operatingsystemrelease. This commit refs #1619

3 views
Skip to first unread message

Andreas Zuber

unread,
Mar 2, 2009, 11:35:34 AM3/2/09
to puppe...@googlegroups.com

Signed-off-by: Andreas Zuber <zu...@puzzle.ch>
---
lib/facter/operatingsystem.rb | 2 ++
lib/facter/operatingsystemrelease.rb | 2 +-
2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib/facter/operatingsystem.rb b/lib/facter/operatingsystem.rb
index 72f25f5..2163f1f 100644
--- a/lib/facter/operatingsystem.rb
+++ b/lib/facter/operatingsystem.rb
@@ -37,6 +37,8 @@ Facter.add(:operatingsystem) do
txt = File.read("/etc/SuSE-release")
if txt =~ /^SUSE LINUX Enterprise Server/i
"SLES"
+ elsif txt =~ /^SUSE LINUX Enterprise Desktop/i
+ "SLED"
elsif txt =~ /^openSUSE/i
"OpenSuSE"
else
diff --git a/lib/facter/operatingsystemrelease.rb b/lib/facter/operatingsystemrelease.rb
index 1ea2e75..daeb647 100644
--- a/lib/facter/operatingsystemrelease.rb
+++ b/lib/facter/operatingsystemrelease.rb
@@ -80,7 +80,7 @@ Facter.add(:operatingsystemrelease) do
end

Facter.add(:operatingsystemrelease) do
- confine :operatingsystem => %w{SLES OpenSuSE}
+ confine :operatingsystem => %w{SLES SLED OpenSuSE}
setcode do
releasefile = Facter::Util::Resolution.exec('cat /etc/SuSE-release')
if releasefile =~ /^VERSION\s*=\s*(\d+)/
--
1.5.5.6

Luke Kanies

unread,
Mar 2, 2009, 10:53:27 PM3/2/09
to puppe...@googlegroups.com
+1

It's long past time we got rid of these horrible case statements. :/
--
Always read stuff that will make you look good if you die in the
middle of it. -- P. J. O'Rourke
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com

Reply all
Reply to author
Forward
0 new messages