Commit 7280c2ee authored by Guido Günther's avatar Guido Günther

Drop library/ from image path

If one pastes from the output of virt-sansbox-image

  $ virt-sandbox-image list
  docker:/library/ubuntu?tag=17.04
  docker:/library/debian?tag=latest

verbatim

  $ virt-sandbox-image run -c qemu:///session docker:/library/debian?tag=latest

This fails like

  /home/<usr>/.local/share/libvirt/images/library/debian:qbeilwxard.qcow2: Could not create file: No such file or directory

so strip off any leading components.
Signed-off-by: Guido Günther's avatarGuido Günther <agx@sigxcpu.org>
Reviewed-by: 's avatarDaniel P. Berrange <berrange@redhat.com>
parent 33843cc1
......@@ -655,7 +655,7 @@ class DockerSource(base.Source):
def get_disk(self, template, templatedir, imagedir, sandboxname):
image = DockerImage.from_template(template)
configfile, diskfile = self._get_template_data(image, templatedir)
tempfile = imagedir + "/" + sandboxname + ".qcow2"
tempfile = imagedir + "/" + sandboxname.split('/')[-1] + ".qcow2"
if not os.path.exists(imagedir):
os.makedirs(imagedir)
cmd = ["qemu-img","create","-q","-f","qcow2"]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment