| 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 9409e6bdd9fd070d676be391b725b1c49f14a636..960f3b164eaf1b31cd3b2d3a09baf19c1bcd18d2 100755
|
| --- a/build/android/buildbot/bb_device_status_check.py
|
| +++ b/build/android/buildbot/bb_device_status_check.py
|
| @@ -13,13 +13,9 @@ import psutil
|
| import re
|
| import signal
|
| import smtplib
|
| -import subprocess
|
| import sys
|
| -import time
|
| -import urllib
|
|
|
| import bb_annotations
|
| -import bb_utils
|
|
|
| sys.path.append(os.path.join(os.path.dirname(__file__),
|
| os.pardir, os.pardir, 'util', 'lib',
|
| @@ -35,11 +31,9 @@ from devil.android import device_utils
|
| from devil.android.sdk import adb_wrapper
|
| from devil.utils import reset_usb
|
| from devil.utils import run_tests_helper
|
| -from devil.utils import timeout_retry
|
| from pylib import constants
|
| -from pylib.cmd_helper import GetCmdOutput
|
|
|
| -_RE_DEVICE_ID = re.compile('Device ID = (\d+)')
|
| +_RE_DEVICE_ID = re.compile(r'Device ID = (\d+)')
|
|
|
| def DeviceInfo(device, args):
|
| """Gathers info on a device via various adb calls.
|
| @@ -150,7 +144,7 @@ def CheckForMissingDevices(args, devices):
|
| buildbot_buildnumber = os.environ.get('BUILDBOT_BUILDNUMBER')
|
|
|
| if new_missing_devs and buildbot_slavename:
|
| - logging.info('new_missing_devs %s' % new_missing_devs)
|
| + logging.info('new_missing_devs %s', new_missing_devs)
|
| devices_missing_msg = '%d devices not detected.' % len(missing_devs)
|
| bb_annotations.PrintSummaryText(devices_missing_msg)
|
|
|
| @@ -161,7 +155,7 @@ def CheckForMissingDevices(args, devices):
|
| subject = 'Devices offline on %s, %s, %s' % (
|
| buildbot_slavename, buildbot_buildername, buildbot_buildnumber)
|
| msg = ('Please reboot the following devices:\n%s' %
|
| - '\n'.join(map(str, new_missing_devs)))
|
| + '\n'.join(str(d) for d in new_missing_devs))
|
| SendEmail(from_address, to_addresses, cc_addresses, subject, msg)
|
|
|
| unauthorized_devices = adb_wrapper.AdbWrapper.Devices(
|
| @@ -219,7 +213,7 @@ def SendEmail(from_address, to_addresses, cc_addresses, subject, msg):
|
| server = smtplib.SMTP('localhost')
|
| server.sendmail(from_address, to_addresses, msg_body)
|
| server.quit()
|
| - except Exception:
|
| + except Exception: # pylint: disable=broad-except
|
| logging.exception('Failed to send alert email.')
|
|
|
|
|
| @@ -343,7 +337,7 @@ def main():
|
| f.write('%s %s %s %.1fC %s%%\n' % (device['serial'], device['type'],
|
| device['build'], float(device['battery']['temperature']) / 10,
|
| device['battery']['level']))
|
| - except Exception:
|
| + except Exception: # pylint: disable=broad-except
|
| pass
|
|
|
| err_msg = CheckForMissingDevices(args, devices) or []
|
|
|