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

Unified Diff: telemetry/telemetry/internal/platform/profiler/tcpdump_profiler.py

Issue 2709523005: [Telemetry] Switch RunShellCommand clients to check_return=True (Closed)
Patch Set: revert change in chown command Created 3 years, 10 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
Index: telemetry/telemetry/internal/platform/profiler/tcpdump_profiler.py
diff --git a/telemetry/telemetry/internal/platform/profiler/tcpdump_profiler.py b/telemetry/telemetry/internal/platform/profiler/tcpdump_profiler.py
index 40c19445f47da914bc8640996a00e6765b273e64..a8527cb0417d593fa50c4d4e436f2f19f9f8091c 100644
--- a/telemetry/telemetry/internal/platform/profiler/tcpdump_profiler.py
+++ b/telemetry/telemetry/internal/platform/profiler/tcpdump_profiler.py
@@ -26,8 +26,9 @@ class _TCPDumpProfilerAndroid(object):
def __init__(self, device, output_path):
self._device = device
self._output_path = output_path
- self._device.RunShellCommand('mkdir -p ' +
- os.path.dirname(self._DEVICE_DUMP_FILE))
+ self._device.RunShellCommand(
+ ['mkdir', '-p', os.path.dirname(self._DEVICE_DUMP_FILE)],
+ check_return=True)
self._proc = subprocess.Popen(
[self._device.adb.GetAdbPath(),
'-s', self._device.adb.GetDeviceSerial(),
@@ -46,7 +47,8 @@ class _TCPDumpProfilerAndroid(object):
'At most one instance of process tcpdump expected but found pids: '
'%s' % tcpdump_pid)
tcpdump_pid = int(tcpdump_pid['tcpdump'][0])
- self._device.RunShellCommand('kill -term ' + tcpdump_pid)
+ self._device.RunShellCommand(
+ ['kill', '-term', str(tcpdump_pid)], check_return=True)
self._proc.terminate()
host_dump = os.path.join(self._output_path,
os.path.basename(self._DEVICE_DUMP_FILE))

Powered by Google App Engine
This is Rietveld 408576698