From: Kevan Carstensen Date: Sat, 5 Dec 2009 05:30:37 +0000 (-0700) Subject: Change "UploadHappinessError" to "UploadUnhappinessError" X-Git-Tag: trac-4400~94 X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/%22doc.html/-?a=commitdiff_plain;h=8bcc771e26c44932fa080ff494e3d9ff8a23b8a8;p=tahoe-lafs%2Ftahoe-lafs.git Change "UploadHappinessError" to "UploadUnhappinessError" --- diff --git a/src/allmydata/immutable/encode.py b/src/allmydata/immutable/encode.py index 064e17f5..f6be4b02 100644 --- a/src/allmydata/immutable/encode.py +++ b/src/allmydata/immutable/encode.py @@ -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) diff --git a/src/allmydata/immutable/upload.py b/src/allmydata/immutable/upload.py index 32aec3f7..9f58abeb 100644 --- a/src/allmydata/immutable/upload.py +++ b/src/allmydata/immutable/upload.py @@ -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: diff --git a/src/allmydata/interfaces.py b/src/allmydata/interfaces.py index 78c712b7..c2231e42 100644 --- a/src/allmydata/interfaces.py +++ b/src/allmydata/interfaces.py @@ -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):