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

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

Issue 2811993002: [devil refactor] Prepare clients for DeviceUnreachableError (Closed)
Patch Set: 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 unified diff | Download patch
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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 logging.info("Version name for %s is %s", package, version_name) 130 logging.info("Version name for %s is %s", package, version_name)
131 131
132 CheckExternalStorage(device) 132 CheckExternalStorage(device)
133 133
134 except device_errors.CommandTimeoutError: 134 except device_errors.CommandTimeoutError:
135 logging.exception('Timed out waiting for device %s. Adding to blacklist.', 135 logging.exception('Timed out waiting for device %s. Adding to blacklist.',
136 str(device)) 136 str(device))
137 if blacklist: 137 if blacklist:
138 blacklist.Extend([str(device)], reason='provision_timeout') 138 blacklist.Extend([str(device)], reason='provision_timeout')
139 139
140 except device_errors.CommandFailedError: 140 except (device_errors.CommandFailedError,
141 device_errors.DeviceUnreachableError):
141 logging.exception('Failed to provision device %s. Adding to blacklist.', 142 logging.exception('Failed to provision device %s. Adding to blacklist.',
142 str(device)) 143 str(device))
143 if blacklist: 144 if blacklist:
144 blacklist.Extend([str(device)], reason='provision_failure') 145 blacklist.Extend([str(device)], reason='provision_failure')
145 146
146 def CheckExternalStorage(device): 147 def CheckExternalStorage(device):
147 """Checks that storage is writable and if not makes it writable. 148 """Checks that storage is writable and if not makes it writable.
148 149
149 Arguments: 150 Arguments:
150 device: The device to check. 151 device: The device to check.
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 552
552 try: 553 try:
553 return ProvisionDevices(args) 554 return ProvisionDevices(args)
554 except (device_errors.DeviceUnreachableError, device_errors.NoDevicesError): 555 except (device_errors.DeviceUnreachableError, device_errors.NoDevicesError):
555 logging.exception('Unable to provision local devices.') 556 logging.exception('Unable to provision local devices.')
556 return exit_codes.INFRA 557 return exit_codes.INFRA
557 558
558 559
559 if __name__ == '__main__': 560 if __name__ == '__main__':
560 sys.exit(main()) 561 sys.exit(main())
OLDNEW
« no previous file with comments | « build/android/adb_install_apk.py ('k') | build/android/pylib/local/device/local_device_gtest_run.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698