]> git.ipfire.org Git - oddments/fireinfo.git/commitdiff
Fix hypervisor type detection when the C module does not return anything.
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 27 Dec 2010 17:32:35 +0000 (18:32 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 27 Dec 2010 17:32:35 +0000 (18:32 +0100)
fireinfo/hypervisor.py

index cdc9efd5b77cf966ece1d227c71411640d3db0f2..10612d569d90bea80561f9057189fd76756ee0fd 100644 (file)
@@ -78,7 +78,13 @@ class Hypervisor(object):
                if not self.virtual:
                        return None
 
-               return self.__info["virtype"]
+               if self.__info["virtype"]:
+                       return self.__info["virtype"]
+
+               if self.hypervisor in ("Qemu", "KVM", "VirtualBox", "VMWare"):
+                       return "full"
+
+               return "unknown"
 
        @property
        def virtual(self):