]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Wed Dec 28 05:50:18 GMT 2011 Brian Warner <warner@lothar.com>
authorDaira Hopwood <daira@jacaranda.org>
Thu, 5 Sep 2013 17:01:02 +0000 (18:01 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Thu, 5 Sep 2013 17:01:02 +0000 (18:01 +0100)
  * mutable publish: fix not-enough-shares detection. Refs #1628.

  This should match the "fix-1628.darcs.2.patch" attachment on that ticket.

src/allmydata/mutable/publish.py

index 392495c1a07095ed68d95f6e8dd2d5e737d40ff9..c611a6f965fd3a3d52dfad75ef067c9160b85436 100644 (file)
@@ -622,10 +622,9 @@ class Publish:
         # Can we still successfully publish this file?
         # TODO: Keep track of outstanding queries before aborting the
         #       process.
-        all_writers = []
-        for shnum, writers in self.writers.iteritems():
-            all_writers.extend(writers)
-        if len(all_writers) < self.required_shares or self.surprised:
+        all_shnums = filter(lambda sh: len(self.writers[sh]) > 0,
+                            self.writers.iterkeys())
+        if len(all_shnums) < self.required_shares or self.surprised:
             return self._failure()
 
         # Figure out what we need to do next. Each of these needs to