summaryrefslogtreecommitdiffstats
path: root/partRequests.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-06-11 05:48:48 +0000
committerJeremy Katz <katzj@redhat.com>2002-06-11 05:48:48 +0000
commita9c04e2add1edc6a3ba8a2ff16521459800c0108 (patch)
treedcddc195bd4fa52d4926dda615edb326324fe300 /partRequests.py
parenta4d0045426f03b17bb1693ea16d897158b4da809 (diff)
downloadanaconda-a9c04e2add1edc6a3ba8a2ff16521459800c0108.tar.gz
anaconda-a9c04e2add1edc6a3ba8a2ff16521459800c0108.tar.xz
anaconda-a9c04e2add1edc6a3ba8a2ff16521459800c0108.zip
make the fsset Device persistent for the request so that we don't screw things up for lvm on raid
Diffstat (limited to 'partRequests.py')
-rw-r--r--partRequests.py46
1 files changed, 34 insertions, 12 deletions
diff --git a/partRequests.py b/partRequests.py
index 8329d350c..49642ab01 100644
--- a/partRequests.py
+++ b/partRequests.py
@@ -24,6 +24,7 @@ import os, sys
from constants import *
from rhpl.translate import _
+from rhpl.log import log
import fsset
import raid
@@ -128,6 +129,9 @@ class RequestSpec:
self.protected = 0
"""Is this partitiion 'protected', ie does it contain install media."""
+ self.dev = None
+ """A Device() as defined in fsset.py to correspond to this request."""
+
def __str__(self):
if self.fstype:
fsname = self.fstype.getName()
@@ -178,7 +182,7 @@ class RequestSpec:
if self.badblocks:
entry.setBadblocks(self.badblocks)
-
+
return entry
def setProtected(self, val):
@@ -401,9 +405,13 @@ class PartitionSpec(RequestSpec):
def getDevice(self, partitions):
- """Return a device to solidify."""
- dev = fsset.PartitionDevice(self.device)
- return dev
+ """Return a device to solidify."""
+ if self.dev:
+ # FIXME: this warning can probably be removed post-beta
+ log("WARNING: getting self.dev more than once for %s" %(self,))
+ return self.dev
+ self.dev = fsset.PartitionDevice(self.device)
+ return self.dev
def getActualSize(self, partitions, diskset):
"""Return the actual size allocated for the request in megabytes."""
@@ -544,13 +552,17 @@ class RaidRequestSpec(RequestSpec):
def getDevice(self, partitions):
"""Return a device which can be solidified."""
+ if self.dev:
+ # FIXME: this warning can probably be removed post-beta
+ log("WARNING: getting self.dev more than once for %s" %(self,))
+ return self.dev
raidmems = []
for member in self.raidmembers:
raidmems.append(partitions.getRequestByID(member).device)
- dev = fsset.RAIDDevice(int(self.raidlevel[-1:]),
- raidmems, minor = self.raidminor,
- spares = self.raidspares)
- return dev
+ self.dev = fsset.RAIDDevice(int(self.raidlevel[-1:]),
+ raidmems, minor = self.raidminor,
+ spares = self.raidspares)
+ return self.dev
def getActualSize(self, partitions, diskset):
"""Return the actual size allocated for the request in megabytes."""
@@ -659,11 +671,16 @@ class VolumeGroupRequestSpec(RequestSpec):
def getDevice(self, partitions):
"""Return a device which can be solidified."""
+ if self.dev:
+ # FIXME: this warning can probably be removed post-beta
+ log("WARNING: getting self.dev more than once for %s" %(self,))
+ return self.dev
+
pvs = []
for pv in self.physicalVolumes:
pvs.append(partitions.getRequestByID(pv).getDevice(partitions))
- dev = fsset.VolumeGroupDevice(self.volumeGroupName, pvs, self.pesize)
- return dev
+ self.dev = fsset.VolumeGroupDevice(self.volumeGroupName, pvs, self.pesize)
+ return self.dev
def getActualSize(self, partitions, diskset):
"""Return the actual size allocated for the request in megabytes."""
@@ -732,11 +749,16 @@ class LogicalVolumeRequestSpec(RequestSpec):
def getDevice(self, partitions):
"""Return a device which can be solidified."""
+ if self.dev:
+ # FIXME: this warning can probably be removed post-beta
+ log("WARNING: getting self.dev more than once for %s" %(self,))
+ return self.dev
+
vg = partitions.getRequestByID(self.volumeGroup)
vgname = vg.volumeGroupName
- dev = fsset.LogicalVolumeDevice(vgname, self.size,
+ self.dev = fsset.LogicalVolumeDevice(vgname, self.size,
self.logicalVolumeName)
- return dev
+ return self.dev
def getActualSize(self, partitions, diskset):
"""Return the actual size allocated for the request in megabytes."""