Chromium Code Reviews| Index: build/android/buildbot/bb_device_status_check.py |
| diff --git a/build/android/buildbot/bb_device_status_check.py b/build/android/buildbot/bb_device_status_check.py |
| index c8b3386d61d468a5a08939f84a04dc5f0ca8ac8e..8483a2d71cf83995f0960b1c40bbf2e1f5fbed0e 100755 |
| --- a/build/android/buildbot/bb_device_status_check.py |
| +++ b/build/android/buildbot/bb_device_status_check.py |
| @@ -135,7 +135,7 @@ def DeviceStatus(devices, blacklist): |
| serial = device.adb.GetDeviceSerial() |
| adb_status = ( |
| adb_devices[serial][1] if serial in adb_devices |
| - else 'unknown') |
| + else 'missing') |
| usb_status = bool(serial in usb_devices) |
| device_status = { |
| @@ -184,8 +184,9 @@ def DeviceStatus(devices, blacklist): |
| if blacklist: |
| blacklist.Extend([serial], reason='status_check_timeout') |
| - elif blacklist: |
| - blacklist.Extend([serial], reason=adb_status) |
| + elif not _IsBlacklisted(serial, blacklist): |
| + blacklist.Extend([serial], |
| + reason=adb_status if usb_status else 'offline') |
| device_status['blacklisted'] = _IsBlacklisted(serial, blacklist) |
| @@ -212,7 +213,7 @@ def RecoverDevices(devices, blacklist): |
| should_restart_usb = set( |
| status['serial'] for status in statuses |
| if (not status['usb_status'] |
| - or status['adb_status'] in ('offline', 'unknown'))) |
| + or status['adb_status'] in ('offline', 'missing'))) |
| should_restart_adb = should_restart_usb.union(set( |
| status['serial'] for status in statuses |
| if status['adb_status'] == 'unauthorized')) |
| @@ -238,10 +239,14 @@ def RecoverDevices(devices, blacklist): |
| for serial in should_restart_usb: |
| try: |
| reset_usb.reset_android_usb(serial) |
| - except (IOError, device_errors.DeviceUnreachableError): |
| + except IOError: |
| logging.exception('Unable to reset USB for %s.', serial) |
| if blacklist: |
| blacklist.Extend([serial], reason='usb_failure') |
| + except device_errors.DeviceUnreachableError: |
| + logging.exception('Unable to reset USB for %s.', serial) |
| + if blacklist: |
| + blacklist.Extend([serial], reason='offline') |
| def blacklisting_recovery(device): |
| if _IsBlacklisted(device.adb.GetDeviceSerial(), blacklist): |
| @@ -395,11 +400,15 @@ def main(): |
| temperature=float(status['battery']['temperature']) / 10, |
| level=status['battery']['level'] |
| )) |
| - else: |
| - f.write('{serial} {adb_status}'.format( |
| + elif status.get('usb_status', False): |
|
jbudorick
2016/03/08 00:08:49
note that this will only appear on the slave page,
bpastene
2016/03/08 00:26:01
Yeah, I just wanted to clean that slave page up a
|
| + f.write('{serial} {adb_status}\n'.format( |
| serial=status['serial'], |
| adb_status=status['adb_status'] |
| )) |
| + else: |
| + f.write('{serial} offline\n'.format( |
| + serial=status['serial'] |
| + )) |
| except Exception: # pylint: disable=broad-except |
| pass |