diff options
author | Chris Lumens <clumens@redhat.com> | 2005-05-03 21:21:58 +0000 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2005-05-03 21:21:58 +0000 |
commit | 409b8aabeb22e48a7458a7469c32dbe3fa2dd26c (patch) | |
tree | a69b7fccd7f75cf58a5b8d0e41b7c167de3ba48d | |
parent | 1449b02ba926481cb331d1dc7b7808f37dc42dd6 (diff) | |
download | anaconda-409b8aabeb22e48a7458a7469c32dbe3fa2dd26c.tar.gz anaconda-409b8aabeb22e48a7458a7469c32dbe3fa2dd26c.tar.xz anaconda-409b8aabeb22e48a7458a7469c32dbe3fa2dd26c.zip |
Allow the resulting string to be put into a call to rhpl.log.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | autopart.py | 26 | ||||
-rw-r--r-- | partRequests.py | 2 |
3 files changed, 25 insertions, 8 deletions
@@ -1,3 +1,8 @@ +2005-05-03 Chris Lumens <clumens@redhat.com> + + * partRequests.py (LogicalVolumeRequestSpec.__str__): Allow the + resulting string to be put into a call to rhpl.log. + 2005-05-03 Bill Nottingham <notting@redhat.com> * loader2/init.c: always reset terminal attributes on ppc (#156411) diff --git a/autopart.py b/autopart.py index e43166641..81d171766 100644 --- a/autopart.py +++ b/autopart.py @@ -1205,14 +1205,14 @@ def doAutoPartition(dir, diskset, partitions, intf, instClass, dispatch): partitions.setProtected(dispatch) else: isKickstart = 0 - + if dir == DISPATCH_BACK: diskset.refreshDevices() partitions.setFromDisk(diskset) partitions.setProtected(dispatch) partitions.autoPartitionRequests = [] return - + # if no auto partition info in instclass we bail if len(partitions.autoPartitionRequests) < 1: #return DISPATCH_NOOP @@ -1327,8 +1327,8 @@ def doAutoPartition(dir, diskset, partitions, intf, instClass, dispatch): 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 @@ -1403,8 +1403,7 @@ def doAutoPartition(dir, diskset, partitions, intf, instClass, dispatch): if req.autoname == 1 and req.volumeGroupName == "lvm": n = lvm.createSuggestedVGName(partitions) req.volumeGroupName = n - - + if (isinstance(req, partRequests.LogicalVolumeRequestSpec)): # if the volgroup is set to a string, we probably need # to find that volgroup and use it's id @@ -1424,6 +1423,19 @@ def doAutoPartition(dir, diskset, partitions, intf, instClass, dispatch): partitions.addRequest(req) + # Remove all preexisting VG requests that reference nonexistant PV + # requests. These VGs should only be present on installs where we're + # using preexisting partitions that already have LVM information. + for req in filter (lambda r: isinstance(r, partRequests.VolumeGroupRequestSpec), partitions.requests): + if len(filter (lambda id: partitions.getRequestByID(id) != None, req.physicalVolumes)) == 0: + partitions.removeRequest (req) + + # Now that we've removed bad VGs, remove all LVs that would have + # resided on those VGs. + for req in filter (lambda r: isinstance(r, partRequests.LogicalVolumeRequestSpec), partitions.requests): + if partitions.getRequestByID(req.volumeGroup) == None: + partitions.removeRequest (req) + # sanity checks for the auto partitioning requests; mostly only useful # for kickstart as our installclass defaults SHOULD be sane for req in partitions.requests: @@ -1458,7 +1470,7 @@ def doAutoPartition(dir, diskset, partitions, intf, instClass, dispatch): intf.messageWindow(_("Error Partitioning"), _("Could not allocate requested partitions: \n\n" "%s.%s") % (msg.value, extra), custom_icon='error') - + if isKickstart: sys.exit(0) diff --git a/partRequests.py b/partRequests.py index c751f2b63..b0cd01bc5 100644 --- a/partRequests.py +++ b/partRequests.py @@ -863,7 +863,7 @@ class LogicalVolumeRequestSpec(RequestSpec): if self.size is not None: size = self.size else: - size = "%s%%" %(self.percent,) + size = "%s percent" %(self.percent,) str = ("LV Request -- mountpoint: %(mount)s uniqueID: %(id)s\n" " type: %(fstype)s format: %(format)s badblocks: %(bb)s\n" |