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