FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 11-15-2010, 03:36 PM
Chris Lumens
 
Default Add support for detecting lvm vorigin snapshot volumes. (#633038)

> @@ -2133,13 +2152,8 @@ class LVMVolumeGroupDevice(DMDevice):
> # TODO: just ask lvm if isModified returns False
>
> # total the sizes of any LVs
> - used = 0
> - size = self.size
> - log.debug("%s size is %dMB" % (self.name, size))
> - for lv in self.lvs:
> - log.debug("lv %s uses %dMB" % (lv.name, lv.vgSpaceUsed))
> - used += self.align(lv.vgSpaceUsed, roundup=True)
> -
> + log.debug("%s size is %dMB" % (self.name, self.size))
> + used = sum(lv.size for lv in self.lvs) + self.snapshotSpace

Don't you want brackets around the list comprehension here?

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 11-15-2010, 07:17 PM
David Lehman
 
Default Add support for detecting lvm vorigin snapshot volumes. (#633038)

On Mon, 2010-11-15 at 11:36 -0500, Chris Lumens wrote:
> > @@ -2133,13 +2152,8 @@ class LVMVolumeGroupDevice(DMDevice):
> > # TODO: just ask lvm if isModified returns False
> >
> > # total the sizes of any LVs
> > - used = 0
> > - size = self.size
> > - log.debug("%s size is %dMB" % (self.name, size))
> > - for lv in self.lvs:
> > - log.debug("lv %s uses %dMB" % (lv.name, lv.vgSpaceUsed))
> > - used += self.align(lv.vgSpaceUsed, roundup=True)
> > -
> > + log.debug("%s size is %dMB" % (self.name, self.size))
> > + used = sum(lv.size for lv in self.lvs) + self.snapshotSpace
>
> Don't you want brackets around the list comprehension here?

If I leave them out it just runs as a generator IIRC. I verified by
running sum(x for x in range(5)) in python shell.

Dave

>
> - Chris
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 05:26 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org