summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRadek Vykydal <rvykydal@redhat.com>2009-06-05 08:56:29 +0200
committerRadek Vykydal <rvykydal@redhat.com>2009-06-05 09:11:30 +0200
commit93fd07cd4cb46dad0d57bf216e603c8256751480 (patch)
treeab0bb49d566e9f0c52fabeeafdc9bf026a3ec957
parentfee64fbdf603158229e371eaa848a3c44991c13a (diff)
downloadanaconda-93fd07cd4cb46dad0d57bf216e603c8256751480.tar.gz
anaconda-93fd07cd4cb46dad0d57bf216e603c8256751480.tar.xz
anaconda-93fd07cd4cb46dad0d57bf216e603c8256751480.zip
Fix discovery of existing raid/lvm for ks install without clearpart (#503310) (#503681)
Default clearPartType to None so that all devices are discovered during storage initialization step, and UI parttype can be set to its default "Replace existing linux system". Also set clearPartType appropriately when going back from partition dialog so that all devices are discovered during storage reset. There is one case that can't be resolved this way: clearpart --all or --linux is set in ks and "Create custom layout" is selected in parttype UI step. Because of ks setting, storage initialization doesn't discover devices (RAID, LVM) on partitions that are to be cleared and therefore they are not present in custom partition dialog. This can be workarounded by going back and than again to custom partitioning dialog. I think we should grey-out type of partitioning combo set to value from ks clearpart command.
-rw-r--r--installclass.py9
-rw-r--r--installclasses/fedora.py3
-rw-r--r--installclasses/rhel.py3
-rw-r--r--iw/autopart_type.py9
-rw-r--r--iw/partition_gui.py1
-rw-r--r--kickstart.py2
-rw-r--r--storage/__init__.py9
-rw-r--r--storage/partitioning.py2
-rw-r--r--textw/partition_text.py6
9 files changed, 22 insertions, 22 deletions
diff --git a/installclass.py b/installclass.py
index 913444f18..d0f535d6f 100644
--- a/installclass.py
+++ b/installclass.py
@@ -187,8 +187,7 @@ class BaseInstallClass(object):
from backend import AnacondaBackend
return AnacondaBackend
- def setDefaultPartitioning(self, storage, platform,
- clear = CLEARPART_TYPE_LINUX, doClear = True):
+ def setDefaultPartitioning(self, storage, platform):
autorequests = [PartSpec(mountpoint="/", fstype=storage.defaultFSType,
size=1024, grow=True, asVol=True)]
@@ -200,12 +199,6 @@ class BaseInstallClass(object):
autorequests.append(PartSpec(fstype="swap", size=minswap, maxSize=maxswap,
grow=True, asVol=True))
- if doClear:
- storage.clearPartType = clear
- storage.clearPartDisks = []
- else:
- storage.clearPartType = CLEARPART_TYPE_NONE
-
storage.autoPartitionRequests = autorequests
diff --git a/installclasses/fedora.py b/installclasses/fedora.py
index 69f198dfc..98002ed0c 100644
--- a/installclasses/fedora.py
+++ b/installclasses/fedora.py
@@ -63,8 +63,7 @@ class InstallClass(BaseInstallClass):
BaseInstallClass.setInstallData(self, anaconda)
BaseInstallClass.setDefaultPartitioning(self,
anaconda.id.storage,
- anaconda.platform,
- CLEARPART_TYPE_LINUX)
+ anaconda.platform)
def setSteps(self, anaconda):
BaseInstallClass.setSteps(self, anaconda);
diff --git a/installclasses/rhel.py b/installclasses/rhel.py
index 521792862..5c0d7155d 100644
--- a/installclasses/rhel.py
+++ b/installclasses/rhel.py
@@ -89,8 +89,7 @@ class InstallClass(BaseInstallClass):
BaseInstallClass.setInstallData(self, anaconda)
BaseInstallClass.setDefaultPartitioning(self,
anaconda.id.storage,
- anaconda.platform,
- CLEARPART_TYPE_LINUX)
+ anaconda.platform)
def setSteps(self, anaconda):
dispatch = anaconda.dispatch
diff --git a/iw/autopart_type.py b/iw/autopart_type.py
index 4d9953c18..f192d6ac3 100644
--- a/iw/autopart_type.py
+++ b/iw/autopart_type.py
@@ -443,10 +443,17 @@ class PartitionTypeWindow(InstallWindow):
(_("Shrink current system"), -2),
(_("Use free space"), CLEARPART_TYPE_NONE),
(_("Create custom layout"), -1))
+
+ # if not set in ks, use UI default
+ if self.storage.clearPartType is None:
+ preselected = CLEARPART_TYPE_LINUX
+ else:
+ preselected = self.storage.clearPartType
+
for (txt, val) in opts:
iter = store.append(None)
store[iter] = (txt, val)
- if val == self.storage.clearPartType:
+ if val == preselected:
self.combo.set_active_iter(iter)
if ((self.combo.get_active() == -1) or
diff --git a/iw/partition_gui.py b/iw/partition_gui.py
index a08d07bf4..0196df7fb 100644
--- a/iw/partition_gui.py
+++ b/iw/partition_gui.py
@@ -665,6 +665,7 @@ class PartitionWindow(InstallWindow):
def getPrev(self):
self.diskStripeGraph.shutDown()
+ self.storage.clearPartType = None
self.storage.reset()
self.tree.clear()
del self.parent
diff --git a/kickstart.py b/kickstart.py
index 3c2505595..099253a0f 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -147,7 +147,7 @@ class AutoPart(commands.autopart.F9_AutoPart):
# sets up default autopartitioning. use clearpart separately
# if you want it
- self.handler.id.instClass.setDefaultPartitioning(self.handler.id.storage, self.handler.anaconda.platform, doClear=False)
+ self.handler.id.instClass.setDefaultPartitioning(self.handler.id.storage, self.handler.anaconda.platform)
self.handler.id.storage.doAutoPart = True
if self.encrypted:
diff --git a/storage/__init__.py b/storage/__init__.py
index e87db9be1..34f01828c 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -202,7 +202,7 @@ class Storage(object):
self.ignoredDisks = []
self.exclusiveDisks = []
self.doAutoPart = False
- self.clearPartType = CLEARPART_TYPE_NONE
+ self.clearPartType = None
self.clearPartDisks = []
self.encryptedAutoPart = False
self.encryptionPassphrase = None
@@ -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
@@ -934,7 +931,7 @@ class Storage(object):
f.write("# not guaranteed to work\n")
# clearpart
- if self.clearPartType == CLEARPART_TYPE_NONE:
+ if self.clearPartType is None or self.clearPartType == CLEARPART_TYPE_NONE:
args = ["--none"]
elif self.clearPartType == CLEARPART_TYPE_LINUX:
args = ["--linux"]
diff --git a/storage/partitioning.py b/storage/partitioning.py
index 8e9ab3cf7..de3e3e50b 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -306,7 +306,7 @@ def clearPartitions(storage):
- Needs some error handling, especially for the parted bits.
"""
- if storage.clearPartType == CLEARPART_TYPE_NONE:
+ if storage.clearPartType is None or storage.clearPartType == CLEARPART_TYPE_NONE:
# not much to do
return
diff --git a/textw/partition_text.py b/textw/partition_text.py
index 48b7c1810..b6960eff8 100644
--- a/textw/partition_text.py
+++ b/textw/partition_text.py
@@ -67,7 +67,11 @@ class PartitionTypeWindow:
for (txt, val) in opts:
typebox.append(txt, val)
- typebox.setCurrent(anaconda.id.storage.clearPartType)
+ if anaconda.id.storage.clearPartType is None:
+ preselection = CLEARPART_TYPE_LINUX
+ else:
+ preselection = anaconda.id.storage.clearPartType
+ typebox.setCurrent(preselection)
g.add(typebox, 0, 1, (0, 1, 0, 0))