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

[PATCH 1/2] Fix discovery of existing raid/lvm for ks install without clearpart (#503310) (#503681)



We have to default to CLEARPART_TYPE_NONE so that if we have ks install
without clarpart we don't have CLEARPART_TYPE_LINUX set. For UI, the default
choice was "Replace existing Linux system" unless something else was specified
in ks. The patch keeps the previous UI behavior except for the case when
clearpart --none is in ks, and also for "Use free space" -> Next -> Back where
"Replace existing Linux system" is preselected instead of "Use free space".  To
address this, we would have to use some other value (CLEARPART_TYPE_DEFAULT) or
None for clearPartType to indicate to use proper UI default. This is
the next step.
---
 installclasses/fedora.py |    2 +-
 installclasses/rhel.py   |    2 +-
 iw/autopart_type.py      |    6 ++++++
 storage/__init__.py      |    5 +----
 4 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/installclasses/fedora.py b/installclasses/fedora.py
index 69f198d..9c97390 100644
--- a/installclasses/fedora.py
+++ b/installclasses/fedora.py
@@ -64,7 +64,7 @@ class InstallClass(BaseInstallClass):
         BaseInstallClass.setDefaultPartitioning(self,
                                                 anaconda.id.storage,
                                                 anaconda.platform,
-                                                CLEARPART_TYPE_LINUX)
+                                                CLEARPART_TYPE_NONE)
 
     def setSteps(self, anaconda):
 	BaseInstallClass.setSteps(self, anaconda);
diff --git a/installclasses/rhel.py b/installclasses/rhel.py
index 5217928..aa3590d 100644
--- a/installclasses/rhel.py
+++ b/installclasses/rhel.py
@@ -90,7 +90,7 @@ class InstallClass(BaseInstallClass):
         BaseInstallClass.setDefaultPartitioning(self, 
                                                 anaconda.id.storage,
                                                 anaconda.platform,
-                                                CLEARPART_TYPE_LINUX)
+                                                CLEARPART_TYPE_NONE)
 
     def setSteps(self, anaconda):
         dispatch = anaconda.dispatch
diff --git a/iw/autopart_type.py b/iw/autopart_type.py
index 4d9953c..bb71401 100644
--- a/iw/autopart_type.py
+++ b/iw/autopart_type.py
@@ -443,6 +443,12 @@ class PartitionTypeWindow(InstallWindow):
                 (_("Shrink current system"), -2),
                 (_("Use free space"), CLEARPART_TYPE_NONE),
                 (_("Create custom layout"), -1))
+
+        # Default for UI is Remove linux partitions, so if we
+        # haven't specified something else in ks, set this default.
+        # This is not correct if we specify clearpart --none in ks.
+        if self.storage.clearPartType == CLEARPART_TYPE_NONE:
+            self.storage.clearPartType = CLEARPART_TYPE_LINUX
         for (txt, val) in opts:
             iter = store.append(None)
             store[iter] = (txt, val)
diff --git a/storage/__init__.py b/storage/__init__.py
index ab636b9..5ea47e6 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -281,10 +281,7 @@ class Storage(object):
                                           _("Finding storage devices..."))
         self.iscsi.startup(self.anaconda.intf)
         self.zfcp.startup()
-        if self.anaconda.id.getUpgrade() or not self.anaconda.isKickstart:
-            # clearPartType defaults to CLEARPART_TYPE_LINUX, but the user
-            # has not made any selection, so we need to ignore it during
-            # population of the device tree
+        if self.anaconda.id.getUpgrade():
             clearPartType = CLEARPART_TYPE_NONE
         else:
             clearPartType = self.clearPartType
-- 
1.6.0.6


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