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, 10 Nov 2014 18:17:16 +0000 (10:17 -0800)
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.

Change-Id: I1b68f97d5bb8e28b04bdb7b58a8c03e2db7a9161

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)))