Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2446)

Unified Diff: telemetry/telemetry/core/cros_interface.py

Issue 2068063002: Use platform.processor to figure out if we're in a VM. (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | telemetry/telemetry/internal/platform/cros_platform_backend.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/core/cros_interface.py
diff --git a/telemetry/telemetry/core/cros_interface.py b/telemetry/telemetry/core/cros_interface.py
index 9a82c8b863d641d6eec211cbc7f1fc081baa53e7..eb275610783e96ef68f909825e00bf82d0b72345 100644
--- a/telemetry/telemetry/core/cros_interface.py
+++ b/telemetry/telemetry/core/cros_interface.py
@@ -4,6 +4,7 @@
"""A wrapper around ssh for common operations on a CrOS-based device"""
import logging
import os
+import platform # pylint: disable=relative-import
import re
import shutil
import stat
@@ -500,11 +501,8 @@ class CrOSInterface(object):
def GetArchName(self):
return self.RunCmdOnDevice(['uname', '-m'])[0]
- def SysVendor(self):
- return self.GetFileContents('/sys/class/dmi/id/sys_vendor').rstrip()
-
- def IsRunningOnVM(self):
- return self.SysVendor() == 'QEMU'
+ def IsRunningInVM(self):
+ return 'QEMU' in platform.processor()
def LsbReleaseValue(self, key, default):
"""/etc/lsb-release is a file with key=value pairs."""
« no previous file with comments | « no previous file | telemetry/telemetry/internal/platform/cros_platform_backend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698