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

Side by Side Diff: build/android/buildbot/bb_device_status_check.py

Issue 284953002: If no battery information, do not try to split. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """A class to keep track of devices across builds and report state.""" 7 """A class to keep track of devices across builds and report state."""
8 import logging 8 import logging
9 import optparse 9 import optparse
10 import os 10 import os
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 return 'Unknown' 64 return 'Unknown'
65 65
66 ac_power = _GetData('AC powered: (\w+)', battery) 66 ac_power = _GetData('AC powered: (\w+)', battery)
67 battery_level = _GetData('level: (\d+)', battery) 67 battery_level = _GetData('level: (\d+)', battery)
68 imei_slice = _GetData('Device ID = (\d+)', 68 imei_slice = _GetData('Device ID = (\d+)',
69 device_adb.old_interface.GetSubscriberInfo(), 69 device_adb.old_interface.GetSubscriberInfo(),
70 lambda x: x[-6:]) 70 lambda x: x[-6:])
71 report = ['Device %s (%s)' % (serial, device_type), 71 report = ['Device %s (%s)' % (serial, device_type),
72 ' Build: %s (%s)' % 72 ' Build: %s (%s)' %
73 (device_build, device_adb.old_interface.GetBuildFingerprint()), 73 (device_build, device_adb.old_interface.GetBuildFingerprint()),
74 ' %s' % '\n '.join(battery.split('\n')), 74 ' %s' % '\n '.join(battery.split('\n')) if battery else '',
luqui 2014/05/13 22:25:43 This inline if is a bit dense and will be tough fo
luqui 2014/05/13 22:26:38 Better yet, a function "indent", to state your int
navabi 2014/05/13 22:40:30 Done. I didn't think we needed an 'indent' functio
75 ' IMEI slice: %s' % imei_slice, 75 ' IMEI slice: %s' % imei_slice,
76 ' Wifi IP: %s' % device_adb.old_interface.GetWifiIP(), 76 ' Wifi IP: %s' % device_adb.old_interface.GetWifiIP(),
77 ''] 77 '']
78 78
79 errors = [] 79 errors = []
80 if battery_level < 15: 80 if battery_level < 15:
81 errors += ['Device critically low in battery. Turning off device.'] 81 errors += ['Device critically low in battery. Turning off device.']
82 if not options.no_provisioning_check: 82 if not options.no_provisioning_check:
83 setup_wizard_disabled = ( 83 setup_wizard_disabled = (
84 device_adb.old_interface.GetSetupWizardStatus() == 'DISABLED') 84 device_adb.old_interface.GetSetupWizardStatus() == 'DISABLED')
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 # devices with critically low battery. Remove those devices from testing, 346 # devices with critically low battery. Remove those devices from testing,
347 # allowing build to continue with good devices. 347 # allowing build to continue with good devices.
348 return 1 348 return 1
349 349
350 if not devices: 350 if not devices:
351 return 1 351 return 1
352 352
353 353
354 if __name__ == '__main__': 354 if __name__ == '__main__':
355 sys.exit(main()) 355 sys.exit(main())
OLDNEW
« 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