[master 07/15] dispatch: Fix rules for running the partitioning step.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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(-)

diff --git a/pyanaconda/installclass.py b/pyanaconda/installclass.py
index ac21f69..70ed0fa 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 1173836..a328038 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 ae7b655..d894543 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 e16a827..937ff11 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 80ba4ca..f4847c6 100644
--- a/pyanaconda/storage/partitioning.py
+++ b/pyanaconda/storage/partitioning.py
@@ -253,13 +253,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 cde81a4..724f4fb 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 90a7063..8d8b515 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
-- 
1.7.3.3

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux