address PR comments
This commit is contained in:
parent
16b451437f
commit
9f743fd6cd
4 changed files with 19 additions and 16 deletions
|
@ -33,6 +33,9 @@ _MAX_RESULTS_PER_PAGE = 50
|
||||||
|
|
||||||
def paginate(limit_kwarg_name='limit', offset_kwarg_name='offset',
|
def paginate(limit_kwarg_name='limit', offset_kwarg_name='offset',
|
||||||
callback_kwarg_name='pagination_callback'):
|
callback_kwarg_name='pagination_callback'):
|
||||||
|
"""
|
||||||
|
Decorates a handler adding a parsed pagination token and a callback to encode a response token.
|
||||||
|
"""
|
||||||
def wrapper(func):
|
def wrapper(func):
|
||||||
@wraps(func)
|
@wraps(func)
|
||||||
def wrapped(*args, **kwargs):
|
def wrapped(*args, **kwargs):
|
||||||
|
|
|
@ -343,9 +343,11 @@ def _upload_chunk(blob_upload, start_offset, length):
|
||||||
"""
|
"""
|
||||||
# Check for invalidate arguments.
|
# Check for invalidate arguments.
|
||||||
if None in {blob_upload, start_offset, length}:
|
if None in {blob_upload, start_offset, length}:
|
||||||
|
logger.error('None provided as argument to _upload_chunk')
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if start_offset > 0 and start_offset > blob_upload.byte_count:
|
if start_offset > 0 and start_offset > blob_upload.byte_count:
|
||||||
|
logger.error('start_offset provided to _upload_chunk greater than blob.upload.byte_count')
|
||||||
return None
|
return None
|
||||||
|
|
||||||
location_set = {blob_upload.location_name}
|
location_set = {blob_upload.location_name}
|
||||||
|
@ -391,7 +393,6 @@ def _upload_chunk(blob_upload, start_offset, length):
|
||||||
size_info, fn = calculate_size_handler()
|
size_info, fn = calculate_size_handler()
|
||||||
input_fp = wrap_with_handler(input_fp, fn)
|
input_fp = wrap_with_handler(input_fp, fn)
|
||||||
|
|
||||||
try:
|
|
||||||
length_written, new_metadata, error = storage.stream_upload_chunk(
|
length_written, new_metadata, error = storage.stream_upload_chunk(
|
||||||
location_set,
|
location_set,
|
||||||
blob_upload.uuid,
|
blob_upload.uuid,
|
||||||
|
@ -402,8 +403,7 @@ def _upload_chunk(blob_upload, start_offset, length):
|
||||||
content_type=BLOB_CONTENT_TYPE,
|
content_type=BLOB_CONTENT_TYPE,
|
||||||
)
|
)
|
||||||
if error is not None:
|
if error is not None:
|
||||||
return None
|
logger.error('storage.stream_upload_chunk returned error %s', error)
|
||||||
except InvalidChunkException:
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# If we determined an uncompressed size and this is the first chunk, add it to the blob.
|
# If we determined an uncompressed size and this is the first chunk, add it to the blob.
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
docker implements pure data transformations according to the many Docker specifications.
|
docker implements pure data transformations according to the many Docker specifications.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
class DockerException(Exception):
|
class DockerFormatException(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class ManifestException(DockerException):
|
class ManifestException(DockerFormatException):
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -40,7 +40,7 @@ class SquashedDockerImageFormatter(TarImageFormatter):
|
||||||
# repositories - JSON file containing a repo -> tag -> image map
|
# repositories - JSON file containing a repo -> tag -> image map
|
||||||
# {image ID folder}:
|
# {image ID folder}:
|
||||||
# json - The layer JSON
|
# json - The layer JSON
|
||||||
# layer.tar - The tared contents of the layer
|
# layer.tar - The tarballed contents of the layer
|
||||||
# VERSION - The docker import version: '1.0'
|
# VERSION - The docker import version: '1.0'
|
||||||
layer_merger = StreamLayerMerger(get_layer_iterator)
|
layer_merger = StreamLayerMerger(get_layer_iterator)
|
||||||
|
|
||||||
|
|
Reference in a new issue