]> scripts.mit.edu Git - wizard.git/commitdiff
Partition on colon for exceptions, ignore blank blacklistings.
authorEdward Z. Yang <ezyang@mit.edu>
Wed, 21 Oct 2009 16:22:46 +0000 (12:22 -0400)
committerEdward Z. Yang <ezyang@mit.edu>
Wed, 21 Oct 2009 16:22:46 +0000 (12:22 -0400)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
TODO
wizard/command/upgrade.py
wizard/tests/util_test.py
wizard/util.py

diff --git a/TODO b/TODO
index dcdfcad9d5ff2436ea86f4260b9ac95a4c66343e..ab3e7d6fe7c90805a1166255e11f18ca368d8e28 100644 (file)
--- a/TODO
+++ b/TODO
@@ -7,8 +7,6 @@ TODO NOW:
       does not seem to have been a problem in practice)
     - Prune -7 call errors and automatically reprocess them (with a
       strike out counter of 3)--this requires better error parsing.
-    - IOError should be aggregated, right now contains custom string
-      that makes this not possible. Partition on a colon.
     - Replace gaierror with a more descriptive name (this is a DNS error)
     - Stronger skips means that backup failures should also be avoided
     - Distinguish between types of backup failures
index 503be69d2448838bd8557d457740b788404ec603..0d90a562f1f977bb566ac8f975f27abd9658086f 100644 (file)
@@ -46,8 +46,12 @@ def main(argv, baton):
             d = deploy.ProductionCopy(".")
             if os.path.exists(".scripts/blacklisted"):
                 reason = open(".scripts/blacklisted").read()
-                print reason
-                raise BlacklistedError(reason)
+                # ignore blank blacklisted files
+                if reason:
+                    print reason
+                    raise BlacklistedError(reason)
+                else:
+                    logging.warning("Application was blacklisted, but no reason was found");
             d.verify()
             d.verifyTag(options.srv_path)
             d.verifyGit(options.srv_path)
index e4ebe91977d846ec31e0f5599bcc1fa47aaafca9..a328cd1516e2175d319d78ec6d7c7283eebed427 100644 (file)
@@ -49,3 +49,8 @@ def test_get_exception_name_withhtml():
     except MyErrorWithHTML:
         assert get_exception_name(traceback.format_exc()) == "MyErrorWithHTML"
 
+def test_get_exception_name_withstr2():
+    try:
+        raise Exception("This is extra info we don't care about");
+    except Exception:
+        assert get_exception_name(traceback.format_exc()) == "Exception"
index 7dbd4d7f3ad2aac4e164fb5e95b7fdc91325ee41..eca883e5be31d96057f4f11e3139d0ceec3a690e 100644 (file)
@@ -152,11 +152,7 @@ def get_exception_name(output):
             continue
         if cue:
             cue = False
-            if line[-1] == ":":
-                result = line[:-1]
-            else:
-                result = line
-            return result
+            return line.partition(':')[0]
     return result
 
 def get_dir_uid(dir):