Merge pull request #522 from dylanmtaylor/fix-vm-detection-func

Fix is_vm detection on real hardware
This commit is contained in:
Anton Hvornum 2021-05-27 20:19:38 +02:00 committed by GitHub
commit 5a33ecf875
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -110,7 +110,7 @@ def cpu_vendor() -> Optional[str]:
def is_vm() -> bool:
try:
# systemd-detect-virt issues a non-zero exit code if it is not on a virtual machine
if b"".join(SysCommand("systemd-detect-virt")).lower() != b"none":
if b"none" not in b"".join(SysCommand("systemd-detect-virt")).lower():
return True
except:
pass