[PATCH 2/2] livemedia-creator: Add option to create qcow2 disk images

Brian C. Lane bcl at redhat.com
Thu Mar 13 21:05:44 UTC 2014


On Thu, Mar 13, 2014 at 04:52:11PM -0400, Chris Lumens wrote:
> > @@ -591,6 +595,20 @@ def novirt_install(opts, disk_img, disk_size, repo_url):
> >      if rc:
> >          raise InstallError("novirt_install failed")
> >  
> > +    if opts.qcow2:
> > +        log.info("Converting %s to qcow2", disk_img)
> > +        qcow2_args = []
> > +        if opts.qcow2_args:
> > +            for arg in opts.qcow2_args:
> 
> Just as a stylistic thing, you shouldn't both need to test for non-empty
> and then iterate.  Just iterating should be fine since if it's an empty
> list it will iterate zero times.
> 
> > @@ -605,11 +623,22 @@ def virt_install(opts, install_log, disk_img, disk_size):
> >      if opts.proxy:
> >          kernel_args += " proxy="+opts.proxy
> >  
> > +    if opts.qcow2:
> > +        # virt-install can't take all the qcow2 options so create the image first
> > +        qcow2_args = []
> > +        if opts.qcow2_args:
> > +            for arg in opts.qcow2_args:
> 
> Here too.

Good point. That's what happens when I re-factor multiple times and
don't take a clean look at it.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list