[master/rhel7-branch][PATCH] Use blivet's getFreeSpace for limitting automatic swap size

Brian C. Lane bcl at redhat.com
Thu Jul 31 23:08:51 UTC 2014


On Wed, Jul 30, 2014 at 08:54:21AM +0200, Vratislav Podzimek wrote:
> On Tue, 2014-07-29 at 11:26 -0500, David Lehman wrote:
> > On 07/29/2014 09:23 AM, 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             | 30 ++++++++++++++++++++++--------
> > >   pyanaconda/ui/gui/spokes/custom.py  |  3 +++
> > >   pyanaconda/ui/gui/spokes/storage.py | 12 +++---------
> > >   3 files changed, 28 insertions(+), 17 deletions(-)
> > >
> > > diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
> > > index c8ac223..8a3a942 100644
> > > --- a/pyanaconda/kickstart.py
> > > +++ b/pyanaconda/kickstart.py
> > > @@ -200,8 +200,7 @@ 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
> > 
> > Shouldn't this all be using Size? Even if not, it should probably be 
> > using MiB instead of MB.
> Even on the rhel7-branch? To be honest, I've just resent a patch that
> I've sent months ago and which stayed unnoticed just rebasing it to the
> current rhel7-branch's HEAD without looking at it much. 'MiB' is
> definitely a right thing to do I will fix it locally. But I'm not aware
> of current state of the "everything to Size" changes in the
> rhel7-branch. Any update?

getFreeSpace uses Size in the dict and swapSuggestion expects an int so
we should stick with using Size for this and convert to int when
necessary. But certainly not float.

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


More information about the anaconda-patches mailing list