Skip to content

Commit

Permalink
Merge remote branch 'adrien/tickets/next/2721' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
jamtur01 committed Mar 16, 2011
2 parents 6f0757d + edb9760 commit 1390100
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lib/facter/operatingsystem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@
else
"SuSE"
end
elsif FileTest.exists?("/etc/slackware-version")
"Slackware"
elsif FileTest.exists?("/etc/bluewhite64-version")
"Bluewhite64"
elsif FileTest.exists?("/etc/slamd64-version")
"Slamd64"
elsif FileTest.exists?("/etc/slackware-version")
"Slackware"
end
end
end
Expand Down
26 changes: 25 additions & 1 deletion lib/facter/operatingsystemrelease.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,29 @@
end

Facter.add(:operatingsystemrelease) do
setcode do Facter[:kernelrelease].value end
confine :operatingsystem => %w{Bluewhite64}
setcode do
releasefile = Facter::Util::Resolution.exec('cat /etc/bluewhite64-version')
if releasefile =~ /^\s*\w+\s+(\d+)\.(\d+)/
$1 + "." + $2
else
"unknown"
end
end
end

Facter.add(:operatingsystemrelease) do
confine :operatingsystem => %w{Slamd64}
setcode do
releasefile = Facter::Util::Resolution.exec('cat /etc/slamd64-version')
if releasefile =~ /^\s*\w+\s+(\d+)\.(\d+)/
$1 + "." + $2
else
"unknown"
end
end
end

Facter.add(:operatingsystemrelease) do
setcode do Facter[:kernelrelease].value end
end

0 comments on commit 1390100

Please sign in to comment.