diff options
author | Tim Smith <tsmith@chef.io> | 2018-02-26 09:43:17 -0800 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-02-26 09:43:17 -0800 |
commit | cd49b82fb0d1ec87aacc4c648c8a4a0986791627 (patch) | |
tree | 30ee3a80992335c5445c77bdde6a2b2f5c789a74 | |
parent | f594e8ae38724c27ee1657a80a111589bb57ea70 (diff) | |
download | ohai-kernel.tar.gz |
Case statement os_lookupkernel
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/ohai/plugins/kernel.rb | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/ohai/plugins/kernel.rb b/lib/ohai/plugins/kernel.rb index c580da7c..ad9242e6 100644 --- a/lib/ohai/plugins/kernel.rb +++ b/lib/ohai/plugins/kernel.rb @@ -59,15 +59,17 @@ Ohai.plugin(:Kernel) do # windows def os_lookup(sys_type) - return "WINNT" if sys_type == 18 # most likely so first - return "Unknown" if sys_type == 0 - return "Other" if sys_type == 1 - return "MSDOS" if sys_type == 14 - return "WIN3x" if sys_type == 15 - return "WIN95" if sys_type == 16 - return "WIN98" if sys_type == 17 - return "WINCE" if sys_type == 19 - nil + case sys_type + when 18 then "WINNT" # most likely so first + when 0 then "Unknown" + when 1 then "Other" + when 14 then "MSDOS" + when 15 then "WIN3x" + when 16 then "WIN95" + when 17 then "WIN98" + when 19 then "WINCE" + else nil + end end collect_data(:default) do |