summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2003-01-31 21:47:55 +0000
committerMike Fulbright <msf@redhat.com>2003-01-31 21:47:55 +0000
commitc2f6a6aef1c1b222183aeeed4f1ad5b6c52953fe (patch)
tree1e5873e041d5373d8108218905fbec4377524c69
parent175dd8a33311aa171b8e2487cc5e7c2ac349e92d (diff)
downloadanaconda-c2f6a6aef1c1b222183aeeed4f1ad5b6c52953fe.tar.gz
anaconda-c2f6a6aef1c1b222183aeeed4f1ad5b6c52953fe.tar.xz
anaconda-c2f6a6aef1c1b222183aeeed4f1ad5b6c52953fe.zip
fix for bug #79454 - a tad messy but this way I dont duplicate code elsewhere
-rw-r--r--iw/lvm_dialog_gui.py15
-rw-r--r--partRequests.py19
2 files changed, 27 insertions, 7 deletions
diff --git a/iw/lvm_dialog_gui.py b/iw/lvm_dialog_gui.py
index e32d5bc26..ac399c97e 100644
--- a/iw/lvm_dialog_gui.py
+++ b/iw/lvm_dialog_gui.py
@@ -553,7 +553,7 @@ class VolumeGroupEditor:
origlvname = logrequest.logicalVolumeName
else:
origlvname = None
-
+
for lv in self.logvolreqs:
if origlvname and lv.logicalVolumeName == origlvname:
continue
@@ -600,7 +600,18 @@ class VolumeGroupEditor:
request.migrate = migrate
request.badblock = None
- err = request.sanityCheckRequest(self.partitions)
+ # make list of original logvol requests so we can skip them
+ # in tests below. We check for mount point name conflicts
+ # above within the current volume group, so it is not
+ # necessary to do now.
+ err = request.sanityCheckRequest(self.partitions, skipMntPtExistCheck=1)
+ if err is None:
+ skiplist = []
+ for lv in self.origvolreqs:
+ skiplist.append(lv.uniqueID)
+
+ err = request.isMountPointInUse(self.partitions, requestSkipList=skiplist)
+
if err:
self.intf.messageWindow(_("Error With Request"),
"%s" % (err), custom_icon="error")
diff --git a/partRequests.py b/partRequests.py
index 9e996f226..90850d6fc 100644
--- a/partRequests.py
+++ b/partRequests.py
@@ -229,7 +229,10 @@ class RequestSpec:
return None
- def isMountPointInUse(self, partitions):
+ # requestSkipList is a list of uids for requests to ignore when
+ # looking for a conflict on the mount point name. Used in lvm
+ # editting code in disk druid, for example.
+ def isMountPointInUse(self, partitions, requestSkipList=None):
"""Return whether my mountpoint is in use by another request."""
mntpt = self.mountpoint
if not mntpt:
@@ -237,6 +240,9 @@ class RequestSpec:
if partitions and partitions.requests:
for request in partitions.requests:
+ if requestSkipList is not None and request.uniqueID in requestSkipList:
+ continue
+
if request.mountpoint == mntpt:
if (not self.uniqueID or
request.uniqueID != self.uniqueID):
@@ -261,7 +267,9 @@ class RequestSpec:
return None
- def sanityCheckRequest(self, partitions):
+ # set skipMntPtExistCheck to non-zero if you want to handle this
+ # check yourself. Used in lvm volume group editting code, for example.
+ def sanityCheckRequest(self, partitions, skipMntPtExistCheck=0):
"""Run the basic sanity checks on the request."""
# see if mount point is valid if its a new partition request
mntpt = self.mountpoint
@@ -276,9 +284,10 @@ class RequestSpec:
if rc:
return rc
- rc = self.isMountPointInUse(partitions)
- if rc:
- return rc
+ if not skipMntPtExistCheck:
+ rc = self.isMountPointInUse(partitions)
+ if rc:
+ return rc
rc = self.doMountPointLinuxFSChecks()
if rc: