summaryrefslogtreecommitdiffstats
path: root/textw/partitioning.py
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>1999-12-22 22:10:31 +0000
committerErik Troan <ewt@redhat.com>1999-12-22 22:10:31 +0000
commit8591ddbcad0a4dbf8dca2ab7ab51b7b8f959dd20 (patch)
treeb188a6ba54f5b95eb81935c9840d9492ad9fef16 /textw/partitioning.py
parentd6df1e240023b7dfccbd109c2e597c39b1257c42 (diff)
downloadanaconda-8591ddbcad0a4dbf8dca2ab7ab51b7b8f959dd20.tar.gz
anaconda-8591ddbcad0a4dbf8dca2ab7ab51b7b8f959dd20.tar.xz
anaconda-8591ddbcad0a4dbf8dca2ab7ab51b7b8f959dd20.zip
fixes inspired by kickstart
Diffstat (limited to 'textw/partitioning.py')
-rw-r--r--textw/partitioning.py56
1 files changed, 36 insertions, 20 deletions
diff --git a/textw/partitioning.py b/textw/partitioning.py
index 6b569315f..f3d8eaec7 100644
--- a/textw/partitioning.py
+++ b/textw/partitioning.py
@@ -98,20 +98,24 @@ class ManualPartitionWindow:
class AutoPartitionWindow:
def __call__(self, screen, todo):
- fstab = []
- for mntpoint, (dev, fstype, reformat) in todo.mounts.items ():
- fstab.append ((dev, mntpoint))
-
- if not todo.ddruid:
- drives = todo.drives.available ().keys ()
- drives.sort (isys.compareDrives)
- todo.ddruid = fsedit(0, drives, fstab, todo.zeroMbr,
- todo.ddruidReadOnly)
- if not todo.instClass.finishPartitioning(todo.ddruid):
- todo.log ("Autopartitioning FAILED\n")
-
- if not todo.getPartitionWarningText():
- return INSTALL_NOOP
+ druid = None
+
+ if todo.instClass.partitions:
+ druid = \
+ todo.fstab.attemptPartitioning(todo.instClass.partitions,
+ todo.instClass.clearParts)
+
+ if not druid:
+ # auto partitioning failed
+ todo.fstab.setRunDruid(1)
+ return
+
+ if not todo.getPartitionWarningText():
+ todo.fstab.setRunDruid(0)
+ todo.fstab.setDruid(druid)
+ todo.fstab.formatAllFilesystems()
+ todo.instClass.addToSkipList("format")
+ return
(rc, choice) = ListboxChoiceWindow(screen, _("Automatic Partitioning"),
_("%s\n\nIf you don't want to do this, you can continue with "
@@ -121,20 +125,32 @@ class AutoPartitionWindow:
[_("Continue"), _("Manually partition")],
buttons = basicButtons, default = _("Continue"))
- if (rc == "back"): return INSTALL_BACK
+ if (rc == "back"):
+ # This happens automatically when we go out of scope, but it's
+ # important so let's be explicit
+ druid = None
+ return INSTALL_BACK
if (choice == 1):
- drives = todo.drives.available ().keys ()
- drives.sort (isys.compareDrives)
- todo.ddruid = fsedit(0, drives, fstab, 0, todo.ddruidReadOnly)
- todo.manuallyPartition()
+ todo.fstab.setRunDruid(1)
+ todo.fstab.rescanPartitions()
+ todo.instClass.removeFromSkipList("format")
+ else:
+ todo.fstab.setRunDruid(0)
+ todo.fstab.setDruid(druid)
+ todo.fstab.formatAllFilesystems()
+ todo.instClass.addToSkipList("format")
class PartitionWindow:
def __call__(self, screen, todo):
dir = INSTALL_NOOP
- if not todo.getSkipPartitioning():
+ if todo.fstab.getRunDruid():
dir = todo.fstab.runDruid()
+ # runDruid returns None when it means INSTALL_OK
+ if not dir:
+ dir = INSTALL_OK
+
return dir
class TurnOnSwapWindow: