refs #1059 add ogIsVirtualMachine()

pull/1/head
Natalia Serrano 2024-10-28 18:02:33 +01:00
parent eaee15b7d4
commit 9301d9aaaf
1 changed files with 2 additions and 5 deletions

View File

@ -309,8 +309,5 @@ def ogCheckProgram(*args):
return 0
def ogIsVirtualMachine():
output = subprocess.check_output(["dmidecode", "-s", "system-product-name"]).decode("utf-8")
if "KVM" in output or "VirtualBox" in output:
return 1
else:
return 0
output = subprocess.run (["dmidecode", "-s", "system-product-name"], capture_output=True, text=True).stdout
return "KVM" in output or "VirtualBox" in output