Fix is_vm detection on real hardware

This commit is contained in:
Dylan Taylor 2021-05-27 14:15:27 -04:00
parent f4bb884625
commit 8ddb9153c7
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