----- Original Message -----
From: "David Lehman" <dlehman(a)redhat.com>
To: "anaconda patch review" <anaconda-patches(a)lists.fedorahosted.org>
Sent: Friday, December 6, 2013 1:11:01 PM
Subject: Re: [blivet 04/13] StorageDevice.minSize returns 0 if format's minSize is
0.
On Fri, 2013-12-06 at 12:54 -0500, Anne Mulhern wrote:
>
>
>
> ----- Original Message -----
> > From: "David Lehman" <dlehman(a)redhat.com>
> > To: "anaconda patch review"
<anaconda-patches(a)lists.fedorahosted.org>
> > Sent: Friday, December 6, 2013 12:06:29 PM
> > Subject: Re: [blivet 04/13] StorageDevice.minSize returns 0 if format's
> > minSize is 0.
> >
> > On Fri, 2013-12-06 at 11:50 -0500, mulhern wrote:
> > > Previously, if format's minSize was 0, then it returned self.size
> > > instead.
> > > I think this was an error, and the intention was to fall back on
> > > self.size
> > > only if format.minSize was not set.
> >
> > Many formats return 0 for minSize, meaning there is no known minimum
> > size. It should be treated the same as None, since no formatting
> > metadata can possibly exist without some space to store it in.
> >
> > David
> >
>
> How about having those formats return None? I don't know if this is good or
> bad...but most arith operators, except +, -, etc. are defined on None, so
> min(None, 1) is None and so forth.
I'd be concerned about fallout from such a change, nor do I see any
value in changing that now.
If flags.installer_mode is False we do not automatically call
self.updateSizeInfo() from the FS constructor. Because of that, all of
the minSize methods in fs.py need to add a check for
self._minInstanceSize of None and instead return self._minSize if that
is the case. Once this is done you will never get a value of None from a
format's minSize attribute. This is my fault -- I did not take this into
account when I made the change to not update size info outside of
anaconda.
David
OK. In working copy, I
* remove the code changes
* improve the comment change
* and add a comment to minSize and maxSize property in DeviceFormat indicating that 0
means unknown.
Does that sound good?
- mulhern
>
> - mulhern
>
> >
> > _______________________________________________
> > anaconda-patches mailing list
> > anaconda-patches(a)lists.fedorahosted.org
> >
https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> >
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches(a)lists.fedorahosted.org
>
https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
_______________________________________________
anaconda-patches mailing list
anaconda-patches(a)lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches