Merge pull request #359 from lbryio/no-more-upload-allowed

No more upload_allowed
This commit is contained in:
Jack Robison 2017-02-15 22:52:07 -05:00 committed by GitHub
commit 03c0ff8529
18 changed files with 78 additions and 99 deletions

View file

@ -8,6 +8,8 @@ can and probably will change functionality and break backwards compatability
at anytime.
## [Unreleased]
### Changed
* Remove unused upload_allowed option
## [0.8.3] - 2017-02-15
### Fixed

View file

@ -24,13 +24,13 @@ class BlobManager(DHTHashSupplier):
def setup(self):
pass
def get_blob(self, blob_hash, upload_allowed, length):
def get_blob(self, blob_hash, length=None):
pass
def get_blob_creator(self):
pass
def _make_new_blob(self, blob_hash, upload_allowed, length):
def _make_new_blob(self, blob_hash, length):
pass
def blob_completed(self, blob, next_announce_time=None):
@ -107,22 +107,21 @@ class DiskBlobManager(BlobManager):
self.db_conn = None
return defer.succeed(True)
def get_blob(self, blob_hash, upload_allowed, length=None):
def get_blob(self, blob_hash, length=None):
"""Return a blob identified by blob_hash, which may be a new blob or a
blob that is already on the hard disk
"""
# TODO: if blob.upload_allowed and upload_allowed is False,
# change upload_allowed in blob and on disk
assert length is None or isinstance(length, int)
if blob_hash in self.blobs:
return defer.succeed(self.blobs[blob_hash])
return self._make_new_blob(blob_hash, upload_allowed, length)
return self._make_new_blob(blob_hash, length)
def get_blob_creator(self):
return self.blob_creator_type(self, self.blob_dir)
def _make_new_blob(self, blob_hash, upload_allowed, length=None):
def _make_new_blob(self, blob_hash, length=None):
log.debug('Making a new blob for %s', blob_hash)
blob = self.blob_type(self.blob_dir, blob_hash, upload_allowed, length)
blob = self.blob_type(self.blob_dir, blob_hash, length)
self.blobs[blob_hash] = blob
return defer.succeed(blob)
@ -144,7 +143,7 @@ class DiskBlobManager(BlobManager):
assert blob_creator.blob_hash is not None
assert blob_creator.blob_hash not in self.blobs
assert blob_creator.length is not None
new_blob = self.blob_type(self.blob_dir, blob_creator.blob_hash, True, blob_creator.length)
new_blob = self.blob_type(self.blob_dir, blob_creator.blob_hash, blob_creator.length)
self.blobs[blob_creator.blob_hash] = new_blob
self._immediate_announce([blob_creator.blob_hash])
next_announce_time = self.get_next_announce_time()
@ -218,7 +217,7 @@ class DiskBlobManager(BlobManager):
for blob_hash, being_deleted in self.blob_hashes_to_delete.items():
if being_deleted is False:
self.blob_hashes_to_delete[blob_hash] = True
d = self.get_blob(blob_hash, True)
d = self.get_blob(blob_hash)
d.addCallbacks(
delete, set_not_deleting,
callbackArgs=(blob_hash,), errbackArgs=(blob_hash,))
@ -272,7 +271,7 @@ class DiskBlobManager(BlobManager):
@defer.inlineCallbacks
def _completed_blobs(self, blobhashes_to_check):
"""Returns of the blobhashes_to_check, which are valid"""
blobs = yield defer.DeferredList([self.get_blob(b, True) for b in blobhashes_to_check])
blobs = yield defer.DeferredList([self.get_blob(b) for b in blobhashes_to_check])
blob_hashes = [b.blob_hash for success, b in blobs if success and b.verified]
defer.returnValue(blob_hashes)
@ -364,16 +363,16 @@ class TempBlobManager(BlobManager):
self._next_manage_call.cancel()
self._next_manage_call = None
def get_blob(self, blob_hash, upload_allowed, length=None):
def get_blob(self, blob_hash, length=None):
if blob_hash in self.blobs:
return defer.succeed(self.blobs[blob_hash])
return self._make_new_blob(blob_hash, upload_allowed, length)
return self._make_new_blob(blob_hash, length)
def get_blob_creator(self):
return self.blob_creator_type(self)
def _make_new_blob(self, blob_hash, upload_allowed, length=None):
blob = self.blob_type(blob_hash, upload_allowed, length)
def _make_new_blob(self, blob_hash, length=None):
blob = self.blob_type(blob_hash, length)
self.blobs[blob_hash] = blob
return defer.succeed(blob)
@ -409,7 +408,7 @@ class TempBlobManager(BlobManager):
assert blob_creator.blob_hash is not None
assert blob_creator.blob_hash not in self.blobs
assert blob_creator.length is not None
new_blob = self.blob_type(blob_creator.blob_hash, True, blob_creator.length)
new_blob = self.blob_type(blob_creator.blob_hash, blob_creator.length)
# TODO: change this; its breaks the encapsulation of the
# blob. Maybe better would be to have the blob_creator
# produce a blob.

