source file: /home/buildslave/tahoe/edgy/build/src/allmydata/util/deferredutil.py
file stats: 10 lines, 10 executed: 100.0% covered
   1. 
   2. from twisted.internet import defer
   3. 
   4. # utility wrapper for DeferredList
   5. def _check_deferred_list(results):
   6.     # if any of the component Deferreds failed, return the first failure such
   7.     # that an addErrback() would fire. If all were ok, return a list of the
   8.     # results (without the success/failure booleans)
   9.     for success,f in results:
  10.         if not success:
  11.             return f
  12.     return [r[1] for r in results]
  13. def DeferredListShouldSucceed(dl):
  14.     d = defer.DeferredList(dl)
  15.     d.addCallback(_check_deferred_list)
  16.     return d
  17.