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

Unified Diff: build/android/provision_devices.py

Issue 975963002: Catch exception if --adb-key-files file does not exist and log warning. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/provision_devices.py
diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py
index 6d633524ae54b55d76c38252c16dae43535650c0..073e05f72c879f1acaf1d9331397a665d19c7ee3 100755
--- a/build/android/provision_devices.py
+++ b/build/android/provision_devices.py
@@ -11,6 +11,7 @@ Usage:
"""
import argparse
+import glob
jbudorick 2015/03/04 00:20:46 nit: remove this
import logging
import os
import posixpath
@@ -145,9 +146,12 @@ def WipeDeviceData(device, options):
if device_authorized:
adb_keys_set = set(adb_keys)
for adb_key_file in options.adb_key_files or []:
- with open(adb_key_file, 'r') as f:
- adb_public_keys = f.readlines()
- adb_keys_set.update(adb_public_keys)
+ try:
+ with open(adb_key_file, 'r') as f:
+ adb_public_keys = f.readlines()
+ adb_keys_set.update(adb_public_keys)
+ except IOError:
+ logging.warning('Unable to find adb keys file %s.' % adb_key_file)
WriteAdbKeysFile(device, '\n'.join(adb_keys_set))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698