From 3d3f2dd6d7cf472a02355bfbc2005ed58c76779a Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 29 Sep 2014 15:33:26 -0400 Subject: [PATCH] Remove map call and estimate call --- util/dockerloadformat.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/util/dockerloadformat.py b/util/dockerloadformat.py index ed6fecc52..350753753 100644 --- a/util/dockerloadformat.py +++ b/util/dockerloadformat.py @@ -58,9 +58,7 @@ def _import_format_generator(namespace, repository, tag, synthetic_image_id, # Yield the merged layer data's header. estimated_file_size = 0 for image in get_image_iterator(): - estimated_file_size += (image.storage.uncompressed_size or - _get_mapped_size(image) or - _estimate_size(image)) + estimated_file_size += image.storage.uncompressed_size yield _tar_file_header(synthetic_image_id + '/layer.tar', estimated_file_size) @@ -127,14 +125,4 @@ def _tar_file_header(name, file_size): def _tar_folder(name): info = tarfile.TarInfo(name=name) info.type = tarfile.DIRTYPE - return info.tobuf() - -def _get_mapped_size(image): - """ Returns a predefined image size for the given image or None if not found. """ - return None - -def _estimate_size(image): - """ Estimates a file size based on a heuristic. """ - # More than 1 SD away from the size difference in the DB, as of 9/29/2014 - return image.storage.image_size * 12 - + return info.tobuf()