OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import datetime | 5 import datetime |
6 import functools | 6 import functools |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import shutil | 9 import shutil |
10 import tempfile | 10 import tempfile |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 except base_error.BaseError: | 197 except base_error.BaseError: |
198 logging.exception('Failed to stop logcat monitor for %s', | 198 logging.exception('Failed to stop logcat monitor for %s', |
199 m.adb.GetDeviceSerial()) | 199 m.adb.GetDeviceSerial()) |
200 except IOError: | 200 except IOError: |
201 logging.exception('Failed to locate logcat for device %s', | 201 logging.exception('Failed to locate logcat for device %s', |
202 m.adb.GetDeviceSerial()) | 202 m.adb.GetDeviceSerial()) |
203 | 203 |
204 if self._logcat_output_file: | 204 if self._logcat_output_file: |
205 file_utils.MergeFiles( | 205 file_utils.MergeFiles( |
206 self._logcat_output_file, | 206 self._logcat_output_file, |
207 [m.output_file for m in self._logcat_monitors]) | 207 [m.output_file for m in self._logcat_monitors |
| 208 if os.path.exists(m.output_file)]) |
208 shutil.rmtree(self._logcat_output_dir) | 209 shutil.rmtree(self._logcat_output_dir) |
209 | 210 |
210 def BlacklistDevice(self, device, reason='local_device_failure'): | 211 def BlacklistDevice(self, device, reason='local_device_failure'): |
211 device_serial = device.adb.GetDeviceSerial() | 212 device_serial = device.adb.GetDeviceSerial() |
212 if self._blacklist: | 213 if self._blacklist: |
213 self._blacklist.Extend([device_serial], reason=reason) | 214 self._blacklist.Extend([device_serial], reason=reason) |
214 with self._devices_lock: | 215 with self._devices_lock: |
215 self._devices = [d for d in self._devices if str(d) != device_serial] | 216 self._devices = [d for d in self._devices if str(d) != device_serial] |
216 | 217 |
OLD | NEW |