[libvirt] [libvirt-sandbox PATCH 1/2] Drop library/ from image path

Guido Günther posted 2 patches 8 years, 8 months ago
[libvirt] [libvirt-sandbox PATCH 1/2] Drop library/ from image path
Posted by Guido Günther 8 years, 8 months ago
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.
---
 libvirt-sandbox/image/sources/docker.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libvirt-sandbox/image/sources/docker.py b/libvirt-sandbox/image/sources/docker.py
index aa5675e..6ca086c 100755
--- a/libvirt-sandbox/image/sources/docker.py
+++ b/libvirt-sandbox/image/sources/docker.py
@@ -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"]
-- 
2.11.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [libvirt-sandbox PATCH 1/2] Drop library/ from image path
Posted by Daniel P. Berrange 8 years, 4 months ago
On Wed, Jun 07, 2017 at 08:02:04AM +0200, Guido Günther wrote:
> 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.
> ---
>  libvirt-sandbox/image/sources/docker.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [libvirt-sandbox PATCH 1/2] Drop library/ from image path
Posted by Guido Günther 8 years, 4 months ago
Hi,
On Fri, Sep 15, 2017 at 01:05:27PM +0100, Daniel P. Berrange wrote:
> On Wed, Jun 07, 2017 at 08:02:04AM +0200, Guido Günther wrote:
> > 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.
> > ---
> >  libvirt-sandbox/image/sources/docker.py | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Reviewed-by: Daniel P. Berrange <berrange@redhat.com>

Pushed both patches.
Thanks!
 -- Guido

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list