View file

@ -82,14 +82,13 @@ class HashBlobWriter(object):
class HashBlob(object):
"""A chunk of data available on the network which is specified by a hashsum"""
def __init__(self, blob_hash, upload_allowed, length=None):
def __init__(self, blob_hash, length=None):
assert is_valid_blobhash(blob_hash)
self.blob_hash = blob_hash
self.length = length
self.writers = {} # {Peer: writer, finished_deferred}
self.finished_deferred = None
self._verified = False
self.upload_allowed = upload_allowed
self.readers = 0
@property

View file

@ -11,9 +11,8 @@ log = logging.getLogger(__name__)
class DownloadManager(object):
implements(interfaces.IDownloadManager)
def __init__(self, blob_manager, upload_allowed):
def __init__(self, blob_manager):
self.blob_manager = blob_manager
self.upload_allowed = upload_allowed
self.blob_info_finder = None
self.progress_manager = None
self.blob_handler = None
@ -82,8 +81,7 @@ class DownloadManager(object):
self.blob_infos[blob_info.blob_num] = blob_info
log.debug(
"Trying to get the blob associated with blob hash %s", blob_info.blob_hash)
d = self.blob_manager.get_blob(
blob_info.blob_hash, self.upload_allowed, blob_info.length)
d = self.blob_manager.get_blob(blob_info.blob_hash, blob_info.length)
d.addCallback(add_blob_to_list, blob_info.blob_num)
d.addErrback(error_during_add)
ds.append(d)

View file

@ -112,7 +112,7 @@ class StandaloneBlobDownloader(object):
self.stop()
self.finished_deferred = defer.Deferred(canceller=cancel_download)
self.download_manager = DownloadManager(self.blob_manager, True)
self.download_manager = DownloadManager(self.blob_manager)
self.download_manager.blob_requester = BlobRequester(self.blob_manager, self.peer_finder,
self.payment_rate_manager, self.wallet,
self.download_manager)

View file

@ -138,7 +138,7 @@ class BlobRequestHandler(object):
return self._send_blob(response, query)
def _send_blob(self, response, query):
d = self.blob_manager.get_blob(query, True)
d = self.blob_manager.get_blob(query)
d.addCallback(self.open_blob_for_reading, response)
return d
@ -177,7 +177,7 @@ class BlobRequestHandler(object):
return defer.succeed(response)
else:
log.debug("Requested blob: %s", str(incoming))
d = self.blob_manager.get_blob(incoming, True)
d = self.blob_manager.get_blob(incoming)
d.addCallback(lambda blob: self.open_blob_for_reading(blob, response))
return d

View file

