Change "UploadHappinessError" to "UploadUnhappinessError"
authorKevan Carstensen <kevan@isnotajoke.com>
Sat, 5 Dec 2009 05:30:37 +0000 (22:30 -0700)
committerKevan Carstensen <kevan@isnotajoke.com>
Sat, 5 Dec 2009 05:30:37 +0000 (22:30 -0700)
src/allmydata/immutable/encode.py
src/allmydata/immutable/upload.py
src/allmydata/interfaces.py

index 064e17f5256adf944df4c6074d6be1b8a5b91fb7..f6be4b023554ddc3e7977c9f61852ca2c3d603fa 100644 (file)
@@ -11,7 +11,7 @@ from allmydata.util import mathutil, hashutil, base32, log
 from allmydata.util.assertutil import _assert, precondition
 from allmydata.codec import CRSEncoder
 from allmydata.interfaces import IEncoder, IStorageBucketWriter, \
-     IEncryptedUploadable, IUploadStatus, UploadHappinessError
+     IEncryptedUploadable, IUploadStatus, UploadUnhappinessError
 
 
 """
@@ -495,7 +495,7 @@ class Encoder(object):
             msg = "lost too many servers during upload (still have %d, want %d): %s" % \
                   (len(servers_left),
                    self.servers_of_happiness, why)
-            raise UploadHappinessError(msg)
+            raise UploadUnhappinessError(msg)
         self.log("but we can still continue with %s shares, we'll be happy "
                  "with at least %s" % (len(servers_left),
                                        self.servers_of_happiness),
@@ -505,12 +505,12 @@ class Encoder(object):
         d = defer.DeferredList(dl, fireOnOneErrback=True)
         def _eatNotEnoughSharesError(f):
             # all exceptions that occur while talking to a peer are handled
-            # in _remove_shareholder. That might raise UploadHappinessError,
+            # in _remove_shareholder. That might raise UploadUnhappinessError,
             # which will cause the DeferredList to errback but which should
-            # otherwise be consumed. Allow non-UploadHappinessError exceptions
+            # otherwise be consumed. Allow non-UploadUnhappinessError exceptions
             # to pass through as an unhandled errback. We use this in lieu of
             # consumeErrors=True to allow coding errors to be logged.
-            f.trap(UploadHappinessError)
+            f.trap(UploadUnhappinessError)
             return None
         for d0 in dl:
             d0.addErrback(_eatNotEnoughSharesError)
index 32aec3f7afbfd4076f5cc7d7ed9da3a91a8dc0c5..9f58abebb19a6ecd41ad239ad2a65bae17d5650a 100644 (file)
@@ -17,7 +17,7 @@ from allmydata.util.assertutil import precondition
 from allmydata.util.rrefutil import add_version_to_remote_reference
 from allmydata.interfaces import IUploadable, IUploader, IUploadResults, \
      IEncryptedUploadable, RIEncryptedUploadable, IUploadStatus, \
-     NoServersError, InsufficientVersionError, UploadHappinessError
+     NoServersError, InsufficientVersionError, UploadUnhappinessError
 from allmydata.immutable import layout
 from pycryptopp.cipher.aes import AES
 
@@ -362,7 +362,7 @@ class Tahoe2PeerSelector:
                             items.append((servernum, sharelist))
                     return self._loop()
                 else:
-                    raise UploadHappinessError("shares could only be placed "
+                    raise UploadUnhappinessError("shares could only be placed "
                                    "on %d servers (%d were requested)" %
                                    (len(effective_happiness),
                                    self.servers_of_happiness))
@@ -434,7 +434,7 @@ class Tahoe2PeerSelector:
                 if self.last_failure_msg:
                     msg += " (%s)" % (self.last_failure_msg,)
                 log.msg(msg, level=log.UNUSUAL, parent=self._log_parent)
-                raise UploadHappinessError(msg)
+                raise UploadUnhappinessError(msg)
             else:
                 # we placed enough to be happy, so we're done
                 if self._status:
index 78c712b7bfbd0e3a28078a09c9099179e2fcd01c..c2231e42ea2df2b5b5736f746525a0e06ff27bf6 100644 (file)
@@ -810,7 +810,7 @@ class NotEnoughSharesError(Exception):
 class NoSharesError(Exception):
     """Download was unable to get any shares at all."""
 
-class UploadHappinessError(Exception):
+class UploadUnhappinessError(Exception):
     """Upload was unable to satisfy 'servers_of_happiness'"""
 
 class UnableToFetchCriticalDownloadDataError(Exception):