diff options
author | Chris Lumens <clumens@redhat.com> | 2007-04-04 19:54:11 +0000 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2007-04-04 19:54:11 +0000 |
commit | 49a55e465ad119dd83ecf299eef406927d2b5437 (patch) | |
tree | 1f1e3dd7328c4464266acb2b1aed488c503e1e6d | |
parent | 14571b0f20e898fe93fa7b2c4ee905ce76d266e7 (diff) | |
download | anaconda-49a55e465ad119dd83ecf299eef406927d2b5437.tar.gz anaconda-49a55e465ad119dd83ecf299eef406927d2b5437.tar.xz anaconda-49a55e465ad119dd83ecf299eef406927d2b5437.zip |
Removing items from a list you're iterating over confuses python (#235279).
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | autopart.py | 14 |
2 files changed, 17 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2007-04-04 Chris Lumens <clumens@redhat.com> + + * autopart.py (doAutoPartition): Removing items from a list you're + iterating over confuses python (#235279). + 2007-04-04 Jeremy Katz <katzj@redhat.com> * liveinst/liveinst.xinit: Work with changes for running from diff --git a/autopart.py b/autopart.py index d87ac378d..5d5cb0137 100644 --- a/autopart.py +++ b/autopart.py @@ -1449,6 +1449,8 @@ def doAutoPartition(anaconda): # requests. These VGs should only be present on installs where we're # using preexisting partitions that already have LVM information. We # need to do the same thing for preexisting RAID requests, as well. + removeReqs = [] + for req in partitions.requests: if isinstance(req, partRequests.VolumeGroupRequestSpec): lst = req.physicalVolumes @@ -1458,13 +1460,21 @@ def doAutoPartition(anaconda): continue if len(filter (lambda id: partitions.getRequestByID(id) != None, lst)) == 0: - partitions.removeRequest (req) + removeReqs.append(req) + + for req in removeReqs: + partitions.removeRequest(req) + + removeReqs = [] # 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) + removeReqs.append(req) + + for req in removeReqs: + partitions.removeRequest(req) # sanity checks for the auto partitioning requests; mostly only useful # for kickstart as our installclass defaults SHOULD be sane |