]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
mutable publish: fix not-enough-shares detection. Refs #1628.
authorKevan Carstensen <kevan@isnotajoke.com>
Wed, 28 Dec 2011 05:50:18 +0000 (21:50 -0800)
committerBrian Warner <warner@lothar.com>
Wed, 28 Dec 2011 05:50:18 +0000 (21:50 -0800)
This should match the "fix-1628.darcs.2.patch" attachment on that ticket.

src/allmydata/mutable/publish.py

index 1e2de76d8e2901c200d2485161905bb3a783f5e3..e8f2ebb4751e42257535f7913e22bbc326081396 100644 (file)
@@ -623,10 +623,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