]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
debug/test_cli: fix error handling for catalog-shares, to make the test stop failing...
authorBrian Warner <warner@allmydata.com>
Thu, 30 Oct 2008 19:06:51 +0000 (12:06 -0700)
committerBrian Warner <warner@allmydata.com>
Thu, 30 Oct 2008 19:06:51 +0000 (12:06 -0700)
src/allmydata/scripts/debug.py
src/allmydata/test/test_cli.py

index 29e3e43fe9541c5d2ca97cef9b3090714f3afc1d..39e5f97f9f94b1dfa39e0df3d2c437e71fba4df3 100644 (file)
@@ -520,8 +520,11 @@ def call(c, *args, **kwargs):
     # take advantage of the fact that ImmediateReadBucketProxy returns
     # Deferreds that are already fired
     results = []
+    failures = []
     d = defer.maybeDeferred(c, *args, **kwargs)
-    d.addCallback(results.append)
+    d.addCallbacks(results.append, failures.append)
+    if failures:
+        failures[0].raiseException()
     return results[0]
 
 def describe_share(abs_sharefile, si_s, shnum_s, now, out):
@@ -580,7 +583,6 @@ def describe_share(abs_sharefile, si_s, shnum_s, now, out):
     elif struct.unpack(">L", prefix[:4]) == (1,):
         # immutable
 
-
         class ImmediateReadBucketProxy(ReadBucketProxy):
             def __init__(self, sf):
                 self.sf = sf
@@ -592,7 +594,7 @@ def describe_share(abs_sharefile, si_s, shnum_s, now, out):
         # use a ReadBucketProxy to parse the bucket and find the uri extension
         sf = storage.ShareFile(abs_sharefile)
         bp = ImmediateReadBucketProxy(sf)
-        bp.start()
+        call(bp.start)
 
         expiration_time = min( [lease.expiration_time
                                 for lease in sf.iter_leases()] )
index 6f72f2505ea634c55b6e60f8d5e2431907eea267..204065e0c80bcb5d8dcf868663d1b0e7120fe898 100644 (file)
@@ -244,7 +244,6 @@ class CLI(unittest.TestCase):
         self.failUnlessEqual(out, "", out)
         self.failUnless("Error processing " in err, err)
         self.failUnless(nodedir1 in err, err)
-        self.flushLoggedErrors(AssertionError)
 
 
 class CLITestMixin: