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

Unified Diff: devil/devil/android/tools/device_recovery.py

Issue 2808763004: [devil] Raise DeviceUnreachableError on device not found (Closed)
Patch Set: match specific device Created 3 years, 8 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 | « devil/devil/android/sdk/adb_wrapper_devicetest.py ('k') | devil/devil/android/tools/device_status.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: devil/devil/android/tools/device_recovery.py
diff --git a/devil/devil/android/tools/device_recovery.py b/devil/devil/android/tools/device_recovery.py
index 57857b1ed15160a90b9b6de82ab99195cc6f1dd5..80c78d25070496f5d4b7885f92432f43ca1f5605 100755
--- a/devil/devil/android/tools/device_recovery.py
+++ b/devil/devil/android/tools/device_recovery.py
@@ -64,7 +64,8 @@ def RecoverDevice(device, blacklist, should_reboot=lambda device: True):
try:
device.WaitUntilFullyBooted(retries=0)
except (device_errors.CommandTimeoutError,
- device_errors.CommandFailedError):
+ device_errors.CommandFailedError,
+ device_errors.DeviceUnreachableError):
logger.exception('Failure while waiting for %s. '
'Attempting to recover.', str(device))
try:
@@ -83,7 +84,8 @@ def RecoverDevice(device, blacklist, should_reboot=lambda device: True):
# exception willbe thrown at that level.
device.adb.Shell('echo b > /proc/sysrq-trigger', expect_status=None,
timeout=5, retries=0)
- except device_errors.CommandFailedError:
+ except (device_errors.CommandFailedError,
+ device_errors.DeviceUnreachableError):
logger.exception('Failed to reboot %s.', str(device))
if blacklist:
blacklist.Extend([device.adb.GetDeviceSerial()],
@@ -97,7 +99,8 @@ def RecoverDevice(device, blacklist, should_reboot=lambda device: True):
try:
device.WaitUntilFullyBooted(
retries=0, timeout=device.REBOOT_DEFAULT_TIMEOUT)
- except device_errors.CommandFailedError:
+ except (device_errors.CommandFailedError,
+ device_errors.DeviceUnreachableError):
logger.exception('Failure while waiting for %s.', str(device))
if blacklist:
blacklist.Extend([device.adb.GetDeviceSerial()],
« no previous file with comments | « devil/devil/android/sdk/adb_wrapper_devicetest.py ('k') | devil/devil/android/tools/device_status.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698