summaryrefslogtreecommitdiffstats
path: root/build/android/tombstones.py
diff options
context:
space:
mode:
authorjbudorick <jbudorick@chromium.org>2015-03-13 08:50:41 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-13 15:51:30 +0000
commit2b4779f35717449c189412e95668c6af261cd82e (patch)
treeb2eefa41502adf14a262d4de1d6c067d08fb9d55 /build/android/tombstones.py
parent51aee59bd7d36d0d64f32d163fa04bff07cc47b5 (diff)
downloadchromium_src-2b4779f35717449c189412e95668c6af261cd82e.zip
chromium_src-2b4779f35717449c189412e95668c6af261cd82e.tar.gz
chromium_src-2b4779f35717449c189412e95668c6af261cd82e.tar.bz2
[Android] Clean up DeviceUtils usage in tombstones.py.
BUG=464722 Review URL: https://codereview.chromium.org/1000203005 Cr-Commit-Position: refs/heads/master@{#320510}
Diffstat (limited to 'build/android/tombstones.py')
-rwxr-xr-xbuild/android/tombstones.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/build/android/tombstones.py b/build/android/tombstones.py
index 78c8457..9b8a8b2 100755
--- a/build/android/tombstones.py
+++ b/build/android/tombstones.py
@@ -22,6 +22,8 @@ from pylib.device import device_errors
from pylib.device import device_utils
+_TZ_UTC = {'TZ': 'UTC'}
+
def _ListTombstones(device):
"""List the tombstone files on the device.
@@ -31,7 +33,9 @@ def _ListTombstones(device):
Yields:
Tuples of (tombstone filename, date time of file on device).
"""
- lines = device.RunShellCommand('TZ=UTC su -c ls -a -l /data/tombstones')
+ lines = device.RunShellCommand(
+ ['ls', '-a', '-l', '/data/tombstones'],
+ as_root=True, check_return=True, env=_TZ_UTC, timeout=60)
for line in lines:
if 'tombstone' in line and not 'No such file or directory' in line:
details = line.split()
@@ -49,7 +53,8 @@ def _GetDeviceDateTime(device):
Returns:
A datetime instance.
"""
- device_now_string = device.RunShellCommand('TZ=UTC date')
+ device_now_string = device.RunShellCommand(
+ ['date'], check_return=True, env=_TZ_UTC)
return datetime.datetime.strptime(
device_now_string[0], '%a %b %d %H:%M:%S %Z %Y')
@@ -76,7 +81,8 @@ def _EraseTombstone(device, tombstone_file):
tombstone_file: the tombstone to delete.
"""
return device.RunShellCommand(
- 'rm /data/tombstones/' + tombstone_file, as_root=True)
+ ['rm', '/data/tombstones/' + tombstone_file],
+ as_root=True, check_return=True)
def _DeviceAbiToArch(device_abi):
@@ -184,7 +190,8 @@ def _GetTombstonesForDevice(device, options):
'data': _GetTombstoneData(device, tombstone_file)}]
except device_errors.CommandFailedError:
for line in device.RunShellCommand(
- 'TZ=UTC su -c ls -a -l /data/tombstones'):
+ ['ls', '-a', '-l', '/data/tombstones'],
+ as_root=True, check_return=True, env=_TZ_UTC, timeout=60):
print '%s: %s' % (str(device), line)
raise