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

Unified Diff: build/android/pylib/device/device_utils.py

Issue 1281923003: [Android] Add --blacklist-file as a command-line option. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix telemetry_unittests Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylib/device/device_blacklist.py ('k') | build/android/pylib/device/device_utils_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/device/device_utils.py
diff --git a/build/android/pylib/device/device_utils.py b/build/android/pylib/device/device_utils.py
index bc1f2ab27339c25b18d03ccac517649c15017c55..522bf331d67c5f9f04c1a1b6987c384887a350cb 100644
--- a/build/android/pylib/device/device_utils.py
+++ b/build/android/pylib/device/device_utils.py
@@ -1843,7 +1843,7 @@ class DeviceUtils(object):
}
@classmethod
- def parallel(cls, devices=None, async=False):
+ def parallel(cls, devices, async=False):
"""Creates a Parallelizer to operate over the provided list of devices.
If |devices| is either |None| or an empty list, the Parallelizer will
@@ -1860,9 +1860,7 @@ class DeviceUtils(object):
A Parallelizer operating over |devices|.
"""
if not devices:
- devices = cls.HealthyDevices()
- if not devices:
- raise device_errors.NoDevicesError()
+ raise device_errors.NoDevicesError()
devices = [d if isinstance(d, cls) else cls(d) for d in devices]
if async:
@@ -1871,10 +1869,14 @@ class DeviceUtils(object):
return parallelizer.SyncParallelizer(devices)
@classmethod
- def HealthyDevices(cls):
- blacklist = device_blacklist.ReadBlacklist()
+ def HealthyDevices(cls, blacklist=None):
+ if not blacklist:
+ # TODO(jbudorick): Remove once clients pass in the blacklist.
+ blacklist = device_blacklist.Blacklist(device_blacklist.BLACKLIST_JSON)
+
+ blacklisted_devices = blacklist.Read()
def blacklisted(adb):
- if adb.GetDeviceSerial() in blacklist:
+ if adb.GetDeviceSerial() in blacklisted_devices:
logging.warning('Device %s is blacklisted.', adb.GetDeviceSerial())
return True
return False
« no previous file with comments | « build/android/pylib/device/device_blacklist.py ('k') | build/android/pylib/device/device_utils_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698