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

Side by Side Diff: build/android/provision_devices.py

Issue 1132993004: [Android] Remove more references to and uses of AndroidCommands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « build/android/buildbot/bb_device_steps.py ('k') | build/android/pylib/android_commands.py » ('j') | 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 (c) 2013 The Chromium Authors. All rights reserved. 3 # Copyright (c) 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 """Provisions Android devices with settings required for bots. 7 """Provisions Android devices with settings required for bots.
8 8
9 Usage: 9 Usage:
10 ./provision_devices.py [-d <device serial number>] 10 ./provision_devices.py [-d <device serial number>]
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 class _PHASES(object): 44 class _PHASES(object):
45 WIPE = 'wipe' 45 WIPE = 'wipe'
46 PROPERTIES = 'properties' 46 PROPERTIES = 'properties'
47 FINISH = 'finish' 47 FINISH = 'finish'
48 48
49 ALL = [WIPE, PROPERTIES, FINISH] 49 ALL = [WIPE, PROPERTIES, FINISH]
50 50
51 51
52 def ProvisionDevices(options): 52 def ProvisionDevices(options):
53 if options.device is not None: 53 devices = device_utils.DeviceUtils.HealthyDevices()
54 devices = [options.device] 54 if options.device:
55 else: 55 devices = [d for d in devices if d == options.device]
56 devices = device_utils.DeviceUtils.HealthyDevices() 56 if not devices:
57 raise device_errors.DeviceUnreachableError(options.device)
57 58
58 parallel_devices = device_utils.DeviceUtils.parallel(devices) 59 parallel_devices = device_utils.DeviceUtils.parallel(devices)
59 parallel_devices.pMap(ProvisionDevice, options) 60 parallel_devices.pMap(ProvisionDevice, options)
60 if options.auto_reconnect: 61 if options.auto_reconnect:
61 _LaunchHostHeartbeat() 62 _LaunchHostHeartbeat()
62 blacklist = device_blacklist.ReadBlacklist() 63 blacklist = device_blacklist.ReadBlacklist()
63 if all(d in blacklist for d in devices): 64 if all(d in blacklist for d in devices):
64 raise device_errors.NoDevicesError 65 raise device_errors.NoDevicesError
65 return 0 66 return 0
66 67
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 args = parser.parse_args() 320 args = parser.parse_args()
320 constants.SetBuildType(args.target) 321 constants.SetBuildType(args.target)
321 322
322 run_tests_helper.SetLogLevel(args.verbose) 323 run_tests_helper.SetLogLevel(args.verbose)
323 324
324 return ProvisionDevices(args) 325 return ProvisionDevices(args)
325 326
326 327
327 if __name__ == '__main__': 328 if __name__ == '__main__':
328 sys.exit(main()) 329 sys.exit(main())
OLDNEW
« no previous file with comments | « build/android/buildbot/bb_device_steps.py ('k') | build/android/pylib/android_commands.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698