summaryrefslogtreecommitdiffstats
path: root/src/virtBootstrap/sources/docker_source.py
diff options
context:
space:
mode:
authorRadostin Stoyanov <rstoyanov1@gmail.com>2018-04-10 16:40:22 +0100
committerRadostin Stoyanov <rstoyanov1@gmail.com>2018-04-10 17:27:02 +0100
commit6146e9ab5e36ff894b8c95d00a45db6181ad8472 (patch)
treee5458ad224a87ebca17b62d979c67b25ad9c1e57 /src/virtBootstrap/sources/docker_source.py
parent085529eb8413449ea66fdc509dfd55b43ec0016e (diff)
downloadvirt-bootstrap.git-6146e9ab5e36ff894b8c95d00a45db6181ad8472.tar.gz
virt-bootstrap.git-6146e9ab5e36ff894b8c95d00a45db6181ad8472.tar.xz
virt-bootstrap.git-6146e9ab5e36ff894b8c95d00a45db6181ad8472.zip
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 <rstoyanov1@gmail.com>
Diffstat (limited to 'src/virtBootstrap/sources/docker_source.py')
-rw-r--r--src/virtBootstrap/sources/docker_source.py6
1 files changed, 5 insertions, 1 deletions
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])