[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[PATCH] Use existing partitions when --onpart is used in ks for PVs and raid (#493065)
- From: Radek Vykydal <rvykydal redhat com>
- To: anaconda-devel-list redhat com
- Subject: [PATCH] Use existing partitions when --onpart is used in ks for PVs and raid (#493065)
- Date: Wed, 1 Apr 2009 14:12:02 +0200
Store mapping from pv/raid names used in ks (e.g. pv.1) to existing
partitions in ks handler and use it when processing ks commands
referring to the names.
---
kickstart.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/kickstart.py b/kickstart.py
index 844e58c..47ccd66 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -685,6 +685,9 @@ class Partition(commands.partition.F9_Partition):
if not device:
raise KickstartValueError, formatErrorMsg(self.lineno, msg="Specified nonexistent partition %s in partition command" % pd.onPart)
+ # store mapping for other ks partitioning commands
+ if kwargs.has_key("name"):
+ self.handler.onPart[kwargs["name"]] = pd.onPart
devicetree.registerAction(ActionCreateFormat(device, kwargs["format"]))
else:
request = storage.newPartition(**kwargs)
@@ -879,6 +882,8 @@ class VolGroup(commands.volgroup.FC3_VolGroup):
# Get a list of all the physical volume devices that make up this VG.
for pv in vgd.physvols:
+ # if pv is using --onpart, use original device
+ pv = self.handler.onPart.get(pv, pv)
dev = devicetree.getDeviceByName(pv)
if not dev:
raise KickstartValueError, formatErrorMsg(self.lineno, msg="Tried to use undefined partition %s in Volume Group specification" % pv)
@@ -1027,6 +1032,7 @@ class AnacondaKSHandler(superclass):
self.showSteps = []
self.anaconda = anaconda
self.id = self.anaconda.id
+ self.onPart = {}
class EarlyKSHandler(superclass):
# This handler class only processes a couple kickstart commands. It is
--
1.5.4.3
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]