@ -38,7 +38,7 @@ class CryptStreamDownloader(object):
implements(IStreamDownloader)
def __init__(self, peer_finder, rate_limiter, blob_manager,
payment_rate_manager, wallet, upload_allowed):
payment_rate_manager, wallet):
"""Initialize a CryptStreamDownloader
@param peer_finder: An object which implements the IPeerFinder
@ -61,7 +61,6 @@ class CryptStreamDownloader(object):
self.blob_manager = blob_manager
self.payment_rate_manager = payment_rate_manager
self.wallet = wallet
self.upload_allowed = upload_allowed
self.key = None
self.stream_name = None
self.completed = False
@ -146,7 +145,7 @@ class CryptStreamDownloader(object):
def _get_download_manager(self):
assert self.blob_requester is None
download_manager = DownloadManager(self.blob_manager, self.upload_allowed)
download_manager = DownloadManager(self.blob_manager)
# TODO: can we get rid of these circular references. I'm not
# smart enough to handle thinking about the interactions
# between them and have hope that there is a simpler way

View file

@ -23,9 +23,9 @@ class EncryptedFileDownloader(CryptStreamDownloader):
"""Classes which inherit from this class download LBRY files"""
def __init__(self, stream_hash, peer_finder, rate_limiter, blob_manager,
stream_info_manager, payment_rate_manager, wallet, upload_allowed):
stream_info_manager, payment_rate_manager, wallet):
CryptStreamDownloader.__init__(self, peer_finder, rate_limiter, blob_manager,
payment_rate_manager, wallet, upload_allowed)
payment_rate_manager, wallet)
self.stream_hash = stream_hash
self.stream_info_manager = stream_info_manager
self.suggested_file_name = None
@ -140,8 +140,9 @@ class EncryptedFileDownloaderFactory(object):
return True
def make_downloader(self, metadata, options, payment_rate_manager, **kwargs):
payment_rate_manager.min_blob_data_payment_rate = options[0]
upload_allowed = options[1]
assert len(options) == 1
data_rate = options[0]
payment_rate_manager.min_blob_data_payment_rate = data_rate
def save_source_if_blob(stream_hash):
if metadata.metadata_source == StreamMetadata.FROM_BLOB:
@ -154,7 +155,7 @@ class EncryptedFileDownloaderFactory(object):
def create_downloader(stream_hash):
downloader = self._make_downloader(stream_hash, payment_rate_manager,
metadata.validator.raw_info, upload_allowed)
metadata.validator.raw_info)
d = downloader.set_stream_info()
d.addCallback(lambda _: downloader)
return d
@ -164,18 +165,17 @@ class EncryptedFileDownloaderFactory(object):
d.addCallback(create_downloader)
return d
def _make_downloader(self, stream_hash, payment_rate_manager, stream_info, upload_allowed):
def _make_downloader(self, stream_hash, payment_rate_manager, stream_info):
pass
class EncryptedFileSaver(EncryptedFileDownloader):
def __init__(self, stream_hash, peer_finder, rate_limiter, blob_manager, stream_info_manager,
payment_rate_manager, wallet, download_directory, upload_allowed, file_name=None):
payment_rate_manager, wallet, download_directory, file_name=None):
EncryptedFileDownloader.__init__(self, stream_hash,
peer_finder, rate_limiter,
blob_manager, stream_info_manager,
payment_rate_manager, wallet,
upload_allowed)
payment_rate_manager, wallet)
self.download_directory = download_directory
self.file_name = file_name
self.file_written_to = None
@ -208,9 +208,7 @@ class EncryptedFileSaver(EncryptedFileDownloader):
def _get_progress_manager(self, download_manager):
return FullStreamProgressManager(self._finished_downloading,
self.blob_manager,
download_manager,
delete_blob_after_finished=not
self.upload_allowed)
download_manager)
def _setup_output(self):
def open_file():
@ -274,12 +272,12 @@ class EncryptedFileSaverFactory(EncryptedFileDownloaderFactory):
stream_info_manager, wallet)
self.download_directory = download_directory
def _make_downloader(self, stream_hash, payment_rate_manager, stream_info, upload_allowed):
def _make_downloader(self, stream_hash, payment_rate_manager, stream_info):
return EncryptedFileSaver(stream_hash, self.peer_finder,
self.rate_limiter, self.blob_manager,
self.stream_info_manager,
payment_rate_manager, self.wallet,
self.download_directory, upload_allowed)
self.download_directory)
@staticmethod
def get_description():
@ -288,12 +286,12 @@ class EncryptedFileSaverFactory(EncryptedFileDownloaderFactory):
class EncryptedFileOpener(EncryptedFileDownloader):
def __init__(self, stream_hash, peer_finder, rate_limiter, blob_manager, stream_info_manager,
payment_rate_manager, wallet, upload_allowed):
payment_rate_manager, wallet):
EncryptedFileDownloader.__init__(self, stream_hash,
peer_finder, rate_limiter,
blob_manager, stream_info_manager,
payment_rate_manager, wallet,
upload_allowed)
)
self.process = None
self.process_log = None
@ -305,9 +303,7 @@ class EncryptedFileOpener(EncryptedFileDownloader):
def _get_progress_manager(self, download_manager):
return FullStreamProgressManager(self._finished_downloading,
self.blob_manager,
download_manager,
delete_blob_after_finished=not
self.upload_allowed)
download_manager)
def _setup_output(self):
def start_process():
@ -363,12 +359,12 @@ class EncryptedFileOpenerFactory(EncryptedFileDownloaderFactory):
return True
return False
def _make_downloader(self, stream_hash, payment_rate_manager, stream_info, upload_allowed):
def _make_downloader(self, stream_hash, payment_rate_manager, stream_info):
return EncryptedFileOpener(stream_hash, self.peer_finder,
self.rate_limiter, self.blob_manager,
self.stream_info_manager,
payment_rate_manager, self.wallet,
upload_allowed)
)
@staticmethod
def get_description():

View file

@ -43,17 +43,5 @@ class EncryptedFileOptions(object):
prm.base.min_blob_data_payment_rate,
get_default_data_rate_description()
),
DownloadOption(
[
DownloadOptionChoice(bool,
None,
None,
bool_options_description=("Allow", "Disallow")),
],
"Allow reuploading data downloaded for this file",
"allow upload",
True,
"Allow"
),
]
return options

View file

@ -25,13 +25,13 @@ class ManagedEncryptedFileDownloader(EncryptedFileSaver):
def __init__(self, rowid, stream_hash, peer_finder, rate_limiter,
blob_manager, stream_info_manager, lbry_file_manager,
payment_rate_manager, wallet, download_directory,
upload_allowed, file_name=None):
file_name=None):
EncryptedFileSaver.__init__(self, stream_hash, peer_finder,
rate_limiter, blob_manager,
stream_info_manager,
payment_rate_manager, wallet,
download_directory,
upload_allowed, file_name)
file_name)
self.sd_hash = None
self.txid = None
self.nout = None
@ -151,15 +151,15 @@ class ManagedEncryptedFileDownloaderFactory(object):
@defer.inlineCallbacks
def make_downloader(self, metadata, options, payment_rate_manager, download_directory=None,
file_name=None):
assert len(options) == 1
data_rate = options[0]
upload_allowed = options[1]
stream_hash = yield save_sd_info(self.lbry_file_manager.stream_info_manager,
metadata.validator.raw_info)
if metadata.metadata_source == StreamMetadata.FROM_BLOB:
yield self.lbry_file_manager.save_sd_blob_hash_to_stream(stream_hash,
metadata.source_blob_hash)
lbry_file = yield self.lbry_file_manager.add_lbry_file(stream_hash, payment_rate_manager,
data_rate, upload_allowed,
data_rate,
download_directory, file_name)
defer.returnValue(lbry_file)

View file

@ -137,7 +137,7 @@ class EncryptedFileManager(object):
@defer.inlineCallbacks
def start_lbry_file(self, rowid, stream_hash,
payment_rate_manager, blob_data_rate=None, upload_allowed=True,
payment_rate_manager, blob_data_rate=None,
download_directory=None, file_name=None):
if not download_directory:
download_directory = self.download_directory
@ -153,7 +153,6 @@ class EncryptedFileManager(object):
payment_rate_manager,
self.session.wallet,
download_directory,
upload_allowed,
file_name=file_name
)
yield lbry_file_downloader.set_stream_info()
@ -183,10 +182,10 @@ class EncryptedFileManager(object):
@defer.inlineCallbacks
def add_lbry_file(self, stream_hash, payment_rate_manager, blob_data_rate=None,
upload_allowed=True, download_directory=None, file_name=None):
download_directory=None, file_name=None):
rowid = yield self._save_lbry_file(stream_hash, blob_data_rate)
lbry_file = yield self.start_lbry_file(rowid, stream_hash, payment_rate_manager,
blob_data_rate, upload_allowed, download_directory,
blob_data_rate, download_directory,
file_name)
defer.returnValue(lbry_file)
@ -270,9 +269,8 @@ class EncryptedFileManager(object):
@rerun_if_locked
def _save_lbry_file(self, stream_hash, data_payment_rate):
def do_save(db_transaction):
db_transaction.execute("insert into lbry_file_options values (?, ?, ?)",
(data_payment_rate, ManagedEncryptedFileDownloader.STATUS_STOPPED,
stream_hash))
row = (data_payment_rate, ManagedEncryptedFileDownloader.STATUS_STOPPED, stream_hash)
db_transaction.execute("insert into lbry_file_options values (?, ?, ?)", row)
return db_transaction.lastrowid
return self.sql_db.runInteraction(do_save)

View file

@ -16,9 +16,9 @@ from lbrynet.lbrylive.StreamDescriptor import LiveStreamType
class _LiveStreamDownloader(CryptStreamDownloader):
def __init__(self, stream_hash, peer_finder, rate_limiter, blob_manager, stream_info_manager,
payment_rate_manager, wallet, upload_allowed):
payment_rate_manager, wallet):
CryptStreamDownloader.__init__(self, peer_finder, rate_limiter, blob_manager,
payment_rate_manager, wallet, upload_allowed)
payment_rate_manager, wallet)
self.stream_hash = stream_hash
self.stream_info_manager = stream_info_manager
self.public_key = None
@ -42,9 +42,9 @@ class _LiveStreamDownloader(CryptStreamDownloader):
class LiveStreamDownloader(_LiveStreamDownloader):
def __init__(self, stream_hash, peer_finder, rate_limiter, blob_manager, stream_info_manager,
payment_rate_manager, wallet, upload_allowed):
payment_rate_manager, wallet):
_LiveStreamDownloader.__init__(self, stream_hash, peer_finder, rate_limiter, blob_manager,
stream_info_manager, payment_rate_manager, wallet, upload_allowed)
stream_info_manager, payment_rate_manager, wallet)
def _get_metadata_handler(self, download_manager):
@ -66,10 +66,10 @@ class LiveStreamDownloader(_LiveStreamDownloader):
class FullLiveStreamDownloader(_LiveStreamDownloader):
def __init__(self, stream_hash, peer_finder, rate_limiter, blob_manager, stream_info_manager,
payment_rate_manager, wallet, upload_allowed):
payment_rate_manager, wallet):
_LiveStreamDownloader.__init__(self, stream_hash, peer_finder, rate_limiter,
blob_manager, stream_info_manager, payment_rate_manager,
wallet, upload_allowed)
wallet)
self.file_handle = None
self.file_name = None
@ -160,8 +160,7 @@ class FullLiveStreamDownloaderFactory(object):
def create_downloader(stream_hash):
stream_downloader = FullLiveStreamDownloader(stream_hash, self.peer_finder, self.rate_limiter,
self.blob_manager, self.stream_info_manager,
prm, self.wallet, True)
# TODO: change upload_allowed=True above to something better
prm, self.wallet)
d = stream_downloader.set_stream_info()
d.addCallback(lambda _: stream_downloader)
return d

View file

@ -176,7 +176,7 @@ class AlwaysSend(object):
@defer.inlineCallbacks
def calculate_available_blob_size(blob_manager):
blob_hashes = yield blob_manager.get_all_verified_blobs()
blobs = yield defer.DeferredList([blob_manager.get_blob(b, True) for b in blob_hashes])
blobs = yield defer.DeferredList([blob_manager.get_blob(b) for b in blob_hashes])
defer.returnValue(sum(b.length for success, b in blobs if success and b.length))
@ -858,7 +858,7 @@ class Daemon(AuthJSONRPCServer):
def _get_or_download_sd_blob(self, blob, sd_hash):
if blob:
return self.session.blob_manager.get_blob(blob[0], True)
return self.session.blob_manager.get_blob(blob[0])
def _check_est(downloader):
if downloader.result is not None:
@ -1357,7 +1357,6 @@ class Daemon(AuthJSONRPCServer):
'stream_hash': base 58 string
'stream_name': string
'suggested_file_name': string
'upload_allowed': bool
'sd_hash': string
"""
@ -1389,7 +1388,6 @@ class Daemon(AuthJSONRPCServer):
'stream_hash': base 58 string
'stream_name': string
'suggested_file_name': string
'upload_allowed': bool
'sd_hash': string
"""
d = self._get_deferred_for_lbry_file(kwargs)
@ -2588,7 +2586,6 @@ class _GetFileHelper(object):
'stream_hash': lbry_file.stream_hash,
'stream_name': lbry_file.stream_name,
'suggested_file_name': lbry_file.suggested_file_name,
'upload_allowed': lbry_file.upload_allowed,
'sd_hash': lbry_file.sd_hash,
'lbry_uri': lbry_file.uri,
'txid': lbry_file.txid,

View file

@ -119,11 +119,15 @@ class GetStream(object):
@defer.inlineCallbacks
def get_downloader(self, factory, stream_metadata):
downloader_options = [self.data_rate, True]
downloader = yield factory.make_downloader(stream_metadata, downloader_options,
self.payment_rate_manager,
download_directory=self.download_directory,
file_name=self.file_name)
# TODO: we should use stream_metadata.options.get_downloader_options
# instead of hard-coding the options to be [self.data_rate]
downloader = yield factory.make_downloader(
stream_metadata,
[self.data_rate],
self.payment_rate_manager,
download_directory=self.download_directory,
file_name=self.file_name
)
defer.returnValue(downloader)
def _pay_key_fee(self, address, fee_lbc, name):

View file

@ -164,7 +164,7 @@ class BlobReflectorClient(Protocol):
blob_hash = self.blob_hashes_to_send[0]
log.debug('No current blob, sending the next one: %s', blob_hash)
self.blob_hashes_to_send = self.blob_hashes_to_send[1:]
d = self.blob_manager.get_blob(blob_hash, True)
d = self.blob_manager.get_blob(blob_hash)
d.addCallback(self.open_blob_for_reading)
# send the server the next blob hash + length
d.addCallbacks(

View file

@ -113,7 +113,7 @@ class EncryptedFileReflectorClient(Protocol):
def get_blobs(blobs):
for (blob, _, _, blob_len) in blobs:
if blob:
yield self.blob_manager.get_blob(blob, True, blob_len)
yield self.blob_manager.get_blob(blob, blob_len)
dl = defer.DeferredList(list(get_blobs(blobs_in_stream)), consumeErrors=True)
dl.addCallback(lambda blobs: [blob for r, blob in blobs if r and blob.is_validated()])
@ -155,7 +155,7 @@ class EncryptedFileReflectorClient(Protocol):
self.stream_descriptor = sd_blob
d = self.factory.stream_info_manager.get_sd_blob_hashes_for_stream(self.factory.stream_hash)
d.addCallback(lambda sd: self.factory.blob_manager.get_blob(sd[0], True))
d.addCallback(lambda sd: self.factory.blob_manager.get_blob(sd[0]))
d.addCallback(_save_descriptor_blob)
return d

View file

@ -222,7 +222,7 @@ class ReflectorServer(Protocol):
sd_blob_size = request_dict[SD_BLOB_SIZE]
if self.blob_write is None:
d = self.blob_manager.get_blob(sd_blob_hash, True, sd_blob_size)
d = self.blob_manager.get_blob(sd_blob_hash, sd_blob_size)
d.addCallback(self.get_descriptor_response)
d.addCallback(self.send_response)
else:
@ -266,7 +266,7 @@ class ReflectorServer(Protocol):
for blob in sd_blob['blobs']:
if 'blob_hash' in blob and 'length' in blob:
blob_hash, blob_len = blob['blob_hash'], blob['length']
d = self.blob_manager.get_blob(blob_hash, True, blob_len)
d = self.blob_manager.get_blob(blob_hash, blob_len)
d.addCallback(lambda blob: blob_hash if not blob.is_validated() else None)
yield d
@ -295,7 +295,7 @@ class ReflectorServer(Protocol):
if self.blob_write is None:
log.debug('Received info for blob: %s', blob_hash[:16])
d = self.blob_manager.get_blob(blob_hash, True, blob_size)
d = self.blob_manager.get_blob(blob_hash, blob_size)
d.addCallback(self.get_blob_response)
d.addCallback(self.send_response)
else:

View file

@ -165,7 +165,7 @@ class TestReflector(unittest.TestCase):
return defer.DeferredList(check_blob_ds)
def verify_have_blob(blob_hash, blob_size):
d = self.server_blob_manager.get_blob(blob_hash, True)
d = self.server_blob_manager.get_blob(blob_hash)
d.addCallback(lambda blob: verify_blob_completed(blob, blob_size))
return d
@ -196,7 +196,7 @@ class TestReflector(unittest.TestCase):
return defer.DeferredList(check_blob_ds)
def verify_have_blob(blob_hash, blob_size):
d = self.server_blob_manager.get_blob(blob_hash, True)
d = self.server_blob_manager.get_blob(blob_hash)
d.addCallback(lambda blob: verify_blob_completed(blob, blob_size))
return d
@ -226,7 +226,7 @@ class TestReflector(unittest.TestCase):
return defer.DeferredList(check_blob_ds)
def verify_have_blob(blob_hash, blob_size):
d = self.server_blob_manager.get_blob(blob_hash, True)
d = self.server_blob_manager.get_blob(blob_hash)
d.addCallback(lambda blob: verify_blob_completed(blob, blob_size))
return d