summaryrefslogtreecommitdiffstats
path: root/pyanaconda/storage/__init__.py
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2012-12-05 13:43:41 -0600
committerDavid Lehman <dlehman@redhat.com>2012-12-11 14:57:42 -0600
commit90244f818237afc7b9572ec2be68078f5971040a (patch)
tree727897b0458092b1af0d9a6353a7ad4a5b3cd447 /pyanaconda/storage/__init__.py
parent7b034687687098a9f96526405bcc6070c02b8997 (diff)
downloadanaconda-90244f818237afc7b9572ec2be68078f5971040a.tar.gz
anaconda-90244f818237afc7b9572ec2be68078f5971040a.tar.xz
anaconda-90244f818237afc7b9572ec2be68078f5971040a.zip
Make sure software selection is checked against filesystem space. (#853636)
Diffstat (limited to 'pyanaconda/storage/__init__.py')
-rw-r--r--pyanaconda/storage/__init__.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index 4ac19e1f8..c914eef2e 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -1410,6 +1410,31 @@ class Storage(object):
self.devicetree.setDiskImages(self.config.diskImages)
self.devicetree.setupDiskImages()
+ @property
+ def fileSystemFreeSpace(self):
+ mountpoints = ["/", "/usr"]
+ free = 0
+ btrfs_volumes = []
+ for mountpoint in mountpoints:
+ device = self.mountpoints.get(mountpoint)
+ if not device:
+ continue
+
+ # don't count the size of btrfs volumes repeatedly when multiple
+ # subvolumes are present
+ if isinstance(device, BTRFSSubVolumeDevice):
+ if device.volume in btrfs_volumes:
+ continue
+ else:
+ btrfs_volumes.append(device.volume)
+
+ if device.format.exists:
+ free += device.format.free
+ else:
+ free += device.size
+
+ return free
+
def sanityCheck(self):
""" Run a series of tests to verify the storage configuration.