summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2000-08-10 16:05:13 +0000
committerMike Fulbright <msf@redhat.com>2000-08-10 16:05:13 +0000
commit7a88fa4caec3dda444d3ddc359fb1d4726c8abe8 (patch)
tree8ccc20a00e6c99b9874288f9fc1ab5a60b9557d7
parentff29ed4b0e8972ddfdbd9f06497a1b9323298630 (diff)
downloadanaconda-7a88fa4caec3dda444d3ddc359fb1d4726c8abe8.tar.gz
anaconda-7a88fa4caec3dda444d3ddc359fb1d4726c8abe8.tar.xz
anaconda-7a88fa4caec3dda444d3ddc359fb1d4726c8abe8.zip
fix code to find largest available space for loopback file
-rw-r--r--fstab.py27
1 files changed, 16 insertions, 11 deletions
diff --git a/fstab.py b/fstab.py
index 5e4746c6c..065205f95 100644
--- a/fstab.py
+++ b/fstab.py
@@ -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():