summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan McLellan <btm@getchef.com>2014-05-15 08:35:41 -0700
committerBryan McLellan <btm@getchef.com>2014-05-15 08:35:41 -0700
commit0f6059d2ea4dada41ab91c8373769950b84cb7b0 (patch)
tree432cb5128606a4f3c1739a9a196fff3b42779345
parentea0fb3f8df17c37589427a665880abce5ea1b6f6 (diff)
parent63da04412e97d3b19849a27e9d2817b04a0e4f3f (diff)
downloadohai-0f6059d2ea4dada41ab91c8373769950b84cb7b0.tar.gz
Merge branch 'OHAI-570'
-rw-r--r--lib/ohai/plugins/linux/platform.rb6
-rw-r--r--spec/unit/plugins/linux/platform_spec.rb14
2 files changed, 20 insertions, 0 deletions
diff --git a/lib/ohai/plugins/linux/platform.rb b/lib/ohai/plugins/linux/platform.rb
index 1ed9c082..90347a45 100644
--- a/lib/ohai/plugins/linux/platform.rb
+++ b/lib/ohai/plugins/linux/platform.rb
@@ -83,6 +83,10 @@ Ohai.plugin(:Platform) do
platform "arch"
# no way to determine platform_version in a rolling release distribution
# kernel release will be used - ex. 2.6.32-ARCH
+ elsif File.exists?('/etc/exherbo-release')
+ platform "exherbo"
+ # no way to determine platform_version in a rolling release distribution
+ # kernel release will be used - ex. 3.13
elsif lsb[:id] =~ /RedHat/i
platform "redhat"
platform_version lsb[:release]
@@ -115,6 +119,8 @@ Ohai.plugin(:Platform) do
platform_family "slackware"
when /arch/
platform_family "arch"
+ when /exherbo/
+ platform_family "exherbo"
end
end
end
diff --git a/spec/unit/plugins/linux/platform_spec.rb b/spec/unit/plugins/linux/platform_spec.rb
index a63ff69e..defe8836 100644
--- a/spec/unit/plugins/linux/platform_spec.rb
+++ b/spec/unit/plugins/linux/platform_spec.rb
@@ -28,6 +28,7 @@ describe Ohai::System, "Linux plugin platform" do
File.stub(:exists?).with("/etc/debian_version").and_return(false)
File.stub(:exists?).with("/etc/redhat-release").and_return(false)
File.stub(:exists?).with("/etc/gentoo-release").and_return(false)
+ File.stub(:exists?).with("/etc/exherbo-release").and_return(false)
File.stub(:exists?).with("/etc/SuSE-release").and_return(false)
File.stub(:exists?).with("/etc/arch-release").and_return(false)
File.stub(:exists?).with("/etc/system-release").and_return(false)
@@ -184,6 +185,19 @@ describe Ohai::System, "Linux plugin platform" do
end
end
+ describe "on exherbo" do
+ before(:each) do
+ @plugin.lsb = nil
+ File.should_receive(:exists?).with("/etc/exherbo-release").and_return(true)
+ end
+
+ it "should set platform and platform_family to exherbo" do
+ @plugin.run
+ @plugin[:platform].should == "exherbo"
+ @plugin[:platform_family].should == "exherbo"
+ end
+ end
+
describe "on redhat breeds" do
describe "with lsb_release results" do
it "should set the platform to redhat and platform_family to rhel even if the LSB name is something absurd but redhat like" do