diff options
author | Jeremy Katz <katzj@redhat.com> | 2001-07-22 19:47:54 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2001-07-22 19:47:54 +0000 |
commit | 971d62913388ea9c34b37e73a4d622e4bc5ca491 (patch) | |
tree | 915eb1626beac4993ad91a513093a07c0c3b3ec4 /partitioning.py | |
parent | 5b9e7f730bc77b2e109b5de5873ef5ef7fb71ea0 (diff) | |
download | anaconda-971d62913388ea9c34b37e73a4d622e4bc5ca491.tar.gz anaconda-971d62913388ea9c34b37e73a4d622e4bc5ca491.tar.xz anaconda-971d62913388ea9c34b37e73a4d622e4bc5ca491.zip |
handle making sure that the members of bootable raid requests get handled
first
Diffstat (limited to 'partitioning.py')
-rw-r--r-- | partitioning.py | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/partitioning.py b/partitioning.py index 100ea6c03..e88ab3fbe 100644 --- a/partitioning.py +++ b/partitioning.py @@ -627,7 +627,7 @@ class PartitionSpec: self.constraint = constraint self.partition = None self.requestSize = size - # XXX these are PartedPartitionDevice, should be requests + # note that the raidmembers are the unique id of the requests self.raidmembers = raidmembers self.raidlevel = raidlevel self.raidspares = raidspares @@ -870,11 +870,26 @@ class Partitions: self.requests[n] = request self.requests[index] = tmp n = n + 1 + tmp = self.getBootableRequest() - if tmp: - index = self.requests.index(tmp) - self.requests[index] = self.requests[0] - self.requests[0] = tmp + + # if raid, we want all of the contents of the bootable raid + if tmp and tmp.type == REQUEST_RAID: + boot = [] + for member in tmp.raidmembers: + boot.append(self.getRequestByID(member)) + elif tmp: + boot = [tmp] + else: + boot = [] + + # remove the bootables from the request + for bootable in boot: + self.requests.pop(self.requests.index(bootable)) + + # move to the front of the list + boot.extend(self.requests) + self.requests = boot def copy (self): new = Partitions() |