[rhel7-branch][PATCHv2] Use blivet's getFreeSpace for limitting automatic swap size

Vratislav Podzimek vpodzime at redhat.com
Fri Aug 1 11:48:00 UTC 2014


On Fri, 2014-08-01 at 13:27 +0200, Vratislav Podzimek wrote:
> On Fri, 2014-08-01 at 11:34 +0200, Vratislav Podzimek wrote:
> > We should limit swap size to 10 % of available free space not overall disk
> > space. Blivet's getFreeSpace can help us a lot with this.
> > 
> > Resolves: rhbz#1053462
> > Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> > ---
> >  pyanaconda/kickstart.py             | 31 +++++++++++++++++++++----------
> >  pyanaconda/ui/gui/spokes/custom.py  |  3 +++
> >  pyanaconda/ui/gui/spokes/storage.py | 12 +++---------
> >  3 files changed, 27 insertions(+), 19 deletions(-)
> > 
> > diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
> > index c8ac223..b5a6499 100644
> > --- a/pyanaconda/kickstart.py
> > +++ b/pyanaconda/kickstart.py
> > @@ -22,7 +22,7 @@ from pyanaconda.errors import ScriptError, errorHandler
> >  from blivet.deviceaction import *
> >  from blivet.devices import LUKSDevice
> >  from blivet.devicelibs.lvm import getPossiblePhysicalExtents
> > -from blivet.devicelibs import swap
> > +from blivet.devicelibs import swap as swap_lib
> >  from blivet.formats import getFormat
> >  from blivet.partitioning import doPartitioning
> >  from blivet.partitioning import growLVM
> > @@ -200,22 +200,33 @@ def removeExistingFormat(device, storage):
> >  
> >  def getAvailableDiskSpace(storage):
> >      """
> > -    Get overall disk space available on disks we may use (not free space on the
> > -    disks, but overall space on the disks).
> > +    Get overall disk space available on disks we may use.
> >  
> >      :param storage: blivet.Blivet instance
> > -    :return: overall disk space available in MB
> > +    :return: overall disk space available in MiB
> >      :rtype: int
> This should reflect the fact that Size instance is now returned. Fixing
> locally.
Forget about this comment, it's not true. I was already thinking about
the [master] version.

-- 
Vratislav Podzimek

Anaconda Rider | RHCE | Red Hat, Inc. | Brno - Czech Republic




More information about the anaconda-patches mailing list