From: Michael Tremer Date: Wed, 26 Jan 2011 19:22:39 +0000 (+0100) Subject: Fix some hypervisor detection if the system returned no BIOS/system vendor. X-Git-Tag: v2.0.4~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aa77c970d18bb95b598ae7ca866238751b5b0c97;p=oddments%2Ffireinfo.git Fix some hypervisor detection if the system returned no BIOS/system vendor. --- diff --git a/fireinfo/hypervisor.py b/fireinfo/hypervisor.py index 9286bd4..9a3fb09 100644 --- a/fireinfo/hypervisor.py +++ b/fireinfo/hypervisor.py @@ -126,13 +126,19 @@ class Hypervisor(object): """ Check for old qemu emulator. """ - return self.system.bios_vendor == "Bochs" + if self.system.bios_vendor: + return self.system.bios_vendor == "Bochs" + + return False def __is_hypervisor_microsoft(self): """ Check for Microsoft hypervisor. """ - return "Microsoft" in self.system.vendor + if self.system.vendor: + return "Microsoft" in self.system.vendor + + return False if __name__ == "__main__":