This commit is contained in:
parent
ba939188cf
commit
d0bc166e7e
|
|
@ -109,9 +109,12 @@ def cpu_vendor() -> Optional[str]:
|
||||||
|
|
||||||
def is_vm() -> bool:
|
def is_vm() -> bool:
|
||||||
try:
|
try:
|
||||||
subprocess.check_call(["systemd-detect-virt"]) # systemd-detect-virt issues a non-zero exit code if it is not on a virtual machine
|
# systemd-detect-virt issues a non-zero exit code if it is not on a virtual machine
|
||||||
return True
|
if b"".join(SysCommand("systemd-detect-virt")).lower() != b"none":
|
||||||
|
return True
|
||||||
except:
|
except:
|
||||||
return False
|
pass
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
# TODO: Add more identifiers
|
# TODO: Add more identifiers
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue