----- 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:14:54 PM
Subject: Re: [blivet 13/13] Adjust currentSize methods slightly.
On Fri, 2013-12-06 at 11:50 -0500, mulhern wrote:
> Add some comments that I believe are correct to StorageDevice.currentSize.
>
> Have BTRFSDevice.currentSize return 0 if the device does not exist, to
> bring
> it in line with the other currentSize methods.
>
> Signed-off-by: mulhern <amulhern(a)redhat.com>
> ---
> blivet/devices.py | 15 ++++++++++-----
> tests/devices_test.py | 6 +-----
> 2 files changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/blivet/devices.py b/blivet/devices.py
> index 23f3a8b..8875f4e 100644
> --- a/blivet/devices.py
> +++ b/blivet/devices.py
> @@ -4282,9 +4286,10 @@ class BTRFSDevice(StorageDevice):
>
> @property
> def currentSize(self):
> - # at some point we'll want to make this a bit more realistic, but
> the
> - # btrfs tools don't provide much of this type of information
> - return self.size
> + if self.exists:
> + return self.size
> + else:
> + return 0
This method is wrong, but no more so than when you found it. It should
do something like sum the parents' currentSizes.
David
Ok. I'll keep the comment change but leave out the coding change and try again
in next patch set.
I think that maybe currentSize need to be implemented in both BTRFSVolume and
BTRFSSubVolume.
Maybe BTRFSVolume's currentSize should be as you suggest, but BTRFSSubVolume's
would be something else.
- mulhern
_______________________________________________
anaconda-patches mailing list
anaconda-patches(a)lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches