summaryrefslogtreecommitdiffstats
path: root/kickstart.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2009-04-30 14:37:42 -0400
committerChris Lumens <clumens@redhat.com>2009-05-01 17:06:52 -0400
commitc25d4bcb43f462c05723774237104a7f5bd5fdb3 (patch)
tree11b45b9827e42b0e1715bd3b1069a57438853317 /kickstart.py
parent0ac21efe8043e7d135703381361beb6e8a5f7cff (diff)
downloadanaconda-c25d4bcb43f462c05723774237104a7f5bd5fdb3.tar.gz
anaconda-c25d4bcb43f462c05723774237104a7f5bd5fdb3.tar.xz
anaconda-c25d4bcb43f462c05723774237104a7f5bd5fdb3.zip
Handle clearpart in the early kickstart pass too.
Diffstat (limited to 'kickstart.py')
-rw-r--r--kickstart.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/kickstart.py b/kickstart.py
index c1098eded..a95762e66 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -239,11 +239,17 @@ class ClearPart(commands.clearpart.FC3_ClearPart):
if self.type is None:
self.type = CLEARPART_TYPE_NONE
- hds = map(lambda x: x.name, self.handler.id.storage.disks)
+ hds = map(udev_device_get_name, udev_get_block_devices())
for disk in self.drives:
if disk not in hds:
raise KickstartValueError, formatErrorMsg(self.lineno, msg="Specified nonexistent disk %s in clearpart command" % disk)
+ # If doing the early kickstart processing, we will not yet have an
+ # instdata attribute. That's okay because we pull the lists right
+ # out of this class instead of the instdata.
+ if not self.handler.id:
+ return retval
+
self.handler.id.storage.clearPartType = self.type
self.handler.id.storage.clearPartDisks = self.drives
if self.initAll:
@@ -1024,7 +1030,7 @@ class EarlyKSHandler(superclass):
self.id = self.anaconda.id
self.maskAllExcept(["vnc", "displaymode", "text", "cmdline",
- "graphical", "rescue", "ignoredisk"])
+ "graphical", "rescue", "ignoredisk", "clearpart"])
class AnacondaPreParser(KickstartParser):
# A subclass of KickstartParser that only looks for %pre scripts and
@@ -1148,6 +1154,12 @@ def fullCommandPass(anaconda, file, earlyKS):
import storage
anaconda.id.storage.ignoredDisks = earlyKS.ignoredisk.ignoredisk
anaconda.id.storage.exclusiveDisks = earlyKS.ignoredisk.onlyuse
+
+ anaconda.id.storage.clearPartType = earlyKS.clearpart.type
+ anaconda.id.storage.clearPartDisks = earlyKS.clearpart.drives
+ if earlyKS.clearpart.initAll:
+ anaconda.id.storage.reinitializeDisks = earlyKS.clearpart.initAll
+
storage.storageInitialize(anaconda)
handler = AnacondaKSHandler(anaconda)