summaryrefslogtreecommitdiffstats
path: root/fstab.py
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2001-01-12 22:30:29 +0000
committerErik Troan <ewt@redhat.com>2001-01-12 22:30:29 +0000
commit097f13ac81a7354e65618711bcb9aa6549dcdb00 (patch)
treeaeaa02825e2d697ca38389b0c76e4cdd8f68ae3b /fstab.py
parenta51964ea1a6ae1a25212cf45e005db406bff7efe (diff)
downloadanaconda-097f13ac81a7354e65618711bcb9aa6549dcdb00.tar.gz
anaconda-097f13ac81a7354e65618711bcb9aa6549dcdb00.tar.xz
anaconda-097f13ac81a7354e65618711bcb9aa6549dcdb00.zip
added checkFormatting()
Diffstat (limited to 'fstab.py')
-rw-r--r--fstab.py31
1 files changed, 30 insertions, 1 deletions
diff --git a/fstab.py b/fstab.py
index 6328775e5..235ca2b6a 100644
--- a/fstab.py
+++ b/fstab.py
@@ -25,7 +25,6 @@ import sys
from translate import _
from log import log
-
def isValidExt2(device):
file = '/tmp/' + device
isys.makeDevInode(device, file)
@@ -46,6 +45,36 @@ def isValidExt2(device):
return 0
class Fstab:
+
+ # return 1 if we should stay on the same screen
+ def checkFormatting(self, messageWindow):
+ alreadyExists = {}
+
+ (drives, raid) = self.partitionList()
+ for (drive, part, type, start, cyl, size, preexisting) in drives:
+ if preexisting:
+ alreadyExists[part] = 1
+
+ badList = []
+ for (part, drive, fsystem, format, size) in \
+ self.formattablePartitions():
+ print part, format
+ if not alreadyExists.has_key(part) and not format:
+ badList.append((part, drive))
+
+ if badList:
+ message = _("The following partitions are newly created, but "
+ "you have chosen not to format them. This will "
+ "probably cause an error later in the install.\n"
+ "\n")
+ for (part, drive) in badList:
+ message = message + ("\t%-20s %s\n" % (part, drive))
+ rc = messageWindow(_("Warning"), message, type = "okcancel").getrc()
+
+ return rc
+
+ return 0
+
def attemptPartitioning(self, partitions, prefstab, clearParts):
attempt = []