summaryrefslogtreecommitdiffstats
path: root/src/virtBootstrap/sources
diff options
context:
space:
mode:
Diffstat (limited to 'src/virtBootstrap/sources')
-rw-r--r--src/virtBootstrap/sources/docker_source.py10
-rw-r--r--src/virtBootstrap/sources/file_source.py14
2 files changed, 17 insertions, 7 deletions
diff --git a/src/virtBootstrap/sources/docker_source.py b/src/virtBootstrap/sources/docker_source.py
index 2dadb42..a6ea3e6 100644
--- a/src/virtBootstrap/sources/docker_source.py
+++ b/src/virtBootstrap/sources/docker_source.py
@@ -272,7 +272,15 @@ class DockerSource(object):
elif self.output_format == 'qcow2':
self.progress("Extracting container layers into qcow2 images",
value=50, logger=logger)
- utils.extract_layers_in_qcow2(self.layers, dest, self.progress)
+
+ img = utils.BuildImage(
+ layers=self.layers,
+ dest=dest,
+ progress=self.progress
+ )
+ img.create_base_layer()
+ img.create_backing_chains()
+
else:
raise Exception("Unknown format:" + self.output_format)
diff --git a/src/virtBootstrap/sources/file_source.py b/src/virtBootstrap/sources/file_source.py
index 412db8a..69f024c 100644
--- a/src/virtBootstrap/sources/file_source.py
+++ b/src/virtBootstrap/sources/file_source.py
@@ -64,14 +64,16 @@ class FileSource(object):
utils.untar_layers(layer, dest, self.progress)
elif self.output_format == 'qcow2':
- # Remove the old path
- file_name = os.path.basename(self.path)
- qcow2_file = os.path.realpath('{}/{}.qcow2'.format(dest,
- file_name))
-
self.progress("Extracting files into qcow2 image", value=0,
logger=logger)
- utils.create_qcow2(self.path, qcow2_file)
+
+ img = utils.BuildImage(
+ layers=layer,
+ dest=dest,
+ progress=self.progress
+ )
+ img.create_base_layer()
+
else:
raise Exception("Unknown format:" + self.output_format)