diff options
author | Radostin Stoyanov <rstoyanov1@gmail.com> | 2017-07-04 16:24:21 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cbosdonnat@suse.com> | 2017-07-05 10:09:10 +0200 |
commit | a1ba3edb9a76fa89001f0a069e5c8eada876fb40 (patch) | |
tree | 7419ab952dab33b730922bf7ad9567f7ba1913d7 | |
parent | 64ef61bd999ab669dcb21424528894f8fad97e0f (diff) | |
download | virt-bootstrap.git-a1ba3edb9a76fa89001f0a069e5c8eada876fb40.tar.gz virt-bootstrap.git-a1ba3edb9a76fa89001f0a069e5c8eada876fb40.tar.xz virt-bootstrap.git-a1ba3edb9a76fa89001f0a069e5c8eada876fb40.zip |
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
-rw-r--r-- | src/virtBootstrap/sources.py | 12 |
1 files changed, 2 insertions, 10 deletions
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) |