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

Unified Diff: build/android/devil/android/sdk/adb_wrapper.py

Issue 1336823004: add more log to adb_wrapper.py Ls function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a message explaining the meaning of the error Created 5 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/devil/android/sdk/adb_wrapper.py
diff --git a/build/android/devil/android/sdk/adb_wrapper.py b/build/android/devil/android/sdk/adb_wrapper.py
index b6ec4e826385569bb166954d8711743996c54e9a..bf68b569170b37f652a401d2803dff284aafa394 100644
--- a/build/android/devil/android/sdk/adb_wrapper.py
+++ b/build/android/devil/android/sdk/adb_wrapper.py
@@ -315,10 +315,15 @@ class AdbWrapper(object):
Raises:
AdbCommandFailedError if |path| does not specify a valid and accessible
- directory in the device.
+ directory in the device, or the output of "adb ls" command is less
+ than four columns
"""
- def ParseLine(line):
+ def ParseLine(line, cmd):
cols = line.split(None, 3)
+ if len(cols) < 4:
+ raise device_errors.AdbCommandFailedError(
+ cmd, line, "the output should be 4 columns, but is only %d columns"
+ % len(cols), device_serial=self._device_serial)
filename = cols.pop()
stat = DeviceStat(*[int(num, base=16) for num in cols])
return (filename, stat)
@@ -327,7 +332,7 @@ class AdbWrapper(object):
lines = self._RunDeviceAdbCmd(
cmd, timeout=timeout, retries=retries).splitlines()
if lines:
- return [ParseLine(line) for line in lines]
+ return [ParseLine(line, cmd) for line in lines]
else:
raise device_errors.AdbCommandFailedError(
cmd, 'path does not specify an accessible directory in the device',
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698