diff options
author | Mike Fulbright <msf@redhat.com> | 2000-08-10 16:05:13 +0000 |
---|---|---|
committer | Mike Fulbright <msf@redhat.com> | 2000-08-10 16:05:13 +0000 |
commit | 7a88fa4caec3dda444d3ddc359fb1d4726c8abe8 (patch) | |
tree | 8ccc20a00e6c99b9874288f9fc1ab5a60b9557d7 /fstab.py | |
parent | ff29ed4b0e8972ddfdbd9f06497a1b9323298630 (diff) | |
download | anaconda-7a88fa4caec3dda444d3ddc359fb1d4726c8abe8.tar.gz anaconda-7a88fa4caec3dda444d3ddc359fb1d4726c8abe8.tar.xz anaconda-7a88fa4caec3dda444d3ddc359fb1d4726c8abe8.zip |
fix code to find largest available space for loopback file
Diffstat (limited to 'fstab.py')
-rw-r--r-- | fstab.py | 27 |
1 files changed, 16 insertions, 11 deletions
@@ -241,20 +241,25 @@ class Fstab: raise TypeError, "unknown partition to format %s" % (device,) # sorted largest to smallest - def filesystemSpace(self, topMount): - space = {} - for (mntpoint, partition, fsystem, doFormat, size) in self.mountList(): - space[mntpoint] = isys.fsSpaceAvailable(topMount + '/' + mntpoint) + def spaceSort(self, a, b): + (m1, s1) = a + (m2, s2) = b + + if (s1 > s2): + return -1 + elif s1 < s2: + return 1 - list = space.keys() - list.sort() - list.reverse() + return 0 - newList = [] - for mnt in list: - newList.append((mnt, space[mnt])) - return newList + def filesystemSpace(self, topMount): + space = [] + for (mntpoint, partition, fsystem, doFormat, size) in self.mountList(): + space.append((mntpoint, isys.fsSpaceAvailable(topMount + '/' + mntpoint))) + + space.sort(self.spaceSort) + return space def formatAllFilesystems(self): for (partition, mount, fsystem, size) in self.ddruid.getFstab(): |