Re: [PATCH sandbox v5 07/20] Image: Refactor create function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 09, 2015 at 01:53:06PM +0200, Cedric Bosdonnat wrote:
> On Tue, 2015-09-08 at 17:29 +0100, Daniel P. Berrange wrote:
> > From: Eren Yagdiran <erenyagdiran@xxxxxxxxx>
> > 
> > Move the docker-related code to the DockerSource and use
> > the Source mechanism
> > 
> > Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> > ---
> >  libvirt-sandbox/image/cli.py                  | 76 +++++-----------------
> >  libvirt-sandbox/image/sources/DockerSource.py | 90 +++++++++++++++++++++++++++
> >  libvirt-sandbox/image/sources/Source.py       | 15 +++++
> >  3 files changed, 122 insertions(+), 59 deletions(-)
> > 

> > +    def _extract_tarballs(self,directory,format,connect):
> > +        tempdir = "/mnt"
> 
> Is it safe to assume we'll be able to use /mnt as a temporary mount
> folder? I'ld be more inclined in using a really temporary folder.

Amuzingly that variable is set and then never used again, so
can just be deleted

> 
> --
> Cedric
> 
> > +        tarfile = directory + "tar.gz"
> > +        diskfile = directory + "qcow2"
> > +        cmd = ['virt-sandbox']
> > +        if connect is not None:
> > +            cmd.append("-c")
> > +            cmd.append(connect)
> > +        cmd.append("-p")
> > +        params = ['-m',
> > +                  'host-image:/mnt=%s,format=%s' %(diskfile,format),
> > +                  '--',
> > +                  '/bin/tar',
> > +                  'zxf',
> > +                  '%s' %tarfile,
> > +                  '-C',
> > +                  '/mnt']
> > +        cmd = cmd + params
> > +        subprocess.call(cmd)
> > +
> >  def debug(msg):
> >      sys.stderr.write(msg)

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]