Ignore exception files in build folder to return correct latest build version

Files like .R33-4987DOT0DOT0.imagesDOTzip.exception is created when devserver
failed to stage a build. The exception file is used for caller to check if a
particular build was staged successfully. This file can cause
GetLatestBuildVersion to return a wrong build version. This CL fix the issue by
ignoring .exception files explicitly.

BUG=chromium:324928
TEST=test in local devserver. Try to stage a none existing build, e.g.,
lumpy-release/R99-1234.0.0
browse to: http://localhost:8080/latestbuild?target=lumpy-release
confirm the correct version was returned.

Change-Id: I3d1bd23a74807304607f906f68d94b9d60c990fe
Reviewed-on: https://chromium-review.googlesource.com/178426
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
diff --git a/common_util.py b/common_util.py
index e516fd0..7b3c7b2 100644
--- a/common_util.py
+++ b/common_util.py
@@ -68,7 +68,7 @@
     raise CommonUtilError('Cannot find path %s' % target_path)
 
   builds = [distutils.version.LooseVersion(build) for build in
-            os.listdir(target_path)]
+            os.listdir(target_path) if not build.endswith('.exception')]
 
   if milestone and builds:
     # Check if milestone Rxx is in the string representation of the build.