Fix kvmdomain facter
authorAurelien Jarno <aurelien@aurel32.net>
Sat, 8 Apr 2017 08:59:23 +0000 (10:59 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Sat, 8 Apr 2017 08:59:23 +0000 (10:59 +0200)
QEMU can return a CPU model different than "QEMU Virtual CPU". Check for
the "hypervisor" flag instead.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
modules/debian_org/lib/facter/servertype.rb

index 21dba00..d309835 100644 (file)
@@ -1,7 +1,7 @@
 Facter.add("kvmdomain") do
        setcode do
                result = false
-               if File.new('/proc/cpuinfo').read().index('QEMU Virtual CPU')
+               if File.new('/proc/cpuinfo').read().index('hypervisor')
                        result = true
                end
                result