From 6146e9ab5e36ff894b8c95d00a45db6181ad8472 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Tue, 10 Apr 2018 16:40:22 +0100 Subject: docker-source: Support blobs without .tar ext Since skopeo v0.1.29 blobs are saved without the .tar extension. See commit: projectatomic/skopeo@43acc74 Fix skopeo tests with changes to dir transport The dir transport has been changed to save the blobs without the .tar extension Fixes the skopeo tests failing due to this change Signed-off-by: Radostin Stoyanov --- src/virtBootstrap/sources/docker_source.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/virtBootstrap/sources/docker_source.py b/src/virtBootstrap/sources/docker_source.py index 715e560..4281f55 100644 --- a/src/virtBootstrap/sources/docker_source.py +++ b/src/virtBootstrap/sources/docker_source.py @@ -107,7 +107,11 @@ class DockerSource(object): self.checksums.append([sum_type, layer_sum]) # Store checksums # Layers are tar files with hashsum used as name - file_path = os.path.join(self.images_dir, layer_sum + '.tar') + file_path = os.path.join(self.images_dir, layer_sum) + if not os.path.isfile(file_path): + file_path += '.tar' + if not os.path.isfile(file_path): + raise ValueError('Blob %s does not exist.' % file_path) # Store 'file path' and set placeholder for 'size' self.layers.append([file_path, None]) -- cgit