DO NOT MERGE Treat adb device info parse failures as warnings
authorPyry Haulos <phaulos@google.com>
Mon, 10 Nov 2014 18:17:16 +0000 (10:17 -0800)
committerPyry Haulos <phaulos@google.com>
Mon, 17 Nov 2014 23:01:24 +0000 (23:01 +0000)
Currently when for example unauthorized adb device is connected
install.py stops working altogether, as parsing failures of such lines
causes fatal error. This change turns those failures into warnings
making install.py more robust.

Bug: 18329517
Change-Id: I1b68f97d5bb8e28b04bdb7b58a8c03e2db7a9161
(cherry picked from commit a78b661ed0327eedf8b13a6debc0b98d0e37b0e5)

android/scripts/common.py

index 3b56e58..fd3d8a9 100644 (file)
@@ -99,7 +99,8 @@ def getDevices (adb):
 
                m = ptrn.match(line)
                if m == None:
-                       raise Exception("Failed to parse device info '%s'" % line)
+                       print "WARNING: Failed to parse device info '%s'" % line
+                       continue
 
                devices.append(Device(m.group(1), m.group(2), m.group(3), m.group(4)))