From 376dd96934de59d72db5fde376533bcba2bdc670 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Sat, 26 Aug 2017 21:41:55 +0100 Subject: DockerSource: Split checksum and layers The current implementation store in one list: - checksum - checksum type - file path - file size However, the information about checksum and checksum type is only used to verify the content of tarball before it is being extracted. Splitting these into separate lists would allow us to reuse the function untar_layers() with FileSource. --- src/virtBootstrap/sources/file_source.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/virtBootstrap/sources/file_source.py') diff --git a/src/virtBootstrap/sources/file_source.py b/src/virtBootstrap/sources/file_source.py index c02f735..412db8a 100644 --- a/src/virtBootstrap/sources/file_source.py +++ b/src/virtBootstrap/sources/file_source.py @@ -57,10 +57,11 @@ class FileSource(object): if not os.path.isfile(self.path): raise Exception('Invalid file source "%s"' % self.path) + layer = [[self.path, os.path.getsize(self.path)]] if self.output_format == 'dir': self.progress("Extracting files into destination directory", value=0, logger=logger) - utils.safe_untar(self.path, dest) + utils.untar_layers(layer, dest, self.progress) elif self.output_format == 'qcow2': # Remove the old path -- cgit