summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-02-11 16:01:21 +0000
committerJeremy Katz <katzj@redhat.com>2003-02-11 16:01:21 +0000
commit1f4f9539c206c23c76f7e358bb6456114d0b416b (patch)
treed10e9f3bdb418f551e354ec93e626af1945dc044
parent3aaa690904e2ad84e138838047f5fd3e85fb1762 (diff)
downloadanaconda-1f4f9539c206c23c76f7e358bb6456114d0b416b.tar.gz
anaconda-1f4f9539c206c23c76f7e358bb6456114d0b416b.tar.xz
anaconda-1f4f9539c206c23c76f7e358bb6456114d0b416b.zip
we need to move the lvs to the new vg id if it changes due to kickstart
preexisting stuff
-rw-r--r--autopart.py10
-rw-r--r--partitions.py13
2 files changed, 18 insertions, 5 deletions
diff --git a/autopart.py b/autopart.py
index 8ad5fcec2..70ef200ac 100644
--- a/autopart.py
+++ b/autopart.py
@@ -1222,6 +1222,7 @@ def doAutoPartition(dir, diskset, partitions, intf, instClass, dispatch):
custom_icon='error')
sys.exit(0)
+ oldid = None
# now go through and set things from the request to the
# preexisting partition's request... ladeda
if request.physicalVolumes:
@@ -1229,11 +1230,20 @@ def doAutoPartition(dir, diskset, partitions, intf, instClass, dispatch):
if request.pesize:
req.pesize = request.pesize
if request.uniqueID: # for raid to work
+ oldid = req.uniqueID
req.uniqueID = request.uniqueID
if not request.format:
req.format = 0
else:
req.format = 1
+
+ # we also need to go through and remap everything which we
+ # previously found to our new id. yay!
+ if oldid is not None:
+ for lv in partitions.getLVMLVForVGID(oldid):
+ lv.volumeGroup = req.uniqueID
+
+
elif (isinstance(request, partRequests.LogicalVolumeRequestSpec) and
request.preexist == 1):
# get the preexisting partition they want to use
diff --git a/partitions.py b/partitions.py
index 7cc33e86a..11d034436 100644
--- a/partitions.py
+++ b/partitions.py
@@ -474,18 +474,21 @@ class Partitions:
if self.getRaidMemberParent(request) is not None:
return 1
else:
- return 0
+ return 0
- def getLVMLVForVG(self, vgrequest):
- """Find and return a list of all of the LVs in the VG."""
+ def getLVMLVForVGID(self, vgid):
+ """Find and return a list of all the LVs associated with a VG id."""
retval = []
- vgid = vgrequest.uniqueID
for request in self.requests:
if request.type == REQUEST_LV:
if request.volumeGroup == vgid:
retval.append(request)
-
return retval
+
+ def getLVMLVForVG(self, vgrequest):
+ """Find and return a list of all of the LVs in the VG."""
+ vgid = vgrequest.uniqueID
+ return self.getLVMLVForVGID(vgid)
def getLVMRequests(self):
"""Return a dictionary of all of the LVM bits.