From a1ba3edb9a76fa89001f0a069e5c8eada876fb40 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Tue, 4 Jul 2017 16:24:21 +0100 Subject: Remove redundant checksum verification The checksum verification of downloaded layers is already done in the method validate_image_layers() or "skopeo copy" [1] [2]. [1] https://github.com/containers/image/blob/master/copy/copy.go#L352 [2] https://github.com/containers/image/blob/master/copy/copy.go#L358 --- src/virtBootstrap/sources.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/virtBootstrap/sources.py b/src/virtBootstrap/sources.py index 9d675cb..d1e9d55 100644 --- a/src/virtBootstrap/sources.py +++ b/src/virtBootstrap/sources.py @@ -133,11 +133,7 @@ def untar_layers(layers_list, dest_dir): nlayers = len(layers_list) for index, layer in enumerate(layers_list): log_layer_extract(layer, index + 1, nlayers) - - sum_type, sum_value, layer_file, _ignore = layer - # Verify the checksum - if not checksum(layer_file, sum_type, sum_value): - raise Exception("Digest not matching: " + layer['digest']) + layer_file = layer[2] # Extract layer tarball into destination directory safe_untar(layer_file, dest_dir) @@ -210,11 +206,7 @@ def extract_layers_in_qcow2(layers_list, dest_dir): nlayers = len(layers_list) for index, layer in enumerate(layers_list): log_layer_extract(layer, index + 1, nlayers) - - sum_type, sum_value, tar_file, _ignore = layer - # Verify the checksum - if not checksum(tar_file, sum_type, sum_value): - raise Exception("Digest not matching: " + layer['digest']) + tar_file = layer[2] # Name format for the qcow2 image qcow2_layer_file = "{}/layer-{}.qcow2".format(dest_dir, index) -- cgit