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

Side by Side Diff: devil/devil/android/tools/device_recovery.py

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 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 | « devil/devil/android/logcat_monitor.py ('k') | devil/devil/android/tools/device_status.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 # Copyright 2016 The Chromium Authors. All rights reserved. 2 # Copyright 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """A script to recover devices in a known bad state.""" 6 """A script to recover devices in a known bad state."""
7 7
8 import argparse 8 import argparse
9 import logging 9 import logging
10 import os 10 import os
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 parser.add_argument('--blacklist-file', help='Device blacklist JSON file.') 161 parser.add_argument('--blacklist-file', help='Device blacklist JSON file.')
162 parser.add_argument('--known-devices-file', action='append', default=[], 162 parser.add_argument('--known-devices-file', action='append', default=[],
163 dest='known_devices_files', 163 dest='known_devices_files',
164 help='Path to known device lists.') 164 help='Path to known device lists.')
165 parser.add_argument('-v', '--verbose', action='count', default=1, 165 parser.add_argument('-v', '--verbose', action='count', default=1,
166 help='Log more information.') 166 help='Log more information.')
167 167
168 args = parser.parse_args() 168 args = parser.parse_args()
169 run_tests_helper.SetLogLevel(args.verbose) 169 run_tests_helper.SetLogLevel(args.verbose)
170 170
171 devil_custom_deps = None 171 devil_dynamic_config = {
172 'config_type': 'BaseConfig',
173 'dependencies': {},
174 }
175
172 if args.adb_path: 176 if args.adb_path:
173 devil_custom_deps = { 177 devil_dynamic_config['dependencies'].update({
174 'adb': { 178 'adb': {
175 devil_env.GetPlatform(): [args.adb_path], 179 'file_info': {
176 }, 180 devil_env.GetPlatform(): {
177 } 181 'local_paths': [args.adb_path]
178 devil_env.config.Initialize(configs=devil_custom_deps) 182 }
183 }
184 }
185 })
186 devil_env.config.Initialize(configs=[devil_dynamic_config])
179 187
180 blacklist = (device_blacklist.Blacklist(args.blacklist_file) 188 blacklist = (device_blacklist.Blacklist(args.blacklist_file)
181 if args.blacklist_file 189 if args.blacklist_file
182 else None) 190 else None)
183 191
184 expected_devices = device_status.GetExpectedDevices(args.known_devices_files) 192 expected_devices = device_status.GetExpectedDevices(args.known_devices_files)
185 usb_devices = set(lsusb.get_android_devices()) 193 usb_devices = set(lsusb.get_android_devices())
186 devices = [device_utils.DeviceUtils(s) 194 devices = [device_utils.DeviceUtils(s)
187 for s in expected_devices.union(usb_devices)] 195 for s in expected_devices.union(usb_devices)]
188 196
189 RecoverDevices(devices, blacklist) 197 RecoverDevices(devices, blacklist)
190 198
191 199
192 if __name__ == '__main__': 200 if __name__ == '__main__':
193 sys.exit(main()) 201 sys.exit(main())
OLDNEW
« no previous file with comments | « devil/devil/android/logcat_monitor.py ('k') | devil/devil/android/tools/device_status.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698