s/TORRENT/BITTORRENT
This commit is contained in:
parent
d00db518df
commit
e54b86c6eb
7 changed files with 14 additions and 14 deletions
|
@ -216,7 +216,7 @@ def put_image_layer(namespace, repository, image_id):
|
|||
sr.add_handler(size_hndlr)
|
||||
|
||||
# Add a handler to hash the chunks of the upload for torrenting
|
||||
piece_hasher = PieceHasher(app.config['TORRENT_PIECE_SIZE'])
|
||||
piece_hasher = PieceHasher(app.config['BITTORRENT_PIECE_SIZE'])
|
||||
sr.add_handler(piece_hasher.update)
|
||||
|
||||
# Add a handler which computes the checksum.
|
||||
|
@ -240,7 +240,7 @@ def put_image_layer(namespace, repository, image_id):
|
|||
size_info.compressed_size,
|
||||
size_info.uncompressed_size)
|
||||
pieces_bytes = piece_hasher.final_piece_hashes()
|
||||
model.storage.save_torrent_info(updated_storage, app.config['TORRENT_PIECE_SIZE'], pieces_bytes)
|
||||
model.storage.save_torrent_info(updated_storage, app.config['BITTORRENT_PIECE_SIZE'], pieces_bytes)
|
||||
|
||||
# Append the computed checksum.
|
||||
csums = []
|
||||
|
|
|
@ -231,7 +231,7 @@ def _upload_chunk(namespace, repo_name, upload_uuid):
|
|||
initial_sha1_value = found.piece_sha_state or resumablehashlib.sha1()
|
||||
initial_sha1_pieces_value = found.piece_hashes or ''
|
||||
|
||||
piece_hasher = PieceHasher(app.config['TORRENT_PIECE_SIZE'], start_offset,
|
||||
piece_hasher = PieceHasher(app.config['BITTORRENT_PIECE_SIZE'], start_offset,
|
||||
initial_sha1_pieces_value,
|
||||
initial_sha1_value)
|
||||
|
||||
|
@ -304,7 +304,7 @@ def _finish_upload(namespace, repo_name, upload_obj, expected_digest):
|
|||
|
||||
if upload_obj.piece_sha_state is not None and not already_exists:
|
||||
piece_bytes = upload_obj.piece_hashes + upload_obj.piece_sha_state.digest()
|
||||
model.storage.save_torrent_info(blob_storage, app.config['TORRENT_PIECE_SIZE'], piece_bytes)
|
||||
model.storage.save_torrent_info(blob_storage, app.config['BITTORRENT_PIECE_SIZE'], piece_bytes)
|
||||
|
||||
# Delete the upload tracking row.
|
||||
upload_obj.delete_instance()
|
||||
|
|
|
@ -282,11 +282,11 @@ def _repo_verb(namespace, repository, tag, verb, formatter, sign=False, checker=
|
|||
# Close any existing DB connection once the process has exited.
|
||||
database.close_db_filter(None)
|
||||
|
||||
hasher = PieceHasher(app.config['TORRENT_PIECE_SIZE'])
|
||||
hasher = PieceHasher(app.config['BITTORRENT_PIECE_SIZE'])
|
||||
|
||||
def _store_metadata_and_cleanup():
|
||||
with database.UseThenDisconnect(app.config):
|
||||
model.storage.save_torrent_info(derived, app.config['TORRENT_PIECE_SIZE'],
|
||||
model.storage.save_torrent_info(derived, app.config['BITTORRENT_PIECE_SIZE'],
|
||||
hasher.final_piece_hashes())
|
||||
derived.image_size = hasher.hashed_bytes
|
||||
derived.save()
|
||||
|
|
Reference in a new issue