From 1975fb0a8ed0617c1f5e97cd752059d1b2a2a365 Mon Sep 17 00:00:00 2001 From: Ales Kozumplik Date: Fri, 6 May 2011 14:37:40 +0200 Subject: dispatch: Fix rules for running the partitioning step. This step is not scheduled by default, it is skipped for any text installation and many kickstart commands (like autopart), it is requested if the user selects "review partitioning layout" on the parttype screen. There is a mechanism in autopartitioning that enables manual partitioning screen (if available) when autopartitioning fails. Instead of checking the availability this just tries to request the manual partitioning step and catches DispatcherError for those cases where this is not possible. --- pyanaconda/installclass.py | 1 - pyanaconda/installclasses/fedora.py | 4 ---- pyanaconda/installclasses/rhel.py | 4 ---- pyanaconda/iw/autopart_type.py | 6 +++--- pyanaconda/storage/partitioning.py | 12 +++++++----- pyanaconda/text.py | 3 ++- pyanaconda/textw/partition_text.py | 2 -- 7 files changed, 12 insertions(+), 20 deletions(-) (limited to 'pyanaconda') diff --git a/pyanaconda/installclass.py b/pyanaconda/installclass.py index ac21f69a0..70ed0faa9 100644 --- a/pyanaconda/installclass.py +++ b/pyanaconda/installclass.py @@ -95,7 +95,6 @@ class BaseInstallClass(object): "cleardiskssel", "parttype", "autopartitionexecute", - "partition", "storagedone", "bootloader", "network", diff --git a/pyanaconda/installclasses/fedora.py b/pyanaconda/installclasses/fedora.py index 117383677..a32803890 100644 --- a/pyanaconda/installclasses/fedora.py +++ b/pyanaconda/installclasses/fedora.py @@ -80,10 +80,6 @@ class InstallClass(BaseInstallClass): BaseInstallClass.setGroupSelection(self, anaconda) map(lambda x: anaconda.backend.selectGroup(x), ["core"]) - def setSteps(self, anaconda): - BaseInstallClass.setSteps(self, anaconda) - anaconda.dispatch.skipStep("partition") - def getBackend(self): if flags.livecdInstall: import pyanaconda.livecd diff --git a/pyanaconda/installclasses/rhel.py b/pyanaconda/installclasses/rhel.py index ae7b655cf..d89454399 100644 --- a/pyanaconda/installclasses/rhel.py +++ b/pyanaconda/installclasses/rhel.py @@ -58,10 +58,6 @@ class InstallClass(BaseInstallClass): anaconda.storage, anaconda.platform) - def setSteps(self, anaconda): - BaseInstallClass.setSteps(self, anaconda) - anaconda.dispatch.skipStep("partition") - def getBackend(self): if flags.livecdInstall: import livecd diff --git a/pyanaconda/iw/autopart_type.py b/pyanaconda/iw/autopart_type.py index e16a82743..937ff1124 100644 --- a/pyanaconda/iw/autopart_type.py +++ b/pyanaconda/iw/autopart_type.py @@ -162,7 +162,7 @@ class PartitionTypeWindow(InstallWindow): if self.buttonGroup.getCurrent() == "custom": self.dispatch.skipStep("autopartitionexecute") self.dispatch.skipStep("cleardiskssel") - self.dispatch.skipStep("partition", skip = 0) + self.dispatch.request_step("partition") self.dispatch.skipStep("bootloader", skip = 0) self.storage.config.clearPartType = CLEARPART_TYPE_NONE @@ -197,7 +197,7 @@ class PartitionTypeWindow(InstallWindow): self.storage.doAutoPart = True if self.reviewButton.get_active(): - self.dispatch.skipStep("partition", skip = 0) + self.dispatch.request_step("partition") self.dispatch.skipStep("bootloader", skip = 0) else: self.dispatch.skipStep("partition") @@ -245,7 +245,7 @@ class PartitionTypeWindow(InstallWindow): self.table = self.xml.get_widget("parttypeTable") self.prevrev = None - self.reviewButton.set_active(not self.dispatch.stepInSkipList("partition")) + self.reviewButton.set_active(self.dispatch.step_enabled("partition")) self.encryptButton.set_active(self.storage.encryptedAutoPart) self.buttonGroup = pixmapRadioButtonGroup() diff --git a/pyanaconda/storage/partitioning.py b/pyanaconda/storage/partitioning.py index 4b4d91d93..25aa16939 100644 --- a/pyanaconda/storage/partitioning.py +++ b/pyanaconda/storage/partitioning.py @@ -250,13 +250,15 @@ def doAutoPartition(anaconda): except PartitioningError as msg: # restore drives to original state anaconda.storage.reset() - if not anaconda.ksdata: - extra = "" - if anaconda.displayMode != "t": - anaconda.dispatch.skipStep("partition", skip = 0) - else: + extra = "" + if anaconda.ksdata: extra = _("\n\nPress 'OK' to exit the installer.") + else: + try: + anaconda.dispatch.request_steps("partition") + except DispatcherError: + pass anaconda.intf.messageWindow(_("Error Partitioning"), _("Could not allocate requested partitions: \n\n" "%(msg)s.%(extra)s") % {'msg': msg, 'extra': extra}, diff --git a/pyanaconda/text.py b/pyanaconda/text.py index cde81a40f..724f4fbb2 100644 --- a/pyanaconda/text.py +++ b/pyanaconda/text.py @@ -553,7 +553,8 @@ class InstallInterface(InstallInterfaceBase): continue def unsupported_steps(self): - return ["filtertype", "filter", "cleardiskssel", "group-selection"] + return ["cleardiskssel", "filtertype", "filter", "group-selection", + "partition"] def killSelf(screen): screen.finish() diff --git a/pyanaconda/textw/partition_text.py b/pyanaconda/textw/partition_text.py index 90a7063dd..8d8b51528 100644 --- a/pyanaconda/textw/partition_text.py +++ b/pyanaconda/textw/partition_text.py @@ -149,8 +149,6 @@ class PartitionTypeWindow: anaconda.storage.config.clearPartDisks = sel break - # ask to review autopartition layout - but only if it's not custom partitioning - anaconda.dispatch.skipStep("partition") anaconda.dispatch.skipStep("bootloader") return INSTALL_OK -- cgit