From 38e107fe7938a01768420cfbf0207821a36d2be6 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Fri, 27 Nov 2015 20:34:50 -0800 Subject: Expand detection of VirtualPC / Hyper-V guests This should solve https://github.com/chef/ohai/issues/647 --- lib/ohai/mixin/dmi_decode.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/ohai/mixin/dmi_decode.rb') diff --git a/lib/ohai/mixin/dmi_decode.rb b/lib/ohai/mixin/dmi_decode.rb index 625b6c90..f367e41d 100644 --- a/lib/ohai/mixin/dmi_decode.rb +++ b/lib/ohai/mixin/dmi_decode.rb @@ -22,9 +22,11 @@ module ::Ohai::Mixin::DmiDecode case line when /Manufacturer: Microsoft/ if dmi_data =~ /Product Name: Virtual Machine/ - if dmi_data =~ /Version: VS2005R2/ + if dmi_data =~ /Version: (VS2005R2|6.0)/ return 'virtualpc' - else + elsif dmi_data =~ /Version: (7.0|Hyper-V)/ + return 'hyperv' + elsif dmi_data =~ /Version: 5.0/ return 'virtualserver' end end -- cgit v1.2.1