diff options
author | Tim Smith <tsmith@chef.io> | 2018-11-26 18:41:09 -0800 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-11-26 18:41:09 -0800 |
commit | 147a3c42edec04862d95405515bcbe8c30c087bb (patch) | |
tree | ec375b1acdd79692f6fe927e250868b19e90b95d | |
parent | 11e73519f412440656b0f451c0bf8675ed0fa8d4 (diff) | |
download | ohai-147a3c42edec04862d95405515bcbe8c30c087bb.tar.gz |
Rely on os-release for Mint and Raspbian
Nothing supported here lacks os-release files
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/ohai/plugins/linux/platform.rb | 9 | ||||
-rw-r--r-- | spec/unit/plugins/linux/platform_spec.rb | 1 |
2 files changed, 1 insertions, 9 deletions
diff --git a/lib/ohai/plugins/linux/platform.rb b/lib/ohai/plugins/linux/platform.rb index 6b40f9c0..a38fcfc6 100644 --- a/lib/ohai/plugins/linux/platform.rb +++ b/lib/ohai/plugins/linux/platform.rb @@ -193,15 +193,8 @@ Ohai.plugin(:Platform) do if lsb[:id] =~ /Ubuntu/i platform "ubuntu" platform_version lsb[:release] - elsif lsb[:id] =~ /LinuxMint/i - platform "linuxmint" - platform_version lsb[:release] else - if File.exist?("/usr/bin/raspi-config") - platform "raspbian" - else - platform "debian" - end + platform "debian" platform_version File.read("/etc/debian_version").chomp end elsif File.exist?("/etc/parallels-release") diff --git a/spec/unit/plugins/linux/platform_spec.rb b/spec/unit/plugins/linux/platform_spec.rb index b14cc55f..786c306c 100644 --- a/spec/unit/plugins/linux/platform_spec.rb +++ b/spec/unit/plugins/linux/platform_spec.rb @@ -271,7 +271,6 @@ OS_DATA allow(File).to receive(:exist?).with("/etc/enterprise-release").and_return(have_enterprise_release) allow(File).to receive(:exist?).with("/etc/oracle-release").and_return(have_oracle_release) allow(File).to receive(:exist?).with("/etc/parallels-release").and_return(have_parallels_release) - allow(File).to receive(:exist?).with("/usr/bin/raspi-config").and_return(have_raspi_config) allow(File).to receive(:exist?).with("/etc/os-release").and_return(have_os_release) allow(File).to receive(:exist?).with("/etc/f5-release").and_return(have_f5_release) allow(File).to receive(:exist?).with("/usr/lib/os-release").and_return(have_usr_lib_os_release) |