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

Unified Diff: build/android/buildbot/bb_device_status_check.py

Issue 1304303006: [Android] Don't use a device blacklist if one isn't provided. (RELAND) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add blacklist to host_info and the old buildbot scripts Created 5 years, 3 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/adb_reverse_forwarder.py ('k') | build/android/buildbot/bb_device_steps.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/buildbot/bb_device_status_check.py
diff --git a/build/android/buildbot/bb_device_status_check.py b/build/android/buildbot/bb_device_status_check.py
index 74d50ae00aa08334e915f4a0537450db49f07500..3a2e990178a846064961ede8986035b88d9e16b9 100755
--- a/build/android/buildbot/bb_device_status_check.py
+++ b/build/android/buildbot/bb_device_status_check.py
@@ -55,6 +55,10 @@ def KillAllAdb():
pass
+def _IsBlacklisted(serial, blacklist):
+ return blacklist and serial in blacklist.Read()
+
+
def _BatteryStatus(device, blacklist):
battery_info = {}
try:
@@ -138,7 +142,7 @@ def DeviceStatus(devices, blacklist):
}
if adb_status == 'device':
- if not serial in blacklist.Read():
+ if not _IsBlacklisted(serial, blacklist):
try:
build_product = device.build_product
build_id = device.build_id
@@ -180,7 +184,7 @@ def DeviceStatus(devices, blacklist):
elif blacklist:
blacklist.Extend([serial])
- device_status['blacklisted'] = serial in blacklist.Read()
+ device_status['blacklisted'] = _IsBlacklisted(serial, blacklist)
return device_status
@@ -223,7 +227,8 @@ def RecoverDevices(devices, blacklist):
for d in should_reboot_device:
logging.debug(' %s', d)
- blacklist.Reset()
+ if blacklist:
+ blacklist.Reset()
if should_restart_adb:
KillAllAdb()
@@ -236,7 +241,7 @@ def RecoverDevices(devices, blacklist):
blacklist.Extend([serial])
def blacklisting_recovery(device):
- if blacklist and device.adb.GetDeviceSerial() in blacklist.Read():
+ if _IsBlacklisted(device.adb.GetDeviceSerial(), blacklist):
logging.debug('%s is blacklisted, skipping recovery.', str(device))
return
@@ -282,11 +287,9 @@ def main():
run_tests_helper.SetLogLevel(args.verbose)
- if args.blacklist_file:
- blacklist = device_blacklist.Blacklist(args.blacklist_file)
- else:
- # TODO(jbudorick): Remove this once bots pass the blacklist file.
- blacklist = device_blacklist.Blacklist(device_blacklist.BLACKLIST_JSON)
+ blacklist = (device_blacklist.Blacklist(args.blacklist_file)
+ if args.blacklist_file
+ else None)
last_devices_path = os.path.join(
args.out_dir, device_list.LAST_DEVICES_FILENAME)
@@ -358,7 +361,7 @@ def main():
live_devices = [status['serial'] for status in statuses
if (status['adb_status'] == 'device'
- and status['serial'] not in blacklist.Read())]
+ and not _IsBlacklisted(status['serial'], blacklist))]
# If all devices failed, or if there are no devices, it's an infra error.
return 0 if live_devices else constants.INFRA_EXIT_CODE
« no previous file with comments | « build/android/adb_reverse_forwarder.py ('k') | build/android/buildbot/bb_device_steps.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698