diff options
author | Jeremy Katz <katzj@redhat.com> | 2001-07-22 03:21:33 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2001-07-22 03:21:33 +0000 |
commit | bd6e20f9d1a6d961c80fccaeef807193d71e8691 (patch) | |
tree | ed58dd17aba755f9e14a4ee96349e8acf8253ce5 /autopart.py | |
parent | 642b989fc1c5e0416559a83878c13db9f5b13a53 (diff) | |
download | anaconda-bd6e20f9d1a6d961c80fccaeef807193d71e8691.tar.gz anaconda-bd6e20f9d1a6d961c80fccaeef807193d71e8691.tar.xz anaconda-bd6e20f9d1a6d961c80fccaeef807193d71e8691.zip |
check the installclass in doAutoPartition so that we don't raise dialogs
during kickstart for warnings and exit if there's an error partitioning
Diffstat (limited to 'autopart.py')
-rw-r--r-- | autopart.py | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/autopart.py b/autopart.py index 387fb491d..9df2df77c 100644 --- a/autopart.py +++ b/autopart.py @@ -803,7 +803,12 @@ def doClearPartAction(partitions, diskset): deletePart(diskset, delete) continue -def doAutoPartition(dir, diskset, partitions, intf): +def doAutoPartition(dir, diskset, partitions, intf, instClass): + if instClass.name and instClass.name == "kickstart": + isKickstart = 1 + else: + isKickstart = 0 + if dir == DISPATCH_BACK: diskset.refreshDevices() partitions.setFromDisk(diskset) @@ -845,15 +850,25 @@ def doAutoPartition(dir, diskset, partitions, intf): try: doPartitioning(diskset, partitions, doRefresh = 0) except PartitioningWarning, msg: - intf.messageWindow(_("Warnings During Automatic Partitioning"), + if not isKickstart: + intf.messageWindow(_("Warnings During Automatic Partitioning"), _("Following warnings occurred during automatic " "partitioning:\n\n%s") % (msg.value)) + else: + log("WARNING: %s" % (msg.value)) except PartitioningError, msg: # restore drives to original state diskset.refreshDevices() partitions.setFromDisk(diskset) + if not isKickstart: + extra = "" + else: + extra = "\n\nPress OK to reboot your system." intf.messageWindow(_("Error Partitioning"), - _("Could not allocate requested partitions: \n\n%s.") % (msg.value)) + _("Could not allocate requested partitions: \n\n%s.%s") % (msg.value, extra)) + + if isKickstart: + sys.exit(0) def queryAutoPartitionOK(intf, diskset, partitions): |